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.../views/waf
File: waf-uninstall.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
?>
[2] Fix | Delete
<script type="text/x-jquery-template" id="wafTmpl_uninstall">
[3] Fix | Delete
<div class="wf-modal">
[4] Fix | Delete
<div class="wf-modal-header">
[5] Fix | Delete
<div class="wf-modal-header-content">
[6] Fix | Delete
<div class="wf-modal-title">
[7] Fix | Delete
<strong><?php esc_html_e('Uninstall Wordfence Firewall', 'wordfence'); ?></strong>
[8] Fix | Delete
</div>
[9] Fix | Delete
</div>
[10] Fix | Delete
<div class="wf-modal-header-action">
[11] Fix | Delete
<div><?php echo wp_kses(sprintf(__('If you cannot complete the uninstall process, <a target="_blank" rel="noopener noreferrer" href="%s">click here for help<span class="screen-reader-text"> (opens in new tab)</span></a>', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_WAF_REMOVE_MANUALLY)), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?></div>
[12] Fix | Delete
<div class="wf-padding-add-left-small wf-modal-header-action-close"><a href="#" onclick="WFAD.colorboxClose(); return false" role="button"><i class="wf-fa wf-fa-times-circle" aria-hidden="true"></i></a></div>
[13] Fix | Delete
</div>
[14] Fix | Delete
</div>
[15] Fix | Delete
<div class="wf-modal-content">
[16] Fix | Delete
<?php
[17] Fix | Delete
if (WF_IS_WP_ENGINE || WF_IS_PRESSABLE || WF_IS_FLYWHEEL) {
[18] Fix | Delete
$currentAutoPrependFile = wordfence::getWAFBootstrapPath();
[19] Fix | Delete
} else {
[20] Fix | Delete
$currentAutoPrependFile = ini_get('auto_prepend_file');
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
?>
[24] Fix | Delete
<p><?php echo wp_kses(__('Extended Protection Mode of the Wordfence Web Application Firewall uses the PHP ini setting called <code>auto_prepend_file</code> in order to ensure it runs before any potentially vulnerable code runs. This PHP setting currently refers to the Wordfence file at:', 'wordfence'), array('code'=>array())); ?></p>
[25] Fix | Delete
<pre class='wf-pre'><?php echo esc_html($currentAutoPrependFile); ?></pre>
[26] Fix | Delete
<?php
[27] Fix | Delete
$contents = file_get_contents($currentAutoPrependFile);
[28] Fix | Delete
$refersToWAF = preg_match('/define\s*\(\s*(["\'])WFWAF_LOG_PATH\1\s*,\s*(__DIR__\s*\.\s*)?(["\']).+?\3\s*\)\s*/', $contents);
[29] Fix | Delete
[30] Fix | Delete
if (!$refersToWAF):
[31] Fix | Delete
?>
[32] Fix | Delete
<p><?php echo wp_kses(sprintf(/* translators: Support URL. */ __('Automatic uninstallation cannot be completed, but you may still be able to <a href="%s" target="_blank" rel="noopener noreferrer">manually uninstall extended protection<span class="screen-reader-text"> (opens in new tab)</span></a>.', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_WAF_REMOVE_MANUALLY)), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?></p>
[33] Fix | Delete
<?php else: ?>
[34] Fix | Delete
<p><?php echo wp_kses(__('Before this file can be deleted, the configuration for the <code>auto_prepend_file</code> setting needs to be removed.', 'wordfence'), array('code'=>array())); ?></p>
[35] Fix | Delete
<?php
[36] Fix | Delete
$serverInfo = wfWebServerInfo::createFromEnvironment();
[37] Fix | Delete
$dropdown = array(
[38] Fix | Delete
array("apache-mod_php", __('Apache + mod_php', 'wordfence'), $serverInfo->isApacheModPHP(), wfWAFAutoPrependHelper::helper('apache-mod_php')->getFilesNeededForBackup()),
[39] Fix | Delete
array("apache-suphp", __('Apache + suPHP', 'wordfence'), $serverInfo->isApacheSuPHP(), wfWAFAutoPrependHelper::helper('apache-suphp')->getFilesNeededForBackup()),
[40] Fix | Delete
array("cgi", __('Apache + CGI/FastCGI', 'wordfence'), $serverInfo->isApache() && !$serverInfo->isApacheSuPHP() && ($serverInfo->isCGI() || $serverInfo->isFastCGI()), wfWAFAutoPrependHelper::helper('cgi')->getFilesNeededForBackup()),
[41] Fix | Delete
array("litespeed", __('LiteSpeed/lsapi', 'wordfence'), $serverInfo->isLiteSpeed(), wfWAFAutoPrependHelper::helper('litespeed')->getFilesNeededForBackup()),
[42] Fix | Delete
array("nginx", __('NGINX', 'wordfence'), $serverInfo->isNGINX(), wfWAFAutoPrependHelper::helper('nginx')->getFilesNeededForBackup()),
[43] Fix | Delete
array("iis", __('Windows (IIS)', 'wordfence'), $serverInfo->isIIS(), wfWAFAutoPrependHelper::helper('iis')->getFilesNeededForBackup()),
[44] Fix | Delete
);
[45] Fix | Delete
[46] Fix | Delete
$hasRecommendedOption = false;
[47] Fix | Delete
$wafPrependOptions = '';
[48] Fix | Delete
foreach ($dropdown as $option) {
[49] Fix | Delete
list($optionValue, $optionText, $selected) = $option;
[50] Fix | Delete
$optionValue=esc_attr($optionValue);
[51] Fix | Delete
$optionText=esc_html($optionText);
[52] Fix | Delete
$wafPrependOptions .= "<option value=\"{$optionValue}\"" . ($selected ? ' selected' : '') . ">{$optionText}" . ($selected ? ' (recommended based on our tests)' : '') . "</option>\n";
[53] Fix | Delete
if ($selected) {
[54] Fix | Delete
$hasRecommendedOption = true;
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
if (!$hasRecommendedOption): ?>
[59] Fix | Delete
<p><?php esc_html_e('If you know your web server\'s configuration, please select it from the list below.', 'wordfence'); ?></p>
[60] Fix | Delete
<?php else: ?>
[61] Fix | Delete
<p><?php esc_html_e('We\'ve preselected your server configuration based on our tests, but if you know your web server\'s configuration, please select it now.', 'wordfence'); ?></p>
[62] Fix | Delete
<?php endif; ?>
[63] Fix | Delete
<select name='serverConfiguration' id='wf-waf-server-config'>
[64] Fix | Delete
<?php echo $wafPrependOptions; ?>
[65] Fix | Delete
</select>
[66] Fix | Delete
<?php
[67] Fix | Delete
$adminURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options&action=removeAutoPrepend');
[68] Fix | Delete
$wfnonce = wp_create_nonce('wfWAFRemoveAutoPrepend');
[69] Fix | Delete
foreach ($dropdown as $option):
[70] Fix | Delete
list($optionValue, $optionText, $selected) = $option;
[71] Fix | Delete
$class = preg_replace('/[^a-z0-9\-]/i', '', $optionValue);
[72] Fix | Delete
$helper = new wfWAFAutoPrependHelper($optionValue, null);
[73] Fix | Delete
$backups = $helper->getFilesNeededForBackup();
[74] Fix | Delete
$filteredBackups = array();
[75] Fix | Delete
foreach ($backups as $index => $backup) {
[76] Fix | Delete
if (!file_exists($backup)) {
[77] Fix | Delete
continue;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
$filteredBackups[$index] = $backup;
[81] Fix | Delete
}
[82] Fix | Delete
$jsonBackups = json_encode(array_map('basename', $filteredBackups));
[83] Fix | Delete
?>
[84] Fix | Delete
<div class="wf-waf-backups wf-waf-backups-<?php echo $class; ?>" style="display: none;" data-backups="<?php echo esc_attr($jsonBackups); ?>">
[85] Fix | Delete
<?php if (count($filteredBackups)): ?><p><?php esc_html_e('Please download a backup of the following files before we make the necessary changes:', 'wordfence'); ?></p><?php endif; ?>
[86] Fix | Delete
<ul class="wf-waf-backup-file-list">
[87] Fix | Delete
<?php
[88] Fix | Delete
foreach ($filteredBackups as $index => $backup) {
[89] Fix | Delete
echo '<li><a class="wf-btn wf-btn-default wf-waf-backup-download" data-backup-index="' . $index . '" href="' .
[90] Fix | Delete
esc_url(add_query_arg(array(
[91] Fix | Delete
'downloadBackup' => 1,
[92] Fix | Delete
'backupIndex' => $index,
[93] Fix | Delete
'serverConfiguration' => $helper->getServerConfig(),
[94] Fix | Delete
'wfnonce' => $wfnonce,
[95] Fix | Delete
), $adminURL)) . '">' . esc_html(sprintf(__('Download %s', 'wordfence'), basename($backup))) . '</a></li>';
[96] Fix | Delete
}
[97] Fix | Delete
?>
[98] Fix | Delete
</ul>
[99] Fix | Delete
</div>
[100] Fix | Delete
<?php endforeach; ?>
[101] Fix | Delete
<?php endif; ?>
[102] Fix | Delete
</div>
[103] Fix | Delete
<div class="wf-modal-footer">
[104] Fix | Delete
<ul class="wf-flex-horizontal wf-flex-full-width">
[105] Fix | Delete
<li class="wf-waf-download-instructions"><?php esc_html_e('Once you have downloaded the files, click Continue to complete uninstallation.', 'wordfence'); ?></li>
[106] Fix | Delete
<li class="wf-right"><a href="#" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" id="wf-waf-uninstall-continue" role="button"><?php esc_html_e('Continue', 'wordfence'); ?></a></li>
[107] Fix | Delete
</ul>
[108] Fix | Delete
</div>
[109] Fix | Delete
</div>
[110] Fix | Delete
</script>
[111] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function