UpdraftPlus WordPress Backup Plugin - Version 0.8.33

Version Description

  • 09/19/2012 =
  • Work around some web hosts with invalid safe_mode configurations
Download this release

Release Info

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

Code changes from version 0.8.28 to 0.8.33

Files changed (2) hide show
  1. readme.txt +18 -4
  2. updraftplus.php +13 -10
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
  === UpdraftPlus ===
2
  Contributors: David Anderson
3
- Tags: backup, restore, database, cloud, amazon, s3, google drive, google, gdrive, ftp, cloud, updraft, back up
4
  Requires at least: 3.2
5
  Tested up to: 3.4.2
6
- Stable tag: 0.8.28
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv2 or later
9
 
10
  == Description ==
11
 
12
- UpdraftPlus simplifies backups (and restoration) for your blog. Backup into the cloud (S3, Google Drive, FTP, and email) and restore with a single click. Backups of files and database can be upon separate schedules.
13
 
14
  == Upgrade Notice ==
15
- Added separate schedules and Google Drive support
16
 
17
  == Installation ==
18
 
@@ -47,6 +47,20 @@ Contact me! This is a complex plugin and the only way I can ensure it's robust i
47
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  = 0.8.28 - 06/06/2012 =
51
  * Now experimentally supports Google Drive (thanks to Sorin Iclanzan, code re-used from his Google Drive-only 'backup' plugin)
52
  * New feature: backup files and database on separate schedules
1
  === UpdraftPlus ===
2
  Contributors: David Anderson
3
+ Tags: backup, restore, database, cloud, amazon, s3, Amazon S3, google drive, google, gdrive, ftp, cloud, updraft, back up
4
  Requires at least: 3.2
5
  Tested up to: 3.4.2
6
+ Stable tag: 0.8.33
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv2 or later
9
 
10
  == Description ==
11
 
12
+ UpdraftPlus simplifies backups (and restoration). Backup into the cloud (S3, Google Drive, FTP, and email) and restore with a single click. Backups of files and database can have separate schedules.
13
 
14
  == Upgrade Notice ==
15
+ Some web hosts set safe_mode=Off, which is an invalid value and causes surprises
16
 
17
  == Installation ==
18
 
47
 
48
  == Changelog ==
49
 
50
+ = 0.8.33 - 09/19/2012 =
51
+ * Work around some web hosts with invalid safe_mode configurations
52
+
53
+ = 0.8.32 - 09/17/2012 =
54
+ * Fix a subtle bug that caused database tables from outside of this WordPress install to be backed up
55
+
56
+ = 0.8.31 - 09/08/2012 =
57
+ * Fixed error deleting old S3 backups. If your expired S3 backups were not deleted, they should be in future - but you will need to delete manually those that expired before you installed this update.
58
+ * Fixed minor bug closing log file
59
+ * Marked as working with WordPress 3.4.2
60
+
61
+ = 0.8.29 - 06/29/2012 =
62
+ * Marking as tested up to WordPress 3.4.1
63
+
64
  = 0.8.28 - 06/06/2012 =
65
  * Now experimentally supports Google Drive (thanks to Sorin Iclanzan, code re-used from his Google Drive-only 'backup' plugin)
66
  * New feature: backup files and database on separate schedules
updraftplus.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: UpdraftPlus - Backup/Restore
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Uploads, themes, plugins, and your DB can be automatically backed up to Amazon S3, Google Drive, FTP, or emailed. Files and DB can be on separate schedules.
6
  Author: David Anderson.
7
- Version: 0.8.28
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  Author URI: http://wordshell.net
10
  */
