Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../lib
File: menu_tools_diagnostic.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
[2] Fix | Delete
/** @var boolean $inEmail */
[3] Fix | Delete
[4] Fix | Delete
$diagnostic = new wfDiagnostic;
[5] Fix | Delete
$plugins = get_plugins();
[6] Fix | Delete
$activePlugins = array_flip(get_option('active_plugins'));
[7] Fix | Delete
$activeNetworkPlugins = is_multisite() ? array_flip(wp_get_active_network_plugins()) : array();
[8] Fix | Delete
$muPlugins = get_mu_plugins();
[9] Fix | Delete
$themes = wp_get_themes();
[10] Fix | Delete
$currentTheme = wp_get_theme();
[11] Fix | Delete
$cols = 3;
[12] Fix | Delete
[13] Fix | Delete
$w = new wfConfig();
[14] Fix | Delete
if (!isset($sendingDiagnosticEmail)) {
[15] Fix | Delete
$sendingDiagnosticEmail = false;
[16] Fix | Delete
}
[17] Fix | Delete
?>
[18] Fix | Delete
<?php if (!$sendingDiagnosticEmail): ?>
[19] Fix | Delete
<script type="application/javascript">
[20] Fix | Delete
(function($) {
[21] Fix | Delete
$(function() {
[22] Fix | Delete
document.title = "<?php esc_attr_e('Diagnostics', 'wordfence'); ?>" + " \u2039 " + WFAD.basePageName;
[23] Fix | Delete
});
[24] Fix | Delete
})(jQuery);
[25] Fix | Delete
</script>
[26] Fix | Delete
<?php endif; ?>
[27] Fix | Delete
<div id="wf-diagnostics">
[28] Fix | Delete
<?php if (!$sendingDiagnosticEmail): ?>
[29] Fix | Delete
<div class="wf-diagnostics-wrapper">
[30] Fix | Delete
<div class="wf-flex-row">
[31] Fix | Delete
<div class="wf-flex-row-1">
[32] Fix | Delete
<?php echo wp_kses(sprintf(__('This page shows information that can be used for troubleshooting conflicts, configuration issues, or compatibility with other plugins, themes, or a host\'s environment. Failing tests are not always a sign of something that you need to fix, but can help the Wordfence team when troubleshooting a problem. (<a href="%s" target="_blank" rel="noopener noreferrer">Learn More <span class="screen-reader-text">opens in new tab</span></a>)', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS)), array('a' => array('href' => array(), 'target' => array(), 'rel' => array()), 'span' => array('class' => array()))) ?>
[33] Fix | Delete
</div>
[34] Fix | Delete
<div class="wf-flex-row-0 wf-padding-add-left">
[35] Fix | Delete
<div id="sendByEmailThanks" class="hidden">
[36] Fix | Delete
<h3><?php esc_html_e('Thanks for sending your diagnostic page over email', 'wordfence'); ?></h3>
[37] Fix | Delete
</div>
[38] Fix | Delete
<div id="sendByEmailDiv" class="wf-add-bottom">
[39] Fix | Delete
<span class="wf-nowrap">
[40] Fix | Delete
<input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="exportDiagnostics" value="Export"/>
[41] Fix | Delete
<input class="wf-btn wf-btn-primary wf-btn-sm" type="submit" id="sendByEmail" value="Send Report by Email"/>
[42] Fix | Delete
<input class="wf-btn wf-btn-default wf-btn-sm" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/>
[43] Fix | Delete
</span>
[44] Fix | Delete
</div>
[45] Fix | Delete
</div>
[46] Fix | Delete
</div>
[47] Fix | Delete
<div id="sendByEmailForm" class="wf-block wf-active hidden">
[48] Fix | Delete
<div class="wf-block-header">
[49] Fix | Delete
<div class="wf-block-header-content">
[50] Fix | Delete
<div class="wf-block-title">
[51] Fix | Delete
<strong><?php esc_html_e('Send Report by Email', 'wordfence') ?></strong>
[52] Fix | Delete
</div>
[53] Fix | Delete
</div>
[54] Fix | Delete
</div>
[55] Fix | Delete
<div class="wf-block-content wf-clearfix">
[56] Fix | Delete
<ul class="wf-block-list">
[57] Fix | Delete
<li>
[58] Fix | Delete
<div><?php esc_html_e('Email address:', 'wordfence'); ?></div>
[59] Fix | Delete
<div style="width: 40%">
[60] Fix | Delete
<p><input class="wf-input-text" type="email" id="_email" value="wftest@wordfence.com"/>
[61] Fix | Delete
</p>
[62] Fix | Delete
</div>
[63] Fix | Delete
</li>
[64] Fix | Delete
<li>
[65] Fix | Delete
<div><?php esc_html_e('Ticket Number/Forum Username:', 'wordfence'); ?></div>
[66] Fix | Delete
<div style="width: 40%">
[67] Fix | Delete
<p><input class="wf-input-text" type="text" id="_ticketnumber" required/></p>
[68] Fix | Delete
</div>
[69] Fix | Delete
</li>
[70] Fix | Delete
<li>
[71] Fix | Delete
<p>
[72] Fix | Delete
<input class="wf-btn wf-btn-primary" type="button" id="doSendEmail" value="Send"/>
[73] Fix | Delete
</p>
[74] Fix | Delete
</li>
[75] Fix | Delete
</ul>
[76] Fix | Delete
</div>
[77] Fix | Delete
</div>
[78] Fix | Delete
</div>
[79] Fix | Delete
<?php endif; ?>
[80] Fix | Delete
<div class="wf-diagnostics-wrapper">
[81] Fix | Delete
<?php foreach ($diagnostic->getResults() as $title => $tests):
[82] Fix | Delete
$key = sanitize_key('wf-diagnostics-' . $title);
[83] Fix | Delete
$hasFailingTest = false;
[84] Fix | Delete
foreach ($tests['results'] as $result) {
[85] Fix | Delete
$infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
[86] Fix | Delete
if (!$result['test'] && !$infoOnly) {
[87] Fix | Delete
$hasFailingTest = true;
[88] Fix | Delete
break;
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
if ($inEmail): ?>
[93] Fix | Delete
<table>
[94] Fix | Delete
<thead>
[95] Fix | Delete
<tr>
[96] Fix | Delete
<th colspan="2"><?php echo esc_html($title) ?></th>
[97] Fix | Delete
</tr>
[98] Fix | Delete
</thead>
[99] Fix | Delete
<tbody>
[100] Fix | Delete
<?php foreach ($tests['results'] as $result): ?>
[101] Fix | Delete
<?php
[102] Fix | Delete
$infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
[103] Fix | Delete
?>
[104] Fix | Delete
<tr>
[105] Fix | Delete
<td style="width: 75%; min-width: 300px"><?php echo (is_array($result['label']) && isset($result['label']['raw']) && $result['label']['raw'] ? $result['label']['value'] : wp_kses($result['label'], array(
[106] Fix | Delete
'code' => array(),
[107] Fix | Delete
'strong' => array(),
[108] Fix | Delete
'em' => array(),
[109] Fix | Delete
'a' => array('href' => true),
[110] Fix | Delete
'span' => array('class' => true)
[111] Fix | Delete
))) ?></td>
[112] Fix | Delete
<td>
[113] Fix | Delete
<?php if ($infoOnly): ?>
[114] Fix | Delete
<div class="wf-result-info"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[115] Fix | Delete
<?php elseif ($result['test']): ?>
[116] Fix | Delete
<div class="wf-result-success"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[117] Fix | Delete
<?php else: ?>
[118] Fix | Delete
<div class="wf-result-error"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[119] Fix | Delete
<?php endif ?>
[120] Fix | Delete
<?php if (isset($result['detail']) && !empty($result['detail'])): ?>
[121] Fix | Delete
<p><strong><?php esc_html_e('Additional Detail', 'wordfence'); ?></strong><br><?php echo (is_array($result['detail']) && isset($result['detail']['escaped']) ? $result['detail']['escaped'] : nl2br(esc_html($result['detail']))); ?></p>
[122] Fix | Delete
<?php endif; ?>
[123] Fix | Delete
</td>
[124] Fix | Delete
</tr>
[125] Fix | Delete
<?php endforeach ?>
[126] Fix | Delete
</tbody>
[127] Fix | Delete
</table>
[128] Fix | Delete
<?php else: ?>
[129] Fix | Delete
<div class="wf-block<?php echo (wfPersistenceController::shared()->isActive($key) ? ' wf-active' : '') .
[130] Fix | Delete
($hasFailingTest ? ' wf-diagnostic-fail' : '') ?>" data-persistence-key="<?php echo esc_attr($key) ?>">
[131] Fix | Delete
<div class="wf-block-header">
[132] Fix | Delete
<div class="wf-block-header-content">
[133] Fix | Delete
<div class="wf-block-title">
[134] Fix | Delete
<strong><?php echo esc_html($title) ?></strong>
[135] Fix | Delete
<span class="wf-text-small"><?php echo esc_html($tests['description']) ?></span>
[136] Fix | Delete
</div>
[137] Fix | Delete
<div class="wf-block-header-action">
[138] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($key) ? 'true' : 'false'); ?>" tabindex="0"></div>
[139] Fix | Delete
</div>
[140] Fix | Delete
</div>
[141] Fix | Delete
</div>
[142] Fix | Delete
<div class="wf-block-content wf-clearfix">
[143] Fix | Delete
<ul class="wf-block-list">
[144] Fix | Delete
<?php foreach ($tests['results'] as $key => $result): ?>
[145] Fix | Delete
<?php
[146] Fix | Delete
$infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
[147] Fix | Delete
?>
[148] Fix | Delete
<li>
[149] Fix | Delete
<div style="width: 75%; min-width: 300px;"><?php echo (is_array($result['label']) && isset($result['label']['raw']) && $result['label']['raw'] ? $result['label']['value'] : wp_kses($result['label'], array(
[150] Fix | Delete
'code' => array(),
[151] Fix | Delete
'strong' => array(),
[152] Fix | Delete
'em' => array(),
[153] Fix | Delete
'a' => array('href' => true),
[154] Fix | Delete
))) ?></div>
[155] Fix | Delete
<div class="wf-right">
[156] Fix | Delete
<?php if ($infoOnly): ?>
[157] Fix | Delete
<div class="wf-result-info"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[158] Fix | Delete
<?php elseif ($result['test']): ?>
[159] Fix | Delete
<div class="wf-result-success"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[160] Fix | Delete
<?php else: ?>
[161] Fix | Delete
<div class="wf-result-error"><?php echo (is_array($result['message']) && isset($result['message']['escaped']) ? $result['message']['escaped'] : nl2br(esc_html($result['message']))); ?></div>
[162] Fix | Delete
<?php endif ?>
[163] Fix | Delete
<?php if (isset($result['detail']) && !empty($result['detail'])): ?>
[164] Fix | Delete
<p><a href="#" onclick="jQuery('#wf-diagnostics-detail-<?php echo esc_attr($key); ?>').show(); jQuery(this).hide(); return false;" role="button"><?php esc_html_e('View Additional Detail', 'wordfence'); ?></a></p>
[165] Fix | Delete
<pre class="wf-pre wf-split-word" id="wf-diagnostics-detail-<?php echo esc_attr($key); ?>" style="max-width: 600px; display: none;"><?php echo (is_array($result['detail']) && isset($result['detail']['escaped']) ? $result['detail']['escaped'] : nl2br(esc_html($result['detail']))); ?></pre>
[166] Fix | Delete
<?php endif; ?>
[167] Fix | Delete
</div>
[168] Fix | Delete
</li>
[169] Fix | Delete
<?php endforeach ?>
[170] Fix | Delete
</ul>
[171] Fix | Delete
</div>
[172] Fix | Delete
</div>
[173] Fix | Delete
<?php endif ?>
[174] Fix | Delete
[175] Fix | Delete
<?php endforeach ?>
[176] Fix | Delete
<?php
[177] Fix | Delete
$howGet = wfConfig::get('howGetIPs', false);
[178] Fix | Delete
list($currentIP, $currentServerVarForIP) = wfUtils::getIPAndServerVariable();
[179] Fix | Delete
$howGetHasErrors = $howGet && (! $currentServerVarForIP || $howGet !== $currentServerVarForIP);
[180] Fix | Delete
?>
[181] Fix | Delete
<div class="wf-block<?php echo ($howGetHasErrors ? ' wf-diagnostic-fail' : '') . (wfPersistenceController::shared()->isActive('wf-diagnostics-client-ip') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-client-ip') ?>">
[182] Fix | Delete
<div class="wf-block-header">
[183] Fix | Delete
<div class="wf-block-header-content">
[184] Fix | Delete
<div class="wf-block-title">
[185] Fix | Delete
<strong><?php esc_html_e('IP Detection', 'wordfence') ?></strong>
[186] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('Methods of detecting a visitor\'s IP address.', 'wordfence') ?></span>
[187] Fix | Delete
</div>
[188] Fix | Delete
<div class="wf-block-header-action">
[189] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-client-ip') ? 'true' : 'false'); ?>" tabindex="0"></div>
[190] Fix | Delete
</div>
[191] Fix | Delete
</div>
[192] Fix | Delete
</div>
[193] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[194] Fix | Delete
[195] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[196] Fix | Delete
<tbody class="thead">
[197] Fix | Delete
<tr>
[198] Fix | Delete
<th><?php esc_html_e('IPs', 'wordfence'); ?></th>
[199] Fix | Delete
<th><?php esc_html_e('Value', 'wordfence'); ?></th>
[200] Fix | Delete
<th><?php esc_html_e('Used', 'wordfence'); ?></th>
[201] Fix | Delete
</tr>
[202] Fix | Delete
</tbody>
[203] Fix | Delete
<tbody>
[204] Fix | Delete
<?php
[205] Fix | Delete
$serverVariables = array(
[206] Fix | Delete
'REMOTE_ADDR' => 'REMOTE_ADDR',
[207] Fix | Delete
'HTTP_CF_CONNECTING_IP' => 'CF-Connecting-IP',
[208] Fix | Delete
'HTTP_X_REAL_IP' => 'X-Real-IP',
[209] Fix | Delete
'HTTP_X_FORWARDED_FOR' => 'X-Forwarded-For',
[210] Fix | Delete
);
[211] Fix | Delete
foreach (wfUtils::getAllServerVariableIPs() as $variable => $ip): ?>
[212] Fix | Delete
<tr>
[213] Fix | Delete
<td><?php echo isset($serverVariables[$variable]) ? $serverVariables[$variable] : $variable ?></td>
[214] Fix | Delete
<td><?php
[215] Fix | Delete
if (! $ip) {
[216] Fix | Delete
_e('(not set)', 'wordfence');
[217] Fix | Delete
} elseif (is_array($ip)) {
[218] Fix | Delete
$output = array_map('esc_html', $ip);
[219] Fix | Delete
echo str_replace($currentIP, "<strong>{$currentIP}</strong>", implode(', ', $output));
[220] Fix | Delete
} else {
[221] Fix | Delete
echo esc_html($ip);
[222] Fix | Delete
}
[223] Fix | Delete
?></td>
[224] Fix | Delete
<?php if ($currentServerVarForIP && $currentServerVarForIP === $variable): ?>
[225] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('In use', 'wordfence'); ?></td>
[226] Fix | Delete
<?php elseif ($howGet === $variable): ?>
[227] Fix | Delete
<td class="wf-result-error"><?php esc_html_e('Configured but not valid', 'wordfence'); ?></td>
[228] Fix | Delete
<?php else: ?>
[229] Fix | Delete
<td></td>
[230] Fix | Delete
<?php endif ?>
[231] Fix | Delete
</tr>
[232] Fix | Delete
<?php endforeach ?>
[233] Fix | Delete
<tr>
[234] Fix | Delete
<td><?php esc_html_e('Trusted Proxies', 'wordfence'); ?></td>
[235] Fix | Delete
<td><?php $proxies = wfConfig::get('howGetIPs_trusted_proxies', ''); echo esc_html(implode(', ', explode("\n", empty($proxies) ? __('(not set)', 'wordfence') : $proxies))); ?></td>
[236] Fix | Delete
<td></td>
[237] Fix | Delete
</tr>
[238] Fix | Delete
<tr>
[239] Fix | Delete
<td><?php esc_html_e('Trusted Proxy Preset', 'wordfence'); ?></td>
[240] Fix | Delete
<td><?php $preset = wfConfig::get('howGetIPs_trusted_proxy_preset'); $presets = wfConfig::getJSON('ipResolutionList', array()); echo esc_html((is_array($presets) && isset($presets[$preset])) ? $presets[$preset]['name'] : __('(not set)', 'wordfence')); ?></td>
[241] Fix | Delete
<td></td>
[242] Fix | Delete
</tr>
[243] Fix | Delete
</tbody>
[244] Fix | Delete
</table>
[245] Fix | Delete
[246] Fix | Delete
</div>
[247] Fix | Delete
</div>
[248] Fix | Delete
[249] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-constants') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-constants') ?>">
[250] Fix | Delete
<div class="wf-block-header">
[251] Fix | Delete
<div class="wf-block-header-content">
[252] Fix | Delete
<div class="wf-block-title">
[253] Fix | Delete
<strong><?php esc_html_e('WordPress Settings', 'wordfence') ?></strong>
[254] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('WordPress version and internal settings/constants.', 'wordfence') ?></span>
[255] Fix | Delete
</div>
[256] Fix | Delete
<div class="wf-block-header-action">
[257] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-constants') ? 'true' : 'false'); ?>" tabindex="0"></div>
[258] Fix | Delete
</div>
[259] Fix | Delete
</div>
[260] Fix | Delete
</div>
[261] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[262] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[263] Fix | Delete
<tbody>
[264] Fix | Delete
<?php
[265] Fix | Delete
foreach (wfDiagnostic::getWordpressValues() as $settingName => $settingData):
[266] Fix | Delete
$escapedName = esc_html($settingName);
[267] Fix | Delete
$escapedDescription = '';
[268] Fix | Delete
$escapedValue = __('(not set)', 'wordfence');
[269] Fix | Delete
if (is_array($settingData)) {
[270] Fix | Delete
$escapedDescription = esc_html($settingData['description']);
[271] Fix | Delete
if (isset($settingData['value'])) {
[272] Fix | Delete
$escapedValue = esc_html($settingData['value']);
[273] Fix | Delete
}
[274] Fix | Delete
} else {
[275] Fix | Delete
$escapedDescription = esc_html($settingData);
[276] Fix | Delete
if (defined($settingName)) {
[277] Fix | Delete
$escapedValue = esc_html(constant($settingName));
[278] Fix | Delete
}
[279] Fix | Delete
}
[280] Fix | Delete
?>
[281] Fix | Delete
<tr>
[282] Fix | Delete
<td><strong><?php echo $escapedName ?></strong></td>
[283] Fix | Delete
<td><?php echo $escapedDescription ?></td>
[284] Fix | Delete
<td><?php echo $escapedValue ?></td>
[285] Fix | Delete
</tr>
[286] Fix | Delete
<?php endforeach ?>
[287] Fix | Delete
</tbody>
[288] Fix | Delete
</table>
[289] Fix | Delete
</div>
[290] Fix | Delete
</div>
[291] Fix | Delete
[292] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-plugins') ?>">
[293] Fix | Delete
<div class="wf-block-header">
[294] Fix | Delete
<div class="wf-block-header-content">
[295] Fix | Delete
<div class="wf-block-title">
[296] Fix | Delete
<strong><?php esc_html_e('WordPress Plugins', 'wordfence') ?></strong>
[297] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('Status of installed plugins.', 'wordfence') ?></span>
[298] Fix | Delete
</div>
[299] Fix | Delete
<div class="wf-block-header-action">
[300] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
[301] Fix | Delete
</div>
[302] Fix | Delete
</div>
[303] Fix | Delete
</div>
[304] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[305] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[306] Fix | Delete
<tbody>
[307] Fix | Delete
<?php foreach ($plugins as $plugin => $pluginData): ?>
[308] Fix | Delete
<?php
[309] Fix | Delete
$slug = $plugin;
[310] Fix | Delete
if (preg_match('/^([^\/]+)\//', $plugin, $matches)) {
[311] Fix | Delete
$slug = $matches[1];
[312] Fix | Delete
}
[313] Fix | Delete
else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $matches)) {
[314] Fix | Delete
$slug = $matches[1];
[315] Fix | Delete
}
[316] Fix | Delete
?>
[317] Fix | Delete
<tr>
[318] Fix | Delete
<td>
[319] Fix | Delete
<strong><?php echo esc_html($pluginData['Name']); ?> (<?php echo esc_html($slug); ?>)</strong>
[320] Fix | Delete
<?php if (!empty($pluginData['Version'])): ?>
[321] Fix | Delete
- <?php echo esc_html(sprintf(__('Version %s', 'wordfence'), $pluginData['Version'])); ?>
[322] Fix | Delete
<?php endif ?>
[323] Fix | Delete
</td>
[324] Fix | Delete
<?php if (array_key_exists(trailingslashit(WP_PLUGIN_DIR) . $plugin, $activeNetworkPlugins)): ?>
[325] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('Network Activated', 'wordfence'); ?></td>
[326] Fix | Delete
<?php elseif (array_key_exists($plugin, $activePlugins)): ?>
[327] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('Active', 'wordfence'); ?></td>
[328] Fix | Delete
<?php else: ?>
[329] Fix | Delete
<td class="wf-result-inactive"><?php esc_html_e('Inactive', 'wordfence'); ?></td>
[330] Fix | Delete
<?php endif ?>
[331] Fix | Delete
</tr>
[332] Fix | Delete
<?php endforeach ?>
[333] Fix | Delete
</tbody>
[334] Fix | Delete
</table>
[335] Fix | Delete
</div>
[336] Fix | Delete
</div>
[337] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-mu-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-mu-wordpress-plugins') ?>">
[338] Fix | Delete
<div class="wf-block-header">
[339] Fix | Delete
<div class="wf-block-header-content">
[340] Fix | Delete
<div class="wf-block-title">
[341] Fix | Delete
<strong><?php esc_html_e('Must-Use WordPress Plugins', 'wordfence') ?></strong>
[342] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('WordPress "mu-plugins" that are always active, including those provided by hosts.', 'wordfence') ?></span>
[343] Fix | Delete
</div>
[344] Fix | Delete
<div class="wf-block-header-action">
[345] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-mu-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
[346] Fix | Delete
</div>
[347] Fix | Delete
</div>
[348] Fix | Delete
</div>
[349] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[350] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[351] Fix | Delete
<?php if (!empty($muPlugins)): ?>
[352] Fix | Delete
<tbody>
[353] Fix | Delete
<?php foreach ($muPlugins as $plugin => $pluginData): ?>
[354] Fix | Delete
<?php
[355] Fix | Delete
$slug = $plugin;
[356] Fix | Delete
if (preg_match('/^([^\/]+)\//', $plugin, $matches)) {
[357] Fix | Delete
$slug = $matches[1];
[358] Fix | Delete
}
[359] Fix | Delete
else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $matches)) {
[360] Fix | Delete
$slug = $matches[1];
[361] Fix | Delete
}
[362] Fix | Delete
?>
[363] Fix | Delete
<tr>
[364] Fix | Delete
<td>
[365] Fix | Delete
<strong><?php echo esc_html($pluginData['Name']) ?> (<?php echo esc_html($slug); ?>)</strong>
[366] Fix | Delete
<?php if (!empty($pluginData['Version'])): ?>
[367] Fix | Delete
- <?php echo esc_html(sprintf(/* translators: Plugin version. */ __('Version %s', 'wordfence'), $pluginData['Version'])); ?>
[368] Fix | Delete
<?php endif ?>
[369] Fix | Delete
</td>
[370] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('Active', 'wordfence'); ?></td>
[371] Fix | Delete
</tr>
[372] Fix | Delete
<?php endforeach ?>
[373] Fix | Delete
</tbody>
[374] Fix | Delete
<?php else: ?>
[375] Fix | Delete
<tbody>
[376] Fix | Delete
<tr>
[377] Fix | Delete
<td><?php esc_html_e('No MU-Plugins', 'wordfence'); ?></td>
[378] Fix | Delete
</tr>
[379] Fix | Delete
</tbody>
[380] Fix | Delete
[381] Fix | Delete
<?php endif ?>
[382] Fix | Delete
</table>
[383] Fix | Delete
</div>
[384] Fix | Delete
</div>
[385] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-dropin-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-dropin-wordpress-plugins') ?>">
[386] Fix | Delete
<div class="wf-block-header">
[387] Fix | Delete
<div class="wf-block-header-content">
[388] Fix | Delete
<div class="wf-block-title">
[389] Fix | Delete
<strong><?php esc_html_e('Drop-In WordPress Plugins', 'wordfence') ?></strong>
[390] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('WordPress "drop-in" plugins that are active.', 'wordfence') ?></span>
[391] Fix | Delete
</div>
[392] Fix | Delete
<div class="wf-block-header-action">
[393] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-dropin-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
[394] Fix | Delete
</div>
[395] Fix | Delete
</div>
[396] Fix | Delete
</div>
[397] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[398] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[399] Fix | Delete
<tbody>
[400] Fix | Delete
<?php
[401] Fix | Delete
//Taken from plugin.php and modified to always show multisite drop-ins
[402] Fix | Delete
$dropins = array(
[403] Fix | Delete
'advanced-cache.php' => array( __( 'Advanced caching plugin', 'wordfence' ), 'WP_CACHE' ), // WP_CACHE
[404] Fix | Delete
'db.php' => array( __( 'Custom database class', 'wordfence' ), true ), // auto on load
[405] Fix | Delete
'db-error.php' => array( __( 'Custom database error message', 'wordfence' ), true ), // auto on error
[406] Fix | Delete
'install.php' => array( __( 'Custom installation script', 'wordfence' ), true ), // auto on installation
[407] Fix | Delete
'maintenance.php' => array( __( 'Custom maintenance message', 'wordfence' ), true ), // auto on maintenance
[408] Fix | Delete
'object-cache.php' => array( __( 'External object cache', 'wordfence' ), true ), // auto on load
[409] Fix | Delete
'php-error.php' => array( __( 'Custom PHP error message', 'wordfence' ), true ), // auto on error
[410] Fix | Delete
'fatal-error-handler.php'=> array( __( 'Custom PHP fatal error handler', 'wordfence' ), true ), // auto on error
[411] Fix | Delete
);
[412] Fix | Delete
$dropins['sunrise.php' ] = array( __( 'Executed before Multisite is loaded', 'wordfence' ), is_multisite() && 'SUNRISE' ); // SUNRISE
[413] Fix | Delete
$dropins['blog-deleted.php' ] = array( __( 'Custom site deleted message', 'wordfence' ), is_multisite() ); // auto on deleted blog
[414] Fix | Delete
$dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message', 'wordfence' ), is_multisite() ); // auto on inactive blog
[415] Fix | Delete
$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message', 'wordfence' ), is_multisite() ); // auto on archived or spammed blog
[416] Fix | Delete
?>
[417] Fix | Delete
<?php foreach ($dropins as $file => $data): ?>
[418] Fix | Delete
<?php
[419] Fix | Delete
$active = file_exists(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && is_readable(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && $data[1];
[420] Fix | Delete
?>
[421] Fix | Delete
<tr>
[422] Fix | Delete
<td>
[423] Fix | Delete
<strong><?php echo esc_html($data[0]) ?> (<?php echo esc_html($file); ?>)</strong>
[424] Fix | Delete
</td>
[425] Fix | Delete
<?php if ($active): ?>
[426] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('Active', 'wordfence'); ?></td>
[427] Fix | Delete
<?php else: ?>
[428] Fix | Delete
<td class="wf-result-inactive"><?php esc_html_e('Inactive', 'wordfence'); ?></td>
[429] Fix | Delete
<?php endif; ?>
[430] Fix | Delete
</tr>
[431] Fix | Delete
<?php endforeach ?>
[432] Fix | Delete
</tbody>
[433] Fix | Delete
</table>
[434] Fix | Delete
</div>
[435] Fix | Delete
</div>
[436] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-themes') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-themes') ?>">
[437] Fix | Delete
<div class="wf-block-header">
[438] Fix | Delete
<div class="wf-block-header-content">
[439] Fix | Delete
<div class="wf-block-title">
[440] Fix | Delete
<strong><?php esc_html_e('Themes', 'wordfence') ?></strong>
[441] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('Status of installed themes.', 'wordfence') ?></span>
[442] Fix | Delete
</div>
[443] Fix | Delete
<div class="wf-block-header-action">
[444] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-themes') ? 'true' : 'false'); ?>" tabindex="0"></div>
[445] Fix | Delete
</div>
[446] Fix | Delete
</div>
[447] Fix | Delete
</div>
[448] Fix | Delete
<div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
[449] Fix | Delete
<table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
[450] Fix | Delete
<?php if (!empty($themes)): ?>
[451] Fix | Delete
<tbody>
[452] Fix | Delete
<?php foreach ($themes as $theme => $themeData): ?>
[453] Fix | Delete
<?php
[454] Fix | Delete
$slug = $theme;
[455] Fix | Delete
if (preg_match('/^([^\/]+)\//', $theme, $matches)) {
[456] Fix | Delete
$slug = $matches[1];
[457] Fix | Delete
}
[458] Fix | Delete
else if (preg_match('/^([^\/.]+)\.php$/', $theme, $matches)) {
[459] Fix | Delete
$slug = $matches[1];
[460] Fix | Delete
}
[461] Fix | Delete
?>
[462] Fix | Delete
<tr>
[463] Fix | Delete
<td>
[464] Fix | Delete
<strong><?php echo esc_html($themeData['Name']) ?> (<?php echo esc_html($slug); ?>)</strong>
[465] Fix | Delete
<?php if (!empty($themeData['Version'])): ?>
[466] Fix | Delete
- <?php echo esc_html(sprintf(/* translators: Theme version. */ __('Version %s', 'wordfence'), $themeData['Version'])); ?>
[467] Fix | Delete
<?php endif ?>
[468] Fix | Delete
<?php if ($currentTheme instanceof WP_Theme && $theme === $currentTheme->get_stylesheet()): ?>
[469] Fix | Delete
<td class="wf-result-success"><?php esc_html_e('Active', 'wordfence'); ?></td>
[470] Fix | Delete
<?php else: ?>
[471] Fix | Delete
<td class="wf-result-inactive"><?php esc_html_e('Inactive', 'wordfence'); ?></td>
[472] Fix | Delete
<?php endif ?>
[473] Fix | Delete
</tr>
[474] Fix | Delete
<?php endforeach ?>
[475] Fix | Delete
</tbody>
[476] Fix | Delete
<?php else: ?>
[477] Fix | Delete
<tbody>
[478] Fix | Delete
<tr>
[479] Fix | Delete
<td><?php esc_html_e('No Themes', 'wordfence'); ?></td>
[480] Fix | Delete
</tr>
[481] Fix | Delete
</tbody>
[482] Fix | Delete
[483] Fix | Delete
<?php endif ?>
[484] Fix | Delete
</table>
[485] Fix | Delete
</div>
[486] Fix | Delete
</div>
[487] Fix | Delete
<div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-cron-jobs') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-cron-jobs') ?>">
[488] Fix | Delete
<div class="wf-block-header">
[489] Fix | Delete
<div class="wf-block-header-content">
[490] Fix | Delete
<div class="wf-block-title">
[491] Fix | Delete
<strong><?php esc_html_e('Cron Jobs', 'wordfence') ?></strong>
[492] Fix | Delete
<span class="wf-text-small"><?php esc_html_e('List of WordPress cron jobs scheduled by WordPress, plugins, or themes.', 'wordfence') ?></span>
[493] Fix | Delete
</div>
[494] Fix | Delete
<div class="wf-block-header-action">
[495] Fix | Delete
<div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-cron-jobs') ? 'true' : 'false'); ?>" tabindex="0"></div>
[496] Fix | Delete
</div>
[497] Fix | Delete
</div>
[498] Fix | Delete
</div>
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function