BackUpWordPress - Version 1.0.3

Version Description

Download this release

Release Info

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

Code changes from version 1.0.2 to 1.0.3

admin.actions.php CHANGED
@@ -15,7 +15,7 @@ function hmbkp_request_delete_backup() {
15
  exit;
16
 
17
  }
18
- add_action( 'load-tools_page_backupswordpress', 'hmbkp_request_delete_backup' );
19
 
20
  /**
21
  * Schedule a one time backup and then
@@ -43,7 +43,7 @@ function hmbkp_request_do_backup() {
43
  exit;
44
 
45
  }
46
- add_action( 'load-tools_page_backupswordpress', 'hmbkp_request_do_backup' );
47
 
48
  /**
49
  * Send the download file to the browser and
@@ -57,7 +57,7 @@ function hmbkp_request_download_backup() {
57
  hmbkp_send_file( base64_decode( $_GET['hmbkp_download'] ) );
58
 
59
  }
60
- add_action( 'load-tools_page_backupswordpress', 'hmbkp_request_download_backup' );
61
 
62
  function hmbkp_ajax_is_backup_in_progress() {
63
  echo (int) hmbkp_is_in_progress();
15
  exit;
16
 
17
  }
18
+ add_action( 'load-tools_page_' . HMBKP_PLUGIN_SLUG, 'hmbkp_request_delete_backup' );
19
 
20
  /**
21
  * Schedule a one time backup and then
43
  exit;
44
 
45
  }
46
+ add_action( 'load-tools_page_' . HMBKP_PLUGIN_SLUG, 'hmbkp_request_do_backup' );
47
 
48
  /**
49
  * Send the download file to the browser and
57
  hmbkp_send_file( base64_decode( $_GET['hmbkp_download'] ) );
58
 
59
  }
60
+ add_action( 'load-tools_page_' . HMBKP_PLUGIN_SLUG, 'hmbkp_request_download_backup' );
61
 
62
  function hmbkp_ajax_is_backup_in_progress() {
63
  echo (int) hmbkp_is_in_progress();
admin.menus.php CHANGED
@@ -5,7 +5,7 @@
5
  * to the tools menu
6
  */
7
  function hmbkp_admin_menu() {
8
- add_management_page( __( 'Manage Backups','hmbkp' ), __( 'Backups','hmbkp' ), 'manage_options', 'backupswordpress', 'hmbkp_manage_backups' );
9
  }
10
  add_action( 'admin_menu', 'hmbkp_admin_menu' );
11
 
5
  * to the tools menu
6
  */
7
  function hmbkp_admin_menu() {
8
+ add_management_page( __( 'Manage Backups','hmbkp' ), __( 'Backups','hmbkp' ), 'manage_options', HMBKP_PLUGIN_SLUG, 'hmbkp_manage_backups' );
9
  }
10
  add_action( 'admin_menu', 'hmbkp_admin_menu' );
11
 
admin.page.php CHANGED
@@ -58,7 +58,7 @@
58
 
59
  <?php if ( count( $backup_archives ) >= get_option( 'hmbkp_max_backups' ) ) : ?>
60
 
61
- <p class="howto"><?php printf( _n( '* Only the latest backup is saved.', '* Only the latest %d backups are saved.', get_option( 'hmbkp_max_backups' ), 'hmbkp' ) ); ?></p>
62
 
63
  <?php endif; ?>
64
 
58
 
59
  <?php if ( count( $backup_archives ) >= get_option( 'hmbkp_max_backups' ) ) : ?>
60
 
61
+ <p class="howto"><?php printf( _n( '* Only the latest backup is saved.', '* Only the latest %d backups are saved.', (int) get_option( 'hmbkp_max_backups' ), 'hmbkp' ) ); ?></p>
62
 
63
  <?php endif; ?>
64
 
assets/hmbkp.js CHANGED
@@ -22,7 +22,7 @@ function hmbkpRedirectOnBackupComplete() {
22
  if ( data == 0 )
23
  location.reload( true );
24
  else
25
- setTimeout( 'hmbkpRedirectOnBackupComplete();', 1000 );
26
  }
27
  );
28
 
22
  if ( data == 0 )
23
  location.reload( true );
24
  else
25
+ setTimeout( 'hmbkpRedirectOnBackupComplete();', 5000 );
26
  }
27
  );
28
 
