The WP Remote WordPress Plugin - Version 2.4.12

Version Description

Download this release

Release Info

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

Code changes from version 2.4.11 to 2.4.12

backupwordpress/admin/actions.php CHANGED
@@ -45,9 +45,9 @@ add_action( 'load-tools_page_' . HMBKP_PLUGIN_SLUG, 'hmbkp_request_delete_schedu
45
  function hmbkp_ajax_request_do_backup() {
46
 
47
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
48
- return;
49
 
50
- // We wan't to display any fatal errors in this ajax request so we can catch them on the other side.
51
  error_reporting( E_ERROR );
52
  @ini_set( 'display_errors', 'On' );
53
  @ini_set( 'html_errors', 'Off' );
@@ -75,12 +75,14 @@ add_action( 'wp_ajax_hmbkp_run_schedule', 'hmbkp_ajax_request_do_backup' );
75
  */
76
  function hmbkp_request_download_backup() {
77
 
 
 
78
  if ( empty( $_GET['hmbkp_download_backup'] ) || ! check_admin_referer( 'hmbkp-download_backup' ) || ! file_exists( base64_decode( $_GET['hmbkp_download_backup'] ) ) )
79
  return;
80
 
81
  $url = str_replace( HM_Backup::conform_dir( HM_Backup::get_home_path() ), home_url(), trailingslashit( dirname( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) ) . urlencode( pathinfo( base64_decode( $_GET['hmbkp_download_backup'] ), PATHINFO_BASENAME ) );
82
 
83
- if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) ) {
84
 
85
  // Force the .htaccess to be rebuilt
86
  if ( file_exists( hmbkp_path() . '/.htaccess' ) )
@@ -147,7 +149,7 @@ add_action( 'admin_init', 'hmbkp_dismiss_error' );
147
  function hmbkp_ajax_is_backup_in_progress() {
148
 
149
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
150
- return;
151
 
152
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) );
153
 
@@ -168,7 +170,7 @@ add_action( 'wp_ajax_hmbkp_is_in_progress', 'hmbkp_ajax_is_backup_in_progress' )
168
  function hmbkp_ajax_calculate_backup_size() {
169
 
170
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
171
- return;
172
 
173
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) );
174
 
@@ -207,6 +209,9 @@ add_action( 'wp_ajax_hmbkp_cron_test', 'hmbkp_ajax_cron_test' );
207
  */
208
  function hmbkp_edit_schedule_load() {
209
 
 
 
 
210
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
211
 
212
  require( HMBKP_PLUGIN_PATH . '/admin/schedule-form.php' );
@@ -221,6 +226,9 @@ add_action( 'wp_ajax_hmbkp_edit_schedule_load', 'hmbkp_edit_schedule_load' );
221
  */
222
  function hmbkp_edit_schedule_excludes_load() {
223
 
 
 
 
224
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
225
 
226
  require( HMBKP_PLUGIN_PATH . '/admin/schedule-form-excludes.php' );
@@ -253,7 +261,7 @@ add_action( 'wp_ajax_hmbkp_add_schedule_load', 'hmbkp_add_schedule_load' );
253
  function hmnkp_edit_schedule_submit() {
254
 
255
  if ( empty( $_GET['hmbkp_schedule_id'] ) )
256
- return;
257
 
258
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
259
 
@@ -325,6 +333,9 @@ add_action( 'wp_ajax_hmnkp_edit_schedule_submit', 'hmnkp_edit_schedule_submit' )
325
  */
326
  function hmbkp_add_exclude_rule() {
327
 
 
 
 
328
  $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] );
329
 
330
  $schedule->set_excludes( $_POST['hmbkp_exclude_rule'], true );
@@ -347,6 +358,9 @@ add_action( 'wp_ajax_hmbkp_add_exclude_rule', 'hmbkp_add_exclude_rule' );
347
  */
348
  function hmbkp_delete_exclude_rule() {
349
 
 
 
 
350
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
351
 
352
  $excludes = $schedule->get_excludes();
@@ -371,18 +385,17 @@ add_action( 'wp_ajax_hmbkp_delete_exclude_rule', 'hmbkp_delete_exclude_rule' );
371
  */
372
  function hmbkp_preview_exclude_rule() {
373
 
374
- if ( ! empty( $_POST['hmbkp_schedule_id'] ) )
375
- $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] );
376
 
377
- if ( ! empty( $_POST['hmbkp_schedule_excludes'] ) )
378
- $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] );
 
379
 
380
  hmbkp_file_list( $schedule, $excludes, 'get_excluded_files' );
381
 
382
  $schedule->set_excludes( $excludes );
383
 
384
- error_log( $schedule->get_excluded_file_count() );
385
-
386
  if ( $schedule->get_excluded_file_count() ) { ?>
387
 
388
  <p><?php printf( _n( '%s matches 1 file.', '%1$s matches %2$d files.', $schedule->get_excluded_file_count(), 'hmbkp' ), '<code>' . implode( '</code>, <code>', $excludes ) . '</code>', $schedule->get_excluded_file_count() ); ?></p>
@@ -403,7 +416,7 @@ add_action( 'wp_ajax_hmbkp_file_list', 'hmbkp_preview_exclude_rule', 10, 0 );
403
  function hmbkp_display_error_and_offer_to_email_it() {
404
 
405
  if ( empty( $_POST['hmbkp_error'] ) )
406
- return;
407
 
408
  $error = str_replace( HM_Backup::get_home_path(), '', $_POST['hmbkp_error'] ); ?>
409
 
@@ -425,7 +438,7 @@ add_action( 'wp_ajax_hmbkp_backup_error', 'hmbkp_display_error_and_offer_to_emai
425
  function hmbkp_send_error_via_email() {
426
 
427
  if ( empty( $_POST['hmbkp_error'] ) )
428
- return;
429
 
430
  $error = $_POST['hmbkp_error'];
431
 
45
  function hmbkp_ajax_request_do_backup() {
46
 
47
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
48
+ exit;
49
 
50
+ // We want to display any fatal errors in this ajax request so we can catch them on the other side.
51
  error_reporting( E_ERROR );
52
  @ini_set( 'display_errors', 'On' );
53
  @ini_set( 'html_errors', 'Off' );
75
  */
76
  function hmbkp_request_download_backup() {
77
 
78
+ global $is_apache;
79
+
80
  if ( empty( $_GET['hmbkp_download_backup'] ) || ! check_admin_referer( 'hmbkp-download_backup' ) || ! file_exists( base64_decode( $_GET['hmbkp_download_backup'] ) ) )
81
  return;
82
 
83
  $url = str_replace( HM_Backup::conform_dir( HM_Backup::get_home_path() ), home_url(), trailingslashit( dirname( base64_decode( $_GET['hmbkp_download_backup'] ) ) ) ) . urlencode( pathinfo( base64_decode( $_GET['hmbkp_download_backup'] ), PATHINFO_BASENAME ) );
84
 
85
+ if ( $is_apache ) {
86
 
87
  // Force the .htaccess to be rebuilt
88
  if ( file_exists( hmbkp_path() . '/.htaccess' ) )
149
  function hmbkp_ajax_is_backup_in_progress() {
150
 
151
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
152
+ exit;
153
 
154
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) );
155
 
170
  function hmbkp_ajax_calculate_backup_size() {
171
 
172
  if ( empty( $_POST['hmbkp_schedule_id'] ) )
173
+ exit;
174
 
175
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_POST['hmbkp_schedule_id'] ) );
176
 
209
  */
210
  function hmbkp_edit_schedule_load() {
211
 
212
+ if ( empty( $_GET['hmbkp_schedule_id'] ) )
213
+ exit;
214
+
215
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
216
 
217
  require( HMBKP_PLUGIN_PATH . '/admin/schedule-form.php' );
226
  */
227
  function hmbkp_edit_schedule_excludes_load() {
228
 
229
+ if ( empty( $_GET['hmbkp_schedule_id'] ) )
230
+ exit;
231
+
232
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
233
 
234
  require( HMBKP_PLUGIN_PATH . '/admin/schedule-form-excludes.php' );
261
  function hmnkp_edit_schedule_submit() {
262
 
263
  if ( empty( $_GET['hmbkp_schedule_id'] ) )
264
+ exit;
265
 
266
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
267
 
333
  */
334
  function hmbkp_add_exclude_rule() {
335
 
336
+ if ( empty( $_POST['hmbkp_schedule_id'] ) )
337
+ exit;
338
+
339
  $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] );
340
 
341
  $schedule->set_excludes( $_POST['hmbkp_exclude_rule'], true );
358
  */
359
  function hmbkp_delete_exclude_rule() {
360
 
361
+ if ( empty( $_GET['hmbkp_schedule_id'] ) )
362
+ exit;
363
+
364
  $schedule = new HMBKP_Scheduled_Backup( $_GET['hmbkp_schedule_id'] );
365
 
366
  $excludes = $schedule->get_excludes();
385
  */
386
  function hmbkp_preview_exclude_rule() {
387
 
388
+ if ( empty( $_POST['hmbkp_schedule_id'] ) || empty( $_POST['hmbkp_schedule_excludes'] ) )
389
+ exit;
390
 
391
+ $schedule = new HMBKP_Scheduled_Backup( $_POST['hmbkp_schedule_id'] );
392
+
393
+ $excludes = explode( ',', $_POST['hmbkp_schedule_excludes'] );
394
 
395
  hmbkp_file_list( $schedule, $excludes, 'get_excluded_files' );
396
 
397
  $schedule->set_excludes( $excludes );
398
 
 
 
399
  if ( $schedule->get_excluded_file_count() ) { ?>
400
 
401
  <p><?php printf( _n( '%s matches 1 file.', '%1$s matches %2$d files.', $schedule->get_excluded_file_count(), 'hmbkp' ), '<code>' . implode( '</code>, <code>', $excludes ) . '</code>', $schedule->get_excluded_file_count() ); ?></p>
416
  function hmbkp_display_error_and_offer_to_email_it() {
417
 
418
  if ( empty( $_POST['hmbkp_error'] ) )
419
+ exit;
420
 
421
  $error = str_replace( HM_Backup::get_home_path(), '', $_POST['hmbkp_error'] ); ?>
422
 
438
  function hmbkp_send_error_via_email() {
439
 
440
  if ( empty( $_POST['hmbkp_error'] ) )
441
+ exit;
442
 
443
  $error = $_POST['hmbkp_error'];
444
 
backupwordpress/admin/schedule.php CHANGED
@@ -93,7 +93,7 @@ foreach ( HMBKP_Services::get_services( $schedule ) as $file => $service )
93
 
94
  <div class="hmbkp-schedule-sentence<?php if ( $schedule->get_status() ) { ?> hmbkp-running<?php } ?>">
95
 
96
- <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', $services ) ); ?>
97
 
98
  <?php hmbkp_schedule_actions( $schedule ); ?>
99
 
93
 
94
  <div class="hmbkp-schedule-sentence<?php if ( $schedule->get_status() ) { ?> hmbkp-running<?php } ?>">
95
 
96
+ <?php printf( __( 'Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp' ), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, implode( '. ', array_filter( $services ) ) ); ?>
97
 
98
  <?php hmbkp_schedule_actions( $schedule ); ?>
99
 
backupwordpress/assets/hmbkp.js CHANGED
@@ -216,7 +216,7 @@ jQuery( document ).ready( function( $ ) {
216
  function( data ) {
217
 
218
  // Assume success if no data passed back
219
- if ( ! data ) {
220
 
221
  $.fancybox.close();
222
 
@@ -306,7 +306,7 @@ jQuery( document ).ready( function( $ ) {
306
  function( data ) {
307
 
308
  // Backup Succeeded
309
- if ( ! data ) {
310
  location.reload( true );
311
  }
312
 
@@ -320,7 +320,7 @@ jQuery( document ).ready( function( $ ) {
320
  { 'action' : 'hmbkp_backup_error', 'hmbkp_error' : data },
321
  function( data ) {
322
 
323
- if ( ! data )
324
  return;
325
 
326
  $.fancybox( {
@@ -375,8 +375,8 @@ function hmbkpRedirectOnBackupComplete( schedule_id, redirect ) {
375
  { 'action' : 'hmbkp_is_in_progress', 'hmbkp_schedule_id' : jQuery( '[data-hmbkp-schedule-id]' ).attr( 'data-hmbkp-schedule-id' ) },
376
  function( data ) {
377
 
378
- if ( data === 0 && redirect === true ) {
379
- location.reload( true );
380
 
381
  } else {
382
 
216
  function( data ) {
217
 
218
  // Assume success if no data passed back
219
+ if ( ! data || data == 0 ) {
220
 
221
  $.fancybox.close();
222
 
306
  function( data ) {
307
 
308
  // Backup Succeeded
309
+ if ( ! data || data == 0 ) {
310
  location.reload( true );
311
  }
312
 
320
  { 'action' : 'hmbkp_backup_error', 'hmbkp_error' : data },
321
  function( data ) {
322
 
323
+ if ( ! data || data == 0 )
324
  return;
325
 
326
  $.fancybox( {
375
  { 'action' : 'hmbkp_is_in_progress', 'hmbkp_schedule_id' : jQuery( '[data-hmbkp-schedule-id]' ).attr( 'data-hmbkp-schedule-id' ) },
376
  function( data ) {
377
 
378
+ if ( data == 0 && redirect === true ) {
379
+ location.reload( true );
380
 
381
  } else {
382
 
backupwordpress/classes/schedule.php CHANGED
@@ -306,8 +306,12 @@ class HMBKP_Scheduled_Backup extends HM_Backup {
306
 
307
  foreach ( $this->get_files() as $file ) {
308
 
309
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
310
- continue;
 
 
 
 
311
 
312
  // Excludes
313
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
306
 
307
  foreach ( $this->get_files() as $file ) {
308
 
309
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
310
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
311
+ continue;
312
+
313
+ if ( ! $file->isReadable() )
314
+ continue;
315
 
316
  // Excludes
317
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', HM_Backup::conform_dir( $file->getPathname() ) ) ) )
backupwordpress/functions/core.php CHANGED
@@ -261,6 +261,8 @@ function hmbkp_rmdirtree( $dir ) {
261
  */
262
  function hmbkp_path() {
263
 
 
 
264
  $path = get_option( 'hmbkp_path' );
265
 
266
  // Allow the backups path to be defined
@@ -285,10 +287,10 @@ function hmbkp_path() {
285
  if ( ! file_exists( $index ) && is_writable( $path ) )
286
  file_put_contents( $index, '' );
287
 
288
- // Protect the directory with a .htaccess file on Apache servers
289
- if ( apply_filters( 'got_rewrite', apache_mod_loaded( 'mod_rewrite', true ) ) && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) {
290
 
291
- $htaccess = $path . '/.htaccess';
 
292
 
293
  $contents[] = '# ' . sprintf( __( 'This %s file ensures that other people cannot download your backup files.', 'hmbkp' ), '.htaccess' );
294
  $contents[] = '';
@@ -327,7 +329,7 @@ function hmbkp_path_default() {
327
  $upload_dir = wp_upload_dir();
328
 
329
  // If the backups dir can't be created in WP_CONTENT_DIR then fallback to uploads
330
- if ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) {
331
 
332
  hmbkp_path_move( $path, $path = HM_Backup::conform_dir( trailingslashit( $upload_dir['basedir'] ) . substr( md5( time() ), 0, 10 ) . '-backups' ) );
333
 
261
  */
262
  function hmbkp_path() {
263
 
264
+ global $is_apache;
265
+
266
  $path = get_option( 'hmbkp_path' );
267
 
268
  // Allow the backups path to be defined
287
  if ( ! file_exists( $index ) && is_writable( $path ) )
288
  file_put_contents( $index, '' );
289
 
290
+ $htaccess = $path . '/.htaccess';
 
291
 
292
+ // Protect the directory with a .htaccess file on Apache servers
293
+ if ( $is_apache && function_exists( 'insert_with_markers' ) && ! file_exists( $htaccess ) && is_writable( $path ) ) {
294
 
295
  $contents[] = '# ' . sprintf( __( 'This %s file ensures that other people cannot download your backup files.', 'hmbkp' ), '.htaccess' );
296
  $contents[] = '';
329
  $upload_dir = wp_upload_dir();
330
 
331
  // If the backups dir can't be created in WP_CONTENT_DIR then fallback to uploads
332
+ if ( ( ( ! is_dir( $path ) && ! is_writable( dirname( $path ) ) ) || ( is_dir( $path ) && ! is_writable( $path ) ) ) && strpos( $path, $upload_dir['basedir'] ) === false ) {
333
 
334
  hmbkp_path_move( $path, $path = HM_Backup::conform_dir( trailingslashit( $upload_dir['basedir'] ) . substr( md5( time() ), 0, 10 ) . '-backups' ) );
335
 
backupwordpress/functions/interface.php CHANGED
@@ -47,7 +47,7 @@ function hmbkp_admin_notices() {
47
  function hmbkp_path_exists_warning() {
48
  $php_user = exec( 'whoami' );
49
  $php_group = reset( explode( ' ', exec( 'groups' ) ) );
50
- echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . WP_CONTENT_DIR . '</code>', '<code>chmod 777 ' . WP_CONTENT_DIR . '</code>' ) . '</p></div>';
51
  }
52
  add_action( 'admin_notices', 'hmbkp_path_exists_warning' );
53
 
@@ -174,8 +174,8 @@ function hmbkp_file_list( HMBKP_Scheduled_Backup $schedule, $excludes = null, $f
174
  if ( ! is_null( $excludes ) && strpos( $file, str_ireplace( $schedule->get_root(), '', $schedule->get_path() ) ) !== false )
175
  continue;
176
 
177
- // Skip directory browsing dots
178
- if ( $file === '.' || $file === '..' )
179
  continue;
180
 
181
  // Show only unreadable files
47
  function hmbkp_path_exists_warning() {
48
  $php_user = exec( 'whoami' );
49
  $php_group = reset( explode( ' ', exec( 'groups' ) ) );
50
+ echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress is almost ready.', 'hmbkp' ) . '</strong> ' . sprintf( __( 'The backups directory can\'t be created because your %1$s directory isn\'t writable, run %2$s or %3$s or create the folder yourself.', 'hmbkp' ), '<code>wp-content</code>', '<code>chown ' . $php_user . ':' . $php_group . ' ' . dirname( hmbkp_path() ) . '</code>', '<code>chmod 777 ' . dirname( hmbkp_path() ) . '</code>' ) . '</p></div>';
51
  }
52
  add_action( 'admin_notices', 'hmbkp_path_exists_warning' );
53
 
174
  if ( ! is_null( $excludes ) && strpos( $file, str_ireplace( $schedule->get_root(), '', $schedule->get_path() ) ) !== false )
175
  continue;
176
 
177
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
178
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
179
  continue;
180
 
181
  // Show only unreadable files
backupwordpress/hm-backup/hm-backup.php CHANGED
@@ -195,7 +195,8 @@ class HM_Backup {
195
 
196
  $home_path = ABSPATH;
197
 
198
- if ( $home_url !== $site_url )
 
199
  $home_path = trailingslashit( substr( ABSPATH, 0, strrpos( ABSPATH, str_replace( $home_url, '', $site_url ) ) ) );
200
 
201
  return self::conform_dir( $home_path );
@@ -817,8 +818,13 @@ class HM_Backup {
817
 
818
  foreach ( $this->get_files() as $file ) {
819
 
820
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
821
- continue;
 
 
 
 
 
822
 
823
  // Excludes
824
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
@@ -902,7 +908,8 @@ class HM_Backup {
902
  if ( ! empty( $this->mysqldump_verified ) )
903
  return true;
904
 
905
- if ( ! file_exists( $this->get_database_dump_filepath() ) )
 
906
  $this->error( $this->get_mysqldump_method(), __( 'The mysqldump file was not created', 'hmbkp' ) );
907
 
908
  if ( $this->get_errors( $this->get_mysqldump_method() ) )
@@ -996,7 +1003,7 @@ class HM_Backup {
996
 
997
  while ( $file = readdir( $handle ) ) :
998
 
999
- // Ignore current dir and containing dir and any unreadable files or directories
1000
  if ( $file === '.' || $file === '..' )
1001
  continue;
1002
 
@@ -1031,8 +1038,13 @@ class HM_Backup {
1031
 
1032
  foreach ( $this->get_files() as $file ) {
1033
 
1034
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
1035
- continue;
 
 
 
 
 
1036
 
1037
  // Excludes
1038
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
@@ -1063,8 +1075,13 @@ class HM_Backup {
1063
 
1064
  foreach ( $this->get_files() as $file ) {
1065
 
1066
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
1067
- continue;
 
 
 
 
 
1068
 
1069
  // Excludes
1070
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
@@ -1095,8 +1112,13 @@ class HM_Backup {
1095
 
1096
  foreach ( $this->get_files() as $file ) {
1097
 
1098
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
1099
- continue;
 
 
 
 
 
1100
 
1101
  // Excludes
1102
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
@@ -1125,8 +1147,13 @@ class HM_Backup {
1125
 
1126
  foreach ( $this->get_files() as $file ) {
1127
 
1128
- if ( $file === '.' || $file === '..' || ! $file->isReadable() )
1129
- continue;
 
 
 
 
 
1130
 
1131
  // Excludes
1132
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
@@ -1153,8 +1180,9 @@ class HM_Backup {
1153
 
1154
  foreach ( $this->get_files() as $file ) {
1155
 
1156
- if ( $file === '.' || $file === '..' )
1157
- continue;
 
1158
 
1159
  if ( ! $file->isReadable() )
1160
  $this->unreadable_files[] = $file;
@@ -1180,8 +1208,9 @@ class HM_Backup {
1180
 
1181
  foreach ( $this->get_files() as $file ) {
1182
 
1183
- if ( $file === '.' || $file === '..' )
1184
- continue;
 
1185
 
1186
  if ( ! $file->isReadable() )
1187
  $this->get_unreadable_file_count++;
195
 
196
  $home_path = ABSPATH;
197
 
198
+ // If site_url contains home_url and they differ then assume WordPress is installed in a sub directory
199
+ if ( $home_url !== $site_url && strpos( $site_url, $home_url ) === 0 )
200
  $home_path = trailingslashit( substr( ABSPATH, 0, strrpos( ABSPATH, str_replace( $home_url, '', $site_url ) ) ) );
201
 
202
  return self::conform_dir( $home_path );
818
 
819
  foreach ( $this->get_files() as $file ) {
820
 
821
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
822
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
823
+ continue;
824
+
825
+ // Skip unreadable files
826
+ if ( ! $file->isReadable() )
827
+ continue;
828
 
829
  // Excludes
830
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
908
  if ( ! empty( $this->mysqldump_verified ) )
909
  return true;
910
 
911
+ // mysqldump can create empty dump files on error so we need to check the filesize
912
+ if ( ! file_exists( $this->get_database_dump_filepath() ) || filesize( $this->get_database_dump_filepath() ) === 0 )
913
  $this->error( $this->get_mysqldump_method(), __( 'The mysqldump file was not created', 'hmbkp' ) );
914
 
915
  if ( $this->get_errors( $this->get_mysqldump_method() ) )
1003
 
1004
  while ( $file = readdir( $handle ) ) :
1005
 
1006
+ // Ignore current dir and containing dir
1007
  if ( $file === '.' || $file === '..' )
1008
  continue;
1009
 
1038
 
1039
  foreach ( $this->get_files() as $file ) {
1040
 
1041
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1042
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1043
+ continue;
1044
+
1045
+ // Skip unreadable files
1046
+ if ( ! $file->isReadable() )
1047
+ continue;
1048
 
1049
  // Excludes
1050
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1075
 
1076
  foreach ( $this->get_files() as $file ) {
1077
 
1078
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1079
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1080
+ continue;
1081
+
1082
+ // Skip unreadable files
1083
+ if ( ! $file->isReadable() )
1084
+ continue;
1085
 
1086
  // Excludes
1087
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1112
 
1113
  foreach ( $this->get_files() as $file ) {
1114
 
1115
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1116
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1117
+ continue;
1118
+
1119
+ // Skip unreadable files
1120
+ if ( ! $file->isReadable() )
1121
+ continue;
1122
 
1123
  // Excludes
1124
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1147
 
1148
  foreach ( $this->get_files() as $file ) {
1149
 
1150
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1151
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1152
+ continue;
1153
+
1154
+ // Skip unreadable files
1155
+ if ( ! $file->isReadable() )
1156
+ continue;
1157
 
1158
  // Excludes
1159
  if ( $excludes && preg_match( '(' . $excludes . ')', str_ireplace( trailingslashit( $this->get_root() ), '', self::conform_dir( $file->getPathname() ) ) ) )
1180
 
1181
  foreach ( $this->get_files() as $file ) {
1182
 
1183
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1184
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1185
+ continue;
1186
 
1187
  if ( ! $file->isReadable() )
1188
  $this->unreadable_files[] = $file;
1208
 
1209
  foreach ( $this->get_files() as $file ) {
1210
 
1211
+ // Skip dot files, they should only exist on versions of PHP between 5.2.11 -> 5.3
1212
+ if ( method_exists( $file, 'isDot' ) && $file->isDot() )
1213
+ continue;
1214
 
1215
  if ( ! $file->isReadable() )
1216
  $this->get_unreadable_file_count++;
backupwordpress/plugin.php CHANGED
@@ -109,10 +109,8 @@ if ( ! function_exists( 'hmbkp_init' ) ) :
109
  */
110
  function hmbkp_init() {
111
 
112
- $plugin_data = get_plugin_data( __FILE__ );
113
-
114
  // define the plugin version
115
- define( 'HMBKP_VERSION', $plugin_data['Version'] );
116
 
117
  // Load translations
118
  load_plugin_textdomain( 'hmbkp', false, HMBKP_PLUGIN_SLUG . '/languages/' );
109
  */
110
  function hmbkp_init() {
111
 
 
 
112
  // define the plugin version
113
+ define( 'HMBKP_VERSION', '2.1.3' );
114
 
115
  // Load translations
116
  load_plugin_textdomain( 'hmbkp', false, HMBKP_PLUGIN_SLUG . '/languages/' );
backupwordpress/readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot, cuvelier
3
  Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
4
  Requires at least: 3.3.3
5
  Tested up to: 3.5
6
- Stable tag: 2.1
7
 
8
  Simple automated back ups of your WordPress powered website.
9
 
@@ -103,11 +103,30 @@ You can also tweet <a href="http://twitter.com/humanmadeltd">@humanmadeltd</a> o
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
3
  Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
4
  Requires at least: 3.3.3
5
  Tested up to: 3.5
6
+ Stable tag: 2.1.3
7
 
8
  Simple automated back ups of your WordPress powered website.
9
 
103
 
104
  == Changelog ==
105
 
106
+ #### 2.1.4
107
+
108
+ * Don't repeatedly try to create the backups directory in the `uploads` if `uploads` isn't writable.
109
+ * Show the correct path in the warning message when the backups path can't be created.
110
+
111
+ #### 2.1.3
112
+
113
+ * Fix a regression in `2.1.2` that broke previewing and adding new exclude rules.
114
+
115
+ #### 2.1.2
116
+
117
+ * Fix an issue that could stop the settings panel from closing on save on servers which return `'0'` for ajax requests.
118
+ * Fix an issue that could cause the backup root to be set to `/` on sites with `site_url` and `home` set to different domains.
119
+ * The mysqldump fallback function will now be used if `mysqldump` produces an empty file.
120
+ * Fix a possible PHP `NOTICE` on Apache servers.
121
+
122
  #### 2.1.1
123
 
124
  * Fix a possible fatal error when a backup schedule is instantiated outside of wp-admin.
125
  * Don't use functions from misc.php as loading it too early can cause fatal errors.
126
  * Don't hardcode an English string in the JS, use the translated string instead.
127
+ * Properly skip dot files, should fix fatal errors on systems with `open_basedir` restrictions.
128
+ * Don't call `apache_mod_loaded` as it caused wierd DNS issue on some sites, use `global $is_apache` instead.
129
+ * Fix a possible double full stop at the end of the schedule sentence.
130
  * Minor code cleanup.
131
 
132
  #### 2.1
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.11
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
@@ -70,6 +70,9 @@ if ( version_compare( get_bloginfo( 'version' ), '3.1', '>=' ) ) {
70
 
71
  require( WPRP_PLUGIN_PATH . '/backupwordpress/plugin.php' );
72
 
 
 
 
73
  require_once( WPRP_PLUGIN_PATH . '/wprp.backups.php' );
74
 
75
  }
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.12
7
  Author: Human Made Limited
8
  Author URI: http://hmn.md/
9
  */
70
 
71
  require( WPRP_PLUGIN_PATH . '/backupwordpress/plugin.php' );
72
 
73
+ // Set the correct path for the BackUpWordPress language files.
74
+ load_plugin_textdomain( 'hmbkp', false, '/wpremote/' . HMBKP_PLUGIN_SLUG . '/languages/' );
75
+
76
  require_once( WPRP_PLUGIN_PATH . '/wprp.backups.php' );
77
 
78
  }
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.11
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,12 @@ You can email us at support@wpremote.com for support.
31
 
32
  == Changelog ==
33
 
 
 
 
 
 
 
34
  #### 2.4.10 + 2.4.11
35
 
36
  * Plugin release shenaningans.
3
  Tags: wpremote, remote administration, multiple wordpress
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
+ Stable tag: 2.4.12
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.12
35
+
36
+ * Upgrade bundled BackUpWordPress to 2.1.3.
37
+ * Fix an issue with Download Site on Apache servers.
38
+ * Set the correct location for the BackUpWordPress language files.
39
+
40
  #### 2.4.10 + 2.4.11
41
 
42
  * Plugin release shenaningans.