| @@ -9,9 +9,10 @@ | ||
| 9 | 9 | public $brandname = 'WP Remote'; |
| 10 | 10 | public $badgeinfo = 'wprbadge'; |
| 11 | 11 | public $ip_header_option = 'wpripheader'; |
| 12 | 12 | public $brand_option = 'bv_whitelabel_infos'; |
| 13 | - public $version = '5.73'; | |
| 13 | + public $wp_lp_whitelabel_option = 'wprLpWhitelabelConf'; | |
| 14 | + public $version = '6.36'; | |
| 14 | 15 | public $webpage = 'https://wpremote.com'; |
| 15 | 16 | public $appurl = 'https://app.wpremote.com'; |
| 16 | 17 | public $slug = 'wpremote/plugin.php'; |
| 17 | 18 | public $plug_redirect = 'wprredirect'; |
| @@ -63,9 +64,9 @@ | ||
| 63 | 64 | $bvsiteinfo = new WPRWPSiteInfo(); |
| 64 | 65 | $encoded_url = base64_encode($bvsiteinfo->siteurl()); |
| 65 | 66 | $secret = WPRRecover::defaultSecret($this->settings); |
| 66 | 67 | |
| 67 | - return base64_encode("v1:".$secret.":".$encoded_url); | |
| 68 | + return base64_encode("v2:".$secret.":".$encoded_url.":".$this->plugname); | |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | public function getDefaultSecret() { |
| 71 | 72 | require_once dirname( __FILE__ ) . '/recover.php'; |
| @@ -85,29 +86,15 @@ | ||
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | public static function getRequestID() { |
| 88 | 89 | if (!defined("BV_REQUEST_ID")) { |
| 89 | - define("BV_REQUEST_ID", uniqid(mt_rand())); | |
| 90 | + define("BV_REQUEST_ID", uniqid(mt_rand())); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_mt_rand | |
| 90 | 91 | } |
| 91 | 92 | return BV_REQUEST_ID; |
| 92 | 93 | } |
| 93 | 94 | |
| 94 | - public function canSetCWBranding() { | |
| 95 | - if (WPRWPSiteInfo::isCWServer()) { | |
| 96 | - | |
| 97 | - $bot_protect_accounts = WPRAccount::accountsByType($this->settings, 'botprotect'); | |
| 98 | - if (sizeof($bot_protect_accounts) >= 1) | |
| 99 | - return true; | |
| 100 | - | |
| 101 | - $bot_protect_accounts = WPRAccount::accountsByPattern($this->settings, 'email', '/@cw_user\.com$/'); | |
| 102 | - if (sizeof($bot_protect_accounts) >= 1) | |
| 103 | - return true; | |
| 104 | - } | |
| 105 | - | |
| 106 | - return false; | |
| 107 | - } | |
| 108 | - | |
| 109 | 95 | public function canWhiteLabel($slug = NULL) { |
| 96 | + // phpcs:disable WordPress.Security.NonceVerification.Recommended | |
| 110 | 97 | if (array_key_exists("bv_override_global_whitelabel", $_REQUEST)) { |
| 111 | 98 | return false; |
| 112 | 99 | } |
| 113 | 100 | if (array_key_exists("bv_override_plugin_whitelabel", $_REQUEST) && isset($slug) && |
| @@ -113,8 +100,9 @@ | ||
| 113 | 100 | if (array_key_exists("bv_override_plugin_whitelabel", $_REQUEST) && isset($slug) && |
| 114 | 101 | $_REQUEST["bv_override_plugin_whitelabel"] === $slug) { |
| 115 | 102 | return false; |
| 116 | 103 | } |
| 104 | + // phpcs:enable WordPress.Security.NonceVerification.Recommended | |
| 117 | 105 | return true; |
| 118 | 106 | } |
| 119 | 107 | |
| 120 | 108 | public function getPluginWhitelabelInfo($slug = null) { |
| @@ -136,8 +124,13 @@ | ||
| 136 | 124 | $whitelabel_infos = $this->settings->getOption($this->brand_option); |
| 137 | 125 | return is_array($whitelabel_infos) ? $whitelabel_infos : array(); |
| 138 | 126 | } |
| 139 | 127 | |
| 128 | + public function getLPWhitelabelInfo() { | |
| 129 | + $infos = $this->settings->getOption($this->wp_lp_whitelabel_option); | |
| 130 | + return is_array($infos) ? $infos : array(); | |
| 131 | + } | |
| 132 | + | |
| 140 | 133 | public function getPluginsWhitelabelInfoByTitle() { |
| 141 | 134 | $whitelabel_infos = $this->getPluginsWhitelabelInfos(); |
| 142 | 135 | $whitelabel_infos_by_title = array(); |
| 143 | 136 | foreach ($whitelabel_infos as $slug => $whitelabel_info) { |
| @@ -153,9 +146,8 @@ | ||
| 153 | 146 | $brand = $this->getPluginWhitelabelInfo(); |
| 154 | 147 | if (is_array($brand) && array_key_exists('menuname', $brand)) { |
| 155 | 148 | return $brand['menuname']; |
| 156 | 149 | } |
| 157 | - | |
| 158 | 150 | return $this->brandname; |
| 159 | 151 | } |
| 160 | 152 | |
| 161 | 153 | public function getBrandIcon() { |