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/dashboar...
File: widget_ips.php
<?php if (!defined('WORDFENCE_VERSION')) { exit; } ?>
[0] Fix | Delete
<?php
[1] Fix | Delete
//$d is defined here as a wfDashboard instance
[2] Fix | Delete
[3] Fix | Delete
$initial = false;
[4] Fix | Delete
if (!isset($limit)) { $limit = 10; $initial = true; }
[5] Fix | Delete
?>
[6] Fix | Delete
<div class="wf-row">
[7] Fix | Delete
<div class="wf-col-xs-12">
[8] Fix | Delete
<div class="wf-dashboard-item active">
[9] Fix | Delete
<div class="wf-dashboard-item-inner">
[10] Fix | Delete
<div class="wf-dashboard-item-content">
[11] Fix | Delete
<div class="wf-dashboard-item-title">
[12] Fix | Delete
<strong><?php esc_html_e('Top IPs Blocked', 'wordfence') ?></strong>
[13] Fix | Delete
</div>
[14] Fix | Delete
<div class="wf-dashboard-item-action"><div class="wf-dashboard-item-action-disclosure"></div></div>
[15] Fix | Delete
</div>
[16] Fix | Delete
</div>
[17] Fix | Delete
<div class="wf-dashboard-item-extra">
[18] Fix | Delete
<?php if ($firewall->learningModeStatus() !== false): ?>
[19] Fix | Delete
<div class="wf-widget-learning-mode"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100.11 100.44"><path d="M96.14,30.67a50.7,50.7,0,0,0-10.66-16A50,50,0,0,0,69.51,4,49.57,49.57,0,0,0,30.6,4a50,50,0,0,0-16,10.69A50.69,50.69,0,0,0,4,30.67,50,50,0,0,0,4,69.74a50.62,50.62,0,0,0,10.66,16,50,50,0,0,0,16,10.69,49.54,49.54,0,0,0,38.91,0,50,50,0,0,0,16-10.69,50.56,50.56,0,0,0,10.66-16,50,50,0,0,0,0-39.07Zm-75.74,39a35.77,35.77,0,0,1-1-37.35,35.21,35.21,0,0,1,12.91-13A34.65,34.65,0,0,1,50.06,14.6a34.22,34.22,0,0,1,19.55,5.93ZM82.71,64a35.4,35.4,0,0,1-7.56,11.37A36,36,0,0,1,63.84,83a34.32,34.32,0,0,1-13.79,2.84A34.85,34.85,0,0,1,30.7,80L79.84,31a34.57,34.57,0,0,1,5.67,19.23A35.17,35.17,0,0,1,82.71,64Zm0,0"/></svg><span><?php esc_html_e('No Data Available During Learning Mode', 'wordfence'); ?></span></div>
[20] Fix | Delete
<?php else: ?>
[21] Fix | Delete
<ul class="wf-dashboard-item-list">
[22] Fix | Delete
<li>
[23] Fix | Delete
<div>
[24] Fix | Delete
<div class="wf-dashboard-toggle-btns">
[25] Fix | Delete
<ul class="wf-pagination wf-pagination-sm">
[26] Fix | Delete
<li class="wf-active"><a href="#" class="wf-dashboard-ips" data-grouping="24h" role="button"><?php esc_html_e('24 Hours', 'wordfence') ?></a></li>
[27] Fix | Delete
<li><a href="#" class="wf-dashboard-ips" data-grouping="7d" role="button"><?php esc_html_e('7 Days', 'wordfence') ?></a></li>
[28] Fix | Delete
<li><a href="#" class="wf-dashboard-ips" data-grouping="30d" role="button"><?php esc_html_e('30 Days', 'wordfence') ?></a></li>
[29] Fix | Delete
</ul>
[30] Fix | Delete
</div>
[31] Fix | Delete
<div class="wf-ips wf-ips-24h">
[32] Fix | Delete
<?php if (count($d->ips24h) == 0): ?>
[33] Fix | Delete
<div class="wf-dashboard-item-list-text"><p><em><?php esc_html_e('No blocks have been recorded.', 'wordfence') ?></em></p></div>
[34] Fix | Delete
<?php else: ?>
[35] Fix | Delete
<?php $data = array_slice($d->ips24h, 0, min($limit, count($d->ips24h)), true); include(dirname(__FILE__) . '/widget_content_ips.php'); ?>
[36] Fix | Delete
<?php if (count($d->ips24h) > $limit && $initial): ?>
[37] Fix | Delete
<div class="wf-dashboard-item-list-text"><div class="wf-dashboard-show-more" data-grouping="ips" data-period="24h"><a href="#" role="button"><?php esc_html_e('Show more', 'wordfence') ?></a></div></div>
[38] Fix | Delete
<?php endif; ?>
[39] Fix | Delete
<?php endif; ?>
[40] Fix | Delete
</div>
[41] Fix | Delete
<div class="wf-ips wf-ips-7d wf-hidden">
[42] Fix | Delete
<?php if (count($d->ips7d) == 0): ?>
[43] Fix | Delete
<div class="wf-dashboard-item-list-text"><p><em><?php esc_html_e('No blocks have been recorded.', 'wordfence') ?></em></p></div>
[44] Fix | Delete
<?php else: ?>
[45] Fix | Delete
<?php $data = array_slice($d->ips7d, 0, min($limit, count($d->ips7d)), true); include(dirname(__FILE__) . '/widget_content_ips.php'); ?>
[46] Fix | Delete
<?php if (count($d->ips7d) > $limit && $initial): ?>
[47] Fix | Delete
<div class="wf-dashboard-item-list-text"><div class="wf-dashboard-show-more" data-grouping="ips" data-period="7d"><a href="#" role="button"><?php esc_html_e('Show more', 'wordfence') ?></a></div></div>
[48] Fix | Delete
<?php endif; ?>
[49] Fix | Delete
<?php endif; ?>
[50] Fix | Delete
</div>
[51] Fix | Delete
<div class="wf-ips wf-ips-30d wf-hidden">
[52] Fix | Delete
<?php if (count($d->ips30d) == 0): ?>
[53] Fix | Delete
<div class="wf-dashboard-item-list-text"><p><em><?php esc_html_e('No blocks have been recorded.', 'wordfence') ?></em></p></div>
[54] Fix | Delete
<?php else: ?>
[55] Fix | Delete
<?php $data = array_slice($d->ips30d, 0, min($limit, count($d->ips30d)), true); include(dirname(__FILE__) . '/widget_content_ips.php'); ?>
[56] Fix | Delete
<?php if (count($d->ips30d) > $limit && $initial): ?>
[57] Fix | Delete
<div class="wf-dashboard-item-list-text"><div class="wf-dashboard-show-more" data-grouping="ips" data-period="30d"><a href="#" role="button"><?php esc_html_e('Show more', 'wordfence') ?></a></div></div>
[58] Fix | Delete
<?php endif; ?>
[59] Fix | Delete
<?php endif; ?>
[60] Fix | Delete
</div>
[61] Fix | Delete
<script type="application/javascript">
[62] Fix | Delete
(function($) {
[63] Fix | Delete
$('.wf-dashboard-ips').on('click', function(e) {
[64] Fix | Delete
e.preventDefault();
[65] Fix | Delete
e.stopPropagation();
[66] Fix | Delete
[67] Fix | Delete
$(this).closest('ul').find('li').removeClass('wf-active');
[68] Fix | Delete
$(this).closest('li').addClass('wf-active');
[69] Fix | Delete
[70] Fix | Delete
$('.wf-ips').addClass('wf-hidden');
[71] Fix | Delete
$('.wf-ips-' + $(this).data('grouping')).removeClass('wf-hidden');
[72] Fix | Delete
});
[73] Fix | Delete
[74] Fix | Delete
$('.wf-ips .wf-dashboard-show-more a').on('click', function(e) {
[75] Fix | Delete
e.preventDefault();
[76] Fix | Delete
e.stopPropagation();
[77] Fix | Delete
[78] Fix | Delete
var grouping = $(this).parent().data('grouping');
[79] Fix | Delete
var period = $(this).parent().data('period');
[80] Fix | Delete
[81] Fix | Delete
$(this).closest('.wf-dashboard-item-list-text').fadeOut();
[82] Fix | Delete
[83] Fix | Delete
var self = this;
[84] Fix | Delete
WFAD.ajax('wordfence_dashboardShowMore', {
[85] Fix | Delete
grouping: grouping,
[86] Fix | Delete
period: period
[87] Fix | Delete
}, function(res) {
[88] Fix | Delete
if (res.ok) {
[89] Fix | Delete
var table = $('#ips-data-template').tmpl(res);
[90] Fix | Delete
$(self).closest('.wf-ips').css('overflow-y', 'auto');
[91] Fix | Delete
$(self).closest('.wf-ips').find('table').replaceWith(table);
[92] Fix | Delete
}
[93] Fix | Delete
else {
[94] Fix | Delete
WFAD.colorboxModal('300px', <?php echo json_encode(__('An error occurred', 'wordfence')) ?>, <?php echo json_encode(__('We encountered an error trying load more data.', 'wordfence')) ?>);
[95] Fix | Delete
$(this).closest('.wf-dashboard-item-list-text').fadeIn();
[96] Fix | Delete
}
[97] Fix | Delete
});
[98] Fix | Delete
});
[99] Fix | Delete
})(jQuery);
[100] Fix | Delete
</script>
[101] Fix | Delete
</div>
[102] Fix | Delete
</li>
[103] Fix | Delete
</ul>
[104] Fix | Delete
<?php endif; ?>
[105] Fix | Delete
</div>
[106] Fix | Delete
</div>
[107] Fix | Delete
</div>
[108] Fix | Delete
</div>
[109] Fix | Delete
<script type="text/x-jquery-template" id="ips-data-template">
[110] Fix | Delete
<table class="wf-table wf-table-hover">
[111] Fix | Delete
<thead>
[112] Fix | Delete
<tr>
[113] Fix | Delete
<th><?php esc_html_e('IP', 'wordfence') ?></th>
[114] Fix | Delete
<th colspan="2"><?php esc_html_e('Country', 'wordfence') ?></th>
[115] Fix | Delete
<th><?php esc_html_e('Block Count', 'wordfence') ?></th>
[116] Fix | Delete
</tr>
[117] Fix | Delete
</thead>
[118] Fix | Delete
<tbody>
[119] Fix | Delete
{{each(idx, d) data}}
[120] Fix | Delete
<tr>
[121] Fix | Delete
<td>${d.IP}</td>
[122] Fix | Delete
<td>${d.countryName}</td>
[123] Fix | Delete
<td><span class="wf-flag ${d.countryFlag}" title="${d.countryName}"></td>
[124] Fix | Delete
<td>${d.blockCount}</td>
[125] Fix | Delete
</tr>
[126] Fix | Delete
{{/each}}
[127] Fix | Delete
</tbody>
[128] Fix | Delete
</table>
[129] Fix | Delete
</script>
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function