| @@ -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.45'; | |
| 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,12 +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 = '4'; | |
| 22 | + const DB_VERSION = '3'; | |
| 25 | 23 | |
| 26 | 24 | public function __construct($settings) { |
| 27 | 25 | $this->settings = $settings; |
| 28 | 26 | $this->config = $this->settings->getOption($this->services_option_name); |
| @@ -39,43 +37,8 @@ | ||
| 39 | 37 | public function hasValidDBVersion() { |
| 40 | 38 | return WPRInfo::DB_VERSION === $this->getCurrentDBVersion(); |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | - public function getLatestWooCommerceDBVersion() { | |
| 44 | - if (defined('WC_ABSPATH') && file_exists(WC_ABSPATH . 'includes/class-wc-install.php')) { | |
| 45 | - include_once WC_ABSPATH . 'includes/class-wc-install.php'; | |
| 46 | - | |
| 47 | - if (class_exists('WC_Install')) { | |
| 48 | - $update_versions = array_keys(WC_Install::get_db_update_callbacks()); | |
| 49 | - | |
| 50 | - if (!empty($update_versions)) { | |
| 51 | - asort($update_versions); | |
| 52 | - return end($update_versions); | |
| 53 | - } | |
| 54 | - } | |
| 55 | - } | |
| 56 | - | |
| 57 | - return false; | |
| 58 | - } | |
| 59 | - | |
| 60 | - public function getLatestElementorDBVersion($file) { | |
| 61 | - if (defined('ELEMENTOR_PATH') && file_exists(ELEMENTOR_PATH . 'core/upgrade/manager.php')) { | |
| 62 | - include_once ELEMENTOR_PATH . 'core/upgrade/manager.php'; | |
| 63 | - | |
| 64 | - if ($file === 'elementor-pro/elementor-pro.php') { | |
| 65 | - $managerClass = '\ElementorPro\Core\Upgrade\Manager'; | |
| 66 | - } else { | |
| 67 | - $managerClass = '\Elementor\Core\Upgrade\Manager'; | |
| 68 | - } | |
| 69 | - | |
| 70 | - $manager = new $managerClass(); | |
| 71 | - | |
| 72 | - return $manager->get_new_version(); | |
| 73 | - } | |
| 74 | - | |
| 75 | - return false; | |
| 76 | - } | |
| 77 | - | |
| 78 | 41 | public static function getRequestID() { |
| 79 | 42 | if (!defined("BV_REQUEST_ID")) { |
| 80 | 43 | define("BV_REQUEST_ID", uniqid(mt_rand())); |
| 81 | 44 | } |
| @@ -96,53 +59,14 @@ | ||
| 96 | 59 | |
| 97 | 60 | return false; |
| 98 | 61 | } |
| 99 | 62 | |
| 100 | - public function canWhiteLabel($slug = NULL) { | |
| 101 | - if (array_key_exists("bv_override_global_whitelabel", $_REQUEST)) { | |
| 102 | - return false; | |
| 103 | - } | |
| 104 | - if (array_key_exists("bv_override_plugin_whitelabel", $_REQUEST) && isset($slug) && | |
| 105 | - $_REQUEST["bv_override_plugin_whitelabel"] === $slug) { | |
| 106 | - return false; | |
| 107 | - } | |
| 108 | - return true; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public function getPluginWhitelabelInfo($slug = null) { | |
| 112 | - if ($slug === null) { | |
| 113 | - $slug = $this->slug; | |
| 114 | - } | |
| 115 | - $whitelabel_infos = $this->getPluginsWhitelabelInfos(); | |
| 116 | - if (!array_key_exists($slug, $whitelabel_infos) || !is_array($whitelabel_infos[$slug])) { | |
| 117 | - return array(); | |
| 118 | - } | |
| 119 | - return $whitelabel_infos[$slug]; | |
| 120 | - } | |
| 121 | - | |
| 122 | 63 | public function getBrandInfo() { |
| 123 | 64 | return $this->settings->getOption($this->brand_option); |
| 124 | 65 | } |
| 125 | 66 | |
| 126 | - public function getPluginsWhitelabelInfos() { | |
| 127 | - $whitelabel_infos = $this->settings->getOption($this->brand_option); | |
| 128 | - return is_array($whitelabel_infos) ? $whitelabel_infos : array(); | |
| 129 | - } | |
| 130 | - | |
| 131 | - public function getPluginsWhitelabelInfoByTitle() { | |
| 132 | - $whitelabel_infos = $this->getPluginsWhitelabelInfos(); | |
| 133 | - $whitelabel_infos_by_title = array(); | |
| 134 | - foreach ($whitelabel_infos as $slug => $whitelabel_info) { | |
| 135 | - if (is_array($whitelabel_info) && array_key_exists('default_title', $whitelabel_info) && isset($whitelabel_info['default_title'])) { | |
| 136 | - $whitelabel_info['slug'] = $slug; | |
| 137 | - $whitelabel_infos_by_title[$whitelabel_info['default_title']] = $whitelabel_info; | |
| 138 | - } | |
| 139 | - } | |
| 140 | - return $whitelabel_infos_by_title; | |
| 141 | - } | |
| 142 | - | |
| 143 | 67 | public function getBrandName() { |
| 144 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 68 | + $brand = $this->getBrandInfo(); | |
| 145 | 69 | if (is_array($brand) && array_key_exists('menuname', $brand)) { |
| 146 | 70 | return $brand['menuname']; |
| 147 | 71 | } |
| 148 | 72 | |
| @@ -149,9 +73,9 @@ | ||
| 149 | 73 | return $this->brandname; |
| 150 | 74 | } |
| 151 | 75 | |
| 152 | 76 | public function getBrandIcon() { |
| 153 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 77 | + $brand = $this->getBrandInfo(); | |
| 154 | 78 | if (is_array($brand) && array_key_exists('brand_icon', $brand)) { |
| 155 | 79 | return $brand['brand_icon']; |
| 156 | 80 | } |
| 157 | 81 | return $this->brand_icon; |
| @@ -165,9 +89,9 @@ | ||
| 165 | 89 | public function appUrl() { |
| 166 | 90 | if (defined('BV_APP_URL')) { |
| 167 | 91 | return BV_APP_URL; |
| 168 | 92 | } else { |
| 169 | - $brand = $this->getPluginWhitelabelInfo(); | |
| 93 | + $brand = $this->getBrandInfo(); | |
| 170 | 94 | if (is_array($brand) && array_key_exists('appurl', $brand)) { |
| 171 | 95 | return $brand['appurl']; |
| 172 | 96 | } |
| 173 | 97 | return $this->appurl; |
| @@ -180,18 +104,13 @@ | ||
| 180 | 104 | } |
| 181 | 105 | |
| 182 | 106 | public function isValidEnvironment(){ |
| 183 | 107 | $bvsiteinfo = new WPRWPSiteInfo(); |
| 108 | + $siteurl = $bvsiteinfo->siteurl(); | |
| 184 | 109 | $bvconfig = $this->config; |
| 185 | - | |
| 186 | - if (is_multisite()) { | |
| 187 | - return true; | |
| 188 | - } elseif ($bvconfig && array_key_exists("siteurl_scheme", $bvconfig)) { | |
| 189 | - $siteurl = $bvsiteinfo->siteurl('', $bvconfig["siteurl_scheme"]); | |
| 190 | - if (array_key_exists("abspath", $bvconfig) && | |
| 191 | - array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) { | |
| 192 | - return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl); | |
| 193 | - } | |
| 110 | + if ($bvconfig && array_key_exists("abspath", $bvconfig) && | |
| 111 | + array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) { | |
| 112 | + return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl); | |
| 194 | 113 | } |
| 195 | 114 | return true; |
| 196 | 115 | } |
| 197 | 116 | |