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/blogvaul...
File: recover.php
<?php
[0] Fix | Delete
if (!defined('ABSPATH')) exit;
[1] Fix | Delete
if (!class_exists('BVRecover')) :
[2] Fix | Delete
class BVRecover {
[3] Fix | Delete
public static $default_secret_key = 'bv_default_secret_key';
[4] Fix | Delete
[5] Fix | Delete
public static function defaultSecret($settings) {
[6] Fix | Delete
$secret = self::getDefaultSecret($settings);
[7] Fix | Delete
if (empty($secret)) {
[8] Fix | Delete
$secret = BVRecover::refreshDefaultSecret($settings);
[9] Fix | Delete
}
[10] Fix | Delete
return $secret;
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
public static function refreshDefaultSecret($settings) {
[14] Fix | Delete
$key_details = array();
[15] Fix | Delete
$key_details["key"] = BVAccount::randString(32);
[16] Fix | Delete
$key_details["expires_at"] = time() + (24 * 60 * 60);
[17] Fix | Delete
[18] Fix | Delete
$settings->updateOption(self::$default_secret_key, $key_details);
[19] Fix | Delete
[20] Fix | Delete
return $key_details["key"];
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
[24] Fix | Delete
public static function deleteDefaultSecret($settings) {
[25] Fix | Delete
$settings->deleteOption(self::$default_secret_key);
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
public static function getDefaultSecret($settings) {
[29] Fix | Delete
$key_details = $settings->getOption(self::$default_secret_key);
[30] Fix | Delete
[31] Fix | Delete
if (is_array($key_details) && $key_details["expires_at"] > time()) {
[32] Fix | Delete
return $key_details["key"];
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
return null;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
public static function getSecretStatus($settings) {
[39] Fix | Delete
$key_details = $settings->getOption(self::$default_secret_key);
[40] Fix | Delete
$status = 'ACTIVE';
[41] Fix | Delete
if (!is_array($key_details)) {
[42] Fix | Delete
$status = 'DELETED';
[43] Fix | Delete
} elseif ($key_details["expires_at"] <= time()) {
[44] Fix | Delete
$status = 'EXPIRED';
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
return $status;
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
public static function validate($key) {
[51] Fix | Delete
return $key && strlen($key) >= 32;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
public static function find($settings, $pubkey) {
[55] Fix | Delete
if (!self::validate($pubkey)) {
[56] Fix | Delete
return null;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
$secret = self::getDefaultSecret($settings);
[60] Fix | Delete
if (!self::validate($secret)) {
[61] Fix | Delete
return null;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
$account = new BVAccount($settings, $pubkey, $secret);
[65] Fix | Delete
return $account;
[66] Fix | Delete
}
[67] Fix | Delete
}
[68] Fix | Delete
endif;
[69] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function