UpdraftPlus WordPress Backup Plugin - Version 1.2.12

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.12
Comparing to
See all releases

Code changes from version 1.2.11 to 1.2.12

Files changed (3) hide show
  1. methods/ftp.php +6 -4
  2. readme.txt +2 -2
  3. updraftplus.php +4 -14
methods/ftp.php CHANGED
@@ -18,12 +18,14 @@ class UpdraftPlus_BackupModule_ftp {
18
  foreach($backup_array as $file) {
19
  $fullpath = trailingslashit(get_option('updraft_dir')).$file;
20
  $updraftplus->log("FTP upload attempt: $file -> $ftp_remote_path/$file");
21
- if ($ftp->put($fullpath,$ftp_remote_path.$file,FTP_BINARY)) {
22
- $updraftplus->log("ERROR: $file_name: Successfully uploaded via FTP");
 
 
23
  $updraftplus->uploaded_file($file);
24
  } else {
25
- $updraftplus->error("$file_name: Failed to upload to FTP" );
26
- $updraftplus->log("ERROR: $file_name: Failed to upload to FTP" );
27
  }
28
  }
29
 
18
  foreach($backup_array as $file) {
19
  $fullpath = trailingslashit(get_option('updraft_dir')).$file;
20
  $updraftplus->log("FTP upload attempt: $file -> $ftp_remote_path/$file");
21
+ $timer_start = microtime(true);
22
+ $size_k = round(filesize($fullpath)/1024,1);
23
+ if ($ftp->put($fullpath, $ftp_remote_path.$file, FTP_BINARY)) {
24
+ $updraftplus->log("FTP upload attempt successful (".$size_k."Kb in ".(round(microtime(true)-$timer_start,2)).'s)');
25
  $updraftplus->uploaded_file($file);
26
  } else {
27
+ $updraftplus->error("FTP upload failed" );
28
+ $updraftplus->log("ERROR: FTP upload failed" );
29
  }
30
  }
31
 
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.11
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
@@ -112,7 +112,7 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
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
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.12
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
112
 
113
  == Changelog ==
114
 
115
+ = 1.2.12 - 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
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.11
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.11';
60
 
61
  // Choices will be shown in the admin menu in the order used here
62
  var $backup_methods = array (
@@ -981,7 +981,7 @@ class UpdraftPlus {
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");
987
  $replace = array('\0', '\n', '\r', '\Z');
@@ -996,7 +996,7 @@ class UpdraftPlus {
996
  $value = ( null === $value || '' === $value) ? $defs[strtolower($key)] : $value;
997
  $values[] = ( '' === $value ) ? "''" : $value;
998
  } else {
999
- $values[] = "'" . str_replace($search, $replace, $this->sql_addslashes($value)) . "'";
1000
  }
1001
  }
1002
  $this->stow(" \n" . $entries . implode(', ', $values) . ');');
@@ -1063,16 +1063,6 @@ class UpdraftPlus {
1063
  }
1064
  }
1065
 
1066
- /**
1067
- * Better addslashes for SQL queries.
1068
- * Taken from phpMyAdmin.
1069
- */
1070
- function sql_addslashes($a_string = '', $is_like = false) {
1071
- if ($is_like) $a_string = str_replace('\\', '\\\\\\\\', $a_string);
1072
- else $a_string = str_replace('\\', '\\\\', $a_string);
1073
- return str_replace('\'', '\\\'', $a_string);
1074
- }
1075
-
1076
  /*END OF WP-DB-BACKUP BLOCK */
1077
 
1078
  /*
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.12
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.12';
60
 
61
  // Choices will be shown in the admin menu in the order used here
62
  var $backup_methods = array (
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");
987
  $replace = array('\0', '\n', '\r', '\Z');
996
  $value = ( null === $value || '' === $value) ? $defs[strtolower($key)] : $value;
997
  $values[] = ( '' === $value ) ? "''" : $value;
998
  } else {
999
+ $values[] = "'" . str_replace($search, $replace, str_replace('\'', '\\\'', str_replace('\\', '\\\\', $value))) . "'";
1000
  }
1001
  }
1002
  $this->stow(" \n" . $entries . implode(', ', $values) . ');');
1063
  }
1064
  }
1065
 
 
 
 
 
 
 
 
 
 
 
1066
  /*END OF WP-DB-BACKUP BLOCK */
1067
 
1068
  /*