The WP Remote WordPress Plugin - Version 4.31

Version Description

  • Fetching Mysql Version
  • Robust data fetch APIs
  • Core plugin changes
  • Sanitizing incoming params
  • Update Database after wp-core update
  • Handling Child theme upgrade code
  • FSWrite wing improvements for older PHP versions
Download this release

Release Info

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

Code changes from version 4.26 to 4.31

callback/wings/bv_upgrader_skin.php CHANGED
@@ -55,9 +55,18 @@ class BVUpgraderSkin extends WP_Upgrader_Skin {
55
  $this->status[$this->action.':'.$key][] = $message;
56
  }
57
 
58
- function feedback($string) {
59
  if ( empty($string) )
60
  return;
 
 
 
 
 
 
 
 
 
61
  $key = $this->get_key();
62
  $message = array();
63
  $message['message'] = $string;
55
  $this->status[$this->action.':'.$key][] = $message;
56
  }
57
 
58
+ function feedback($string, ...$args) {
59
  if ( empty($string) )
60
  return;
61
+
62
+ if ( strpos( $string, '%' ) !== false ) {
63
+ if ( $args ) {
64
+ $args = array_map( 'strip_tags', $args );
65
+ $args = array_map( 'esc_html', $args );
66
+ $string = vsprintf( $string, $args );
67
+ }
68
+ }
69
+
70
  $key = $this->get_key();
71
  $message = array();
72
  $message['message'] = $string;
callback/wings/fs_write.php CHANGED
@@ -5,7 +5,7 @@ if (!class_exists('BVFSWriteCallback')) :
5
 
6
  class BVFSWriteCallback extends BVCallbackBase {
7
 
8
- const MEGABYTE = 1024 * 1024;
9
 
10
  public function __construct() {
11
  }
5
 
6
  class BVFSWriteCallback extends BVCallbackBase {
7
 
8
+ const MEGABYTE = 1048576;
9
 
10
  public function __construct() {
11
  }
callback/wings/info.php CHANGED
@@ -135,6 +135,7 @@ class BVInfoCallback extends BVCallbackBase {
135
  'charset' => get_bloginfo('charset'),
136
  'wpversion' => $wp_version,
137
  'dbversion' => $wp_db_version,
 
138
  'abspath' => ABSPATH,
139
  'bvpluginpath' => defined('WPRBASEPATH') ? WPRBASEPATH : null,
140
  'uploadpath' => $upload_dir['basedir'],
135
  'charset' => get_bloginfo('charset'),
136
  'wpversion' => $wp_version,
137
  'dbversion' => $wp_db_version,
138
+ 'mysql_version' => $db->getMysqlVersion(),
139
  'abspath' => ABSPATH,
140
  'bvpluginpath' => defined('WPRBASEPATH') ? WPRBASEPATH : null,
141
  'uploadpath' => $upload_dir['basedir'],
callback/wings/manage.php CHANGED
@@ -40,6 +40,7 @@ class BVManageCallback extends BVCallbackBase {
40
  @include_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
41
  @include_once ABSPATH.'wp-admin/includes/user.php';
42
  @include_once ABSPATH.'wp-includes/registration.php';
 
43
  @include_once ABSPATH.'wp-admin/includes/update.php';
44
  @require_once ABSPATH.'wp-admin/includes/update-core.php';
45
  }
@@ -202,12 +203,12 @@ class BVManageCallback extends BVCallbackBase {
202
  }
203
  }
204
  if (array_key_exists('themes', $params) && !empty($params['themes'])) {
205
- $templates = array();
206
  foreach ($params['themes'] as $theme) {
207
- $templates[] = $theme['template'];
208
  }
209
- if (!empty($templates)) {
210
- $result['themes'] = $this->upgradeThemes($templates, $has_bv_skin);
211
  }
212
  }
213
  return $result;
@@ -379,12 +380,12 @@ class BVManageCallback extends BVCallbackBase {
379
  $upgrader = new Theme_Upgrader($skin);
380
  $result = $upgrader->bulk_upgrade($themes);
381
  }
382
- foreach($themes as $template) {
383
- $res = $result[$template];
384
  if (!$res || is_wp_error($res)) {
385
- $result[$template] = array('status' => "Error");
386
  } else {
387
- $result[$template] = array('status' => "Done");
388
  }
389
  }
390
  return $result;
@@ -480,6 +481,15 @@ class BVManageCallback extends BVCallbackBase {
480
  }
481
  }
482
 
 
 
 
 
 
 
 
 
 
483
  function process($request) {
484
  global $wp_filesystem;
485
  $this->include_files();
@@ -520,6 +530,9 @@ class BVManageCallback extends BVCallbackBase {
520
  $isHttps = true;
521
  $resp = array("autologin" => $this->autoLogin($params['username'], $isHttps));
522
  break;
 
 
 
523
  default:
524
  $resp = false;
525
  }
40
  @include_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
41
  @include_once ABSPATH.'wp-admin/includes/user.php';
42
  @include_once ABSPATH.'wp-includes/registration.php';
43
+ @include_once ABSPATH.'wp-admin/includes/upgrade.php';
44
  @include_once ABSPATH.'wp-admin/includes/update.php';
45
  @require_once ABSPATH.'wp-admin/includes/update-core.php';
46
  }
203
  }
204
  }
