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/wp-conte.../plugins/wordfenc.../modules/login-se.../views/options
File: option-captcha-threshold.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_LS_VERSION')) { exit; }
[1] Fix | Delete
[2] Fix | Delete
$optionName = \WordfenceLS\Controller_Settings::OPTION_RECAPTCHA_THRESHOLD;
[3] Fix | Delete
$currentValue = \WordfenceLS\Controller_Settings::shared()->get_float($optionName, 0.5);
[4] Fix | Delete
$selectOptions = array(
[5] Fix | Delete
array('label' => __('1.0 (definitely a human)', 'wordfence'), 'value' => 1.0, 'selected' => ((int) ($currentValue * 10)) == 10),
[6] Fix | Delete
array('label' => __('0.9', 'wordfence'), 'value' => 0.9, 'selected' => ((int) ($currentValue * 10)) == 9),
[7] Fix | Delete
array('label' => __('0.8', 'wordfence'), 'value' => 0.8, 'selected' => ((int) ($currentValue * 10)) == 8),
[8] Fix | Delete
array('label' => __('0.7', 'wordfence'), 'value' => 0.7, 'selected' => ((int) ($currentValue * 10)) == 7),
[9] Fix | Delete
array('label' => __('0.6', 'wordfence'), 'value' => 0.6, 'selected' => ((int) ($currentValue * 10)) == 6),
[10] Fix | Delete
array('label' => __('0.5 (probably a human)', 'wordfence'), 'value' => 0.5, 'selected' => ((int) ($currentValue * 10)) == 5),
[11] Fix | Delete
array('label' => __('0.4', 'wordfence'), 'value' => 0.4, 'selected' => ((int) ($currentValue * 10)) == 4),
[12] Fix | Delete
array('label' => __('0.3', 'wordfence'), 'value' => 0.3, 'selected' => ((int) ($currentValue * 10)) == 3),
[13] Fix | Delete
array('label' => __('0.2', 'wordfence'), 'value' => 0.2, 'selected' => ((int) ($currentValue * 10)) == 2),
[14] Fix | Delete
array('label' => __('0.1 (probably a bot)', 'wordfence'), 'value' => 0.1, 'selected' => ((int) ($currentValue * 10)) <= 1),
[15] Fix | Delete
);
[16] Fix | Delete
?>
[17] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[18] Fix | Delete
<li>
[19] Fix | Delete
<ul id="wfls-option-recaptcha-threshold" class="wfls-option wfls-option-select" data-select-option="<?php echo esc_attr($optionName); ?>" data-original-select-value="<?php echo esc_attr($currentValue); ?>">
[20] Fix | Delete
<li class="wfls-option-spacer"></li>
[21] Fix | Delete
<li class="wfls-option-content">
[22] Fix | Delete
<ul>
[23] Fix | Delete
<li class="wfls-option-title">
[24] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[25] Fix | Delete
<li><span id="wfls-option-recaptcha-threshold-label"><strong><?php esc_html_e('reCAPTCHA human/bot threshold score', 'wordfence'); ?></strong></span></li>
[26] Fix | Delete
<li class="wfls-option-subtitle"><?php esc_html_e('A reCAPTCHA score equal to or higher than this value will be considered human. Anything lower will be treated as a bot and require additional verification for login and registration.', 'wordfence'); ?></li>
[27] Fix | Delete
</ul>
[28] Fix | Delete
</li>
[29] Fix | Delete
<li class="wfls-option-select wfls-padding-add-top-xs-small">
[30] Fix | Delete
<select aria-labelledby="wfls-option-recaptcha-threshold-label">
[31] Fix | Delete
<?php foreach ($selectOptions as $o): ?>
[32] Fix | Delete
<option class="wfls-option-select-option" value="<?php echo esc_attr($o['value']); ?>"<?php if ($o['selected']) { echo ' selected'; } ?>><?php echo esc_html($o['label']); ?></option>
[33] Fix | Delete
<?php endforeach; ?>
[34] Fix | Delete
</select>
[35] Fix | Delete
</li>
[36] Fix | Delete
</ul>
[37] Fix | Delete
</li>
[38] Fix | Delete
</ul>
[39] Fix | Delete
</li>
[40] Fix | Delete
<li>
[41] Fix | Delete
<ul class="wfls-option">
[42] Fix | Delete
<li class="wfls-option-spacer"></li>
[43] Fix | Delete
<li class="wfls-recaptcha-score-history">
[44] Fix | Delete
<div class="wfls-recaptcha-chart-container">
[45] Fix | Delete
<canvas id="wfls-recaptcha-score-history"></canvas>
[46] Fix | Delete
</div>
[47] Fix | Delete
<div class="wfls-center">
[48] Fix | Delete
<a href="#" id="wfls-reset-recaptcha-score-stats" class="wfls-text-small"><?php esc_html_e('Reset Score Statistics', 'wordfence'); ?></a>
[49] Fix | Delete
</div>
[50] Fix | Delete
</li>
[51] Fix | Delete
</ul>
[52] Fix | Delete
</li>
[53] Fix | Delete
</ul>
[54] Fix | Delete
<script type="application/javascript">
[55] Fix | Delete
<?php
[56] Fix | Delete
$stats = \WordfenceLS\Controller_Settings::shared()->get_array(\WordfenceLS\Controller_Settings::OPTION_CAPTCHA_STATS);
[57] Fix | Delete
?>
[58] Fix | Delete
(function($) {
[59] Fix | Delete
$(function() {
[60] Fix | Delete
$('#wfls-reset-recaptcha-score-stats').on('click', function(e) {
[61] Fix | Delete
e.preventDefault();
[62] Fix | Delete
e.stopPropagation();
[63] Fix | Delete
[64] Fix | Delete
WFLS.ajax('wordfence_ls_reset_recaptcha_stats', {}, function(res) {
[65] Fix | Delete
if (res.success) {
[66] Fix | Delete
window.location.reload(true);
[67] Fix | Delete
}
[68] Fix | Delete
else {
[69] Fix | Delete
if (res.hasOwnProperty('html') && res.html) {
[70] Fix | Delete
WFLS.panelModalHTML((WFLS.screenSize(500) ? '300px' : '400px'), 'Error Resetting reCAPTCHA Statistics', res.error);
[71] Fix | Delete
}
[72] Fix | Delete
else {
[73] Fix | Delete
WFLS.panelModal((WFLS.screenSize(500) ? '300px' : '400px'), 'Error Resetting reCAPTCHA Statistics', res.error);
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
});
[77] Fix | Delete
});
[78] Fix | Delete
});
[79] Fix | Delete
[80] Fix | Delete
$(window).on('wfls-tab-change.recaptcha-score-history', function(e, target) {
[81] Fix | Delete
if (target == 'settings') {
[82] Fix | Delete
var barChartData = {
[83] Fix | Delete
labels: ['0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0'],
[84] Fix | Delete
datasets: [{
[85] Fix | Delete
label: '<?php esc_attr_e('Requests', 'wordfence'); ?>',
[86] Fix | Delete
backgroundColor: 'rgba(75,192,192,0.4)',
[87] Fix | Delete
borderColor: 'rgba(75,192,192,1.0)',
[88] Fix | Delete
borderWidth: 1,
[89] Fix | Delete
data: <?php echo json_encode($stats['counts']) ?>
[90] Fix | Delete
}]
[91] Fix | Delete
};
[92] Fix | Delete
[93] Fix | Delete
new Chart($('#wfls-recaptcha-score-history'), {
[94] Fix | Delete
type: 'bar',
[95] Fix | Delete
data: barChartData,
[96] Fix | Delete
options: {
[97] Fix | Delete
responsive: true,
[98] Fix | Delete
legend: {
[99] Fix | Delete
display: false,
[100] Fix | Delete
},
[101] Fix | Delete
title: {
[102] Fix | Delete
display: true,
[103] Fix | Delete
text: '<?php esc_attr_e('reCAPTCHA Score History', 'wordfence'); ?>'
[104] Fix | Delete
},
[105] Fix | Delete
scales: {
[106] Fix | Delete
y: {
[107] Fix | Delete
display: true,
[108] Fix | Delete
title: {
[109] Fix | Delete
display: true,
[110] Fix | Delete
text: '<?php esc_attr_e('Count', 'wordfence'); ?>'
[111] Fix | Delete
},
[112] Fix | Delete
ticks: {
[113] Fix | Delete
min: 0,
[114] Fix | Delete
precision: 0,
[115] Fix | Delete
stepSize: <?php echo max(10, pow(10, floor(log10(array_sum($stats['counts']) / 5)))); ?>
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
}
[119] Fix | Delete
}
[120] Fix | Delete
});
[121] Fix | Delete
$(window).off('wfls-tab-change.recaptcha-score-history');
[122] Fix | Delete
}
[123] Fix | Delete
});
[124] Fix | Delete
})(jQuery);
[125] Fix | Delete
</script>
[126] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function