The WP Remote WordPress Plugin - Version 2.2

Version Description

Download this release

Release Info

Developer willmot
Plugin Icon 128x128 The WP Remote WordPress Plugin
Version 2.2
Comparing to
See all releases

Code changes from version 2.1.3 to 2.2

Files changed (4) hide show
  1. plugin.php +3 -4
  2. readme.txt +12 -4
  3. wprp.api.php +11 -1
  4. wprp.plugins.php +10 -0
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: WP Remote
5
  Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. Deactivate to clear your API Key.
6
- Version: 2.1.3
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
@@ -25,9 +25,8 @@ Author URI: http://hmn.md/
25
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
  */
27
 
28
- define( 'WPRP_PLUGIN_SLUG', basename( dirname( __FILE__ ) ) );
29
- define( 'WPRP_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . WPRP_PLUGIN_SLUG );
30
- define( 'WPRP_PLUGIN_URL', WP_PLUGIN_URL . '/' . WPRP_PLUGIN_SLUG );
31
 
32
  // Don't activate on anything less than PHP 5.2.4
33
  if ( version_compare( phpversion(), '5.2.4', '<' ) ) {
3
  /*
4
  Plugin Name: WP Remote
5
  Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. Deactivate to clear your API Key.
6
+ Version: 2.2
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
25
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
  */
27
 
28
+ define( 'WPRP_PLUGIN_SLUG', 'wpremote' );
29
+ define( 'WPRP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
 
30
 
31
  // Don't activate on anything less than PHP 5.2.4
32
  if ( version_compare( phpversion(), '5.2.4', '<' ) ) {
readme.txt CHANGED
@@ -15,9 +15,9 @@ The WP Remote WordPress Plugin works with [WP Remote](https://wpremote.com/) to
15
 
16
  * Track all your WordPress sites from one place.
17
  * Track the WordPress version each site is running and easily update.
18
- * Track all your plugins and themes 1 click update them.
19
- * Free to use and you can track an unlimited number of sites.
20
- * Backups of your database and files
21
 
22
  = Support =
23
 
@@ -27,4 +27,12 @@ You can email us at support@wpremote.com for support.
27
 
28
  1. Install The WP Remote WordPress Plugin either via the WordPress.org plugin directory, or by uploading the files to your server.
29
  2. Activate the plugin.
30
- 3. Sign up for an account at wpremote.com and add your site.
 
 
 
 
 
 
 
 
15
 
16
  * Track all your WordPress sites from one place.
17
  * Track the WordPress version each site is running and easily update.
18
+ * Track all your plugins and themes and 1 click update them.
19
+ * Free to monitor and update an unlimited number of sites.
20
+ * Back up your database and files.
21
 
22
  = Support =
23
 
27
 
28
  1. Install The WP Remote WordPress Plugin either via the WordPress.org plugin directory, or by uploading the files to your server.
29
  2. Activate the plugin.
30
+ 3. Sign up for an account at wpremote.com and add your site.
31
+
32
+ == Changelog ==
33
+
34
+ #### 2.2
35
+
36
+ * Start keeping a changelog of plugin changes
37
+ * Pass home_url, site_url and admin_url to WP Remote instead of guessing at them, fixes issues with the urls being wrong for non-standard WordPress installs
38
+ * Better error message when you have the wrong API key entered.
wprp.api.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
 
3
  // Check the API Key
4
- if ( ! isset( $_GET['wpr_api_key'] ) || urldecode( $_GET['wpr_api_key'] ) !== get_option( 'wpr_api_key' ) || ! isset( $_GET['actions'] ) ) {
 
 
 
5
  echo json_encode( 'bad-api-key' );
6
  exit;
7
  }
@@ -80,6 +83,13 @@ foreach( $actions as $action => $value ) {
80
  $actions[$action] = _wprp_backups_api_call( $action );
81
 
82
  break;
 
 
 
 
 
 
 
83
 
84
  default :
85
 
1
  <?php
2
 
3
  // Check the API Key
4
+ if ( ! get_option( 'wpr_api_key' ) ) {
5
+ echo json_encode( 'blank-api-key' );
6
+ exit;
7
+ } elseif ( ! isset( $_GET['wpr_api_key'] ) || urldecode( $_GET['wpr_api_key'] ) !== get_option( 'wpr_api_key' ) || ! isset( $_GET['actions'] ) ) {
8
  echo json_encode( 'bad-api-key' );
9
  exit;
10
  }
83
  $actions[$action] = _wprp_backups_api_call( $action );
84
 
85
  break;
86
+
87
+ // get site info
88
+ case 'get_site_info' :
89
+
90
+ $actions[$action] = array( 'site_url' => get_site_url(), 'home_url' => get_home_url(), 'admin_url' => get_admin_url(), );
91
+
92
+ break;
93
 
94
  default :
95
 
wprp.plugins.php CHANGED
@@ -79,6 +79,9 @@ function _wprp_upgrade_plugin( $plugin ) {
79
  $upgrader = new Plugin_Upgrader( $skin );
80
  $is_active = is_plugin_active( $plugin );
81
 
 
 
 
82
  // Do the upgrade
83
  ob_start();
84
  $result = $upgrader->upgrade( $plugin );
@@ -97,6 +100,13 @@ function _wprp_upgrade_plugin( $plugin ) {
97
  // If the plugin was activited, we have to re-activate it
98
  if ( $is_active ) {
99
 
 
 
 
 
 
 
 
100
  // we do a remote request to activate, as we don;t want to kill any installs
101
  $url = add_query_arg( 'wpr_api_key', $_GET['wpr_api_key'], get_bloginfo( 'url' ) );
102
  $url = add_query_arg( 'actions', 'activate_plugin', $url );
79
  $upgrader = new Plugin_Upgrader( $skin );
80
  $is_active = is_plugin_active( $plugin );
81
 
82
+ // Force a plugin update check
83
+ wp_update_plugins();
84
+
85
  // Do the upgrade
86
  ob_start();
87
  $result = $upgrader->upgrade( $plugin );
100
  // If the plugin was activited, we have to re-activate it
101
  if ( $is_active ) {
102
 
103
+ // we can not use the "normal" way or lazy activating, as thet requires wpremote to be activated
104
+ if ( strpos( $plugin, 'wpremote' ) !== false ) {
105
+ activate_plugin( $plugin, '', false, true );
106
+ return array( 'status' => 'success' );
107
+ }
108
+
109
+
110
  // we do a remote request to activate, as we don;t want to kill any installs
111
  $url = add_query_arg( 'wpr_api_key', $_GET['wpr_api_key'], get_bloginfo( 'url' ) );
112
  $url = add_query_arg( 'actions', 'activate_plugin', $url );