Version Description
- 04/01/2013 =
- Deal with a potential situation in which a backup run could be erroneously identified as superfluous and cancelled
Download this release
Release Info
Developer | DavidAnderson |
Plugin | UpdraftPlus WordPress Backup Plugin |
Version | 1.1.10 |
Comparing to | |
See all releases |
Code changes from version 1.1.9 to 1.1.10
- methods/googledrive.php +2 -2
- readme.txt +12 -1
- updraftplus.php +27 -15
methods/googledrive.php
CHANGED
@@ -80,7 +80,7 @@ class UpdraftPlus_BackupModule_googledrive {
|
|
80 |
} else {
|
81 |
$json_values = json_decode( $result['body'], true );
|
82 |
if ( isset( $json_values['refresh_token'] ) ) {
|
83 |
-
update_option('updraft_googledrive_token'
|
84 |
header('Location: '.admin_url('options-general.php?page=updraftplus&message=' . __( 'Google Drive authorization was successful.', 'updraftplus' ) ) );
|
85 |
}
|
86 |
else {
|
@@ -302,7 +302,7 @@ class UpdraftPlus_BackupModule_googledrive {
|
|
302 |
<th>Google Drive:</th>
|
303 |
<td>
|
304 |
<p><a href="http://david.dw-perspective.org.uk/da/index.php/computer-resources/updraftplus-googledrive-authorisation/"><strong>For longer help, including screenshots, follow this link. The description below is sufficient for more expert users.</strong></a></p>
|
305 |
-
<p><a href="https://code.google.com/apis/console/">Follow this link to your Google API Console</a>, and there create a Client ID in the API Access section. Select 'Web Application' as the application type.</p><p>You must add <kbd><?php echo admin_url('options-general.php?page=updraftplus&action=updraftmethod-googledrive-auth'); ?></kbd> as the authorised redirect URI when asked.
|
306 |
|
307 |
<?php
|
308 |
if (!class_exists('SimpleXMLElement')) { echo " <b>WARNING:</b> You do not have the SimpleXMLElement installed. Google Drive backups will <b>not</b> work until you do."; }
|
80 |
} else {
|
81 |
$json_values = json_decode( $result['body'], true );
|
82 |
if ( isset( $json_values['refresh_token'] ) ) {
|
83 |
+
update_option('updraft_googledrive_token', $json_values['refresh_token']); // Save token
|
84 |
header('Location: '.admin_url('options-general.php?page=updraftplus&message=' . __( 'Google Drive authorization was successful.', 'updraftplus' ) ) );
|
85 |
}
|
86 |
else {
|
302 |
<th>Google Drive:</th>
|
303 |
<td>
|
304 |
<p><a href="http://david.dw-perspective.org.uk/da/index.php/computer-resources/updraftplus-googledrive-authorisation/"><strong>For longer help, including screenshots, follow this link. The description below is sufficient for more expert users.</strong></a></p>
|
305 |
+
<p><a href="https://code.google.com/apis/console/">Follow this link to your Google API Console</a>, and there create a Client ID in the API Access section. Select 'Web Application' as the application type.</p><p>You must add <kbd><?php echo admin_url('options-general.php?page=updraftplus&action=updraftmethod-googledrive-auth'); ?></kbd> as the authorised redirect URI when asked. N.B. If you install UpdraftPlus on several WordPress sites, then you cannot re-use your client ID; you must create a new one from your Google API console for each blog.
|
306 |
|
307 |
<?php
|
308 |
if (!class_exists('SimpleXMLElement')) { echo " <b>WARNING:</b> You do not have the SimpleXMLElement installed. Google Drive backups will <b>not</b> work until you do."; }
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ 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.5
|
6 |
-
Stable tag: 1.1.
|
7 |
Donate link: http://david.dw-perspective.org.uk/donate
|
8 |
License: GPLv3 or later
|
9 |
|
@@ -93,12 +93,23 @@ Nothing, probably. That's the point of an encryption key - people who don't have
|
|
93 |
|
94 |
No, there's no warranty or guarantee, etc. It's completely up to you to verify that UpdraftPlus is working correctly. If it doesn't then that's unfortunate, but this is a free plugin.
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
= Have you written any other free plugins? =
|
97 |
|
98 |
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.
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
102 |
= 1.1.9 - 12/31/2012 =
|
103 |
* Big code re-factoring; cloud access methods now modularised, paving way for easier adding of new methods. Note that Google Drive users may need to re-authenticate - please check that your backups are working.
|
104 |
* Fix bug whereby some resumptions of failed backups were erroneously cancelled
|
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.5
|
6 |
+
Stable tag: 1.1.10
|
7 |
Donate link: http://david.dw-perspective.org.uk/donate
|
8 |
License: GPLv3 or later
|
9 |
|
93 |
|
94 |
No, there's no warranty or guarantee, etc. It's completely up to you to verify that UpdraftPlus is working correctly. If it doesn't then that's unfortunate, but this is a free plugin.
|
95 |
|
96 |
+
= Does UpdraftPlus delete all its settings when it is de-installed? =
|
97 |
+
|
98 |
+
No. Doing so is "cleaner", but some users also de-install and re-install and don't want to have to re-enter their settings. The few entries in the WordPress options database (which won't ever be accessed) will make no difference that could possibly be detected on your site performance or space usage.
|
99 |
+
|
100 |
+
= I am not running the most recent version of UpdraftPlus. Should I upgrade? =
|
101 |
+
|
102 |
+
Yes; especially before you submit any support requests.
|
103 |
+
|
104 |
= Have you written any other free plugins? =
|
105 |
|
106 |
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.
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 1.1.10 - 04/01/2013 =
|
111 |
+
* Deal with a potential situation in which a backup run could be erroneously identified as superfluous and cancelled
|
112 |
+
|
113 |
= 1.1.9 - 12/31/2012 =
|
114 |
* Big code re-factoring; cloud access methods now modularised, paving way for easier adding of new methods. Note that Google Drive users may need to re-authenticate - please check that your backups are working.
|
115 |
* Fix bug whereby some resumptions of failed backups were erroneously cancelled
|
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, on separate schedules.
|
6 |
Author: David Anderson.
|
7 |
-
Version: 1.1.
|
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.1.
|
60 |
|
61 |
// Choices will be shown in the admin menu in the order used here
|
62 |
var $backup_methods = array (
|
@@ -69,6 +69,7 @@ class UpdraftPlus {
|
|
69 |
var $dbhandle;
|
70 |
var $errors = array();
|
71 |
var $nonce;
|
|
|
72 |
var $logfile_name = "";
|
73 |
var $logfile_handle = false;
|
74 |
var $backup_time;
|
@@ -129,7 +130,10 @@ class UpdraftPlus {
|
|
129 |
|
130 |
function backup_time_nonce() {
|
131 |
$this->backup_time = time();
|
132 |
-
$
|
|
|
|
|
|
|
133 |
}
|
134 |
|
135 |
# Logs the given line, adding date stamp and newline
|
@@ -211,11 +215,13 @@ class UpdraftPlus {
|
|
211 |
|
212 |
function backup_files() {
|
213 |
# Note that the "false" for database gets over-ridden automatically if they turn out to have the same schedules
|
|
|
214 |
$this->backup(true,false);
|
215 |
}
|
216 |
|
217 |
function backup_database() {
|
218 |
# Note that nothing will happen if the file backup had the same schedule
|
|
|
219 |
$this->backup(false,true);
|
220 |
}
|
221 |
|
@@ -230,20 +236,26 @@ class UpdraftPlus {
|
|
230 |
function check_backup_race( $to_delete = false ) {
|
231 |
// Avoid caching
|
232 |
global $wpdb;
|
233 |
-
$row = $wpdb->get_row(
|
234 |
$cur_trans = ( is_object( $row ) ) ? $row->option_value : "";
|
|
|
235 |
if ($cur_trans != "" && $cur_trans != $this->nonce) {
|
236 |
-
|
237 |
-
$
|
238 |
-
if
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
}
|
|
|
245 |
}
|
246 |
-
exit;
|
247 |
}
|
248 |
}
|
249 |
|
@@ -369,7 +381,7 @@ class UpdraftPlus {
|
|
369 |
if (0 == $encryption_error) {
|
370 |
$this->log("$file: encryption successful");
|
371 |
# Delete unencrypted file
|
372 |
-
@unlink($file);
|
373 |
return basename($file.'.crypt');
|
374 |
} else {
|
375 |
$this->log("Encryption error occurred when encrypting database. Encryption aborted.");
|
@@ -1433,7 +1445,7 @@ ENDHERE;
|
|
1433 |
echo '<div style="color:blue">Old directories successfully deleted.</div>';
|
1434 |
}
|
1435 |
if(!$this->memory_check(96)) {?>
|
1436 |
-
<div style="color:orange">Your PHP memory limit is too low.
|
1437 |
<?php
|
1438 |
}
|
1439 |
if(!$this->execution_time_check(300)) {?>
|
@@ -1442,7 +1454,7 @@ ENDHERE;
|
|
1442 |
}
|
1443 |
|
1444 |
if($this->scan_old_dirs()) {?>
|
1445 |
-
<div style="color:orange">You have old directories from a previous backup.
|
1446 |
<form method="post" action="<?php echo remove_query_arg(array('updraft_restore_success','action')) ?>">
|
1447 |
<input type="hidden" name="action" value="updraft_delete_old_dirs" />
|
1448 |
<input type="submit" class="button-primary" value="Delete Old Dirs" onclick="return(confirm('Are you sure you want to delete the old directories? This cannot be undone.'))" />
|
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, on separate schedules.
|
6 |
Author: David Anderson.
|
7 |
+
Version: 1.1.10
|
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.1.10';
|
60 |
|
61 |
// Choices will be shown in the admin menu in the order used here
|
62 |
var $backup_methods = array (
|
69 |
var $dbhandle;
|
70 |
var $errors = array();
|
71 |
var $nonce;
|
72 |
+
var $cronrun_type = "";
|
73 |
var $logfile_name = "";
|
74 |
var $logfile_handle = false;
|
75 |
var $backup_time;
|
130 |
|
131 |
function backup_time_nonce() {
|
132 |
$this->backup_time = time();
|
133 |
+
$nonce = substr(md5(time().rand()), 20);
|
134 |
+
$this->nonce = $nonce;
|
135 |
+
// Short-lived, as we only use this for detecting a race condition
|
136 |
+
set_transient("updraftplus_runtype_$nonce", $this->cronrun_type, 300);
|
137 |
}
|
138 |
|
139 |
# Logs the given line, adding date stamp and newline
|
215 |
|
216 |
function backup_files() {
|
217 |
# Note that the "false" for database gets over-ridden automatically if they turn out to have the same schedules
|
218 |
+
$this->cronrun_type = "files";
|
219 |
$this->backup(true,false);
|
220 |
}
|
221 |
|
222 |
function backup_database() {
|
223 |
# Note that nothing will happen if the file backup had the same schedule
|
224 |
+
$this->cronrun_type = "database";
|
225 |
$this->backup(false,true);
|
226 |
}
|
227 |
|
236 |
function check_backup_race( $to_delete = false ) {
|
237 |
// Avoid caching
|
238 |
global $wpdb;
|
239 |
+
$row = $wpdb->get_row($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", "_transient_updraftplus_backup_job_nonce"));
|
240 |
$cur_trans = ( is_object( $row ) ) ? $row->option_value : "";
|
241 |
+
// Check if another backup job ID is stored in the transient
|
242 |
if ($cur_trans != "" && $cur_trans != $this->nonce) {
|
243 |
+
// Also check if that job is of the same type as ours, as two cron jobs could legitimately fire at the same time
|
244 |
+
$otherjob_crontype = get_transient("updraftplus_runtype_".$cur_trans, "xyz");
|
245 |
+
// $this->cronrun_type should be "files", "database" or blank (if we were not run via a cron job)
|
246 |
+
if ($otherjob_crontype == $this->cronrun_type) {
|
247 |
+
$this->log("Another backup job ($cur_trans) of the same type ($otherjob_crontype) appears to now be running - terminating our run (apparent race condition)");
|
248 |
+
$bdir = $this->backups_dir_location();
|
249 |
+
if (is_array($to_delete)) {
|
250 |
+
foreach ($to_delete as $key => $file) {
|
251 |
+
if (is_file($bdir.'/'.$file)) {
|
252 |
+
$this->log("Deleting the file we created: ".$file);
|
253 |
+
@unlink($bdir.'/'.$file);
|
254 |
+
}
|
255 |
}
|
256 |
}
|
257 |
+
exit;
|
258 |
}
|
|
|
259 |
}
|
260 |
}
|
261 |
|
381 |
if (0 == $encryption_error) {
|
382 |
$this->log("$file: encryption successful");
|
383 |
# Delete unencrypted file
|
384 |
+
@unlink($updraft_dir.'/'.$file);
|
385 |
return basename($file.'.crypt');
|
386 |
} else {
|
387 |
$this->log("Encryption error occurred when encrypting database. Encryption aborted.");
|
1445 |
echo '<div style="color:blue">Old directories successfully deleted.</div>';
|
1446 |
}
|
1447 |
if(!$this->memory_check(96)) {?>
|
1448 |
+
<div style="color:orange">Your PHP memory limit is too low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may not work properly with a memory limit of less than 96 Mb (though on the other hand, it has been used successfully with a 32Mb limit - your mileage may vary, but don't blame us!). Current limit is: <?php echo $this->memory_check_current(); ?> Mb</div>
|
1449 |
<?php
|
1450 |
}
|
1451 |
if(!$this->execution_time_check(300)) {?>
|
1454 |
}
|
1455 |
|
1456 |
if($this->scan_old_dirs()) {?>
|
1457 |
+
<div style="color:orange">You have old directories from a previous backup. Click to delete them after you have verified that the restoration worked.</div>
|
1458 |
<form method="post" action="<?php echo remove_query_arg(array('updraft_restore_success','action')) ?>">
|
1459 |
<input type="hidden" name="action" value="updraft_delete_old_dirs" />
|
1460 |
<input type="submit" class="button-primary" value="Delete Old Dirs" onclick="return(confirm('Are you sure you want to delete the old directories? This cannot be undone.'))" />
|