| @@ -8,10 +8,10 @@ | ||
| 8 | 8 | public $plugname = 'wpremote'; |
| 9 | 9 | public $brandname = 'WP Remote'; |
| 10 | 10 | public $badgeinfo = 'wprbadge'; |
| 11 | 11 | public $ip_header_option = 'wpripheader'; |
| 12 | - public $brand_option = 'bv_whitelabel_infos'; | |
| 13 | - public $version = '5.68'; | |
| 12 | + public $brand_option = 'wprbrand'; | |
| 13 | + public $version = '4.79'; | |
| 14 | 14 | public $webpage = 'https://wpremote.com'; |
| 15 | 15 | public $appurl = 'https://app.wpremote.com'; |
| 16 | 16 | public $slug = 'wpremote/plugin.php'; |
| 17 | 17 | public $plug_redirect = 'wprredirect'; |
| @@ -17,13 +17,10 @@ | ||
| 17 | 17 | public $plug_redirect = 'wprredirect'; |
| 18 | 18 | public $logo = '../img/wprlogo.png'; |
| 19 | 19 | public $brand_icon = '/img/icon.png'; |
| 20 | 20 | public $services_option_name = 'wprconfig'; |
| 21 | - public $author = 'WP Remote'; | |
| 22 | - public $title = 'WP Remote'; | |
| 23 | 21 | |
| 24 | - const DB_VERSION = '5'; | |
| 25 | - const AL_CONF_VERSION = '1.1'; | |
| 22 | + const DB_VERSION = '3'; | |
| 26 | 23 | |
| 27 | 24 | public function __construct($settings) { |
| 28 | 25 | $this->settings = $settings; |
| 29 | 26 | $this->config = $this->settings->getOption($this->services_option_name); |
| @@ -40,51 +37,8 @@ | ||
| 40 | 37 | public function hasValidDBVersion() { |
| 41 | 38 | return WPRInfo::DB_VERSION === $this->getCurrentDBVersion(); |
| 42 | 39 | } |
| 43 | 40 | |
| 44 | - public function getLatestWooCommerceDBVersion() { | |
| 45 | - if (defined('WC_ABSPATH') && file_exists(WC_ABSPATH . 'includes/class-wc-install.php')) { | |
| 46 | - include_once WC_ABSPATH . 'includes/class-wc-install.php'; | |
| 47 | - | |
| 48 | - if (class_exists('WC_Install')) { | |
| 49 | - $update_versions = array_keys(WC_Install::get_db_update_callbacks()); | |
| 50 | - | |
| 51 | - if (!empty($update_versions)) { | |
| 52 | - asort($update_versions); | |
| 53 | - return end($update_versions); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - } | |
| 57 | - | |
| 58 | - return false; | |
| 59 | - } | |
| 60 | - | |
| 61 | - public function getConnectionKey() { | |
| 62 | - require_once dirname( __FILE__ ) . '/recover.php'; | |
| 63 | - $bvsiteinfo = new WPRWPSiteInfo(); | |
| 64 | - $encoded_url = base64_encode($bvsiteinfo->siteurl()); | |
| 65 | - $secret = WPRRecover::defaultSecret($this->settings); | |
| 66 | - | |
| 67 | - return base64_encode("v1:".$secret.":".$encoded_url); | |
| 68 | - } | |
| 69 | - | |
| 70 | - public function getDefaultSecret() { | |
| 71 | - require_once dirname( __FILE__ ) . '/recover.php'; | |
| 72 | - $bvsiteinfo = new WPRWPSiteInfo(); | |
| 73 | - return WPRRecover::defaultSecret($this->settings); | |
| 74 | - } | |
| 75 | - | |
| 76 | - public function getLatestElementorDBVersion($file) { | |
| 77 | - $managerClass = $file === "elementor/elementor.php" ? '\Elementor\Core\Upgrade\Manager' : '\ElementorPro\Core\Upgrade\Manager'; | |
| 78 | - | |
| 79 | - if (!class_exists($managerClass)) { | |
| 80 | - return false; | |
| 81 | - } | |
| 82 | - | |
| 83 | - $manager = new $managerClass(); | |
| 84 | - return $manager->get_new_version(); | |
| 85 | - } | |
| 86 | - | |
| 87 | 41 | public static function getRequestID() { |
| 88 | 42 | if (!defined("BV_REQUEST_ID")) { |
| 89 | 43 | define("BV_REQUEST_ID", uniqid(mt_rand())); |
| 90 | 44 | } |
| @@ -105,53 +59,14 @@ | ||
| 105 | 59 | |
| 106 | 60 | return false; |
| 107 | 61 | } |
| 108 | 62 | |
| 109 | - public function canWhiteLabel($slug = NULL) { | |
| 110 | - if (array_key_exists("bv_override_global_whitelabel", $_REQUEST)) { | |
| 111 | - return false; | |
| 112 | - } | |
| 113 | - if (array_key_exists("bv_override_plugin_whitelabel", $_REQUEST) && isset($slug) && | |
| 114 | - $_REQUEST["bv_override_plugin_whitelabel"] === $slug) { | |
| 115 | - return false; | |
| 116 | - } | |
| 117 | - return true; | |
| 118 | - } | |
| 119 | - | |
| 120 | - public function getPluginWhitelabelInfo($slug = null) { | |
| 121 | - if ($slug === null) { | |
| 122 | - $slug = $this->slug; | |
| 123 | - } | |
| 124 | - $whitelabel_infos = $this->getPluginsWhitelabelInfos(); | |
| 125 | - if (!array_key_exists($slug, $whitelabel_infos) || !is_array($whitelabel_infos[$slug])) { | |
| 126 | - return array(); | |
| 127 | - } | |
| 128 | - return $whitelabel_infos[$slug]; | |
| 129 | - } | |
| 130 | - | |
| 131 | 63 | public function getBrandInfo() { |
| 132 | 64 | return $this->settings->getOption($this->brand_option); |
| 133 | 65 | } |
| 134 | 66 | |
| 135 | - public function getPluginsWhitelabelInfos() { | |
| 136 | - $whitelabel_infos = $this->settings->getOption($this->brand_option); | |
| 137 | - return is_array($whitelabel_infos) ? $whitelabel_infos : array(); | |
| 138 | - } | |
| 139 | - | |
| 140 | - public function getPluginsWhitelabelInfoByTitle() { | |
| 141 | - $whitelabel_infos = $this->getPluginsWhitelabelInfos(); | |
| 142 | - $whitelabel_infos_by_title = array(); | |
| 143 | - foreach ($whitelabel_infos as $slug => $whitelabel_info) { | |
| 144 | - if (is_array($whitelabel_info) && array_key_exists('default_title', $whitelabel_info) && isset($whitelabel_info['default_title'])) { | |
| 145 | - $whitelabel_info['slug'] = $slug; | |
| 146 | - $whitelabel_infos_by_title[$whitelabel_info['default_title']] = $whitelabel_info; | |
| 147 | - } | |
| 148 | - } | |
| 149 | - return $whitelabel_infos_by_title; | |
| 150 | - } | |
| 151 | - | |
| 152 | 67 | public function getBrandName() { |
| 153 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 68 | + $brand = $this->getBrandInfo(); | |
| 154 | 69 | if (is_array($brand) && array_key_exists('menuname', $brand)) { |
| 155 | 70 | return $brand['menuname']; |
| 156 | 71 | } |
| 157 | 72 | |
| @@ -158,9 +73,9 @@ | ||
| 158 | 73 | return $this->brandname; |
| 159 | 74 | } |
| 160 | 75 | |
| 161 | 76 | public function getBrandIcon() { |
| 162 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 77 | + $brand = $this->getBrandInfo(); | |
| 163 | 78 | if (is_array($brand) && array_key_exists('brand_icon', $brand)) { |
| 164 | 79 | return $brand['brand_icon']; |
| 165 | 80 | } |
| 166 | 81 | return $this->brand_icon; |
| @@ -174,9 +89,9 @@ | ||
| 174 | 89 | public function appUrl() { |
| 175 | 90 | if (defined('BV_APP_URL')) { |
| 176 | 91 | return BV_APP_URL; |
| 177 | 92 | } else { |
| 178 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 93 | + $brand = $this->getBrandInfo(); | |
| 179 | 94 | if (is_array($brand) && array_key_exists('appurl', $brand)) { |
| 180 | 95 | return $brand['appurl']; |
| 181 | 96 | } |
| 182 | 97 | return $this->appurl; |
| @@ -189,18 +104,13 @@ | ||
| 189 | 104 | } |
| 190 | 105 | |
| 191 | 106 | public function isValidEnvironment(){ |
| 192 | 107 | $bvsiteinfo = new WPRWPSiteInfo(); |
| 108 | + $siteurl = $bvsiteinfo->siteurl(); | |
| 193 | 109 | $bvconfig = $this->config; |
| 194 | - | |
| 195 | - if (is_multisite()) { | |
| 196 | - return true; | |
| 197 | - } elseif ($bvconfig && array_key_exists("siteurl_scheme", $bvconfig)) { | |
| 198 | - $siteurl = $bvsiteinfo->siteurl('', $bvconfig["siteurl_scheme"]); | |
| 199 | - if (array_key_exists("abspath", $bvconfig) && | |
| 200 | - array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) { | |
| 201 | - return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl); | |
| 202 | - } | |
| 110 | + if ($bvconfig && array_key_exists("abspath", $bvconfig) && | |
| 111 | + array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) { | |
| 112 | + return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl); | |
| 203 | 113 | } |
| 204 | 114 | return true; |
| 205 | 115 | } |
| 206 | 116 | |