BackUpWordPress - Version 2.0.2

Version Description

Download this release

Release Info

Developer willmot
Plugin Icon 128x128 BackUpWordPress
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0 to 2.0.2

admin/actions.php CHANGED
@@ -89,7 +89,7 @@ function hmbkp_request_cancel_backup() {
89
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_GET['hmbkp_schedule_id'] ) );
90
 
91
  // Delete the running backup
92
- if ( file_exists( trailingslashit( hmbkp_path() ) . $schedule->get_running_backup_filename() ) )
93
  unlink( trailingslashit( hmbkp_path() ) . $schedule->get_running_backup_filename() );
94
 
95
  hmbkp_cleanup();
@@ -166,7 +166,7 @@ function hmbkp_ajax_cron_test() {
166
 
167
  $response = wp_remote_get( site_url( 'wp-cron.php' ) );
168
 
169
- if ( ! is_wp_error( $response ) && $response['response']['code'] != '200' )
170
  echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled back ups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . $response['response']['code'] . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
171
 
172
  else
89
  $schedule = new HMBKP_Scheduled_Backup( urldecode( $_GET['hmbkp_schedule_id'] ) );
90
 
91
  // Delete the running backup
92
+ if ( $schedule->get_running_backup_filename() && file_exists( trailingslashit( hmbkp_path() ) . $schedule->get_running_backup_filename() ) )
93
  unlink( trailingslashit( hmbkp_path() ) . $schedule->get_running_backup_filename() );
94
 
95
  hmbkp_cleanup();
166
 
167
  $response = wp_remote_get( site_url( 'wp-cron.php' ) );
168
 
169
+ if ( is_wp_error( $response ) || $response['response']['code'] !== 200 )
170
  echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'hmbkp' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled back ups. See the %3$s for more details.', 'hmbkp' ), '<code>wp-cron.php</code>', '<code>' . $response['response']['code'] . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
171
 
172
  else
classes/email.php CHANGED
@@ -114,7 +114,7 @@ class HMBKP_Email_Service extends HMBKP_Service {
114
  $headers = 'From: BackUpWordPress <' . get_bloginfo( 'admin_email' ) . '>' . "\r\n";
115
 
116
  // The backup failed, send a message saying as much
117
- if ( file_exists( $file ) && ( $errors = array_merge( $this->schedule->get_errors(), $this->schedule->get_warnings() ) ) ) {
118
 
119
  $error_message = '';
120
 
114
  $headers = 'From: BackUpWordPress <' . get_bloginfo( 'admin_email' ) . '>' . "\r\n";
115
 
116
  // The backup failed, send a message saying as much
117
+ if ( ! file_exists( $file ) && ( $errors = array_merge( $this->schedule->get_errors(), $this->schedule->get_warnings() ) ) ) {
118
 
119
  $error_message = '';
120
 
functions/interface.php CHANGED
@@ -110,7 +110,7 @@ function hmbkp_admin_notices() {
110
  function hmbkp_backup_failed_notice() {
111
  echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress failed to perform the backup.', 'hmbkp' ) . '</strong> ' . __( 'You have likely hit a memory limit.', 'hmbkp' ) . '<a href="' . add_query_arg( 'action', 'hmbkp_dismiss_error' ) . '" style="float: right;" class="button">Dismiss</a></p></div>';
112
  }
113
- add_action( 'admin_notices', 'hmbkp_backup_failed_notice' );
114
 
115
  endif;
116
 
@@ -178,11 +178,11 @@ function hmbkp_file_list( HMBKP_Scheduled_Backup $schedule, $excludes = null, $f
178
 
179
  <?php if ( $file->isDir() ) { ?>
180
 
181
- <li title="<?php echo esc_attr( $schedule::conform_dir( trailingslashit( $file->getPathName() ) ) ); ?>"><?php echo trailingslashit( str_ireplace( $schedule::conform_dir( trailingslashit( $schedule->get_root() ) ), '', $schedule::conform_dir( $file->getPathName() ) ) ); ?></li>
182
 
183
  <?php } else { ?>
184
 
185
- <li title="<?php echo esc_attr( $schedule::conform_dir( $file->getPathName() ) ); ?>"><?php echo str_ireplace( $schedule::conform_dir( trailingslashit( $schedule->get_root() ) ), '', $schedule::conform_dir( $file->getPathName() ) ); ?></li>
186
 
187
  <?php }
188
 
110
  function hmbkp_backup_failed_notice() {
111
  echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress failed to perform the backup.', 'hmbkp' ) . '</strong> ' . __( 'You have likely hit a memory limit.', 'hmbkp' ) . '<a href="' . add_query_arg( 'action', 'hmbkp_dismiss_error' ) . '" style="float: right;" class="button">Dismiss</a></p></div>';
112
  }
113
+ //add_action( 'admin_notices', 'hmbkp_backup_failed_notice' );
114
 
115
  endif;
116
 
178
 
179
  <?php if ( $file->isDir() ) { ?>
180
 
181
+ <li title="<?php echo esc_attr( HM_Backup::conform_dir( trailingslashit( $file->getPathName() ) ) ); ?>"><?php echo trailingslashit( str_ireplace( HM_Backup::conform_dir( trailingslashit( $schedule->get_root() ) ), '', HM_Backup::conform_dir( $file->getPathName() ) ) ); ?></li>
182
 
183
  <?php } else { ?>
184
 
185
+ <li title="<?php echo esc_attr( HM_Backup::conform_dir( $file->getPathName() ) ); ?>"><?php echo str_ireplace( HM_Backup::conform_dir( trailingslashit( $schedule->get_root() ) ), '', HM_Backup::conform_dir( $file->getPathName() ) ); ?></li>
186
 
187
  <?php }
188