PluginProbe
The WP Remote WordPress Plugin / 4.84
The WP Remote WordPress Plugin v4.84
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
wpremote / info.php

info.php in The WP Remote WordPress Plugin 4.84, at info.php

164 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) exit;
4 if (!class_exists('WPRInfo')) :
5 class WPRInfo {
6 public $settings;
7 public $config;
8 public $plugname = 'wpremote';
9 public $brandname = 'WP Remote';
10 public $badgeinfo = 'wprbadge';
11 public $ip_header_option = 'wpripheader';
12 public $brand_option = 'wprbrand';
13 public $version = '4.84';
14 public $webpage = 'https://wpremote.com';
15 public $appurl = 'https://app.wpremote.com';
16 public $slug = 'wpremote/plugin.php';
17 public $plug_redirect = 'wprredirect';
18 public $logo = '../img/wprlogo.png';
19 public $brand_icon = '/img/icon.png';
20 public $services_option_name = 'wprconfig';
21
22 const DB_VERSION = '3';
23
24 public function __construct($settings) {
25 $this->settings = $settings;
26 $this->config = $this->settings->getOption($this->services_option_name);
27 }
28
29 public function getCurrentDBVersion() {
30 $bvconfig = $this->config;
31 if ($bvconfig && array_key_exists('db_version', $bvconfig)) {
32 return $bvconfig['db_version'];
33 }
34 return false;
35 }
36
37 public function hasValidDBVersion() {
38 return WPRInfo::DB_VERSION === $this->getCurrentDBVersion();
39 }
40
41 public static function getRequestID() {
42 if (!defined("BV_REQUEST_ID")) {
43 define("BV_REQUEST_ID", uniqid(mt_rand()));
44 }
45 return BV_REQUEST_ID;
46 }
47
48 public function canSetCWBranding() {
49 if (WPRWPSiteInfo::isCWServer()) {
50
51 $bot_protect_accounts = WPRAccount::accountsByType($this->settings, 'botprotect');
52 if (sizeof($bot_protect_accounts) >= 1)
53 return true;
54
55 $bot_protect_accounts = WPRAccount::accountsByPattern($this->settings, 'email', '/@cw_user\.com$/');
56 if (sizeof($bot_protect_accounts) >= 1)
57 return true;
58 }
59
60 return false;
61 }
62
63 public function getBrandInfo() {
64 return $this->settings->getOption($this->brand_option);
65 }
66
67 public function getBrandName() {
68 $brand = $this->getBrandInfo();
69 if (is_array($brand) && array_key_exists('menuname', $brand)) {
70 return $brand['menuname'];
71 }
72
73 return $this->brandname;
74 }
75
76 public function getBrandIcon() {
77 $brand = $this->getBrandInfo();
78 if (is_array($brand) && array_key_exists('brand_icon', $brand)) {
79 return $brand['brand_icon'];
80 }
81 return $this->brand_icon;
82 }
83
84 public function getWatchTime() {
85 $time = $this->settings->getOption('bvwatchtime');
86 return ($time ? $time : 0);
87 }
88
89 public function appUrl() {
90 if (defined('BV_APP_URL')) {
91 return BV_APP_URL;
92 } else {
93 $brand = $this->getBrandInfo();
94 if (is_array($brand) && array_key_exists('appurl', $brand)) {
95 return $brand['appurl'];
96 }
97 return $this->appurl;
98 }
99 }
100
101 public function isActivePlugin() {
102 $expiry_time = time() - (3 * 24 * 3600);
103 return ($this->getWatchTime() > $expiry_time);
104 }
105
106 public function isValidEnvironment(){
107 $bvsiteinfo = new WPRWPSiteInfo();
108 $bvconfig = $this->config;
109
110 if (is_multisite()) {
111 return true;
112 } elseif ($bvconfig && array_key_exists("siteurl_scheme", $bvconfig)) {
113 $siteurl = $bvsiteinfo->siteurl('', $bvconfig["siteurl_scheme"]);
114 if (array_key_exists("abspath", $bvconfig) &&
115 array_key_exists("siteurl", $bvconfig) && !empty($siteurl)) {
116 return ($bvconfig["abspath"] == ABSPATH && $bvconfig["siteurl"] == $siteurl);
117 }
118 }
119 return true;
120 }
121
122 public function isProtectModuleEnabled() {
123 return $this->isServiceActive("protect") && $this->isValidEnvironment();
124 }
125
126 public function isDynSyncModuleEnabled() {
127 if ($this->isServiceActive("dynsync")) {
128 $dynconfig = $this->config['dynsync'];
129 if (array_key_exists('dynplug', $dynconfig) && ($dynconfig['dynplug'] === $this->plugname)) {
130 return true;
131 }
132 }
133 return false;
134 }
135
136 public function isServiceActive($service) {
137 $bvconfig = $this->config;
138 if ($bvconfig && array_key_exists('services', $bvconfig)) {
139 return in_array($service, $bvconfig['services']) && $this->isActivePlugin();
140 }
141 return false;
142 }
143
144 public function isActivateRedirectSet() {
145 return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
146 }
147
148 public function isMalcare() {
149 return $this->getBrandName() === 'MalCare';
150 }
151
152 public function isBlogvault() {
153 return $this->getBrandName() === 'BlogVault';
154 }
155
156 public function info() {
157 return array(
158 "bvversion" => $this->version,
159 "sha1" => "true",
160 "plugname" => $this->plugname
161 );
162 }
163 }
164 endif;