The WP Remote WordPress Plugin - Version 2.1.2

Version Description

Download this release

Release Info

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

Code changes from version 2.1.1 to 2.1.2

Files changed (4) hide show
  1. hm-backup/hm-backup.php +9 -4
  2. plugin.php +1 -1
  3. readme.txt +1 -1
  4. wprp.backups.php +25 -12
hm-backup/hm-backup.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Generic file and database backup class
5
  *
6
- * @version 1.4
7
  */
8
  class HM_Backup {
9
 
@@ -874,18 +874,23 @@ class HM_Backup {
874
  */
875
  public function conform_dir( $dir, $recursive = false ) {
876
 
 
 
 
 
877
  // Replace single forward slash (looks like double slash because we have to escape it)
878
  $dir = str_replace( '\\', '/', $dir );
879
  $dir = str_replace( '//', '/', $dir );
880
 
881
  // Remove the trailing slash
882
- $dir = untrailingslashit( $dir );
 
883
 
884
  // Carry on until completely normalized
885
  if ( ! $recursive && $this->conform_dir( $dir, true ) != $dir )
886
  return $this->conform_dir( $dir );
887
 
888
- return $dir;
889
 
890
  }
891
 
@@ -1218,7 +1223,7 @@ class HM_Backup {
1218
  */
1219
  public function error_handler( $type ) {
1220
 
1221
- if ( in_array( $type, array( E_STRICT, E_DEPRECATED ) ) || error_reporting() === 0 )
1222
  return false;
1223
 
1224
  $args = func_get_args();
3
  /**
4
  * Generic file and database backup class
5
  *
6
+ * @version 1.5.1
7
  */
8
  class HM_Backup {
9
 
874
  */
875
  public function conform_dir( $dir, $recursive = false ) {
876
 
877
+ // Assume empty dir is root
878
+ if ( ! $dir )
879
+ $dir = '/';
880
+
881
  // Replace single forward slash (looks like double slash because we have to escape it)
882
  $dir = str_replace( '\\', '/', $dir );
883
  $dir = str_replace( '//', '/', $dir );
884
 
885
  // Remove the trailing slash
886
+ if ( $dir !== '/' )
887
+ $dir = untrailingslashit( $dir );
888
 
889
  // Carry on until completely normalized
890
  if ( ! $recursive && $this->conform_dir( $dir, true ) != $dir )
891
  return $this->conform_dir( $dir );
892
 
893
+ return (string) $dir;
894
 
895
  }
896
 
1223
  */
1224
  public function error_handler( $type ) {
1225
 
1226
+ if ( ( defined( 'E_DEPRECATED' ) && $type == E_DEPRECATED ) || ( defined( 'E_STRICT' ) && $type == E_STRICT ) || error_reporting() === 0 )
1227
  return false;
1228
 
1229
  $args = func_get_args();
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.0
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.1.2
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.3.1
6
- Stable tag: 2.1.0
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
 
3
  Tags: wpremote, remote administration, multiple wordpress
4
  Requires at least: 2.9
5
  Tested up to: 3.3.1
6
+ Stable tag: 2.1.2
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
 
wprp.backups.php CHANGED
@@ -19,7 +19,7 @@ function _wprp_backups_api_call( $action ) {
19
 
20
  case 'do_backup' :
21
 
22
- @ignore_user_abort(true);
23
 
24
  $backup = new HM_Backup();
25
  $upload_dir = wp_upload_dir();
@@ -27,15 +27,31 @@ function _wprp_backups_api_call( $action ) {
27
  // Store the backup file in the uploads dir
28
  $backup->path = $upload_dir['basedir'] . '/_wpremote_backups';
29
 
30
- $running_file = $backup->path . '/.backup_running';
 
 
 
 
31
 
32
  // delete the backups folder to cleanup old backups
33
- _wprp_backups_rmdirtree( $backup->path );
34
 
35
- if ( ! @mkdir( $backup->path ) )
36
  return new WP_Error( 'unable-to-create-backups-directory', 'Unable to write the .backup_running file - check your permissions on wp-content/uploads' );
37
 
38
- // write the backup runing file for tracking...
 
 
 
 
 
 
 
 
 
 
 
 
39
  if ( ! $handle = @fopen( $running_file, 'w' ) )
40
  return new WP_Error( 'unable-to-write-backup-running-file' );
41
 
@@ -46,9 +62,6 @@ function _wprp_backups_api_call( $action ) {
46
  if ( ! file_exists( $running_file ) )
47
  return new WP_Error( 'backup-running-file-was-not-created' );
48
 
49
- // Set a random backup filename
50
- $backup->archive_filename = md5( time() ) . '.zip';
51
-
52
  // Excludes
53
  if ( ! empty( $_REQUEST['backup_excludes'] ) ) {
54
 
@@ -58,11 +71,11 @@ function _wprp_backups_api_call( $action ) {
58
 
59
  $backup->backup();
60
 
61
- unlink( $backup->path . '/.backup_completed' );
62
- unlink( $backup->path . '/.backup_running' );
63
 
64
- // write the backup runing file for tracking...
65
- $completed_file = $backup->path . '/.backup_completed';
66
 
67
  if ( ! $handle = @fopen( $completed_file, 'w' ) )
68
  return new WP_Error( 'unable-to-write-backup-completed-file' );
19
 
20
  case 'do_backup' :
21
 
22
+ @ignore_user_abort( true );
23
 
24
  $backup = new HM_Backup();
25
  $upload_dir = wp_upload_dir();
27
  // Store the backup file in the uploads dir
28
  $backup->path = $upload_dir['basedir'] . '/_wpremote_backups';
29
 
30
+ $running_file = $backup->path() . '/.backup_running';
31
+ $index_php = $backup->path() . '/index.php';
32
+
33
+ // Set a random backup filename
34
+ $backup->archive_filename = md5( time() ) . '.zip';
35
 
36
  // delete the backups folder to cleanup old backups
37
+ _wprp_backups_rmdirtree( $backup->path() );
38
 
39
+ if ( ! @mkdir( $backup->path() ) )
40
  return new WP_Error( 'unable-to-create-backups-directory', 'Unable to write the .backup_running file - check your permissions on wp-content/uploads' );
41
 
42
+
43
+ // Write an index.php file so stop directory listing
44
+ if ( ! $handle = @fopen( $index_php, 'w' ) )
45
+ return new WP_Error( 'unable-to-write-index-php-file' );
46
+
47
+ fwrite( $handle, '' );
48
+
49
+ fclose( $handle );
50
+
51
+ if ( ! file_exists( $index_php ) )
52
+ return new WP_Error( 'index-php-file-was-not-created' );
53
+
54
+ // Write the backup runing file for tracking...
55
  if ( ! $handle = @fopen( $running_file, 'w' ) )
56
  return new WP_Error( 'unable-to-write-backup-running-file' );
57
 
62
  if ( ! file_exists( $running_file ) )
63
  return new WP_Error( 'backup-running-file-was-not-created' );
64
 
 
 
 
65
  // Excludes
66
  if ( ! empty( $_REQUEST['backup_excludes'] ) ) {
67
 
71
 
72
  $backup->backup();
73
 
74
+ unlink( $backup->path() . '/.backup_completed' );
75
+ unlink( $backup->path() . '/.backup_running' );
76
 
77
+ // Write the backup runing file for tracking...
78
+ $completed_file = $backup->path() . '/.backup_completed';
79
 
80
  if ( ! $handle = @fopen( $completed_file, 'w' ) )
81
  return new WP_Error( 'unable-to-write-backup-completed-file' );