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_firewall_waf_options.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
$waf = wfWAF::getInstance();
[2] Fix | Delete
$d = new wfDashboard(); unset($d->countriesNetwork);
[3] Fix | Delete
$firewall = new wfFirewall();
[4] Fix | Delete
$config = $waf->getStorageEngine();
[5] Fix | Delete
$wafURL = wfPage::pageURL(wfPage::PAGE_FIREWALL);
[6] Fix | Delete
$wafConfigURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#configureAutoPrepend');
[7] Fix | Delete
$wafRemoveURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#removeAutoPrepend');
[8] Fix | Delete
/** @var array $wafData */
[9] Fix | Delete
[10] Fix | Delete
$backPage = new wfPage(wfPage::PAGE_FIREWALL);
[11] Fix | Delete
if (isset($_GET['source']) && wfPage::isValidPage($_GET['source'])) {
[12] Fix | Delete
$backPage = new wfPage($_GET['source']);
[13] Fix | Delete
}
[14] Fix | Delete
?>
[15] Fix | Delete
<script type="application/javascript">
[16] Fix | Delete
(function($) {
[17] Fix | Delete
WFAD.wafData = <?php echo json_encode($wafData); ?>;
[18] Fix | Delete
WFAD.restoreWAFData = JSON.parse(JSON.stringify(WFAD.wafData)); //Copied into wafData when canceling changes
[19] Fix | Delete
[20] Fix | Delete
$(function() {
[21] Fix | Delete
document.title = "<?php esc_attr_e('Firewall Options', 'wordfence'); ?>" + " \u2039 " + WFAD.basePageName;
[22] Fix | Delete
[23] Fix | Delete
WFAD.wafConfigPageRender();
[24] Fix | Delete
[25] Fix | Delete
//Hash-based option block linking
[26] Fix | Delete
if (window.location.hash) {
[27] Fix | Delete
var hashes = WFAD.parseHashes();
[28] Fix | Delete
var hash = hashes[hashes.length - 1];
[29] Fix | Delete
var target = $("#" + hash);
[30] Fix | Delete
var block = target.parents('.wf-block');
[31] Fix | Delete
if (!block.length) {
[32] Fix | Delete
block = $('.wf-block[data-persistence-key="' + hash + '"]');
[33] Fix | Delete
target = block;
[34] Fix | Delete
}
[35] Fix | Delete
if (block.length) {
[36] Fix | Delete
if (!block.hasClass('wf-active')) {
[37] Fix | Delete
block.find('.wf-block-content').slideDown({
[38] Fix | Delete
always: function() {
[39] Fix | Delete
block.addClass('wf-active');
[40] Fix | Delete
$('html, body').animate({
[41] Fix | Delete
scrollTop: target.offset().top - 100
[42] Fix | Delete
}, 1000);
[43] Fix | Delete
}
[44] Fix | Delete
});
[45] Fix | Delete
[46] Fix | Delete
WFAD.ajax('wordfence_saveDisclosureState', {name: block.data('persistenceKey'), state: true}, function() {});
[47] Fix | Delete
}
[48] Fix | Delete
else {
[49] Fix | Delete
$('html, body').animate({
[50] Fix | Delete
scrollTop: target.offset().top - 100
[51] Fix | Delete
}, 1000);
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
history.replaceState('', document.title, window.location.pathname + window.location.search);
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
var updatePendingCircles = function() {
[59] Fix | Delete
$('#circle-waf-coverage, #circle-waf-rules, #circle-waf-blacklist, #circle-waf-brute').wfCircularProgress({pendingOverlay: Object.keys(WFAD.pendingChanges).length > 0});
[60] Fix | Delete
};
[61] Fix | Delete
var coalescingUpdateTimer = false;
[62] Fix | Delete
[63] Fix | Delete
$('.wf-option, .wf-rule-toggle').on('change', function() {
[64] Fix | Delete
clearTimeout(coalescingUpdateTimer);
[65] Fix | Delete
coalescingUpdateTimer = setTimeout(updatePendingCircles, 100);
[66] Fix | Delete
});
[67] Fix | Delete
});
[68] Fix | Delete
[69] Fix | Delete
$(window).on('wfOptionsReset', function() {
[70] Fix | Delete
WFAD.wafData = JSON.parse(JSON.stringify(WFAD.restoreWAFData));
[71] Fix | Delete
WFAD.wafConfigPageRender();
[72] Fix | Delete
});
[73] Fix | Delete
})(jQuery);
[74] Fix | Delete
</script>
[75] Fix | Delete
<div class="wf-options-controls">
[76] Fix | Delete
<div class="wf-row">
[77] Fix | Delete
<div class="wf-col-xs-12">
[78] Fix | Delete
<?php
[79] Fix | Delete
echo wfView::create('options/block-controls', array(
[80] Fix | Delete
'backLink' => $backPage->url(),
[81] Fix | Delete
'backLabelHTML' => wp_kses(sprintf(__('<span class="wf-hidden-xs">Back to </span>%s', 'wordfence'), $backPage->label()), array('span'=>array('class'=>array()))),
[82] Fix | Delete
'restoreDefaultsSection' => wfConfig::OPTIONS_TYPE_FIREWALL,
[83] Fix | Delete
'restoreDefaultsMessage' => __('Are you sure you want to restore the default Firewall settings? This will undo any custom changes you have made to the options on this page. If you have manually disabled any rules or added any custom allowlisted URLs, those changes will not be overwritten.', 'wordfence'),
[84] Fix | Delete
))->render();
[85] Fix | Delete
?>
[86] Fix | Delete
</div>
[87] Fix | Delete
</div>
[88] Fix | Delete
</div>
[89] Fix | Delete
<div class="wf-options-controls-spacer"></div>
[90] Fix | Delete
<?php
[91] Fix | Delete
if (!wfOnboardingController::shouldShowAttempt3() && wfConfig::get('touppPromptNeeded')) {
[92] Fix | Delete
echo wfView::create('gdpr/disabled-overlay')->render();
[93] Fix | Delete
echo wfView::create('gdpr/banner')->render();
[94] Fix | Delete
}
[95] Fix | Delete
?>
[96] Fix | Delete
<div class="wrap wordfence">
[97] Fix | Delete
<div class="wf-container-fluid">
[98] Fix | Delete
<?php
[99] Fix | Delete
if (function_exists('network_admin_url') && is_multisite()) {
[100] Fix | Delete
$firewallURL = network_admin_url('admin.php?page=WordfenceWAF#top#waf');
[101] Fix | Delete
$blockingURL = network_admin_url('admin.php?page=WordfenceWAF#top#blocking');
[102] Fix | Delete
}
[103] Fix | Delete
else {
[104] Fix | Delete
$firewallURL = admin_url('admin.php?page=WordfenceWAF#top#waf');
[105] Fix | Delete
$blockingURL = admin_url('admin.php?page=WordfenceWAF#top#blocking');
[106] Fix | Delete
}
[107] Fix | Delete
?>
[108] Fix | Delete
<div class="wf-row">
[109] Fix | Delete
<div class="wf-col-xs-12">
[110] Fix | Delete
<div class="wp-header-end"></div>
[111] Fix | Delete
<?php if (isset($storageExceptionMessage)): ?>
[112] Fix | Delete
<div class="notice notice-error"><p><?php echo $storageExceptionMessage; ?></p></div>
[113] Fix | Delete
<?php endif; ?>
[114] Fix | Delete
</div>
[115] Fix | Delete
</div>
[116] Fix | Delete
<div class="wf-row">
[117] Fix | Delete
<div class="<?php echo wfStyle::contentClasses(); ?>">
[118] Fix | Delete
<div id="waf-options" class="wf-fixed-tab-content">
[119] Fix | Delete
<?php
[120] Fix | Delete
echo wfView::create('common/section-title', array(
[121] Fix | Delete
'title' => __('Firewall Options', 'wordfence'),
[122] Fix | Delete
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF),
[123] Fix | Delete
'helpLabelHTML' => wp_kses(__('Learn more<span class="wf-hidden-xs"> about the Firewall</span>', 'wordfence'), array('span'=>array('class'=>array()))),
[124] Fix | Delete
'showIcon' => true,
[125] Fix | Delete
))->render();
[126] Fix | Delete
?>
[127] Fix | Delete
<div class="wf-row">
[128] Fix | Delete
<div class="wf-col-xs-12">
[129] Fix | Delete
<div class="wf-block wf-active">
[130] Fix | Delete
<div class="wf-block-content">
[131] Fix | Delete
<ul class="wf-block-list wf-block-list-horizontal wf-block-list-nowrap wf-waf-coverage">
[132] Fix | Delete
<li>
[133] Fix | Delete
<?php
[134] Fix | Delete
if (function_exists('network_admin_url') && is_multisite()) { $optionsURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options'); }
[135] Fix | Delete
else { $optionsURL = admin_url('admin.php?page=WordfenceWAF&subpage=waf_options'); }
[136] Fix | Delete
echo wfView::create('common/status-detail', array(
[137] Fix | Delete
'id' => 'waf-coverage',
[138] Fix | Delete
'percentage' => $firewall->wafStatus(),
[139] Fix | Delete
'activeColor' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? '#ececec' : null /* automatic */),
[140] Fix | Delete
'title' => __('Web Application Firewall', 'wordfence'),
[141] Fix | Delete
'subtitle' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? __('Currently in Learning Mode', 'wordfence') : __('Stops Complex Attacks', 'wordfence')),
[142] Fix | Delete
'link' => $optionsURL,
[143] Fix | Delete
'linkLabel' => null,
[144] Fix | Delete
'statusTitle' => __('Web Application Firewall Status', 'wordfence'),
[145] Fix | Delete
'statusList' => $firewall->wafStatusList(),
[146] Fix | Delete
'statusExtra' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? wfView::create('waf/status-tooltip-learning-mode')->render() : ''),
[147] Fix | Delete
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_OVERALL),
[148] Fix | Delete
))->render();
[149] Fix | Delete
?>
[150] Fix | Delete
</li>
[151] Fix | Delete
<li>
[152] Fix | Delete
<?php
[153] Fix | Delete
echo wfView::create('common/status-detail', array(
[154] Fix | Delete
'id' => 'waf-rules',
[155] Fix | Delete
'percentage' => $firewall->ruleStatus(),
[156] Fix | Delete
'activeColor' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? '#ececec' : null /* automatic */),
[157] Fix | Delete
'title' => __('Firewall Rules: ', 'wordfence') . ($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM ? __('Premium', 'wordfence') : __('Community', 'wordfence')),
[158] Fix | Delete
'subtitle' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? __('Currently in Learning Mode', 'wordfence') : ($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM ? __('Rules updated in real-time', 'wordfence') : __('Rule updates delayed by 30 days', 'wordfence'))),
[159] Fix | Delete
'link' => 'https://www.wordfence.com/gnl1wafUpgrade/wordfence-signup/',
[160] Fix | Delete
'linkLabel' => null,
[161] Fix | Delete
'linkNewWindow' => true,
[162] Fix | Delete
'statusTitle' => __('Firewall Rules Status', 'wordfence'),
[163] Fix | Delete
'statusList' => $firewall->wafStatusList('rules'),
[164] Fix | Delete
'statusExtra' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? wfView::create('waf/status-tooltip-learning-mode')->render() : ''),
[165] Fix | Delete
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_RULES),
[166] Fix | Delete
))->render();
[167] Fix | Delete
?>
[168] Fix | Delete
</li>
[169] Fix | Delete
<li>
[170] Fix | Delete
<?php
[171] Fix | Delete
echo wfView::create('common/status-detail', array(
[172] Fix | Delete
'id' => 'waf-blacklist',
[173] Fix | Delete
'percentage' => $firewall->blacklistStatus(),
[174] Fix | Delete
'title' => __('Real-Time IP Blocklist: ', 'wordfence') . ($firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_ENABLED ? __('Enabled', 'wordfence') : __('Disabled', 'wordfence')),
[175] Fix | Delete
'subtitle' => __('Blocks requests from known malicious IPs', 'wordfence'),
[176] Fix | Delete
'link' => (($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM && $firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_DISABLED) ? network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-advanced') : 'https://www.wordfence.com/gnl1wafUpgrade/wordfence-signup/'),
[177] Fix | Delete
'linkLabel' => null,
[178] Fix | Delete
'linkNewWindow' => !($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM && $firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_DISABLED),
[179] Fix | Delete
'statusTitle' => __('Blocklist Status', 'wordfence'),
[180] Fix | Delete
'statusList' => $firewall->wafStatusList('blacklist'),
[181] Fix | Delete
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_BLACKLIST),
[182] Fix | Delete
))->render();
[183] Fix | Delete
?>
[184] Fix | Delete
</li>
[185] Fix | Delete
<li>
[186] Fix | Delete
<?php
[187] Fix | Delete
echo wfView::create('common/status-detail', array(
[188] Fix | Delete
'id' => 'waf-brute',
[189] Fix | Delete
'percentage' => $firewall->bruteForceStatus(),
[190] Fix | Delete
'title' => __('Brute Force Protection', 'wordfence') . ($firewall->bruteForceStatus() == 0 ? __(': Disabled', 'wordfence') : ''),
[191] Fix | Delete
'subtitle' => __('Stops Password Guessing Attacks', 'wordfence'),
[192] Fix | Delete
'link' => network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-bruteforce'),
[193] Fix | Delete
'linkLabel' => null,
[194] Fix | Delete
'statusTitle' => __('Brute Force Protection Status', 'wordfence'),
[195] Fix | Delete
'statusList' => $firewall->bruteForceStatusList(),
[196] Fix | Delete
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_BRUTE_FORCE),
[197] Fix | Delete
))->render();
[198] Fix | Delete
?>
[199] Fix | Delete
</li>
[200] Fix | Delete
</ul>
[201] Fix | Delete
</div>
[202] Fix | Delete
</div>
[203] Fix | Delete
</div>
[204] Fix | Delete
</div>
[205] Fix | Delete
<?php
[206] Fix | Delete
echo wfView::create('waf/options-group-basic-firewall', array(
[207] Fix | Delete
'firewall' => $firewall,
[208] Fix | Delete
'waf' => $waf,
[209] Fix | Delete
'stateKey' => 'waf-options-basic',
[210] Fix | Delete
'collapseable' => false,
[211] Fix | Delete
))->render();
[212] Fix | Delete
?>
[213] Fix | Delete
<?php
[214] Fix | Delete
echo wfView::create('waf/options-group-advanced-firewall', array(
[215] Fix | Delete
'firewall' => $firewall,
[216] Fix | Delete
'waf' => $waf,
[217] Fix | Delete
'stateKey' => 'waf-options-advanced',
[218] Fix | Delete
))->render();
[219] Fix | Delete
?>
[220] Fix | Delete
<?php
[221] Fix | Delete
echo wfView::create('waf/options-group-brute-force', array(
[222] Fix | Delete
'firewall' => $firewall,
[223] Fix | Delete
'waf' => $waf,
[224] Fix | Delete
'stateKey' => 'waf-options-bruteforce',
[225] Fix | Delete
))->render();
[226] Fix | Delete
?>
[227] Fix | Delete
<?php
[228] Fix | Delete
echo wfView::create('waf/options-group-rate-limiting', array(
[229] Fix | Delete
'firewall' => $firewall,
[230] Fix | Delete
'waf' => $waf,
[231] Fix | Delete
'stateKey' => 'waf-options-ratelimiting',
[232] Fix | Delete
))->render();
[233] Fix | Delete
?>
[234] Fix | Delete
<?php
[235] Fix | Delete
echo wfView::create('waf/options-group-whitelisted', array(
[236] Fix | Delete
'firewall' => $firewall,
[237] Fix | Delete
'waf' => $waf,
[238] Fix | Delete
'stateKey' => 'waf-options-whitelisted',
[239] Fix | Delete
))->render();
[240] Fix | Delete
?>
[241] Fix | Delete
</div> <!-- end waf options block -->
[242] Fix | Delete
</div> <!-- end content block -->
[243] Fix | Delete
</div> <!-- end row -->
[244] Fix | Delete
</div> <!-- end container -->
[245] Fix | Delete
</div>
[246] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function