The WP Remote WordPress Plugin - Version 2.4.9

Version Description

Download this release

Release Info

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

Code changes from version 2.4.8 to 2.4.9

backupwordpress/classes/schedule.php CHANGED
@@ -94,7 +94,7 @@ class HMBKP_Scheduled_Backup extends HM_Backup {
94
  $this->set_path( hmbkp_path() );
95
 
96
  // Set the archive filename to site name + schedule slug + date
97
- $this->set_archive_filename( implode( '-', array( sanitize_title( url_shorten( home_url() ) ), $this->get_id(), $this->get_type(), date( 'Y-m-d-H-i-s', current_time( 'timestamp' ) ) ) ) . '.zip' );
98
 
99
  // Setup the schedule if it isn't set or TODO if it's changed
100
  if ( ( ! $this->get_next_occurrence() && in_array( $this->get_reoccurrence(), array_keys( wp_get_schedules() ) ) ) || ( date( get_option( 'time_format' ), strtotime( HMBKP_SCHEDULE_TIME ) - ( get_option( 'gmt_offset' ) * 3600 ) ) !== date( get_option( 'time_format' ), $this->get_next_occurrence() ) ) )
94
  $this->set_path( hmbkp_path() );
95
 
96
  // Set the archive filename to site name + schedule slug + date
97
+ $this->set_archive_filename( implode( '-', array( sanitize_title( str_ireplace( array( 'http://', 'https://', 'www' ), '', home_url() ) ), $this->get_id(), $this->get_type(), date( 'Y-m-d-H-i-s', current_time( 'timestamp' ) ) ) ) . '.zip' );
98
 
99
  // Setup the schedule if it isn't set or TODO if it's changed
100
  if ( ( ! $this->get_next_occurrence() && in_array( $this->get_reoccurrence(), array_keys( wp_get_schedules() ) ) ) || ( date( get_option( 'time_format' ), strtotime( HMBKP_SCHEDULE_TIME ) - ( get_option( 'gmt_offset' ) * 3600 ) ) !== date( get_option( 'time_format' ), $this->get_next_occurrence() ) ) )
backupwordpress/hm-backup/hm-backup.php CHANGED
@@ -270,7 +270,7 @@ class HM_Backup {
270
  public function get_archive_filename() {
271
 
272
  if ( empty( $this->archive_filename ) )
273
- $this->set_archive_filename( implode( '-', array( sanitize_title( url_shorten( home_url() ) ), 'backup', date( 'Y-m-d-H-i-s', current_time( 'timestamp' ) ) ) ) . '.zip' );
274
 
275
  return $this->archive_filename;
276
 
@@ -350,7 +350,7 @@ class HM_Backup {
350
  public function get_root() {
351
 
352
  if ( empty( $this->root ) )
353
- $this->set_root( HM_Backup::conform_dir( self::get_home_path() ) );
354
 
355
  return $this->root;
356
 
@@ -368,7 +368,7 @@ class HM_Backup {
368
  if ( empty( $path ) || ! is_string( $path ) || ! is_dir ( $path ) )
369
  throw new Exception( 'Invalid root path <code>' . $path . '</code> must be a valid directory path' );
370
 
371
- $this->root = HM_Backup::conform_dir( $path );
372
 
373
  }
374
 
@@ -381,7 +381,7 @@ class HM_Backup {
381
  public function get_path() {
382
 
383
  if ( empty( $this->path ) )
384
- $this->set_path( HM_Backup::conform_dir( hmbkp_path_default() ) );
385
 
386
  return $this->path;
387
 
@@ -399,7 +399,7 @@ class HM_Backup {
399
  if ( empty( $path ) || ! is_string( $path ) )
400
  throw new Exception( 'Invalid backup path <code>' . $path . '</code> must be a non empty (string)' );
401
 
402
- $this->path = HM_Backup::conform_dir( $path );
403
 
404
  }
405
 
@@ -511,7 +511,7 @@ class HM_Backup {
511
 
512
  // Find the one which works
513
  foreach ( $mysqldump_locations as $location )
514
- if ( is_executable( HM_Backup::conform_dir( $location ) ) )
515
  $this->set_mysqldump_command_path( $location );
516
 
517
  return $this->mysqldump_command_path;
@@ -572,7 +572,7 @@ class HM_Backup {
572
 
573
  // Find the one which works
574
  foreach ( $zip_locations as $location )
575
- if ( is_executable( HM_Backup::conform_dir( $location ) ) )
576
  $this->set_zip_command_path( $location );
577
 
578
  return $this->zip_command_path;
@@ -821,14 +821,14 @@ class HM_Backup {
821
  continue;
822
 
823
  // Excludes
824
- if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
825
  continue;
826
 
827
  if ( $file->isDir() )
828
- $zip->addEmptyDir( trailingslashit( str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) );
829
 
830
  elseif ( $file->isFile() )
831
- $zip->addFile( $file->getPathname(), str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) );
832
 
833
  if ( ++$files_added % 500 === 0 )
834
  if ( ! $zip->close() || ! $zip->open( $this->get_archive_filepath(), ZIPARCHIVE::CREATE ) )
@@ -947,7 +947,7 @@ class HM_Backup {
947
  if ( $this->get_errors( $this->get_archive_method() ) )
948
  return false;
949
 
950
- if ( $this->get_unreadable_files() )
951
  $this->warning( $this->get_archive_method(), __( 'The following files are unreadable and couldn\'t be backed up: ', 'hmbkp' ) . implode( ', ', $this->get_unreadable_files() ) );
952
 
953
  return $this->archive_verified = true;
@@ -1000,7 +1000,7 @@ class HM_Backup {
1000
  if ( $file === '.' || $file === '..' )
1001
  continue;
1002
 
1003
- $filepath = HM_Backup::conform_dir( trailingslashit( $dir ) . $file );
1004
  $file = str_ireplace( trailingslashit( $this->get_root() ), '', $filepath );
1005
 
1006
  $files[] = new SplFileInfo( $filepath );
@@ -1035,7 +1035,7 @@ class HM_Backup {
1035
  continue;
1036
 
1037
  // Excludes
1038
- if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
1039
  continue;
1040
 
1041
  $this->included_files[] = $file;
@@ -1067,7 +1067,7 @@ class HM_Backup {
1067
  continue;
1068
 
1069
  // Excludes
1070
- if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
1071
  continue;
1072
 
1073
  $this->included_file_count++;
@@ -1099,7 +1099,7 @@ class HM_Backup {
1099
  continue;
1100
 
1101
  // Excludes
1102
- if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
1103
  $this->excluded_files[] = $file;
1104
 
1105
  }
@@ -1129,7 +1129,7 @@ class HM_Backup {
1129
  continue;
1130
 
1131
  // Excludes
1132
- if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
1133
  $this->excluded_file_count++;
1134
 
1135
  }
@@ -1291,7 +1291,7 @@ class HM_Backup {
1291
  $fragment = true;
1292
 
1293
  // Strip $this->root and conform
1294
- $rule = str_ireplace( $this->get_root(), '', untrailingslashit( HM_Backup::conform_dir( $rule ) ) );
1295
 
1296
  // Strip the preceeding slash
1297
  if ( in_array( substr( $rule, 0, 1 ), array( '\\', '/' ) ) )
270
  public function get_archive_filename() {
271
 
272
  if ( empty( $this->archive_filename ) )
273
+ $this->set_archive_filename( implode( '-', array( sanitize_title( str_ireplace( array( 'http://', 'https://', 'www' ), '', home_url() ) ), 'backup', date( 'Y-m-d-H-i-s', current_time( 'timestamp' ) ) ) ) . '.zip' );
274
 
275
  return $this->archive_filename;
276
 
350
  public function get_root() {
351
 
352
  if ( empty( $this->root ) )
353
+ $this->set_root( self::conform_dir( self::get_home_path() ) );
354
 
355
  return $this->root;
356
 
368
  if ( empty( $path ) || ! is_string( $path ) || ! is_dir ( $path ) )
369
  throw new Exception( 'Invalid root path <code>' . $path . '</code> must be a valid directory path' );
370
 
371
+ $this->root = self::conform_dir( $path );
372
 
373
  }
374
 
381
  public function get_path() {
382
 
383
  if ( empty( $this->path ) )
384
+ $this->set_path( self::conform_dir( hmbkp_path_default() ) );
385
 
386
  return $this->path;
387
 
399
  if ( empty( $path ) || ! is_string( $path ) )
400
  throw new Exception( 'Invalid backup path <code>' . $path . '</code> must be a non empty (string)' );
401
 
402
+ $this->path = self::conform_dir( $path );
403
 
404
  }
405
 
511
 
512
  // Find the one which works
513
  foreach ( $mysqldump_locations as $location )
514
+ if ( is_executable( self::conform_dir( $location ) ) )
515
  $this->set_mysqldump_command_path( $location );
516
 
517
  return $this->mysqldump_command_path;
572
 
573
  // Find the one which works
574
  foreach ( $zip_locations as $location )
575
+ if ( is_executable( self::conform_dir( $location ) ) )
576
  $this->set_zip_command_path( $location );
577
 
578
  return $this->zip_command_path;
821
  continue;
822
 
823
  // Excludes
824
+ if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
825
  continue;
826
 
827
  if ( $file->isDir() )
828
+ $zip->addEmptyDir( trailingslashit( str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) );
829
 
830
  elseif ( $file->isFile() )
831
+ $zip->addFile( $file->getPathname(), str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) );
832
 
833
  if ( ++$files_added % 500 === 0 )
834
  if ( ! $zip->close() || ! $zip->open( $this->get_archive_filepath(), ZIPARCHIVE::CREATE ) )
947
  if ( $this->get_errors( $this->get_archive_method() ) )
948
  return false;
949
 
950
+ if ( $this->get_unreadable_file_count() )
951
  $this->warning( $this->get_archive_method(), __( 'The following files are unreadable and couldn\'t be backed up: ', 'hmbkp' ) . implode( ', ', $this->get_unreadable_files() ) );
952
 
953
  return $this->archive_verified = true;
1000
  if ( $file === '.' || $file === '..' )
1001
  continue;
1002
 
1003
+ $filepath = self::conform_dir( trailingslashit( $dir ) . $file );
1004
  $file = str_ireplace( trailingslashit( $this->get_root() ), '', $filepath );
1005
 
1006
  $files[] = new SplFileInfo( $filepath );
1035
  continue;
1036
 
1037
  // Excludes
1038
+ if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1039
  continue;
1040
 
1041
  $this->included_files[] = $file;
1067
  continue;
1068
 
1069
  // Excludes
1070
+ if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1071
  continue;
1072
 
1073
  $this->included_file_count++;
1099
  continue;
1100
 
1101
  // Excludes
1102
+ if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1103
  $this->excluded_files[] = $file;
1104
 
1105
  }
1129
  continue;
1130
 
1131
  // Excludes
1132
+ if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1133
  $this->excluded_file_count++;
1134
 
1135
  }
1291
  $fragment = true;
1292
 
1293
  // Strip $this->root and conform
1294
+ $rule = str_ireplace( $this->get_root(), '', untrailingslashit( self::conform_dir( $rule ) ) );
1295
 
1296
  // Strip the preceeding slash
1297
  if ( in_array( substr( $rule, 0, 1 ), array( '\\', '/' ) ) )
backupwordpress/plugin.php CHANGED
@@ -1,5 +1,14 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
3
  /* Copyright 2011 Human Made Limited (email : support@hmn.md)
4
 
5
  This program is free software; you can redistribute it and/or modify
1
  <?php
2
 
3
+ /*
4
+ Plugin Name: BackUpWordPress
5
+ Plugin URI: http://hmn.md/backupwordpress/
6
+ Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools &rarr; Backups</strong>.
7
+ Author: Human Made Limited
8
+ Version: 2.1.1 Alpha
9
+ Author URI: http://hmn.md/
10
+ */
11
+
12
  /* Copyright 2011 Human Made Limited (email : support@hmn.md)
13
 
14
  This program is free software; you can redistribute it and/or modify
backupwordpress/readme.txt CHANGED
@@ -103,6 +103,13 @@ You can also tweet <a href="http://twitter.com/humanmadeltd">@humanmadeltd</a> o
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
106
  #### 2.1
107
 
108
  * Stop blocking people with `safe_mode = On` from using the plugin, instead just show a warning.
103
 
104
  == Changelog ==
105
 
106
+ #### 2.1.1
107
+
108
+ * Fix a possible fatal error when a backup schedule is instantiated outside of wp-admin.
109
+ * Don't use functions from misc.php as loading it too early can cause fatal errors.
110
+ * Don't hardcode an English string in the JS, use the translated string instead.
111
+ * Minor code cleanup.
112
+
113
  #### 2.1
114
 
115
  * Stop blocking people with `safe_mode = On` from using the plugin, instead just show a warning.
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>. <strong>Deactivate to clear your API Key.</strong>
6
- Version: 2.4.8
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>. <strong>Deactivate to clear your API Key.</strong>
6
+ Version: 2.4.9
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.4.8
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.4.8
35
 
36
  * Pull in latest BackUpWordPress which fixes a possible Fatal error caused by misc.php being included to early.
3
  Tags: wpremote, remote administration, multiple wordpress
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
+ Stable tag: 2.4.9
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.4.9
35
+
36
+ * Pull in latest BackUpWordPress which fixes a possible Fatal error caused by `url_shorten` being called outside the admin.
37
+
38
  #### 2.4.8
39
 
40
  * Pull in latest BackUpWordPress which fixes a possible Fatal error caused by misc.php being included to early.