The WP Remote WordPress Plugin - Version 4.74

Version Description

  • Enhanced handling of plugin services
  • Removed deprecated hook
Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 The WP Remote WordPress Plugin
Version 4.74
Comparing to
See all releases

Code changes from version 4.73 to 4.74

callback/base.php CHANGED
@@ -10,11 +10,11 @@ class BVCallbackBase {
10
  "DYNSYNC_WING_VERSION" => '1.0',
11
  "UPGRADER_WING_VERSION" => '1.0',
12
  "BRAND_WING_VERSION" => '1.0',
13
- "DB_WING_VERSION" => '1.0',
14
  "ACCOUNT_WING_VERSION" => '1.1',
15
- "MISC_WING_VERSION" => '1.1',
16
- "FS_WING_VERSION" => '1.0',
17
- "INFO_WING_VERSION" => '1.3',
18
  "WATCH_WING_VERSION" => '1.0',
19
  "FS_WRITE_WING_VERSION" => '1.0',
20
  "IPSTORE_WING_VERSION" => '1.0',
10
  "DYNSYNC_WING_VERSION" => '1.0',
11
  "UPGRADER_WING_VERSION" => '1.0',
12
  "BRAND_WING_VERSION" => '1.0',
13
+ "DB_WING_VERSION" => '1.1',
14
  "ACCOUNT_WING_VERSION" => '1.1',
15
+ "MISC_WING_VERSION" => '1.2',
16
+ "FS_WING_VERSION" => '1.1',
17
+ "INFO_WING_VERSION" => '1.4',
18
  "WATCH_WING_VERSION" => '1.0',
19
  "FS_WRITE_WING_VERSION" => '1.0',
20
  "IPSTORE_WING_VERSION" => '1.0',
callback/wings/db.php CHANGED
@@ -11,7 +11,7 @@ class BVDBCallback extends BVCallbackBase {
11
 
12
  public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
13
 
14
- const DB_WING_VERSION = 1.0;
15
 
16
  public function __construct($callback_handler) {
17
  $this->db = $callback_handler->db;
@@ -284,6 +284,22 @@ class BVDBCallback extends BVCallbackBase {
284
  break;
285
  case "altrtbl":
286
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  break;
288
  default:
289
  $resp = false;
11
 
12
  public static $bvTables = array("fw_requests", "lp_requests", "ip_store");
13
 
14
+ const DB_WING_VERSION = 1.1;
15
 
16
  public function __construct($callback_handler) {
17
  $this->db = $callback_handler->db;
284
  break;
285
  case "altrtbl":
286
  $resp = array("altrtbl" => $db->alterBVTable($params['query'], $params['query']));
287
+ break;
288
+ case "tbls":
289
+ $resp = array();
290
+
291
+ if (array_key_exists('truncate', $params))
292
+ $resp['truncate'] = $db->truncateTables($params['truncate']);
293
+
294
+ if (array_key_exists('drop', $params))
295
+ $resp['drop'] = $db->dropTables($params['drop']);
296
+
297
+ if (array_key_exists('create', $params))
298
+ $resp['create'] = $db->createTables($params['create']);
299
+
300
+ if (array_key_exists('alter', $params))
301
+ $resp['alter'] = $db->alterTables($params['alter']);
302
+
303
  break;
304
  default:
305
  $resp = false;
callback/wings/fs.php CHANGED
@@ -9,7 +9,7 @@ class BVFSCallback extends BVCallbackBase {
9
  public $account;
10
 
11
  public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
12
- const FS_WING_VERSION = 1.0;
13
 
14
  public function __construct($callback_handler) {
15
  $this->account = $callback_handler->account;
@@ -200,7 +200,7 @@ class BVFSCallback extends BVCallbackBase {
200
  if ($md5 === true && !is_dir($absfile)) {
201
  $fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
202
  }
203
- $result["stats"][] = $fdata;
204
  }
205
  return $result;
206
  }
@@ -288,15 +288,11 @@ class BVFSCallback extends BVCallbackBase {
288
  $resp = array("status" => "done", "links" => $links);
289
  break;
290
  case "getfilesstats":
291
- $files = $params['files'];
292
- $offset = intval(urldecode($params['offset']));
293
- $limit = intval(urldecode($params['limit']));
294
- $bsize = intval(urldecode($params['bsize']));
295
- $md5 = false;
296
- if (array_key_exists('md5', $params)) {
297
- $md5 = true;
298
- }
299
- $resp = $this->getFilesStats($files, $offset, $limit, $bsize, $md5);
300
  break;
301
  case "sendmanyfiles":
302
  $files = $params['files'];
@@ -335,7 +331,7 @@ class BVFSCallback extends BVCallbackBase {
335
  foreach($regexes as $regex) {
336
  $directoryList = array_merge($directoryList, glob($options['dir'].$regex, $glob_option));
337
  }
338
- $resp[$options['dir']] = $this->getFilesStats($directoryList, 0, 0, 0, $md5);
339
  }
340
  break;
341
  case "dirsexists":
@@ -357,6 +353,30 @@ class BVFSCallback extends BVCallbackBase {
357
  $files = $params['files'];
358
  $withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
359
  $resp = array("files_content" => $this->getFilesContent($files, $withContent));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  break;
361
  default:
362
  $resp = false;
9
  public $account;
10
 
11
  public static $cwAllowedFiles = array(".htaccess", ".user.ini", "malcare-waf.php");
12
+ const FS_WING_VERSION = 1.1;
13
 
14
  public function __construct($callback_handler) {
15
  $this->account = $callback_handler->account;
200
  if ($md5 === true && !is_dir($absfile)) {
201
  $fdata["md5"] = $this->calculateMd5($absfile, $fdata, $offset, $limit, $bsize);
202
  }
203
+ $result[] = $fdata;
204
  }
205
  return $result;
206
  }
288
  $resp = array("status" => "done", "links" => $links);
289
  break;
290
  case "getfilesstats":
291
+ $md5 = array_key_exists('md5', $params) ? $params['md5'] : false;
292
+ $stats = $this->getFilesStats(
293
+ $params['files'], $params['offset'], $params['limit'], $params['bsize'], $md5
294
+ );
295
+ $resp = array('stats' => $stats);
 
 
 
 
296
  break;
297
  case "sendmanyfiles":
298
  $files = $params['files'];
331
  foreach($regexes as $regex) {
332
  $directoryList = array_merge($directoryList, glob($options['dir'].$regex, $glob_option));
333
  }
334
+ $resp[$options['dir']] = array('stats' => $this->getFilesStats($directoryList, 0, 0, 0, $md5));
335
  }
336
  break;
337
  case "dirsexists":
353
  $files = $params['files'];
354
  $withContent = array_key_exists('withcontent', $params) ? $params['withcontent'] : true;
355
  $resp = array("files_content" => $this->getFilesContent($files, $withContent));
356
+ break;
357
+ case "gtfls":
358
+ $resp = array();
359
+
360
+ if (array_key_exists('get_files_content', $params)) {
361
+ $args = $params['get_files_content'];
362
+ $with_content = array_key_exists('withcontent', $args) ? $args['withcontent'] : true;
363
+ $resp['get_files_content'] = $this->getFilesContent($args['files'], $with_content);
364
+ }
365
+
366
+ if (array_key_exists('get_files_stats', $params)) {
367
+ $args = $params['get_files_stats'];
368
+ $md5 = array_key_exists('md5', $args) ? $args['md5'] : false;
369
+ $stats = $this->getFilesStats(
370
+ $args['files'], $args['offset'], $args['limit'], $args['bsize'], $md5
371
+ );
372
+
373
+ $result = array();
374
+ foreach ($stats as $stat) {
375
+ $result[$stat['filename']] = $stat;
376
+ }
377
+ $resp['get_files_stats'] = $result;
378
+ }
379
+
380
  break;
381
  default:
382
  $resp = false;
callback/wings/info.php CHANGED
@@ -10,7 +10,7 @@ class BVInfoCallback extends BVCallbackBase {
10
  public $bvinfo;
11
  public $bvapi;
12
 
13
- const INFO_WING_VERSION = 1.3;
14
 
15
  public function __construct($callback_handler) {
16
  $this->db = $callback_handler->db;
@@ -260,6 +260,18 @@ class BVInfoCallback extends BVCallbackBase {
260
  return $host_info;
261
  }
262
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  function refreshUpdatesInfo() {
264
  global $wp_current_filter;
265
  $wp_current_filter[] = 'load-update-core.php';
@@ -399,6 +411,21 @@ class BVInfoCallback extends BVCallbackBase {
399
  return $result;
400
  }
401
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  public function process($request) {
403
  $db = $this->db;
404
  $params = $request->params;
@@ -468,6 +495,9 @@ class BVInfoCallback extends BVCallbackBase {
468
  case "gtsteinfo":
469
  $resp = $this->getSiteInfo($params);
470
  break;
 
 
 
471
  default:
472
  $resp = false;
473
  }
10
  public $bvinfo;
11
  public $bvapi;
12
 
13
+ const INFO_WING_VERSION = 1.4;
14
 
15
  public function __construct($callback_handler) {
16
  $this->db = $callback_handler->db;
260
  return $host_info;
261
  }
262
 
263
+ public function serverConfig() {
264
+ return array(
265
+ 'software' => $_SERVER['SERVER_SOFTWARE'],
266
+ 'sapi' => (function_exists('php_sapi_name')) ? php_sapi_name() : false,
267
+ 'has_apache_get_modules' => function_exists('apache_get_modules'),
268
+ 'posix_getuid' => (function_exists('posix_getuid')) ? posix_getuid() : null,
269
+ 'uid' => (function_exists('getmyuid')) ? getmyuid() : null,
270
+ 'user_ini' => ini_get('user_ini.filename'),
271
+ 'php_major_version' => PHP_MAJOR_VERSION
272
+ );
273
+ }
274
+
275
  function refreshUpdatesInfo() {
276
  global $wp_current_filter;
277
  $wp_current_filter[] = 'load-update-core.php';
411
  return $result;
412
  }
413
 
414
+ function getPluginServicesInfo($args) {
415
+ $result = array();
416
+
417
+ if (array_key_exists('get_options', $args))
418
+ $result['get_options'] = $this->settings->getOptions($args['get_options']);
419
+
420
+ if (array_key_exists('pingbv', $args))
421
+ $result['pingbv'] = array('status' => $this->pingBV());
422
+
423
+ if (array_key_exists('server_config', $args))
424
+ $result['server_config'] = $this->serverConfig();
425
+
426
+ return $result;
427
+ }
428
+
429
  public function process($request) {
430
  $db = $this->db;
431
  $params = $request->params;
495
  case "gtsteinfo":
496
  $resp = $this->getSiteInfo($params);
497
  break;
498
+ case "psinfo":
499
+ $resp = $this->getPluginServicesInfo($params);
500
+ break;
501
  default:
502
  $resp = false;
503
  }
callback/wings/misc.php CHANGED
@@ -11,7 +11,7 @@ class BVMiscCallback extends BVCallbackBase {
11
  public $bvapi;
12
  public $db;
13
 
14
- const MISC_WING_VERSION = 1.1;
15
 
16
  public function __construct($callback_handler) {
17
  $this->settings = $callback_handler->settings;
@@ -154,6 +154,19 @@ class BVMiscCallback extends BVCallbackBase {
154
  break;
155
  case "dlttrsnt":
156
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  break;
158
  case "setbvss":
159
  $resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
11
  public $bvapi;
12
  public $db;
13
 
14
+ const MISC_WING_VERSION = 1.2;
15
 
16
  public function __construct($callback_handler) {
17
  $this->settings = $callback_handler->settings;
154
  break;
155
  case "dlttrsnt":
156
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
157
+ break;
158
+ case "optns":
159
+ $resp = array();
160
+
161
+ if (array_key_exists("get_options", $params))
162
+ $resp["get_options"] = $settings->getOptions($params["get_options"]);
163
+
164
+ if (array_key_exists("update_options", $params))
165
+ $resp["update_options"] = $settings->updateOptions($params["update_options"]);
166
+
167
+ if (array_key_exists("delete_options", $params))
168
+ $resp["delete_options"] = $settings->deleteOptions($params["delete_options"]);
169
+
170
  break;
171
  case "setbvss":
172
  $resp = array("status" => $settings->updateOption('bv_site_settings', $params['bv_site_settings']));
info.php CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('WPRInfo')) :
10
  public $badgeinfo = 'wprbadge';
11
  public $ip_header_option = 'wpripheader';
12
  public $brand_option = 'wprbrand';
13
- public $version = '4.73';
14
  public $webpage = 'https://wpremote.com';
15
  public $appurl = 'https://app.wpremote.com';
16
  public $slug = 'wpremote/plugin.php';
10
  public $badgeinfo = 'wprbadge';
11
  public $ip_header_option = 'wpripheader';
12
  public $brand_option = 'wprbrand';
13
+ public $version = '4.74';
14
  public $webpage = 'https://wpremote.com';
15
  public $appurl = 'https://app.wpremote.com';
16
  public $slug = 'wpremote/plugin.php';
plugin.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpremote.com
5
  Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>.
6
  Author: WP Remote
7
  Author URI: https://wpremote.com
8
- Version: 4.73
9
  Network: True
10
  */
11
 
5
  Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>.
6
  Author: WP Remote
7
  Author URI: https://wpremote.com
8
+ Version: 4.74
9
  Network: True
10
  */
11
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://app.wpremote.com/home/signup
6
  Requires at least: 4.0
7
  Tested up to: 5.9
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.73
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
@@ -32,6 +32,10 @@ You can email us at support@wpremote.com for support.
32
  3. Sign up for an account at wpremote.com and add your site.
33
 
34
  == CHANGELOG ==
 
 
 
 
35
  = 4.73 =
36
  * Improvements in identifying plugin updates.
37
 
6
  Requires at least: 4.0
7
  Tested up to: 5.9
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.74
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
32
  3. Sign up for an account at wpremote.com and add your site.
33
 
34
  == CHANGELOG ==
35
+ = 4.74 =
36
+ * Enhanced handling of plugin services
37
+ * Removed deprecated hook
38
+
39
  = 4.73 =
40
  * Improvements in identifying plugin updates.
41
 
wp_db.php CHANGED
@@ -92,6 +92,14 @@ class WPRWPDb {
92
  return $this->isTablePresent($table);
93
  }
94
 
 
 
 
 
 
 
 
 
95
  public function alterBVTable($query, $name) {
96
  $resp = false;
97
  $table = $this->getBVTable($name);
@@ -101,6 +109,14 @@ class WPRWPDb {
101
  return $resp;
102
  }
103
 
 
 
 
 
 
 
 
 
104
  public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
105
  $query = "SELECT $fields from $table $filter";
106
  if ($limit > 0)
@@ -154,6 +170,22 @@ class WPRWPDb {
154
  return !$this->isTablePresent($table);
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  public function deleteRowsFromtable($name, $count = 1) {
158
  $table = $this->getBVTable($name);
159
  if ($this->isTablePresent($table)) {
92
  return $this->isTablePresent($table);
93
  }
94
 
95
+ public function createTables($tables, $usedbdelta = false) {
96
+ $result = array();
97
+ foreach ($tables as $table => $query) {
98
+ $result[$table] = $this->createTable($query, $table, $usedbdelta);
99
+ }
100
+ return $result;
101
+ }
102
+
103
  public function alterBVTable($query, $name) {
104
  $resp = false;
105
  $table = $this->getBVTable($name);
109
  return $resp;
110
  }
111
 
112
+ public function alterTables($tables) {
113
+ $result = array();
114
+ foreach ($tables as $table => $query) {
115
+ $result[$table] = $this->alterBVTable($query, $table);
116
+ }
117
+ return $result;
118
+ }
119
+
120
  public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) {
121
  $query = "SELECT $fields from $table $filter";
122
  if ($limit > 0)
170
  return !$this->isTablePresent($table);
171
  }
172
 
173
+ public function dropTables($tables) {
174
+ $result = array();
175
+ foreach ($tables as $table) {
176
+ $result[$table] = $this->dropBVTable($table);
177
+ }
178
+ return $result;
179
+ }
180
+
181
+ public function truncateTables($tables) {
182
+ $result = array();
183
+ foreach ($tables as $table) {
184
+ $result[$table] = $this->truncateBVTable($table);
185
+ }
186
+ return $result;
187
+ }
188
+
189
  public function deleteRowsFromtable($name, $count = 1) {
190
  $table = $this->getBVTable($name);
191
  if ($this->isTablePresent($table)) {
wp_dynsync.php CHANGED
@@ -294,11 +294,6 @@ class BVWPDynSync {
294
  $this->add_db_event('woocommerce_order_items', array('order_item_id' => $item_id, 'msg_type' => 'delete'));
295
  }
296
 
297
- function woocommerce_downloadable_product_permissions_delete_handler($bool, $download_id, $product_id, $order) {
298
- $this->add_db_event('woocommerce_downloadable_product_permissions', array('order_id' => $order->id, 'product_id' => $product_id, 'download_id' => $download_id));
299
- return true;
300
- }
301
-
302
  function woocommerce_attribute_added_handler($attribute_id, $attribute) {
303
  $this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $attribute_id));
304
  }
@@ -641,7 +636,6 @@ class BVWPDynSync {
641
  add_action('woocommerce_grant_product_download_access', array($this, 'woocommerce_grant_product_download_access_handler'), 10, 1);
642
  add_action('woocommerce_ajax_revoke_access_to_product_download', array($this, 'woocommerce_revoke_access_to_product_download_handler'), 10, 4);
643
  add_action('woocommerce_deleted_order_downloadable_permissions', array($this, 'woocommerce_deleted_order_downloadable_permissions_handler'), 10, 1);
644
- add_filter('woocommerce_process_product_file_download_paths_remove_access_to_old_file', array($this, 'woocommerce_downloadable_product_permissions_delete_handler', 10, 4));
645
 
646
  add_action('woocommerce_new_payment_token', array($this, 'woocommerce_payment_token_handler'), 10, 1);
647
  add_action('woocommerce_payment_token_created', array($this, 'woocommerce_payment_token_handler'), 10, 1);
@@ -696,4 +690,4 @@ class BVWPDynSync {
696
  add_action('woocommerce_grant_product_download_permissions', array($this, 'woocommerce_grant_product_download_permissions_handler'), 10, 1);
697
  }
698
  }
699
- endif;
294
  $this->add_db_event('woocommerce_order_items', array('order_item_id' => $item_id, 'msg_type' => 'delete'));
295
  }
296
 
 
 
 
 
 
297
  function woocommerce_attribute_added_handler($attribute_id, $attribute) {
298
  $this->add_db_event('woocommerce_attribute_taxonomies', array('attribute_id' => $attribute_id));
299
  }
636
  add_action('woocommerce_grant_product_download_access', array($this, 'woocommerce_grant_product_download_access_handler'), 10, 1);
637
  add_action('woocommerce_ajax_revoke_access_to_product_download', array($this, 'woocommerce_revoke_access_to_product_download_handler'), 10, 4);
638
  add_action('woocommerce_deleted_order_downloadable_permissions', array($this, 'woocommerce_deleted_order_downloadable_permissions_handler'), 10, 1);
 
639
 
640
  add_action('woocommerce_new_payment_token', array($this, 'woocommerce_payment_token_handler'), 10, 1);
641
  add_action('woocommerce_payment_token_created', array($this, 'woocommerce_payment_token_handler'), 10, 1);
690
  add_action('woocommerce_grant_product_download_permissions', array($this, 'woocommerce_grant_product_download_permissions_handler'), 10, 1);
691
  }
692
  }
693
+ endif;