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.../modules/login-se.../views/options
File: option-captcha.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_LS_VERSION')) { exit; }
[1] Fix | Delete
[2] Fix | Delete
$enableOptionName = \WordfenceLS\Controller_Settings::OPTION_ENABLE_AUTH_CAPTCHA;
[3] Fix | Delete
$currentEnableValue = \WordfenceLS\Controller_Settings::shared()->get_bool($enableOptionName);
[4] Fix | Delete
[5] Fix | Delete
$siteKeyOptionName = \WordfenceLS\Controller_Settings::OPTION_RECAPTCHA_SITE_KEY;
[6] Fix | Delete
$siteKeyValue = \WordfenceLS\Controller_Settings::shared()->get($siteKeyOptionName);
[7] Fix | Delete
[8] Fix | Delete
$secretOptionName = \WordfenceLS\Controller_Settings::OPTION_RECAPTCHA_SECRET;
[9] Fix | Delete
$secretValue = \WordfenceLS\Controller_Settings::shared()->get($secretOptionName);
[10] Fix | Delete
?>
[11] Fix | Delete
<ul id="wfls-option-enable-auth-captcha" data-option="<?php echo esc_attr($enableOptionName); ?>" data-enabled-value="1" data-disabled-value="0" data-original-value="<?php echo $currentEnableValue ? '1' : '0'; ?>">
[12] Fix | Delete
<li>
[13] Fix | Delete
<ul class="wfls-option wfls-padding-add-bottom-small">
[14] Fix | Delete
<li id="wfls-enable-auth-captcha" class="wfls-option-checkbox<?php echo ($currentEnableValue ? ' wfls-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($currentEnableValue ? 'true' : 'false'); ?>" tabindex="0"><i class="wfls-ion-ios-checkmark-empty" aria-hidden="true" aria-labelledby="wfls-enable-auth-captcha-label"></i></li>
[15] Fix | Delete
<li class="wfls-option-title">
[16] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[17] Fix | Delete
<li>
[18] Fix | Delete
<strong id="wfls-enable-auth-captcha-label"><?php esc_html_e('Enable reCAPTCHA on the login and user registration pages', 'wordfence'); ?></strong>
[19] Fix | Delete
</li>
[20] Fix | Delete
<li class="wfls-option-subtitle"><?php printf(__('reCAPTCHA v3 does not make users solve puzzles or click a checkbox like previous versions. The only visible part is the reCAPTCHA logo. If a visitor\'s browser fails the CAPTCHA, Wordfence will send an email to the user\'s address with a link they can click to verify that they are a user of your site. You can read further details <a href="%s" target="_blank" rel="noopener noreferrer">in our documentation</a>.', 'wordfence'), \WordfenceLS\Controller_Support::esc_supportURL(\WordfenceLS\Controller_Support::ITEM_MODULE_LOGIN_SECURITY_CAPTCHA)); ?></li>
[21] Fix | Delete
</ul>
[22] Fix | Delete
</li>
[23] Fix | Delete
</ul>
[24] Fix | Delete
</li>
[25] Fix | Delete
<li>
[26] Fix | Delete
<ul class="wfls-option wfls-padding-no-top">
[27] Fix | Delete
<li class="wfls-option-spacer"></li>
[28] Fix | Delete
<li>
[29] Fix | Delete
<table>
[30] Fix | Delete
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($siteKeyValue); ?>" data-text-option="<?php echo esc_attr($siteKeyOptionName); ?>">
[31] Fix | Delete
<th id="wfls-enable-captcha-site-key-label" class="wfls-padding-add-bottom"><?php esc_html_e('reCAPTCHA v3 Site Key', 'wordfence'); ?></th>
[32] Fix | Delete
<td class="wfls-option-text wfls-padding-add-bottom"><input type="text" name="recaptchaSiteKey" id="input-recaptchaSiteKey" class="wfls-form-control" value="<?php echo esc_attr($siteKeyValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
[33] Fix | Delete
</tr>
[34] Fix | Delete
<tr class="wfls-option wfls-option-text" data-original-value="<?php echo esc_attr($secretValue); ?>" data-text-option="<?php echo esc_attr($secretOptionName); ?>">
[35] Fix | Delete
<th id="wfls-enable-captcha-secret-label"><?php esc_html_e('reCAPTCHA v3 Secret', 'wordfence'); ?></th>
[36] Fix | Delete
<td class="wfls-option-text"><input type="text" name="recaptchaSecret" id="input-recaptchaSecret" class="wfls-form-control" value="<?php echo esc_attr($secretValue); ?>"<?php if (!$currentEnableValue) { echo ' disabled'; } ?>></td>
[37] Fix | Delete
</tr>
[38] Fix | Delete
</table>
[39] Fix | Delete
</li>
[40] Fix | Delete
</ul>
[41] Fix | Delete
<ul class="wfls-option wfls-padding-no-top">
[42] Fix | Delete
<li class="wfls-option-spacer"></li>
[43] Fix | Delete
<li class="wfls-option-title">
[44] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[45] Fix | Delete
<li class="wfls-option-subtitle"><?php echo wp_kses(__('Note: This feature requires a free site key and secret for the <a href="https://www.google.com/recaptcha/about/" target="_blank" rel="noopener noreferrer">Google reCAPTCHA v3 Service</a>. To set up new reCAPTCHA keys, log into your Google account and go to the <a href="https://www.google.com/recaptcha/admin" target="_blank" rel="noopener noreferrer">reCAPTCHA admin page</a>.', 'wordfence'), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()))); ?></li>
[46] Fix | Delete
</ul>
[47] Fix | Delete
</li>
[48] Fix | Delete
</ul>
[49] Fix | Delete
</li>
[50] Fix | Delete
</ul>
[51] Fix | Delete
<script type="application/javascript">
[52] Fix | Delete
(function($) {
[53] Fix | Delete
$(function() {
[54] Fix | Delete
$('#wfls-enable-auth-captcha').on('keydown', function(e) {
[55] Fix | Delete
if (e.keyCode == 32) {
[56] Fix | Delete
e.preventDefault();
[57] Fix | Delete
e.stopPropagation();
[58] Fix | Delete
[59] Fix | Delete
$(this).trigger('click');
[60] Fix | Delete
}
[61] Fix | Delete
});
[62] Fix | Delete
[63] Fix | Delete
$('#wfls-enable-auth-captcha').on('click', function(e) {
[64] Fix | Delete
e.preventDefault();
[65] Fix | Delete
e.stopPropagation();
[66] Fix | Delete
[67] Fix | Delete
var optionElement = $('#wfls-option-enable-auth-captcha');
[68] Fix | Delete
if (optionElement.hasClass('wfls-disabled')) {
[69] Fix | Delete
return;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
var option = optionElement.data('option');
[73] Fix | Delete
var value = false;
[74] Fix | Delete
var isActive = $(this).hasClass('wfls-checked');
[75] Fix | Delete
if (isActive) {
[76] Fix | Delete
$(this).removeClass('wfls-checked').attr('aria-checked', 'false');
[77] Fix | Delete
$('#input-recaptchaSiteKey, #input-recaptchaSecret').attr('disabled', true);
[78] Fix | Delete
value = optionElement.data('disabledValue');
[79] Fix | Delete
}
[80] Fix | Delete
else {
[81] Fix | Delete
$(this).addClass('wfls-checked').attr('aria-checked', 'true');
[82] Fix | Delete
$('#input-recaptchaSiteKey, #input-recaptchaSecret').attr('disabled', false);
[83] Fix | Delete
value = optionElement.data('enabledValue');
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
var originalValue = optionElement.data('originalValue');
[87] Fix | Delete
if (originalValue == value) {
[88] Fix | Delete
delete WFLS.pendingChanges[option];
[89] Fix | Delete
}
[90] Fix | Delete
else {
[91] Fix | Delete
WFLS.pendingChanges[option] = value;
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
$(optionElement).trigger('change', [false]);
[95] Fix | Delete
WFLS.updatePendingChanges();
[96] Fix | Delete
});
[97] Fix | Delete
[98] Fix | Delete
$('#wfls-enable-auth-captcha-label').on('click', function(e) {
[99] Fix | Delete
var links = $(this).find('a');
[100] Fix | Delete
var buffer = 10;
[101] Fix | Delete
for (var i = 0; i < links.length; i++) {
[102] Fix | Delete
var t = $(links[i]).offset().top;
[103] Fix | Delete
var l = $(links[i]).offset().left;
[104] Fix | Delete
var b = t + $(links[i]).height();
[105] Fix | Delete
var r = l + $(links[i]).width();
[106] Fix | Delete
[107] Fix | Delete
if (e.pageX > l - buffer && e.pageX < r + buffer && e.pageY > t - buffer && e.pageY < b + buffer) {
[108] Fix | Delete
return;
[109] Fix | Delete
}
[110] Fix | Delete
}
[111] Fix | Delete
$(this).closest('.wfls-option').find('.wfls-option-checkbox').trigger('click');
[112] Fix | Delete
}).css('cursor', 'pointer');
[113] Fix | Delete
[114] Fix | Delete
$('#input-recaptchaSiteKey, #input-recaptchaSecret').on('change paste keyup', function() {
[115] Fix | Delete
var e = this;
[116] Fix | Delete
[117] Fix | Delete
setTimeout(function() {
[118] Fix | Delete
var optionElement = $(e).closest('.wfls-option');
[119] Fix | Delete
var option = optionElement.data('textOption');
[120] Fix | Delete
[121] Fix | Delete
if (typeof option !== 'undefined') {
[122] Fix | Delete
var value = $(e).val();
[123] Fix | Delete
[124] Fix | Delete
var originalValue = $(optionElement).data('originalValue');
[125] Fix | Delete
if (originalValue == value) {
[126] Fix | Delete
delete WFLS.pendingChanges[option];
[127] Fix | Delete
}
[128] Fix | Delete
else {
[129] Fix | Delete
WFLS.pendingChanges[option] = value;
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
$(optionElement).trigger('change', [false]);
[133] Fix | Delete
WFLS.updatePendingChanges();
[134] Fix | Delete
}
[135] Fix | Delete
}, 4);
[136] Fix | Delete
});
[137] Fix | Delete
[138] Fix | Delete
$(window).on('wflsOptionsReset', function() {
[139] Fix | Delete
$('#wfls-enable-auth-captcha').each(function() {
[140] Fix | Delete
var enabledValue = $(this).data('enabledValue');
[141] Fix | Delete
var disabledValue = $(this).data('disabledValue');
[142] Fix | Delete
var originalValue = $(this).data('originalValue');
[143] Fix | Delete
if (enabledValue == originalValue) {
[144] Fix | Delete
$(this).find('#wfls-enable-auth-captcha.wfls-option-checkbox').addClass('wfls-checked').attr('aria-checked', 'true');
[145] Fix | Delete
}
[146] Fix | Delete
else {
[147] Fix | Delete
$(this).find('#wfls-enable-auth-captcha.wfls-option-checkbox').removeClass('wfls-checked').attr('aria-checked', 'false');
[148] Fix | Delete
}
[149] Fix | Delete
$(this).trigger('change', [true]);
[150] Fix | Delete
});
[151] Fix | Delete
$('#input-recaptchaSiteKey, #input-recaptchaSecret').each(function() {
[152] Fix | Delete
$(this).val($(this).data('originalValue'));
[153] Fix | Delete
$(this).attr('disabled', !$('#wfls-enable-auth-captcha.wfls-option-checkbox').hasClass('wfls-checked'));
[154] Fix | Delete
});
[155] Fix | Delete
});
[156] Fix | Delete
});
[157] Fix | Delete
})(jQuery);
[158] Fix | Delete
</script>
[159] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function