205
  if (array_key_exists('themes', $params) && !empty($params['themes'])) {
206
+ $stylesheets = array();
207
  foreach ($params['themes'] as $theme) {
208
+ $stylesheets[] = $theme['stylesheet'];
209
  }
210
+ if (!empty($stylesheets)) {
211
+ $result['themes'] = $this->upgradeThemes($stylesheets, $has_bv_skin);
212
  }
213
  }
214
  return $result;
380
  $upgrader = new Theme_Upgrader($skin);
381
  $result = $upgrader->bulk_upgrade($themes);
382
  }
383
+ foreach($themes as $stylesheet) {
384
+ $res = $result[$stylesheet];
385
  if (!$res || is_wp_error($res)) {
386
+ $result[$stylesheet] = array('status' => "Error");
387
  } else {
388
+ $result[$stylesheet] = array('status' => "Done");
389
  }
390
  }
391
  return $result;
481
  }
482
  }
483
 
484
+ function upgrade_db(){
485
+ if (function_exists('wp_upgrade')) {
486
+ wp_upgrade();
487
+ return "DONE";
488
+ } else {
489
+ return "NOUPGRADERFUNCTION";
490
+ }
491
+ }
492
+
493
  function process($request) {
494
  global $wp_filesystem;
495
  $this->include_files();
530
  $isHttps = true;
531
  $resp = array("autologin" => $this->autoLogin($params['username'], $isHttps));
532
  break;
533
+ case "updatedb":
534
+ $resp = array("status" => $this->upgrade_db());
535
+ break;
536
  default:
537
  $resp = false;
538
  }
callback/wings/misc.php CHANGED
@@ -94,6 +94,9 @@ class BVMiscCallback extends BVCallbackBase {
94
  case "dlttrsnt":
95
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
96
  break;
 
 
 
97
  default:
98
  $resp = false;
99
  }
94
  case "dlttrsnt":
95
  $resp = array("dlttrsnt" => $settings->deleteTransient($params['key']));
96
  break;
97
+ case "setmanulsignup":
98
+ $resp = array("setmanulsignup" => $settings->updateOption("bvmanualsignup", true));
99
+ break;
100
  default:
101
  $resp = false;
102
  }
info.php CHANGED
@@ -9,7 +9,7 @@ if (!class_exists('WPRInfo')) :
9
  public $badgeinfo = 'wprbadge';
10
  public $ip_header_option = 'wpripheader';
11
  public $brand_option = 'wprbrand';
12
- public $version = '4.26';
13
  public $webpage = 'https://wpremote.com';
14
  public $appurl = 'https://app.wpremote.com';
15
  public $slug = 'wpremote/plugin.php';
