PluginProbe
The WP Remote WordPress Plugin / 4.68
The WP Remote WordPress Plugin v4.68
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.68, at info.php

148 lines 3.7 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.68';
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 ($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 ($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 ($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 isProtectModuleEnabled() {
107 return $this->isServiceActive("protect");
108 }
109
110 public function isDynSyncModuleEnabled() {
111 if ($this->isServiceActive("dynsync")) {
112 $dynconfig = $this->config['dynsync'];
113 if (array_key_exists('dynplug', $dynconfig) && ($dynconfig['dynplug'] === $this->plugname)) {
114 return true;
115 }
116 }
117 return false;
118 }
119
120 public function isServiceActive($service) {
121 $bvconfig = $this->config;
122 if ($bvconfig && array_key_exists('services', $bvconfig)) {
123 return in_array($service, $bvconfig['services']) && $this->isActivePlugin();
124 }
125 return false;
126 }
127
128 public function isActivateRedirectSet() {
129 return ($this->settings->getOption($this->plug_redirect) === 'yes') ? true : false;
130 }
131
132 public function isMalcare() {
133 return $this->getBrandName() === 'MalCare - Pro';
134 }
135
136 public function isBlogvault() {
137 return $this->getBrandName() === 'BlogVault';
138 }
139
140 public function info() {
141 return array(
142 "bvversion" => $this->version,
143 "sha1" => "true",
144 "plugname" => $this->plugname
145 );
146 }
147 }
148 endif;