functions/core.functions.php CHANGED
@@ -15,11 +15,25 @@ function hmbkp_activate() {
15
  * Removes options and clears all cron schedules
16
  *
17
  * @todo remove all hmbkp_ options
18
- * @todo remove all old bkpwp_ options
19
  * @return void
20
  */
21
  function hmbkp_deactivate() {
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  // Clear crons
24
  wp_clear_scheduled_hook( 'hmbkp_schedule_backup_hook' );
25
 
@@ -34,6 +48,9 @@ function hmbkp_deactivate() {
34
  */
35
  function hmbkp_update() {
36
 
 
 
 
37
  // Update from backUpWordPress
38
  if ( get_option( 'bkpwp_max_backups' ) ) :
39
 
@@ -323,7 +340,7 @@ function hmbkp_calculate() {
323
 
324
  foreach ( $files as $f ) :
325
  $str = hmbkp_conform_dir( $f, true );
326
- $filesize += filesize( $f );
327
  endforeach;
328
 
329
  // Cache in a transient for a day
15
  * Removes options and clears all cron schedules
16
  *
17
  * @todo remove all hmbkp_ options
 
18
  * @return void
19
  */
20
  function hmbkp_deactivate() {
21
 
22
+ // Delete options
23
+ $options = array(
24
+ 'hmbkp_zip_path',
25
+ 'hmbkp_mysqldump_path',
26
+ 'hmbkp_path',
27
+ 'hmbkp_max_backups',
28
+ 'hmbkp_running',
29
+ '_transient_hmbkp_estimated_filesize',
30
+ '_transient_timeout_hmbkp_estimated_filesize'
31
+ );
32
+
33
+ foreach ( $options as $option )
34
+ delete_option( $option );
35
+
36
+
37
  // Clear crons
38
  wp_clear_scheduled_hook( 'hmbkp_schedule_backup_hook' );
39
 
48
  */
49
  function hmbkp_update() {
50
 
51
+ if ( !get_option( 'hmbkp_max_backups' ) )
52
+ hmbkp_set_defaults();
53
+
54
  // Update from backUpWordPress
55
  if ( get_option( 'bkpwp_max_backups' ) ) :
56
 
340
 
341
  foreach ( $files as $f ) :
342
  $str = hmbkp_conform_dir( $f, true );
343
+ $filesize += @filesize( $f );
344
  endforeach;
345
 
346
  // Cache in a transient for a day
functions/interface.functions.php CHANGED
@@ -22,8 +22,8 @@ function hmbkp_get_backup_row( $file ) {
22
 
23
  <td>
24
 
25
- <a href="tools.php?page=backupswordpress&amp;hmbkp_download=<?php echo $encode; ?>"><?php _e( 'Download', 'hmbkp' ); ?></a> |
26
- <a href="tools.php?page=backupswordpress&amp;hmbkp_delete=<?php echo $encode ?>"><?php _e( 'Delete', 'hmbkp' ); ?></a>
27
 
28
  </td>
29
 
22
 
23
  <td>
24
 
25
+ <a href="tools.php?page=<?php echo HMBKP_PLUGIN_SLUG; ?>&amp;hmbkp_download=<?php echo $encode; ?>"><?php _e( 'Download', 'hmbkp' ); ?></a> |
26
+ <span class="submitdelete"><a href="tools.php?page=<?php echo HMBKP_PLUGIN_SLUG; ?>&amp;hmbkp_delete=<?php echo $encode ?>"><?php _e( 'Delete', 'hmbkp' ); ?></a></span>
27
 
28
  </td>
29
 
plugin.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: BackUpWordPress
5
  Plugin URI: http://humanmade.co.uk/
6
  Description: Simple automated backups of your WordPress powered website.
7
  Author: Human Made Limited
8
- Version: 1.0.2
9
  Author URI: http://humanmade.co.uk/
10
  */
11
 
@@ -28,19 +28,22 @@ Author URI: http://humanmade.co.uk/
28
 
29
  // TODO use wp_filesystem
30
  // TODO try to use zipArchive before pclzip
31
- // TODO get rid of schedules
32
 
33
- define( 'HMBKP_PLUGIN_PATH', trailingslashit( dirname( __FILE__ ) ) );
34
- define( 'HMBKP_PLUGIN_URL', str_replace( ABSPATH, get_bloginfo( 'url' ) . '/', HMBKP_PLUGIN_PATH ) );
 
35
 
36
  // Load the admin actions file
37
  function hmbkp_actions() {
38
 
 
39
  hmbkp_update();
40
 
41
  require_once( HMBKP_PLUGIN_PATH . '/admin.actions.php' );
42
-
43
- if ( isset( $_GET['page'] ) && $_GET['page'] == 'backupswordpress' ) :
 
44
  wp_enqueue_script( 'hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.js' );
45
  wp_enqueue_style( 'hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.css' );
46
  endif;
@@ -63,8 +66,8 @@ require_once( HMBKP_PLUGIN_PATH . '/functions/backup.mysql.fallback.functions.ph
63
  require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.fallback.functions.php' );
64
 
65
  // Plugin activation and deactivation
66
- add_action( 'activate_backupwordpress/plugin.php', 'hmbkp_activate' );
67
- add_action( 'deactivate_backupwordpress/plugin.php', 'hmbkp_deactivate' );
68
 
69
  // Add more cron schedules
70
  add_filter( 'cron_schedules', 'hmbkp_more_reccurences' );
5
  Plugin URI: http://humanmade.co.uk/
6
  Description: Simple automated backups of your WordPress powered website.
7
  Author: Human Made Limited
8
+ Version: 1.0.3
9
  Author URI: http://humanmade.co.uk/
10
  */
11
 
28
 
29
  // TODO use wp_filesystem
30
  // TODO try to use zipArchive before pclzip
31
+ // TODO get rid of schedules
32
 
33
+ define( 'HMBKP_PLUGIN_SLUG', 'backupwordpress' );
34
+ define( 'HMBKP_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . HMBKP_PLUGIN_SLUG );
35
+ define( 'HMBKP_PLUGIN_URL', WP_PLUGIN_URL . '/' . HMBKP_PLUGIN_SLUG );
36
 
37
  // Load the admin actions file
38
  function hmbkp_actions() {
39
 
40
+ // Fire the update action
41
  hmbkp_update();
42
 
43
  require_once( HMBKP_PLUGIN_PATH . '/admin.actions.php' );
44
+
45
+ // Load admin css and js
46
+ if ( isset( $_GET['page'] ) && $_GET['page'] == HMBKP_PLUGIN_SLUG ) :
47
  wp_enqueue_script( 'hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.js' );
48
  wp_enqueue_style( 'hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.css' );
49
  endif;
66
  require_once( HMBKP_PLUGIN_PATH . '/functions/backup.files.fallback.functions.php' );
67
 
68
  // Plugin activation and deactivation
69
+ add_action( 'activate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_activate' );
70
+ add_action( 'deactivate_' . HMBKP_PLUGIN_SLUG . '/plugin.php', 'hmbkp_deactivate' );
71
 
72
  // Add more cron schedules
73
  add_filter( 'cron_schedules', 'hmbkp_more_reccurences' );
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
- === BackUp WordPress ===
2
  Contributors: willmot, humanmade
3
  Tags: back up, backup, backups
4
  Requires at least: 3.0
5
  Tested up to: 3.1
6
- Stable tag: 1.0.2
7
 
8
  Simple automated backups of your WordPress powered website.
9
 
10
- BackUp WordPress will back up your entire site including your database and all your files once every day.
11
 
12
  == Installation ==
13
 
@@ -27,6 +27,16 @@ Contact hello@humanmade.co.uk for help and support
27
 
28
  == Changelog ==
29
 
 
 
 
 
 
 
 
 
 
 
30
  #### 1.0.1 & 1.0.2
31
 
32
  Fix some silly 1.0 bugs
1
+ === BackUpWordPress ===
2
  Contributors: willmot, humanmade
3
  Tags: back up, backup, backups
4
  Requires at least: 3.0
5
  Tested up to: 3.1
6
+ Stable tag: 1.0.3
7
 
8
  Simple automated backups of your WordPress powered website.
9
 
10
+ BackUpWordPress will back up your entire site including your database and all your files once every day.
11
 
12
  == Installation ==
13
 
27
 
28
  == Changelog ==
29
 
30
+ #### 1.0.3
31
+
32
+ Minor bug fix release.
33
+
34
+ * Suppress `filesize()` warnings when calculating backup size.
35
+ * Plugin should now work when symlinked.
36
+ * Remove all options on deactivate, you should now be able to deactivate then activate to fix issues with settings etc. becoming corrupt.
37
+ * Call setup_defaults for users who update from backupwordpress 0.4.5 so they get new settings.
38
+ * Don't ajax ping running backup status quite so often.
39
+
40
  #### 1.0.1 & 1.0.2
41
 
42
  Fix some silly 1.0 bugs