UpdraftPlus WordPress Backup Plugin - Version 1.2.11

Version Description

  • 01/08/2013 =
  • DropBox support (no chunked uploading yet, but otherwise complete)
  • Make the creation of the database dump also resumable, for people with really slow servers
  • Database table backups are now timed
Download this release

Release Info

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

Code changes from version 1.2.10 to 1.2.11

Files changed (2) hide show
  1. readme.txt +3 -2
  2. updraftplus.php +14 -15
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.10
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
@@ -112,9 +112,10 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
112
 
113
  == Changelog ==
114
 
115
- = 1.2.10 - 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
 
118
 
119
  = 1.1.16 - 01/07/2013 =
120
  * Requested feature: more frequent scheduling options requested
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.11
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
112
 
113
  == Changelog ==
114
 
115
+ = 1.2.11 - 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
118
+ * Database table backups are now timed
119
 
120
  = 1.1.16 - 01/07/2013 =
121
  * Requested feature: more frequent scheduling options requested
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: Uploads, themes, plugins, other 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.10
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
@@ -56,7 +56,7 @@ define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
56
 
57
  class UpdraftPlus {
58
 
59
- var $version = '1.2.10';
60
 
61
  // Choices will be shown in the admin menu in the order used here
62
  var $backup_methods = array (
@@ -906,6 +906,8 @@ class UpdraftPlus {
906
  function backup_table($table, $segment = 'none') {
907
  global $wpdb;
908
 
 
 
909
  $total_rows = 0;
910
 
911
  $table_structure = $wpdb->get_results("DESCRIBE $table");
@@ -952,24 +954,21 @@ class UpdraftPlus {
952
  $this->stow("#\n");
953
  }
954
 
 
955
  if(($segment == 'none') || ($segment >= 0)) {
956
  $defs = array();
957
- $ints = array();
 
958
  foreach ($table_structure as $struct) {
959
- if ( (0 === strpos($struct->Type, 'tinyint')) ||
960
- (0 === strpos(strtolower($struct->Type), 'smallint')) ||
961
- (0 === strpos(strtolower($struct->Type), 'mediumint')) ||
962
- (0 === strpos(strtolower($struct->Type), 'int')) ||
963
- (0 === strpos(strtolower($struct->Type), 'bigint')) ) {
964
  $defs[strtolower($struct->Field)] = ( null === $struct->Default ) ? 'NULL' : $struct->Default;
965
- $ints[strtolower($struct->Field)] = "1";
966
  }
967
  }
968
 
969
  // Batch by $row_inc
970
- if ( ! defined('ROWS_PER_SEGMENT') ) {
971
- define('ROWS_PER_SEGMENT', 100);
972
- }
973
 
974
  if($segment == 'none') {
975
  $row_start = 0;
@@ -981,7 +980,7 @@ class UpdraftPlus {
981
  do {
982
 
983
  if ( !ini_get('safe_mode') || strtolower(ini_get('safe_mode')) == "off") @set_time_limit(15*60);
984
- $table_data = $wpdb->get_results("SELECT * FROM $table $where LIMIT {$row_start}, {$row_inc}", ARRAY_A);
985
  $entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES (';
986
  // \x08\\x09, not required
987
  $search = array("\x00", "\x0a", "\x0d", "\x1a");
@@ -991,7 +990,7 @@ class UpdraftPlus {
991
  $total_rows++;
992
  $values = array();
993
  foreach ($row as $key => $value) {
994
- if ($ints[strtolower($key)]) {
995
  // make sure there are no blank spots in the insert syntax,
996
  // yet try to avoid quotation marks around integers
997
  $value = ( null === $value || '' === $value) ? $defs[strtolower($key)] : $value;
@@ -1015,7 +1014,7 @@ class UpdraftPlus {
1015
  $this->stow("# --------------------------------------------------------\n");
1016
  $this->stow("\n");
1017
  }
1018
- $this->log("Table $table: Total rows added: $total_rows");
1019
 
1020
  } // end backup_table()
1021
 
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Backup and Restore: Uploads, themes, plugins, other 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.11
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
56
 
57
  class UpdraftPlus {
58
 
59
+ var $version = '1.2.11';
60
 
61
  // Choices will be shown in the admin menu in the order used here
62
  var $backup_methods = array (
906
  function backup_table($table, $segment = 'none') {
907
  global $wpdb;
908
 
909
+ $microtime = microtime(true);
910
+
911
  $total_rows = 0;
912
 
913
  $table_structure = $wpdb->get_results("DESCRIBE $table");
954
  $this->stow("#\n");
955
  }
956
 
957
+ // In UpdraftPlus, segment is always 'none'
958
  if(($segment == 'none') || ($segment >= 0)) {
959
  $defs = array();
960
+ $integer_fields = array();
961
+ // $table_structure was from "DESCRIBE $table"
962
  foreach ($table_structure as $struct) {
963
+ if ( (0 === strpos($struct->Type, 'tinyint')) || (0 === strpos(strtolower($struct->Type), 'smallint')) ||
964
+ (0 === strpos(strtolower($struct->Type), 'mediumint')) || (0 === strpos(strtolower($struct->Type), 'int')) || (0 === strpos(strtolower($struct->Type), 'bigint')) ) {
 
 
 
965
  $defs[strtolower($struct->Field)] = ( null === $struct->Default ) ? 'NULL' : $struct->Default;
966
+ $integer_fields[strtolower($struct->Field)] = "1";
967
  }
968
  }
969
 
970
  // Batch by $row_inc
971
+ if ( ! defined('ROWS_PER_SEGMENT') ) define('ROWS_PER_SEGMENT', 100);
 
 
972
 
973
  if($segment == 'none') {
974
  $row_start = 0;
980
  do {
981
 
982
  if ( !ini_get('safe_mode') || strtolower(ini_get('safe_mode')) == "off") @set_time_limit(15*60);
983
+ $table_data = $wpdb->get_results("SELECT * FROM $table LIMIT {$row_start}, {$row_inc}", ARRAY_A);
984
  $entries = 'INSERT INTO ' . $this->backquote($table) . ' VALUES (';
985
  // \x08\\x09, not required
986
  $search = array("\x00", "\x0a", "\x0d", "\x1a");
990
  $total_rows++;
991
  $values = array();
992
  foreach ($row as $key => $value) {
993
+ if (isset($integer_fields[strtolower($key)])) {
994
  // make sure there are no blank spots in the insert syntax,
995
  // yet try to avoid quotation marks around integers
996
  $value = ( null === $value || '' === $value) ? $defs[strtolower($key)] : $value;
1014
  $this->stow("# --------------------------------------------------------\n");
1015
  $this->stow("\n");
1016
  }
1017
+ $this->log("Table $table: Total rows added: $total_rows in ".sprintf("%.02f",microtime(true)-$microtime)." seconds");
1018
 
1019
  } // end backup_table()
1020