UpdraftPlus WordPress Backup Plugin - Version 1.2.17

Version Description

  • 01/11/2013 =
  • Revert DropBox to CURL-only until we fix a remaining bug with WordPress's built-in methods
  • Fix unnecessary repetition of database dump upon resumption of a failed backup
Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 UpdraftPlus WordPress Backup Plugin
Version 1.2.17
Comparing to
See all releases

Code changes from version 1.2.16 to 1.2.17

Files changed (3) hide show
  1. methods/dropbox.php +5 -4
  2. readme.txt +6 -2
  3. updraftplus.php +14 -7
methods/dropbox.php CHANGED
@@ -149,6 +149,7 @@ class UpdraftPlus_BackupModule_dropbox {
149
  <tr class="updraftplusmethod dropbox">
150
  <th></th>
151
  <td>
 
152
  <?php
153
  // Check requirements. No need to check curl as we now use WP's built-in HTTP functions
154
  if (!function_exists('mcrypt_encrypt')) {
@@ -241,8 +242,8 @@ class UpdraftPlus_BackupModule_dropbox {
241
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/StorageInterface.php');
242
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/Encrypter.php');
243
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/WordPress.php');
244
- // require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/Curl.php');
245
- require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/WordPress.php');
246
 
247
  // Set the callback URL
248
  $callback = admin_url('options-general.php?page=updraftplus&action=updraftmethod-dropbox-auth');
@@ -253,8 +254,8 @@ class UpdraftPlus_BackupModule_dropbox {
253
  // Instantiate the storage
254
  $storage = new Dropbox_WordPress($encrypter, "updraft_dropboxtk_");
255
 
256
- $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
257
- // $OAuth = new Dropbox_Curl($key, $secret, $storage, $callback);
258
  return new Dropbox_API($OAuth);
259
  }
260
 
149
  <tr class="updraftplusmethod dropbox">
150
  <th></th>
151
  <td>
152
+ <p><strong>Warning:</strong> UpdraftPlus's DropBox support cannot yet upload anything bigger than 150Mb. If any of your created dumps (plugins, themes, content, database) exceed this, then you cannot use DropBox. We are working on it!</p>
153
  <?php
154
  // Check requirements. No need to check curl as we now use WP's built-in HTTP functions
155
  if (!function_exists('mcrypt_encrypt')) {
242
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/StorageInterface.php');
243
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/Encrypter.php');
244
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Storage/WordPress.php');
245
+ require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/Curl.php');
246
+ // require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/WordPress.php');
247
 
248
  // Set the callback URL
249
  $callback = admin_url('options-general.php?page=updraftplus&action=updraftmethod-dropbox-auth');
254
  // Instantiate the storage
255
  $storage = new Dropbox_WordPress($encrypter, "updraft_dropboxtk_");
256
 
257
+ // $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
258
+ $OAuth = new Dropbox_Curl($key, $secret, $storage, $callback);
259
  return new Dropbox_API($OAuth);
260
  }
261
 
readme.txt CHANGED
@@ -3,12 +3,12 @@ Contributors: David Anderson
3
  Tags: backup, restore, database, cloud, amazon, s3, Amazon S3, DropBox, DropBox backup, google drive, google, gdrive, ftp, cloud, updraft, back up
4
  Requires at least: 3.2
5
  Tested up to: 3.5
6
- Stable tag: 1.2.16
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
10
  == Upgrade Notice ==
11
- Fixed bug with deletion of some old S3 backups
12
 
13
  == Description ==
14
 
@@ -112,6 +112,10 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
112
 
113
  == Changelog ==
114
 
 
 
 
 
115
  = 1.2.14 - 01/08/2013 =
116
  * DropBox support (no chunked uploading yet, but otherwise complete)
117
  * Make the creation of the database dump also resumable, for people with really slow servers
3
  Tags: backup, restore, database, cloud, amazon, s3, Amazon S3, DropBox, DropBox backup, google drive, google, gdrive, ftp, cloud, updraft, back up
4
  Requires at least: 3.2
5
  Tested up to: 3.5
6
+ Stable tag: 1.2.17
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
10
  == Upgrade Notice ==
11
+ Revert DropBox method to fix broken uploads
12
 
13
  == Description ==
14
 
112
 
113
  == Changelog ==
114
 
115
+ = 1.2.17 - 01/11/2013 =
116
+ * Revert DropBox to CURL-only until we fix a remaining bug with WordPress's built-in methods
117
+ * Fix unnecessary repetition of database dump upon resumption of a failed backup
118
+
119
  = 1.2.14 - 01/08/2013 =
120
  * DropBox support (no chunked uploading yet, but otherwise complete)
121
  * Make the creation of the database dump also resumable, for people with really slow servers
updraftplus.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: UpdraftPlus - Backup/Restore
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Backup and restore: All your content and your DB can be automatically backed up to Amazon S3, DropBox, Google Drive, FTP, or emailed, on separate schedules.
6
  Author: David Anderson.
7
- Version: 1.2.16
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
@@ -13,9 +13,10 @@ Author URI: http://wordshell.net
13
  /*
14
  TODO
15
  //Add Box.Net and Microsoft Skydrive support??
16
- //improve error reporting / pretty up return messages in admin area
17
  //?? On 'backup now', open up a Lightbox, count down 5 seconds, then start examining the log file (if it can be found)
18
  //Should make clear in dashboard what is a non-fatal error (i.e. can be retried) - leads to unnecessary bug reports
 
19
 
20
  Encrypt filesystem, if memory allows (and have option for abort if not); split up into multiple zips when needed
21
  // Does not delete old custom directories upon a restore?
@@ -57,7 +58,7 @@ define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
57
 
58
  class UpdraftPlus {
59
 
60
- var $version = '1.2.16';
61
 
62
  // Choices will be shown in the admin menu in the order used here
63
  var $backup_methods = array (
@@ -181,13 +182,17 @@ class UpdraftPlus {
181
  $backup_database = get_transient("updraft_backdb_".$bnonce);
182
 
183
  // The transient is read and written below (instead of using the existing variable) so that we can copy-and-paste this part as needed.
184
- if ($backup_database) {
185
- $this->log("Beginning backup of database");
186
  $db_backup = $this->backup_db();
187
  if(is_array($our_files)) $our_files['db'] = $db_backup;
188
  $backup_contains = get_transient("updraft_backupcontains_".$this->nonce);
189
  $backup_contains = (substr($backup_contains,0,10) == "Files only") ? "Files and database" : "Database only (no files)";
190
  set_transient("updraft_backupcontains_".$this->nonce, $backup_contains, 3600*3);
 
 
 
 
191
  }
192
 
193
  // Save this to our history so we can track backups for the retain feature
@@ -203,6 +208,7 @@ class UpdraftPlus {
203
 
204
  foreach ($our_files as $key => $file) {
205
 
 
206
  $hash = md5($file);
207
  $fullpath = trailingslashit(get_option('updraft_dir')).$file;
208
  if (get_transient('updraft_'.$hash) === "yes") {
@@ -291,7 +297,7 @@ class UpdraftPlus {
291
 
292
  // Log some information that may be helpful
293
  global $wp_version;
294
- $this->log("PHP version: ".phpversion()." (".php_uname().") WordPress version: ".$wp_version." Updraft version: ".$this->version." PHP Max Execution Time: ".ini_get("max_execution_time")." Backup files: $backup_files (schedule: ".get_option('updraft_interval','unset').") Backup DB: $backup_database (schedule: ".get_option('updraft_interval_database','unset').")");
295
 
296
  # If the files and database schedules are the same, and if this the file one, then we rope in database too.
297
  # On the other hand, if the schedules were the same and this was the database run, then there is nothing to do.
@@ -336,7 +342,7 @@ class UpdraftPlus {
336
  }
337
 
338
  // Save what *should* be done, to make it resumable from this point on
339
- set_transient("updraft_backdb_".$this->nonce, $backup_database, 3600*3);
340
  // Save this to our history so we can track backups for the retain feature
341
  $this->log("Saving backup history");
342
  $this->save_backup_history($backup_array);
@@ -351,6 +357,7 @@ class UpdraftPlus {
351
  $backup_contains = get_transient("updraft_backupcontains_".$this->nonce);
352
  $backup_contains = (substr($backup_contains,0,10) == "Files only") ? "Files and database" : "Database only (no files)";
353
  set_transient("updraft_backupcontains_".$this->nonce, $backup_contains, 3600*3);
 
354
  }
355
 
356
  $this->check_backup_race($backup_array);
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Backup and restore: All your content and your DB can be automatically backed up to Amazon S3, DropBox, Google Drive, FTP, or emailed, on separate schedules.
6
  Author: David Anderson.
7
+ Version: 1.2.17
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
13
  /*
14
  TODO
15
  //Add Box.Net and Microsoft Skydrive support??
16
+ //improve error reporting / pretty up return messages in admin area. One thing: have a "backup is now finished" flag. Otherwise with the resuming things get ambiguous/confusing. See http://wordpress.org/support/topic/backup-status - user was not aware that backup completely failed. Maybe a "backup status" field for each nonce that gets updated? (Even via AJAX?)
17
  //?? On 'backup now', open up a Lightbox, count down 5 seconds, then start examining the log file (if it can be found)
18
  //Should make clear in dashboard what is a non-fatal error (i.e. can be retried) - leads to unnecessary bug reports
19
+ //Eventually, when everything can be resumed, we will no longer need the backup() routine; it can be replaced with the resume() routine
20
 
21
  Encrypt filesystem, if memory allows (and have option for abort if not); split up into multiple zips when needed
22
  // Does not delete old custom directories upon a restore?
58
 
59
  class UpdraftPlus {
60
 
61
+ var $version = '1.2.17';
62
 
63
  // Choices will be shown in the admin menu in the order used here
64
  var $backup_methods = array (
182
  $backup_database = get_transient("updraft_backdb_".$bnonce);
183
 
184
  // The transient is read and written below (instead of using the existing variable) so that we can copy-and-paste this part as needed.
185
+ if ($backup_database == "begun") {
186
+ $this->log("Resuming creation of database dump");
187
  $db_backup = $this->backup_db();
188
  if(is_array($our_files)) $our_files['db'] = $db_backup;
189
  $backup_contains = get_transient("updraft_backupcontains_".$this->nonce);
190
  $backup_contains = (substr($backup_contains,0,10) == "Files only") ? "Files and database" : "Database only (no files)";
191
  set_transient("updraft_backupcontains_".$this->nonce, $backup_contains, 3600*3);
192
+ } elseif ($backup_database == "finished") {
193
+ $this->log("Database dump: Creation was completed already");
194
+ } else {
195
+ $this->log("Unrecognised data when trying to ascertain if the database was backed up ($backup_database)");
196
  }
197
 
198
  // Save this to our history so we can track backups for the retain feature
208
 
209
  foreach ($our_files as $key => $file) {
210
 
211
+ if ($key == 'nonce') { continue; }
212
  $hash = md5($file);
213
  $fullpath = trailingslashit(get_option('updraft_dir')).$file;
214
  if (get_transient('updraft_'.$hash) === "yes") {
297
 
298
  // Log some information that may be helpful
299
  global $wp_version;
300
+ $this->log("PHP version: ".phpversion()." (".@php_uname().") WordPress version: ".$wp_version." Updraft version: ".$this->version." PHP Max Execution Time: ".@ini_get("max_execution_time")." Backup files: $backup_files (schedule: ".get_option('updraft_interval','unset').") Backup DB: $backup_database (schedule: ".get_option('updraft_interval_database','unset').")");
301
 
302
  # If the files and database schedules are the same, and if this the file one, then we rope in database too.
303
  # On the other hand, if the schedules were the same and this was the database run, then there is nothing to do.
342
  }
343
 
344
  // Save what *should* be done, to make it resumable from this point on
345
+ set_transient("updraft_backdb_".$this->nonce, "begun", 3600*3);
346
  // Save this to our history so we can track backups for the retain feature
347
  $this->log("Saving backup history");
348
  $this->save_backup_history($backup_array);
357
  $backup_contains = get_transient("updraft_backupcontains_".$this->nonce);
358
  $backup_contains = (substr($backup_contains,0,10) == "Files only") ? "Files and database" : "Database only (no files)";
359
  set_transient("updraft_backupcontains_".$this->nonce, $backup_contains, 3600*3);
360
+ set_transient("updraft_backdb_".$this->nonce, "finished", 3600*3);
361
  }
362
 
363
  $this->check_backup_race($backup_array);