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...
File: wordfence-login-security.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (defined('WP_INSTALLING') && WP_INSTALLING) { return; }
[2] Fix | Delete
if (!defined('ABSPATH')) { exit; }
[3] Fix | Delete
[4] Fix | Delete
$wfCoreActive = false;
[5] Fix | Delete
$plugins = (array) get_option('active_plugins', array()); //Used in lieu of is_plugin_active since that's not loaded until admin_init
[6] Fix | Delete
if (is_multisite()) {
[7] Fix | Delete
$sitePlugins = array_keys((array) get_site_option('active_sitewide_plugins', array()));
[8] Fix | Delete
$plugins = array_merge($plugins, $sitePlugins);
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
$wfVersion = ((is_multisite() && function_exists('get_network_option')) ? get_network_option(null, 'wordfence_version', false) : get_option('wordfence_version', false));
[12] Fix | Delete
if (version_compare($wfVersion, '7.3.1', '>=')) {
[13] Fix | Delete
foreach ($plugins as $p) {
[14] Fix | Delete
if (preg_match('~^wordfence[^/]*/wordfence\.php$~i', $p)) {
[15] Fix | Delete
$wfCoreActive = true;
[16] Fix | Delete
break;
[17] Fix | Delete
}
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
if ($wfCoreActive && !(isset($wfCoreLoading) && $wfCoreLoading)) {
[22] Fix | Delete
return; //Wordfence core will load this, prevent the standalone one from also loading if active
[23] Fix | Delete
}
[24] Fix | Delete
else {
[25] Fix | Delete
define('WORDFENCE_LS_FROM_CORE', ($wfCoreActive && isset($wfCoreLoading) && $wfCoreLoading));
[26] Fix | Delete
[27] Fix | Delete
define('WORDFENCE_LS_VERSION', '1.1.12');
[28] Fix | Delete
define('WORDFENCE_LS_BUILD_NUMBER', '1722265817');
[29] Fix | Delete
[30] Fix | Delete
define('WORDFENCE_LS_PLUGIN_BASENAME', plugin_basename(__FILE__));
[31] Fix | Delete
[32] Fix | Delete
if (!defined('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES')) { define('WORDFENCE_LS_EMAIL_VALIDITY_DURATION_MINUTES', 15); }
[33] Fix | Delete
[34] Fix | Delete
if (!WORDFENCE_LS_FROM_CORE) {
[35] Fix | Delete
global $wp_plugin_paths;
[36] Fix | Delete
foreach ($wp_plugin_paths as $dir => $realdir) {
[37] Fix | Delete
if (strpos(__FILE__, $realdir) === 0) {
[38] Fix | Delete
define('WORDFENCE_LS_FCPATH', $dir . '/' . basename(__FILE__));
[39] Fix | Delete
define('WORDFENCE_LS_PATH', trailingslashit($dir));
[40] Fix | Delete
break;
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
if (!defined('WORDFENCE_LS_FCPATH')) {
[46] Fix | Delete
/** @noinspection PhpConstantReassignmentInspection */
[47] Fix | Delete
define('WORDFENCE_LS_FCPATH', __FILE__);
[48] Fix | Delete
/** @noinspection PhpConstantReassignmentInspection */
[49] Fix | Delete
define('WORDFENCE_LS_PATH', trailingslashit(dirname(WORDFENCE_LS_FCPATH)));
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
if (!function_exists('wordfence_ls_autoload')) {
[53] Fix | Delete
function wordfence_ls_autoload($class) {
[54] Fix | Delete
$class = str_replace('\\', '/', $class);
[55] Fix | Delete
$class = str_replace('\\\\', '/', $class);
[56] Fix | Delete
$components = explode('/', $class);
[57] Fix | Delete
if (count($components) < 2) {
[58] Fix | Delete
return false;
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
if ($components[0] != 'WordfenceLS') {
[62] Fix | Delete
return false;
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
$path = '';
[66] Fix | Delete
for ($i = 1; $i < count($components) - 1; $i++) {
[67] Fix | Delete
$path .= '/' . strtolower($components[$i]);
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if (preg_match('/^(Controller|Model|Utility)_([a-z0-9]+)$/i', $components[count($components) - 1], $matches)) {
[71] Fix | Delete
$path = dirname(__FILE__) . '/classes/' . strtolower($matches[1]) . $path . '/' . strtolower($matches[2]) . '.php';
[72] Fix | Delete
if (file_exists($path)) {
[73] Fix | Delete
require_once($path);
[74] Fix | Delete
return true;
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
return false;
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
if (!defined('WORDFENCE_LS_AUTOLOADER_REGISTERED')) {
[83] Fix | Delete
define('WORDFENCE_LS_AUTOLOADER_REGISTERED', true);
[84] Fix | Delete
spl_autoload_register('wordfence_ls_autoload');
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
if (!defined('WORDFENCE_LS_VERSIONONLY_MODE') && (!defined('WORDFENCE_USE_LEGACY_2FA') || (defined('WORDFENCE_USE_LEGACY_2FA') && !WORDFENCE_USE_LEGACY_2FA))) { //Used to get version from file
[88] Fix | Delete
\WordfenceLS\Controller_WordfenceLS::shared()->init();
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function