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/offboard...
File: deactivation-prompt.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) exit;
[1] Fix | Delete
[2] Fix | Delete
$selectedOptionKey = $deactivationOption === null ? null : $deactivationOption->getKey();
[3] Fix | Delete
?>
[4] Fix | Delete
<div style="display: none;">
[5] Fix | Delete
<div class="wf-modal wf-deactivate-modal" id="wf-offboarding-delete-prompt-template">
[6] Fix | Delete
<div class="wf-modal-header">
[7] Fix | Delete
<div class="wf-modal-header-content">
[8] Fix | Delete
<div class="wf-modal-title"><strong><?php esc_html_e('Deactivate Wordfence', 'wordfence') ?></strong></div>
[9] Fix | Delete
</div>
[10] Fix | Delete
</div>
[11] Fix | Delete
<div class="wf-modal-content">
[12] Fix | Delete
<p><?php esc_html_e('You are about to deactivate Wordfence. Would you like to delete its data or keep it in place?', 'wordfence') ?></p>
[13] Fix | Delete
<div class="wf-radio-group">
[14] Fix | Delete
<?php foreach (wfDeactivationOption::getAll() as $option): ?>
[15] Fix | Delete
<?php
[16] Fix | Delete
$inputId = 'wf-deactivate-option-' . $option->getKey();
[17] Fix | Delete
?>
[18] Fix | Delete
<div class="wf-radio-option">
[19] Fix | Delete
<input type="radio" data-name="wf-deactivate-option" value="<?php echo esc_attr($option->getKey()) ?>" class="wf-templated" data-id="<?php echo esc_attr($inputId) ?>"<?php if ($option->getKey() === $selectedOptionKey): ?> checked<?php endif ?>>
[20] Fix | Delete
<label for="<?php echo esc_attr($inputId) ?>"><?php echo esc_html($option->getLabel()) ?></label>
[21] Fix | Delete
</div>
[22] Fix | Delete
<?php endforeach ?>
[23] Fix | Delete
</div>
[24] Fix | Delete
</div>
[25] Fix | Delete
<div class="wf-modal-footer">
[26] Fix | Delete
<button data-id="wf-deactivate-delete" class="wf-btn wf-btn-danger wf-deactivate-confirm wf-templated"><?php esc_html_e('Deactivate and Delete Data', 'wordfence') ?></button>
[27] Fix | Delete
<button data-id="wf-deactivate-retain" class="wf-btn wf-btn-primary wf-deactivate-confirm wf-templated"><?php esc_html_e('Deactivate', 'wordfence') ?></button>
[28] Fix | Delete
<button data-id="wf-deactivate-cancel" class="wf-btn wf-btn-default wf-templated"><?php esc_html_e('Cancel', 'wordfence') ?></button>
[29] Fix | Delete
</div>
[30] Fix | Delete
</div>
[31] Fix | Delete
<?php if ($wafOptimized): ?>
[32] Fix | Delete
<div class="wf-modal" id="wf-offboarding-waf-optimized-template">
[33] Fix | Delete
<div class="wf-modal-header">
[34] Fix | Delete
<div class="wf-modal-header-content">
[35] Fix | Delete
<div class="wf-modal-title"><strong><?php esc_html_e('Extended Protection Still Enabled', 'wordfence') ?></strong></div>
[36] Fix | Delete
</div>
[37] Fix | Delete
</div>
[38] Fix | Delete
<div class="wf-modal-content">
[39] Fix | Delete
<p><?php esc_html_e('The Wordfence firewall is still optimized. You should remove the firewall\'s extended protection before deleting to avoid PHP errors if some firewall files cannot be removed, or if PHP\'s "auto_prepend_file" setting is cached.', 'wordfence') ?></p>
[40] Fix | Delete
<p><a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_REMOVE_OPTIMIZATION) ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence') ?></a></p>
[41] Fix | Delete
</div>
[42] Fix | Delete
<div class="wf-modal-footer">
[43] Fix | Delete
<a class="wf-btn wf-btn-danger" href="<?php echo esc_attr(network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options&wf_deactivate=true#removeAutoPrepend')) ?>"><?php esc_html_e('Remove Extended Protection', 'wordfence') ?></a>
[44] Fix | Delete
<button onclick="jQuery.wfcolorbox.close(); return false;" class="wf-btn wf-btn-default"><?php esc_html_e('Cancel', 'wordfence') ?></a>
[45] Fix | Delete
</div>
[46] Fix | Delete
</div>
[47] Fix | Delete
<?php endif ?>
[48] Fix | Delete
<div class="wf-modal" id="wf-offboarding-delete-confirm-template">
[49] Fix | Delete
<div class="wf-modal-header">
[50] Fix | Delete
<div class="wf-modal-header-content">
[51] Fix | Delete
<div class="wf-modal-title"><strong><?php esc_html_e('Delete Wordfence Data?', 'wordfence') ?></strong></div>
[52] Fix | Delete
</div>
[53] Fix | Delete
</div>
[54] Fix | Delete
<div class="wf-modal-content"><span class="message"><?php esc_html_e('Are you sure you want to delete the selected Wordfence data? If you reactivate Wordfence later, deleted settings and history cannot be recovered.', 'wordfence') ?></span></div>
[55] Fix | Delete
<div class="wf-modal-footer">
[56] Fix | Delete
<button class="wf-btn wf-btn-danger wf-deactivate-delete-confirm"><?php esc_html_e('Deactivate and Delete Data', 'wordfence') ?></button>
[57] Fix | Delete
<button class="wf-btn wf-btn-default wf-deactivate-delete-cancel"><?php esc_html_e('Cancel', 'wordfence') ?></a>
[58] Fix | Delete
</div>
[59] Fix | Delete
</div>
[60] Fix | Delete
<div class="wf-modal" id="wf-offboarding-delete-error-template">
[61] Fix | Delete
<div class="wf-modal-header">
[62] Fix | Delete
<div class="wf-modal-header-content">
[63] Fix | Delete
<div class="wf-modal-title"><strong><?php esc_html_e('Error', 'wordfence') ?></strong></div>
[64] Fix | Delete
</div>
[65] Fix | Delete
</div>
[66] Fix | Delete
<div class="wf-modal-content"><span class="message"><?php esc_html_e('An unexpected error occurred while attempting to configure Wordfence to delete its data on deactivation.', 'wordfence') ?></span></div>
[67] Fix | Delete
<div class="wf-modal-footer wf-modal-footer-center">
[68] Fix | Delete
<button onclick="jQuery.wfcolorbox.close(); return false;" class="wf-btn wf-btn-primary"><?php esc_html_e('Close', 'wordfence') ?></a>
[69] Fix | Delete
</div>
[70] Fix | Delete
</div>
[71] Fix | Delete
</div>
[72] Fix | Delete
<script type="text/javascript">
[73] Fix | Delete
(function($) {
[74] Fix | Delete
[75] Fix | Delete
var wafOptimized = <?php echo json_encode($wafOptimized); ?>;
[76] Fix | Delete
[77] Fix | Delete
var stateController = new (function() {
[78] Fix | Delete
[79] Fix | Delete
var processing = false;
[80] Fix | Delete
[81] Fix | Delete
function applyState() {
[82] Fix | Delete
var modal = $("#wfcolorbox .wf-deactivate-modal");
[83] Fix | Delete
buttons = modal.find('button');
[84] Fix | Delete
options = modal.find('input[type=radio]');
[85] Fix | Delete
[buttons, options].forEach(function(element) {
[86] Fix | Delete
element.prop('disabled', processing).toggleClass('disabled', processing);
[87] Fix | Delete
});
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
function setProcessing(state) {
[91] Fix | Delete
processing = state;
[92] Fix | Delete
applyState();
[93] Fix | Delete
return true;
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
this.startProcessing = function() {
[97] Fix | Delete
if (processing)
[98] Fix | Delete
return false;
[99] Fix | Delete
return setProcessing(true);
[100] Fix | Delete
};
[101] Fix | Delete
[102] Fix | Delete
this.endProcessing = function() {
[103] Fix | Delete
if (!processing)
[104] Fix | Delete
return false;
[105] Fix | Delete
return setProcessing(false);
[106] Fix | Delete
};
[107] Fix | Delete
[108] Fix | Delete
this.refresh = function() {
[109] Fix | Delete
applyState();
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
})();
[113] Fix | Delete
[114] Fix | Delete
function updateButtons() {
[115] Fix | Delete
var retain = $('input[name=wf-deactivate-option]:checked').val() === 'retain';
[116] Fix | Delete
$('#wf-deactivate-retain').toggle(retain);
[117] Fix | Delete
$('#wf-deactivate-delete').toggle(!retain);
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
function replaceTemplatedAttribute(element, key) {
[121] Fix | Delete
var value = element.data(key);
[122] Fix | Delete
if (typeof value !== 'undefined')
[123] Fix | Delete
element.attr(key, value);
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
function showOffboardingModal(id) {
[127] Fix | Delete
var content = $("#wf-offboarding-" + id + "-template").clone().attr('id', null);
[128] Fix | Delete
content.find('.wf-templated').each(function() {
[129] Fix | Delete
var element = $(this);
[130] Fix | Delete
['id', 'name'].forEach(function(key) {
[131] Fix | Delete
replaceTemplatedAttribute(element, key);
[132] Fix | Delete
});
[133] Fix | Delete
});
[134] Fix | Delete
$.wfcolorbox({
[135] Fix | Delete
width: (wordfenceExt.isSmallScreen ? '300px' : '500px'),
[136] Fix | Delete
html: content[0].outerHTML,
[137] Fix | Delete
overlayClose: false,
[138] Fix | Delete
closeButton: false,
[139] Fix | Delete
className: 'wf-modal',
[140] Fix | Delete
onComplete: function() {
[141] Fix | Delete
updateButtons();
[142] Fix | Delete
stateController.refresh();
[143] Fix | Delete
}
[144] Fix | Delete
});
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
function deactivate() {
[148] Fix | Delete
$.wfcolorbox.close();
[149] Fix | Delete
$(document).off('click.wf-deactivate');
[150] Fix | Delete
$('#deactivate-wordfence').get(0).click();
[151] Fix | Delete
}
[152] Fix | Delete
[153] Fix | Delete
function showDeletionPrompt() {
[154] Fix | Delete
showOffboardingModal('delete-prompt');
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
$(document)
[158] Fix | Delete
.on('click', '.wf-deactivate-confirm', function (event) {
[159] Fix | Delete
if (!stateController.startProcessing())
[160] Fix | Delete
return;
[161] Fix | Delete
var option = $('input[name=wf-deactivate-option]:checked').val();
[162] Fix | Delete
function fail() {
[163] Fix | Delete
showOffboardingModal('delete-error');
[164] Fix | Delete
stateController.endProcessing();
[165] Fix | Delete
}
[166] Fix | Delete
wordfenceExt.ajax(
[167] Fix | Delete
'wordfence_setDeactivationOption',
[168] Fix | Delete
{ option: option},
[169] Fix | Delete
function(data) {
[170] Fix | Delete
if (data.success) {
[171] Fix | Delete
if (option !== <?php echo json_encode(wfDeactivationOption::RETAIN); ?>) {
[172] Fix | Delete
if (wafOptimized) {
[173] Fix | Delete
showOffboardingModal('waf-optimized');
[174] Fix | Delete
}
[175] Fix | Delete
else {
[176] Fix | Delete
showOffboardingModal('delete-confirm');
[177] Fix | Delete
}
[178] Fix | Delete
stateController.endProcessing();
[179] Fix | Delete
}
[180] Fix | Delete
else {
[181] Fix | Delete
deactivate();
[182] Fix | Delete
}
[183] Fix | Delete
stateController.endProcessing();
[184] Fix | Delete
}
[185] Fix | Delete
else {
[186] Fix | Delete
fail();
[187] Fix | Delete
}
[188] Fix | Delete
},
[189] Fix | Delete
fail
[190] Fix | Delete
);
[191] Fix | Delete
})
[192] Fix | Delete
.on('click', '.wf-deactivate-delete-confirm', function (event) {
[193] Fix | Delete
deactivate();
[194] Fix | Delete
})
[195] Fix | Delete
.on('click', '.wf-deactivate-delete-cancel', function (event) {
[196] Fix | Delete
showDeletionPrompt();
[197] Fix | Delete
})
[198] Fix | Delete
.on('click', '#wf-deactivate-cancel', function (event) {
[199] Fix | Delete
$.wfcolorbox.close();
[200] Fix | Delete
})
[201] Fix | Delete
.on('click.wf-deactivate', '#deactivate-wordfence', function (event) {
[202] Fix | Delete
event.preventDefault();
[203] Fix | Delete
showDeletionPrompt();
[204] Fix | Delete
})
[205] Fix | Delete
.on('change', 'input[name=wf-deactivate-option]', function(event) {
[206] Fix | Delete
updateButtons();
[207] Fix | Delete
});
[208] Fix | Delete
[209] Fix | Delete
<?php if ($deactivate): ?>
[210] Fix | Delete
$(document).ready(function() {
[211] Fix | Delete
$('#deactivate-wordfence').trigger('click');
[212] Fix | Delete
});
[213] Fix | Delete
<?php endif ?>
[214] Fix | Delete
[215] Fix | Delete
})(jQuery);
[216] Fix | Delete
</script>
[217] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function