@@ -54,7 +54,7 @@ if(!$updraft->memory_check(192)) {
54
 
55
  class UpdraftPlus {
56
 
57
- var $version = '0.8.28';
58
 
59
  var $dbhandle;
60
  var $errors = array();
@@ -555,7 +555,7 @@ class UpdraftPlus {
555
  }
556
 
557
  // Close log file
558
- close($this->logfile_handle);
559
  if (!get_option('updraft_debug_mode')) { @unlink($this->logfile_name); }
560
  }
561
 
@@ -652,7 +652,7 @@ class UpdraftPlus {
652
  @unlink($fullpath); //delete it if it's locally available
653
  if ($updraft_service == "s3") {
654
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file");
655
- if (!$remote_object->deleteObject($bucket_name, $file)) {
656
  $this->error("S3 Error: Failed to delete object $file. Error was ".$php_errormsg);
657
  }
658
  } elseif ($updraft_service == "ftp") {
@@ -669,7 +669,7 @@ class UpdraftPlus {
669
  @unlink($fullpath); //delete it if it's locally available
670
  if ($updraft_service == "s3") {
671
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file2");
672
- if (!$remote_object->deleteObject($bucket_name, $file2)) {
673
  $this->error("S3 Error: Failed to delete object $file2. Error was ".$php_errormsg);
674
  }
675
  } elseif ($updraft_service == "ftp") {
@@ -687,7 +687,7 @@ class UpdraftPlus {
687
  @unlink($fullpath); //delete it if it's locally available
688
  if ($updraft_service == "s3") {
689
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file3");
690
- if (!$remote_object->deleteObject($bucket_name, $file3)) {
691
  $this->error("S3 Error: Failed to delete object $file3. Error was ".$php_errormsg);
692
  }
693
  } elseif ($updraft_service == "ftp") {
@@ -928,12 +928,14 @@ class UpdraftPlus {
928
  $this->stow("/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");
929
  $this->stow("/*!40101 SET NAMES " . DB_CHARSET . " */;\n");
930
  }
 
931
 
932
  foreach ($all_tables as $table) {
933
  $total_tables++;
934
  // Increase script execution time-limit to 15 min for every table.
935
- if ( !ini_get('safe_mode')) @set_time_limit(15*60);
936
- if ( strpos($table, $table_prefix) == 0 ) {
 
937
  // Create the SQL statements
938
  $this->stow("# --------------------------------------------------------\n");
939
  $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n");
@@ -1085,7 +1087,7 @@ class UpdraftPlus {
1085
  $where = ' WHERE post_type != "revision"';
1086
  }
1087
 
1088
- if ( !ini_get('safe_mode')) @set_time_limit(15*60);
1089
  $table_data = $wpdb->get_results("SELECT * FROM $table $where LIMIT {$row_start}, {$row_inc}", ARRAY_A);
1090
  $entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES (';
1091
  // \x08\\x09, not required
@@ -1398,7 +1400,8 @@ class UpdraftPlus {
1398
  }
1399
  }
1400
  echo '</div>'; //close the updraft_restore_progress div
1401
- if(ini_get('safe_mode')) {
 
1402
  echo "<p>DB could not be restored because safe_mode is active on your server. You will need to manually restore the file via phpMyAdmin or another method.</p><br/>";
1403
  return false;
1404
  }
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Uploads, themes, plugins, and your DB can be automatically backed up to Amazon S3, Google Drive, FTP, or emailed. Files and DB can be on separate schedules.
6
  Author: David Anderson.
7
+ Version: 0.8.33
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  Author URI: http://wordshell.net
10
  */
54
 
55
  class UpdraftPlus {
56
 
57
+ var $version = '0.8.33';
58
 
59
  var $dbhandle;
60
  var $errors = array();
555
  }
556
 
557
  // Close log file
558
+ @fclose($this->logfile_handle);
559
  if (!get_option('updraft_debug_mode')) { @unlink($this->logfile_name); }
560
  }
561
 
652
  @unlink($fullpath); //delete it if it's locally available
653
  if ($updraft_service == "s3") {
654
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file");
655
+ if (!$remote_object->deleteObject($remote_path, $file)) {
656
  $this->error("S3 Error: Failed to delete object $file. Error was ".$php_errormsg);
657
  }
658
  } elseif ($updraft_service == "ftp") {
669
  @unlink($fullpath); //delete it if it's locally available
670
  if ($updraft_service == "s3") {
671
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file2");
672
+ if (!$remote_object->deleteObject($remote_path, $file2)) {
673
  $this->error("S3 Error: Failed to delete object $file2. Error was ".$php_errormsg);
674
  }
675
  } elseif ($updraft_service == "ftp") {
687
  @unlink($fullpath); //delete it if it's locally available
688
  if ($updraft_service == "s3") {
689
  $this->log("$backup_datestamp: Delete remote: s3://$remote_path/$file3");
690
+ if (!$remote_object->deleteObject($remote_path, $file3)) {
691
  $this->error("S3 Error: Failed to delete object $file3. Error was ".$php_errormsg);
692
  }
693
  } elseif ($updraft_service == "ftp") {
928
  $this->stow("/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");
929
  $this->stow("/*!40101 SET NAMES " . DB_CHARSET . " */;\n");
930
  }
931
+ $this->stow("/*!40101 SET foreign_key_checks = 0 */;\n");
932
 
933
  foreach ($all_tables as $table) {
934
  $total_tables++;
935
  // Increase script execution time-limit to 15 min for every table.
936
+ if ( !ini_get('safe_mode') || strtolower(ini_get('safe_mode')) == "off") @set_time_limit(15*60);
937
+ # === is needed, otherwise 'false' matches (i.e. prefix does not match)
938
+ if ( strpos($table, $table_prefix) === 0 ) {
939
  // Create the SQL statements
940
  $this->stow("# --------------------------------------------------------\n");
941
  $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n");
1087
  $where = ' WHERE post_type != "revision"';
1088
  }
1089
 
1090
+ if ( !ini_get('safe_mode') || strtolower(ini_get('safe_mode')) == "off") @set_time_limit(15*60);
1091
  $table_data = $wpdb->get_results("SELECT * FROM $table $where LIMIT {$row_start}, {$row_inc}", ARRAY_A);
1092
  $entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES (';
1093
  // \x08\\x09, not required
1400
  }
1401
  }
1402
  echo '</div>'; //close the updraft_restore_progress div
1403
+ # The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
1404
+ if(ini_get('safe_mode') && strtolower(ini_get('safe_mode')) != "off") {
1405
  echo "<p>DB could not be restored because safe_mode is active on your server. You will need to manually restore the file via phpMyAdmin or another method.</p><br/>";
1406
  return false;
1407
  }