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

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