@@ -21,8 +21,8 @@ if (!class_exists('WPRInfo')) :
21
  $this->settings = $settings;
22
  }
23
 
24
- public function canOverrideCW() {
25
- $scanOption = $this->settings->getOption('bvoverridecw');
26
  return (isset($scanOption) && $scanOption == 1);
27
  }
28
 
9
  public $badgeinfo = 'wprbadge';
10
  public $ip_header_option = 'wpripheader';
11
  public $brand_option = 'wprbrand';
12
+ public $version = '4.31';
13
  public $webpage = 'https://wpremote.com';
14
  public $appurl = 'https://app.wpremote.com';
15
  public $slug = 'wpremote/plugin.php';
21
  $this->settings = $settings;
22
  }
23
 
24
+ public function isManualSignup() {
25
+ $scanOption = $this->settings->getOption('bvmanualsignup');
26
  return (isset($scanOption) && $scanOption == 1);
27
  }
28
 
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.26
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.31
9
  Network: True
10
  */
11
 
protect/wp/lp/lp.php CHANGED
@@ -91,11 +91,6 @@ class BVWPLP {
91
  return $this->config->blockAllLimit;
92
  }
93
 
94
- public function getLoginLogsTable() {
95
- global $bvdb;
96
- return $bvdb->getBVTable(BVWPLP::$requests_table);
97
- }
98
-
99
  public function getAllowLoginsTransient() {
100
  return $this->settings->getTransient('bvlp_allow_logins');
101
  }
91
  return $this->config->blockAllLimit;
92
  }
93
 
 
 
 
 
 
94
  public function getAllowLoginsTransient() {
95
  return $this->settings->getTransient('bvlp_allow_logins');
96
  }
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.4
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.26
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,15 @@ 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.26 =
36
  * Handling Premium plugin and themes updates
37
 
6
  Requires at least: 4.0
7
  Tested up to: 5.4
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.31
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.31 =
36
+ * Fetching Mysql Version
37
+ * Robust data fetch APIs
38
+ * Core plugin changes
39
+ * Sanitizing incoming params
40
+ * Update Database after wp-core update
41
+ * Handling Child theme upgrade code
42
+ * FSWrite wing improvements for older PHP versions
43
+
44
  = 4.26 =
45
  * Handling Premium plugin and themes updates
46
 
wp_api.php CHANGED
@@ -11,19 +11,21 @@ if (!class_exists('WPRWPAPI')) :
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
- $this->create_request_params($method, $body, $public);
15
  } else {
16
  $api_public_key = $this->settings->getOption('bvApiPublic');
17
  if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
18
- $this->create_request_params($method, $body, $api_public_key);
19
  }
20
  }
21
  }
22
 
23
- public function create_request_params($method, $body, $pubkey) {
24
  $account = WPRAccount::find($this->settings, $pubkey);
25
- $url = $account->authenticatedUrl($method);
26
- $this->http_request($url, $body);
 
 
27
  }
28
 
29
  public function http_request($url, $body, $headers = array()) {
11
 
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
+ $this->do_request($method, $body, $public);
15
  } else {
16
  $api_public_key = $this->settings->getOption('bvApiPublic');
17
  if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
18
+ $this->do_request($method, $body, $api_public_key);
19
  }
20
  }
21
  }
22
 
23
+ public function do_request($method, $body, $pubkey) {
24
  $account = WPRAccount::find($this->settings, $pubkey);
25
+ if (isset($account)) {
26
+ $url = $account->authenticatedUrl($method);
27
+ $this->http_request($url, $body);
28
+ }
29
  }
30
 
31
  public function http_request($url, $body, $headers = array()) {
wp_db.php CHANGED
@@ -182,5 +182,10 @@ class WPRWPDb {
182
 
183
  return $result;
184
  }
 
 
 
 
 
185
  }
186
- endif;
182
 
183
  return $result;
184
  }
185
+
186
+ public function getMysqlVersion() {
187
+ global $wpdb;
188
+ return $wpdb->db_version();
189
+ }
190
  }
191
+ endif;