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: wfDeactivationOption.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class wfDeactivationOption {
[2] Fix | Delete
[3] Fix | Delete
const RETAIN = 'retain';
[4] Fix | Delete
const DELETE_MAIN = 'delete-main';
[5] Fix | Delete
const DELETE_LOGIN_SECURITY = 'delete-wfls';
[6] Fix | Delete
const DELETE_ALL = 'delete-all';
[7] Fix | Delete
[8] Fix | Delete
private static $options = array();
[9] Fix | Delete
[10] Fix | Delete
private $key;
[11] Fix | Delete
private $label;
[12] Fix | Delete
private $deleteMain, $deleteLoginSecurity;
[13] Fix | Delete
[14] Fix | Delete
private function __construct($key, $label, $deleteMain, $deleteLoginSecurity) {
[15] Fix | Delete
$this->key = $key;
[16] Fix | Delete
$this->label = $label;
[17] Fix | Delete
$this->deleteMain = $deleteMain;
[18] Fix | Delete
$this->deleteLoginSecurity = $deleteLoginSecurity;
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
public function getKey() {
[22] Fix | Delete
return $this->key;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public function getLabel() {
[26] Fix | Delete
return $this->label;
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public function deletesMain() {
[30] Fix | Delete
return $this->deleteMain;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function deletesLoginSecurity() {
[34] Fix | Delete
return $this->deleteLoginSecurity;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function matchesState($deleteMain, $deleteLoginSecurity) {
[38] Fix | Delete
return $deleteMain === $this->deleteMain && $deleteLoginSecurity === $this->deleteLoginSecurity;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
private static function registerOption($option) {
[42] Fix | Delete
self::$options[$option->getKey()] = $option;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
private static function initializeOptions() {
[46] Fix | Delete
if (empty(self::$options)) {
[47] Fix | Delete
$options = array(
[48] Fix | Delete
new self(self::RETAIN, __('Keep all Wordfence tables and data', 'wordfence'), false, false),
[49] Fix | Delete
new self(self::DELETE_MAIN, __('Delete Wordfence tables and data, but keep Login Security tables and 2FA codes', 'wordfence'), true, false),
[50] Fix | Delete
new self(self::DELETE_LOGIN_SECURITY, __('Delete Login Security tables and 2FA codes, but keep Wordfence tables and data', 'wordfence'), false, true),
[51] Fix | Delete
new self(self::DELETE_ALL, __('Delete all Wordfence tables and data', 'wordfence'), true, true)
[52] Fix | Delete
);
[53] Fix | Delete
foreach ($options as $option)
[54] Fix | Delete
self::registerOption($option);
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
public static function getAll() {
[59] Fix | Delete
self::initializeOptions();
[60] Fix | Delete
return self::$options;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
public static function forKey($key) {
[64] Fix | Delete
self::initializeOptions();
[65] Fix | Delete
return array_key_exists($key, self::$options) ? self::$options[$key] : null;
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
public static function forState($deleteMain, $deleteLoginSecurity) {
[69] Fix | Delete
foreach (self::getAll() as $option) {
[70] Fix | Delete
if ($option->matchesState($deleteMain, $deleteLoginSecurity))
[71] Fix | Delete
return $option;
[72] Fix | Delete
}
[73] Fix | Delete
return null;
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
}
[77] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function