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: info.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!defined('ABSPATH')) exit;
[2] Fix | Delete
if (!class_exists('BVInfo')) :
[3] Fix | Delete
class BVInfo {
[4] Fix | Delete
public $settings;
[5] Fix | Delete
public $config;
[6] Fix | Delete
public $plugname = 'bvbackup';
[7] Fix | Delete
public $brandname = 'BlogVault';
[8] Fix | Delete
public $badgeinfo = 'bvbadge';
[9] Fix | Delete
public $ip_header_option = 'bvipheader';
[10] Fix | Delete
public $brand_option = 'bv_whitelabel_infos';
[11] Fix | Delete
public $version = '5.65';
[12] Fix | Delete
public $webpage = 'https://blogvault.net';
[13] Fix | Delete
public $appurl = 'https://app.blogvault.net';
[14] Fix | Delete
public $slug = 'blogvault-real-time-backup/blogvault.php';
[15] Fix | Delete
public $plug_redirect = 'bvredirect';
[16] Fix | Delete
public $logo = '../img/bvlogo.png';
[17] Fix | Delete
public $brand_icon = '/img/icon.svg';
[18] Fix | Delete
public $services_option_name = 'bvconfig';
[19] Fix | Delete
public $author = 'Backup by BlogVault';
[20] Fix | Delete
public $title = 'WordPress Backup & Security Plugin - BlogVault';
[21] Fix | Delete
[22] Fix | Delete
const DB_VERSION = '4';
[23] Fix | Delete
[24] Fix | Delete
public function __construct($settings) {
[25] Fix | Delete
$this->settings = $settings;
[26] Fix | Delete
$this->config = $this->settings->getOption($this->services_option_name);
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public function getCurrentDBVersion() {
[30] Fix | Delete
$bvconfig = $this->config;
[31] Fix | Delete
if ($bvconfig && array_key_exists('db_version', $bvconfig)) {
[32] Fix | Delete
return $bvconfig['db_version'];
[33] Fix | Delete
}
[34] Fix | Delete
return false;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function hasValidDBVersion() {
[38] Fix | Delete
return BVInfo::DB_VERSION === $this->getCurrentDBVersion();
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
public function getLatestWooCommerceDBVersion() {
[42] Fix | Delete
if (defined('WC_ABSPATH') && file_exists(WC_ABSPATH . 'includes/class-wc-install.php')) {
[43] Fix | Delete
include_once WC_ABSPATH . 'includes/class-wc-install.php';
[44] Fix | Delete
[45] Fix | Delete
if (class_exists('WC_Install')) {
[46] Fix | Delete
$update_versions = array_keys(WC_Install::get_db_update_callbacks());
[47] Fix | Delete
[48] Fix | Delete
if (!empty($update_versions)) {
[49] Fix | Delete
asort($update_versions);
[50] Fix | Delete
return end($update_versions);
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
return false;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
public function getConnectionKey() {
[59] Fix | Delete
require_once dirname( __FILE__ ) . '/recover.php';
[60] Fix | Delete
$bvsiteinfo = new BVWPSiteInfo();
[61] Fix | Delete
$encoded_url = base64_encode($bvsiteinfo->siteurl());
[62] Fix | Delete
$secret = BVRecover::defaultSecret($this->settings);
[63] Fix | Delete
[64] Fix | Delete
return base64_encode("v1:".$secret.":".$encoded_url);
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
public function getDefaultSecret() {
[68] Fix | Delete
require_once dirname( __FILE__ ) . '/recover.php';
[69] Fix | Delete
$bvsiteinfo = new BVWPSiteInfo();
[70] Fix | Delete
return BVRecover::defaultSecret($this->settings);
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
public function getLatestElementorDBVersion($file) {
[74] Fix | Delete
$managerClass = $file === "elementor/elementor.php" ? '\Elementor\Core\Upgrade\Manager' : '\ElementorPro\Core\Upgrade\Manager';
[75] Fix | Delete
[76] Fix | Delete
if (!class_exists($managerClass)) {
[77] Fix | Delete
return false;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
$manager = new $managerClass();
[81] Fix | Delete
return $manager->get_new_version();
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
public static function getRequestID() {
[85] Fix | Delete
if (!defined("BV_REQUEST_ID")) {
[86] Fix | Delete
define("BV_REQUEST_ID", uniqid(mt_rand()));
[87] Fix | Delete
}
[88] Fix | Delete
return BV_REQUEST_ID;
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
public function canSetCWBranding() {
[92] Fix | Delete
if (BVWPSiteInfo::isCWServer()) {
[93] Fix | Delete
[94] Fix | Delete
$bot_protect_accounts = BVAccount::accountsByType($this->settings, 'botprotect');
[95] Fix | Delete
if (sizeof($bot_protect_accounts) >= 1)
[96] Fix | Delete
return true;
[97] Fix | Delete
[98] Fix | Delete
$bot_protect_accounts = BVAccount::accountsByPattern($this->settings, 'email', '/@cw_user\.com$/');
[99] Fix | Delete
if (sizeof($bot_protect_accounts) >= 1)
[100] Fix | Delete
return true;
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
return false;
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
public function canWhiteLabel($slug = NULL) {
[107] Fix | Delete
if (array_key_exists("bv_override_global_whitelabel", $_REQUEST)) {
[108] Fix | Delete
return false;
[109] Fix | Delete
}
[110] Fix | Delete
if (array_key_exists("bv_override_plugin_whitelabel", $_REQUEST) && isset($slug) &&
[111] Fix | Delete
$_REQUEST["bv_override_plugin_whitelabel"] === $slug) {
[112] Fix | Delete
return false;
[113] Fix | Delete
}
[114] Fix | Delete
return true;
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
public function getPluginWhitelabelInfo($slug = null) {
[118] Fix | Delete
if ($slug === null) {
[119] Fix | Delete
$slug = $this->slug;
[120] Fix | Delete
}
[121] Fix | Delete
$whitelabel_infos = $this->getPluginsWhitelabelInfos();
[122] Fix | Delete
if (!array_key_exists($slug, $whitelabel_infos) || !is_array($whitelabel_infos[$slug])) {
[123] Fix | Delete
return array();
[124] Fix | Delete
}
[125] Fix | Delete
return $whitelabel_infos[$slug];
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
public function getBrandInfo() {
[129] Fix | Delete
return $this->settings->getOption($this->brand_option);
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
public function getPluginsWhitelabelInfos() {
[133] Fix | Delete
$whitelabel_infos = $this->settings->getOption($this->brand_option);
[134] Fix | Delete
return is_array($whitelabel_infos) ? $whitelabel_infos : array();
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
public function getPluginsWhitelabelInfoByTitle() {
[138] Fix | Delete
$whitelabel_infos = $this->getPluginsWhitelabelInfos();
[139] Fix | Delete
$whitelabel_infos_by_title = array();
[140] Fix | Delete
foreach ($whitelabel_infos as $slug => $whitelabel_info) {
[141] Fix | Delete
if (is_array($whitelabel_info) && array_key_exists('default_title', $whitelabel_info) && isset($whitelabel_info['default_title'])) {
[142] Fix | Delete
$whitelabel_info['slug'] = $slug;
[143] Fix | Delete
$whitelabel_infos_by_title[$whitelabel_info['default_title']] = $whitelabel_info;
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
return $whitelabel_infos_by_title;
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
public function getBrandName() {
[150] Fix | Delete
$brand = $this->getPluginWhitelabelInfo();
[151] Fix | Delete
if (is_array($brand) && array_key_exists('menuname', $brand)) {
[152] Fix | Delete
return $brand['menuname'];
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
return $this->brandname;
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
public function getBrandIcon() {
[159] Fix | Delete
$brand = $this->getPluginWhitelabelInfo();
[160] Fix | Delete
if (is_array($brand) && array_key_exists('brand_icon', $brand)) {
[161] Fix | Delete
return $brand['brand_icon'];
[162] Fix | Delete
}
[163] Fix | Delete
return $this->brand_icon;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
public function getWatchTime() {
[167] Fix | Delete
$time = $this->settings->getOption('bvwatchtime');
[168] Fix | Delete
return ($time ? $time : 0);
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
public function appUrl() {
[172] Fix | Delete
if (defined('BV_APP_URL')) {
[173] Fix | Delete
return BV_APP_URL;
[174] Fix | Delete
} else {
[175] Fix | Delete
$brand = $this->getPluginWhitelabelInfo();
[176] Fix | Delete
if (is_array($brand) && array_key_exists('appurl', $brand)) {
[177] Fix | Delete
return $brand['appurl'];
[178] Fix | Delete
}
[179] Fix | Delete
return $this->appurl;
[180] Fix | Delete
}
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
public function isActivePlugin() {
[184] Fix | Delete
$expiry_time = time() - (3 * 24 * 3600);
[185] Fix | Delete
return ($this->getWatchTime() > $expiry_time);
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
public function isValidEnvironment(){
[189] Fix | Delete
$bvsiteinfo = new BVWPSiteInfo();
[190] Fix | Delete
$bvconfig = $this->config;
[191] Fix | Delete
[192] Fix | Delete
if (is_multisite()) {
[193] Fix | Delete
return true;
[194] Fix | Delete
} elseif ($bvconfig && array_key_exists("siteurl_scheme", $bvconfig)) {
[195] Fix | Delete
$siteurl = $bvsiteinfo->siteurl('', $bvconfig["siteurl_scheme"]);
[196] Fix | Delete
if (array_key_exists("abspath", $bvconfig) &&
[197] Fix | Delete
array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) {
[198] Fix | Delete
return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl);
[199] Fix | Delete
}
[200] Fix | Delete
}
[201] Fix | Delete
return true;
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
public function isProtectModuleEnabled() {
[205] Fix | Delete
return $this->isServiceActive("protect") && $this->isValidEnvironment();
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
public function isDynSyncModuleEnabled() {
[209] Fix | Delete
if ($this->isServiceActive("dynsync")) {
[210] Fix | Delete
$dynconfig = $this->config['dynsync'];
[211] Fix | Delete
if (array_key_exists('dynplug', $dynconfig) && ($dynconfig['dynplug'] === $this->plugname)) {
[212] Fix | Delete
return true;
[213] Fix | Delete
}
[214] Fix | Delete
}
[215] Fix | Delete
return false;
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
public function isServiceActive($service) {
[219] Fix | Delete
$bvconfig = $this->config;
[220] Fix | Delete
if ($bvconfig && array_key_exists('services', $bvconfig)) {
[221] Fix | Delete
return in_array($service, $bvconfig['services']) && $this->isActivePlugin();
[222] Fix | Delete
}
[223] Fix | Delete
return false;
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
public function isActivateRedirectSet() {
[227] Fix | Delete
return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
public function isMalcare() {
[231] Fix | Delete
return $this->getBrandName() === 'MalCare';
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
public function isBlogvault() {
[235] Fix | Delete
return $this->getBrandName() === 'BlogVault';
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
public function info() {
[239] Fix | Delete
return array(
[240] Fix | Delete
"bvversion" => $this->version,
[241] Fix | Delete
"sha1" => "true",
[242] Fix | Delete
"plugname" => $this->plugname
[243] Fix | Delete
);
[244] Fix | Delete
}
[245] Fix | Delete
}
[246] Fix | Delete
endif;
[247] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function