UpdraftPlus WordPress Backup Plugin - Version 1.2.35

Version Description

  • 01/17/2013 =
  • New button to delete all existing settings
  • Admin console now displays rolling status updates
Download this release

Release Info

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

Code changes from version 1.2.33 to 1.2.35

Files changed (4) hide show
  1. methods/dropbox.php +5 -0
  2. methods/googledrive.php +4 -0
  3. readme.txt +4 -3
  4. updraftplus.php +73 -17
methods/dropbox.php CHANGED
@@ -205,6 +205,11 @@ class UpdraftPlus_BackupModule_dropbox {
205
  function config_print() {
206
 
207
  ?>
 
 
 
 
 
208
  <tr class="updraftplusmethod dropbox">
209
  <th></th>
210
  <td>
205
  function config_print() {
206
 
207
  ?>
208
+ <tr class="updraftplusmethod dropbox">
209
+ <td></td>
210
+ <td><em>DropBox is a great choice, because UpdraftPlus supports chunked uploads - no matter how big your blog is, UpdraftPlus can upload it a little at a time, and not get thwarted by timeouts.</em></td>
211
+ </tr>
212
+
213
  <tr class="updraftplusmethod dropbox">
214
  <th></th>
215
  <td>
methods/googledrive.php CHANGED
@@ -305,6 +305,10 @@ class UpdraftPlus_BackupModule_googledrive {
305
 
306
  function config_print() {
307
  ?>
 
 
 
 
308
  <tr class="updraftplusmethod googledrive">
309
  <th>Google Drive:</th>
310
  <td>
305
 
306
  function config_print() {
307
  ?>
308
+ <tr class="updraftplusmethod googledrive">
309
+ <td>Google Drive:</td>
310
+ <td><em>Google Drive is a great choice, because UpdraftPlus supports chunked uploads - no matter how big your blog is, UpdraftPlus can upload it a little at a time, and not get thwarted by timeouts.</em></td>
311
+ </tr>
312
  <tr class="updraftplusmethod googledrive">
313
  <th>Google Drive:</th>
314
  <td>
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.33
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
10
  == Upgrade Notice ==
11
- Complete DropBox support. FTP over SSL. Less noise. Option to delete all settings.
12
 
13
  == Description ==
14
 
@@ -119,8 +119,9 @@ Yes; especially before you submit any support requests.
119
  Thanks for asking - yes, I have. Check out my profile page - http://profiles.wordpress.org/DavidAnderson/ . I am also available for hire for bespoke work.
120
 
121
  == Changelog ==
122
- = 1.2.33 - 01/17/2013 =
123
  * New button to delete all existing settings
 
124
 
125
  = 1.2.31 - 01/15/2013 =
126
  * Fixed bug with DropBox deletions
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.35
7
  Donate link: http://david.dw-perspective.org.uk/donate
8
  License: GPLv3 or later
9
 
10
  == Upgrade Notice ==
11
+ Complete DropBox support. FTP over SSL. Less noise, more info. Option to delete all settings.
12
 
13
  == Description ==
14
 
119
  Thanks for asking - yes, I have. Check out my profile page - http://profiles.wordpress.org/DavidAnderson/ . I am also available for hire for bespoke work.
120
 
121
  == Changelog ==
122
+ = 1.2.35 - 01/17/2013 =
123
  * New button to delete all existing settings
124
+ * Admin console now displays rolling status updates
125
 
126
  = 1.2.31 - 01/15/2013 =
127
  * Fixed bug with DropBox deletions
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: your content and database can be automatically backed up to Amazon S3, DropBox, Google Drive, FTP or email, on separate schedules.
6
  Author: David Anderson.
7
- Version: 1.2.33
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
@@ -64,7 +64,7 @@ define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
64
 
65
  class UpdraftPlus {
66
 
67
- var $version = '1.2.33';
68
 
69
  // Choices will be shown in the admin menu in the order used here
70
  var $backup_methods = array (
@@ -163,6 +163,7 @@ class UpdraftPlus {
163
  # Logs the given line, adding (relative) time stamp and newline
164
  function log($line) {
165
  if ($this->logfile_handle) fwrite($this->logfile_handle, sprintf("%08.03f", round(microtime(true)-$this->opened_log_time, 3))." ".$line."\n");
 
166
  }
167
 
168
  function backup_resume($resumption_no) {
@@ -186,7 +187,7 @@ class UpdraftPlus {
186
  if ($next_resumption < 10) {
187
  wp_schedule_single_event(time()+$resume_delay, 'updraft_backup_resume' ,array($next_resumption));
188
  } else {
189
- $this->log("This is our tenth attempt - will not try again");
190
  }
191
  $this->backup_time = $btime;
192
 
@@ -492,7 +493,38 @@ class UpdraftPlus {
492
  // - Debug mode
493
  // - There were no errors (which means we completed and so this is the final run - time for the final report)
494
  // - It was the tenth resumption; everything failed
495
- if ($allow_email && get_option('updraft_email') != "" && (get_option('updraft_debug_mode') || empty($this->errors) || $resumption_no >=9 )) $this->send_results_email();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
 
497
  @fclose($this->logfile_handle);
498
 
@@ -1184,10 +1216,12 @@ class UpdraftPlus {
1184
  // Called via AJAX
1185
  function updraft_ajax_handler() {
1186
  // Test the nonce (probably not needed, since we're presumably admin-authed, but there's no harm)
1187
- $nonce = (empty($_POST['nonce'])) ? "" : $_POST['nonce'];
1188
- if (! wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce') || empty($_POST['subaction'])) die('Security check');
1189
 
1190
- if ($_POST['subaction'] == 'credentials_test') {
 
 
1191
  $method = (preg_match("/^[a-z0-9]+$/", $_POST['method'])) ? $_POST['method'] : "";
1192
 
1193
  // Test the credentials, return a code
@@ -1565,9 +1599,11 @@ class UpdraftPlus {
1565
  if(isset($_POST['action']) && $_POST['action'] == 'updraft_backup') {
1566
  echo '<div class="updated fade" style="max-width: 800px; font-size:140%; line-height: 140%; padding:14px; clear:left;"><strong>Schedule backup:</strong> ';
1567
  if (wp_schedule_single_event(time()+5, 'updraft_backup_all') === false) {
 
1568
  echo "Failed.";
1569
  } else {
1570
- echo "OK. Now load a page from your site to make sure the schedule can trigger.";
 
1571
  }
1572
  echo '</div>';
1573
  }
@@ -1575,7 +1611,7 @@ class UpdraftPlus {
1575
  if(isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_all') { $this->backup(true,true); }
1576
  elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_db') { $this->backup_db(); }
1577
  elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_wipesettings') {
1578
- $settings = array('updraft_interval', 'updraft_interval_database', 'updraft_retain', 'updraft_encryptionphrase', 'updraft_service', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_dropbox_folder', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_others_exclude');
1579
  foreach ($settings as $s) {
1580
  delete_option($s);
1581
  }
@@ -1627,7 +1663,7 @@ ENDHERE;
1627
  ?>
1628
 
1629
  <h2 style="clear:left;">Existing Schedule And Backups</h2>
1630
- <table class="form-table" style="float:left; clear: both; width:475px">
1631
  <tr>
1632
  <?php
1633
  $updraft_dir = $this->backups_dir_location();
@@ -1662,26 +1698,26 @@ ENDHERE;
1662
  }
1663
  ?>
1664
 
1665
- <th>The Time Now:</th>
1666
  <td style="color:blue"><?php echo $current_time?></td>
1667
  </tr>
1668
  <tr>
1669
- <th>Next Scheduled Files Backup:</th>
1670
  <td style="color:blue"><?php echo $next_scheduled_backup?></td>
1671
  </tr>
1672
  <tr>
1673
- <th>Next Scheduled DB Backup:</th>
1674
  <td style="color:blue"><?php echo $next_scheduled_backup_database?></td>
1675
  </tr>
1676
  <tr>
1677
- <th>Last Backup:</th>
1678
  <td style="color:<?php echo $last_backup_color ?>"><?php echo $last_backup?></td>
1679
  </tr>
1680
  </table>
1681
- <div style="float:left; width:200px; padding-top: 100px;">
1682
  <form method="post" action="">
1683
  <input type="hidden" name="action" value="updraft_backup" />
1684
- <p><input type="submit" <?php echo $backup_disabled ?> class="button-primary" value="Backup Now!" style="padding-top:3px;padding-bottom:3px;font-size:24px !important" onclick="return(confirm('This will schedule a one-time backup. To trigger the backup you should go ahead, then wait 10 seconds, then load a page on your site. WordPress should then start the backup running in the background.'))" /></p>
1685
  </form>
1686
  <div style="position:relative">
1687
  <div style="position:absolute;top:0;left:0">
@@ -1712,7 +1748,11 @@ ENDHERE;
1712
  <br style="clear:both" />
1713
  <table class="form-table">
1714
  <tr>
1715
- <th>Download Backups</th>
 
 
 
 
1716
  <td><a href="#" title="Click to see available backups" onclick="jQuery('.download-backups').toggle();return false;"><?php echo count($backup_history)?> available</a></td>
1717
  </tr>
1718
  <tr>
@@ -1914,7 +1954,23 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
1914
  </table>
1915
  <script type="text/javascript">
1916
  /* <![CDATA[ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1917
  jQuery(document).ready(function() {
 
1918
  jQuery('.updraftplusmethod').hide();
1919
  <?php
1920
  if ($active_service) echo "jQuery('.${active_service}').show();";
4
  Plugin URI: http://wordpress.org/extend/plugins/updraftplus
5
  Description: Backup and restore: your content and database can be automatically backed up to Amazon S3, DropBox, Google Drive, FTP or email, on separate schedules.
6
  Author: David Anderson.
7
+ Version: 1.2.35
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
64
 
65
  class UpdraftPlus {
66
 
67
+ var $version = '1.2.35';
68
 
69
  // Choices will be shown in the admin menu in the order used here
70
  var $backup_methods = array (
163
  # Logs the given line, adding (relative) time stamp and newline
164
  function log($line) {
165
  if ($this->logfile_handle) fwrite($this->logfile_handle, sprintf("%08.03f", round(microtime(true)-$this->opened_log_time, 3))." ".$line."\n");
166
+ update_option("updraft_lastmessage", $line." (".date('M d H:i:s').")");
167
  }
168
 
169
  function backup_resume($resumption_no) {
187
  if ($next_resumption < 10) {
188
  wp_schedule_single_event(time()+$resume_delay, 'updraft_backup_resume' ,array($next_resumption));
189
  } else {
190
+ $this->log("The current run is our tenth attempt - will not try again");
191
  }
192
  $this->backup_time = $btime;
193
 
493
  // - Debug mode
494
  // - There were no errors (which means we completed and so this is the final run - time for the final report)
495
  // - It was the tenth resumption; everything failed
496
+
497
+ $send_an_email = false;
498
+
499
+ // Make sure that the final status is shown
500
+ if (empty($this->errors)) {
501
+ $send_an_email = true;
502
+ $final_message = "The backup apparently succeeded and is now complete";
503
+ } elseif ($resumption_no >=9) {
504
+ $send_an_email = true;
505
+ $final_message = "The backup attempt has finished, apparently unsuccesfully";
506
+ } else {
507
+ // There are errors, but a resumption will be attempted
508
+ $final_message = "The backup has not finished; a resumption is scheduled within 5 minutes";
509
+ }
510
+
511
+ // Now over-ride the decision to send an email, if needed
512
+ if (get_option('updraft_debug_mode')) {
513
+ $send_an_email = true;
514
+ $this->log("An email has been scheduled for this job, because we are in debug mode");
515
+ }
516
+ // If there's no email address, or the set was empty, that is the final over-ride: don't send
517
+ if (!$allow_email) {
518
+ $send_an_email = false;
519
+ $this->log("No email will be sent - this backup set was empty.");
520
+ } elseif (get_option('updraft_email') == '') {
521
+ $send_an_email = false;
522
+ $this->log("No email will/can be sent - the user has not configured an email address.");
523
+ }
524
+
525
+ if ($send_an_email) $this->send_results_email();
526
+
527
+ $this->log($final_message);
528
 
529
  @fclose($this->logfile_handle);
530
 
1216
  // Called via AJAX
1217
  function updraft_ajax_handler() {
1218
  // Test the nonce (probably not needed, since we're presumably admin-authed, but there's no harm)
1219
+ $nonce = (empty($_REQUEST['nonce'])) ? "" : $_REQUEST['nonce'];
1220
+ if (! wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce') || empty($_REQUEST['subaction'])) die('Security check');
1221
 
1222
+ if ('lastlog' == $_GET['subaction']) {
1223
+ echo htmlspecialchars(get_option('updraft_lastmessage', '(Nothing yet logged)'));
1224
+ } elseif ($_POST['subaction'] == 'credentials_test') {
1225
  $method = (preg_match("/^[a-z0-9]+$/", $_POST['method'])) ? $_POST['method'] : "";
1226
 
1227
  // Test the credentials, return a code
1599
  if(isset($_POST['action']) && $_POST['action'] == 'updraft_backup') {
1600
  echo '<div class="updated fade" style="max-width: 800px; font-size:140%; line-height: 140%; padding:14px; clear:left;"><strong>Schedule backup:</strong> ';
1601
  if (wp_schedule_single_event(time()+5, 'updraft_backup_all') === false) {
1602
+ $this->log("A backup run failed to schedule");
1603
  echo "Failed.";
1604
  } else {
1605
+ echo "OK. Now load any page from your site to make sure the schedule can trigger.";
1606
+ $this->log("A backup run has been scheduled");
1607
  }
1608
  echo '</div>';
1609
  }
1611
  if(isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_all') { $this->backup(true,true); }
1612
  elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_db') { $this->backup_db(); }
1613
  elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_wipesettings') {
1614
+ $settings = array('updraft_interval', 'updraft_interval_database', 'updraft_retain', 'updraft_encryptionphrase', 'updraft_service', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_dropbox_folder', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_others_exclude', 'updraft_lastmessage');
1615
  foreach ($settings as $s) {
1616
  delete_option($s);
1617
  }
1663
  ?>
1664
 
1665
  <h2 style="clear:left;">Existing Schedule And Backups</h2>
1666
+ <table class="form-table" style="float:left; clear: both; width:545px;">
1667
  <tr>
1668
  <?php
1669
  $updraft_dir = $this->backups_dir_location();
1698
  }
1699
  ?>
1700
 
1701
+ <th>Time now:</th>
1702
  <td style="color:blue"><?php echo $current_time?></td>
1703
  </tr>
1704
  <tr>
1705
+ <th>Next scheduled files backup:</th>
1706
  <td style="color:blue"><?php echo $next_scheduled_backup?></td>
1707
  </tr>
1708
  <tr>
1709
+ <th>Next scheduled DB backup:</th>
1710
  <td style="color:blue"><?php echo $next_scheduled_backup_database?></td>
1711
  </tr>
1712
  <tr>
1713
+ <th>Last backup:</th>
1714
  <td style="color:<?php echo $last_backup_color ?>"><?php echo $last_backup?></td>
1715
  </tr>
1716
  </table>
1717
+ <div style="float:left; width:200px; padding-top: 40px;">
1718
  <form method="post" action="">
1719
  <input type="hidden" name="action" value="updraft_backup" />
1720
+ <p><input type="submit" <?php echo $backup_disabled ?> class="button-primary" value="Backup Now!" style="padding-top:3px;padding-bottom:3px;font-size:24px !important" onclick="return(confirm('This will schedule a one-time backup. To trigger the backup you should go ahead, then wait 10 seconds, then visit any page on your site. WordPress should then start the backup running in the background.'))" /></p>
1721
  </form>
1722
  <div style="position:relative">
1723
  <div style="position:absolute;top:0;left:0">
1748
  <br style="clear:both" />
1749
  <table class="form-table">
1750
  <tr>
1751
+ <th>Last backup log message:</th>
1752
+ <td id="updraft_lastlogcontainer"><?php echo htmlspecialchars(get_option('updraft_lastmessage', '(Nothing yet logged)')); ?></td>
1753
+ </tr>
1754
+ <tr>
1755
+ <th>Download backups</th>
1756
  <td><a href="#" title="Click to see available backups" onclick="jQuery('.download-backups').toggle();return false;"><?php echo count($backup_history)?> available</a></td>
1757
  </tr>
1758
  <tr>
1954
  </table>
1955
  <script type="text/javascript">
1956
  /* <![CDATA[ */
1957
+ var lastlog_lastmessage = "";
1958
+ var lastlog_sdata = {
1959
+ action: 'updraft_ajax',
1960
+ subaction: 'lastlog',
1961
+ nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce'); ?>'
1962
+ };
1963
+ function updraft_showlastlog(){
1964
+ jQuery.get(ajaxurl, lastlog_sdata, function(response) {
1965
+ nexttimer = 1500;
1966
+ if (lastlog_lastmessage == response) { nexttimer = 4500; }
1967
+ window.setTimeout(function(){updraft_showlastlog()}, nexttimer);
1968
+ jQuery('#updraft_lastlogcontainer').html(response);
1969
+ lastlog_lastmessage = response;
1970
+ });
1971
+ }
1972
  jQuery(document).ready(function() {
1973
+ window.setTimeout(function(){updraft_showlastlog()}, 1200);
1974
  jQuery('.updraftplusmethod').hide();
1975
  <?php
1976
  if ($active_service) echo "jQuery('.${active_service}').show();";