The WP Remote WordPress Plugin - Version 2.3.1

Version Description

Download this release

Release Info

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

Code changes from version 2.3 to 2.3.1

Files changed (3) hide show
  1. plugin.php +1 -1
  2. readme.txt +5 -1
  3. wprp.plugins.php +37 -30
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.3
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
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.3.1
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot
3
  Tags: wpremote, remote administration, multiple wordpress
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
- Stable tag: 2.3
7
 
8
  WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place.
9
 
@@ -31,6 +31,10 @@ You can email us at support@wpremote.com for support.
31
 
32
  == Changelog ==
33
 
 
 
 
 
34
  #### 2.3
35
 
36
  * WP_Filesystem support for servers which don't allow PHP direct filesystem access.
3
  Tags: wpremote, remote administration, multiple wordpress
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
+ Stable tag: 2.3.1
7
 
8
  WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place.
9
 
31
 
32
  == Changelog ==
33
 
34
+ #### 2.3.1
35
+
36
+ * PHP 5.2.4 compat.
37
+
38
  #### 2.3
39
 
40
  * WP_Filesystem support for servers which don't allow PHP direct filesystem access.
wprp.plugins.php CHANGED
@@ -9,7 +9,7 @@ function _wprp_get_plugins() {
9
 
10
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
11
 
12
- _wpr_add_non_extend_plugin_support();
13
 
14
  // Get all plugins
15
  $plugins = get_plugins();
@@ -77,7 +77,7 @@ function _wprp_upgrade_plugin( $plugin ) {
77
  if ( ! _wprp_supports_plugin_upgrade() )
78
  return array( 'status' => 'error', 'error' => 'WordPress version too old for plugin upgrades' );
79
 
80
- _wpr_add_non_extend_plugin_support();
81
 
82
  // check for filesystem access
83
  if ( ! _wpr_check_filesystem_access() )
@@ -171,43 +171,50 @@ function _wprp_supports_plugin_upgrade() {
171
 
172
  }
173
 
174
- function _wpr_add_non_extend_plugin_support() {
 
 
175
 
176
- add_filter( 'pre_set_site_transient_update_plugins', function( $value ) {
177
 
178
- foreach( $non_extend_list = _wprp_get_non_extend_plugins_data() as $key => $anon_function ) {
179
 
180
- if ( ( $returned = $non_extend_list[$key]() ) )
181
- $value->response[$returned->plugin_location] = $returned;
182
- }
183
 
184
- return $value;
185
 
186
- } );
187
  }
188
 
 
189
  function _wprp_get_non_extend_plugins_data() {
190
 
191
  return array(
192
- 'gravity_forms' => function() {
193
-
194
- if ( ! class_exists('GFCommon') || ! method_exists( 'GFCommon', 'get_version_info' ) || ! method_exists( 'RGForms', 'premium_update_push' ) )
195
- return false;
196
-
197
- $version_data = GFCommon::get_version_info();
198
- $plugin_data = reset( RGForms::premium_update_push( array() ) );
199
-
200
- if ( empty( $version_data['url'] ) || empty( $version_data['is_valid_key'] ) || empty( $plugin_data['new_version'] ) || empty( $plugin_data['PluginURI'] ) || empty( $plugin_data['slug'] ) )
201
- return false;
202
-
203
- return (object) array(
204
- 'plugin_location' => $plugin_data['slug'], //Not in standard structure but don't forget to include it!
205
- 'id' => 999999999,
206
- 'slug' => 'gravityforms',
207
- 'url' => $plugin_data['PluginURI'],
208
- 'package' => $version_data['url'],
209
- 'new_version' => $version_data['version']
210
- );
211
- }
 
 
 
 
212
  );
 
213
  }
9
 
10
  require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
11
 
12
+ _wpr_add_non_extend_plugin_support_filter();
13
 
14
  // Get all plugins
15
  $plugins = get_plugins();
77
  if ( ! _wprp_supports_plugin_upgrade() )
78
  return array( 'status' => 'error', 'error' => 'WordPress version too old for plugin upgrades' );
79
 
80
+ _wpr_add_non_extend_plugin_support_filter();
81
 
82
  // check for filesystem access
83
  if ( ! _wpr_check_filesystem_access() )
171
 
172
  }
173
 
174
+ function _wpr_add_non_extend_plugin_support_filter() {
175
+ add_filter( 'pre_set_site_transient_update_plugins', '_wpr_add_non_extend_plugin_support' );
176
+ }
177
 
178
+ function _wpr_add_non_extend_plugin_support( $value ) {
179
 
180
+ foreach( $non_extend_list = _wprp_get_non_extend_plugins_data() as $key => $anon_function ) {
181
 
182
+ if ( ( $returned = call_user_func( $non_extend_list[$key] ) ) )
183
+ $value->response[$returned->plugin_location] = $returned;
184
+ }
185
 
186
+ return $value;
187
 
 
188
  }
189
 
190
+
191
  function _wprp_get_non_extend_plugins_data() {
192
 
193
  return array(
194
+
195
+ 'gravity_forms' => '_wpr_get_gravity_form_plugin_data'
196
+
197
+ );
198
+ }
199
+
200
+ function _wpr_get_gravity_form_plugin_data() {
201
+
202
+ if ( ! class_exists('GFCommon') || ! method_exists( 'GFCommon', 'get_version_info' ) || ! method_exists( 'RGForms', 'premium_update_push' ) )
203
+ return false;
204
+
205
+ $version_data = GFCommon::get_version_info();
206
+ $plugin_data = reset( RGForms::premium_update_push( array() ) );
207
+
208
+ if ( empty( $version_data['url'] ) || empty( $version_data['is_valid_key'] ) || empty( $plugin_data['new_version'] ) || empty( $plugin_data['PluginURI'] ) || empty( $plugin_data['slug'] ) )
209
+ return false;
210
+
211
+ return (object) array(
212
+ 'plugin_location' => $plugin_data['slug'], //Not in standard structure but don't forget to include it!
213
+ 'id' => 999999999,
214
+ 'slug' => 'gravityforms',
215
+ 'url' => $plugin_data['PluginURI'],
216
+ 'package' => $version_data['url'],
217
+ 'new_version' => $version_data['version']
218
  );
219
+
220
  }