Version Description
- 03/04/2013 =
- Hooks for WebDAV support via add-on
Download this release
Release Info
Developer | DavidAnderson |
Plugin | UpdraftPlus WordPress Backup Plugin |
Version | 1.4.30 |
Comparing to | |
See all releases |
Code changes from version 1.4.29 to 1.4.30
- methods/dropbox.php +25 -58
- methods/webdav.php +85 -0
- options.php +1 -0
- readme.txt +8 -5
- updraftplus.php +9 -5
methods/dropbox.php
CHANGED
@@ -16,7 +16,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
16 |
|
17 |
if ($this->current_file_size > 0) {
|
18 |
$percent = round(100*($offset/$this->current_file_size),1);
|
19 |
-
$updraftplus->record_uploaded_chunk($percent, "
|
20 |
} else {
|
21 |
$updraftplus->log("Dropbox: Chunked Upload: $offset bytes uploaded");
|
22 |
}
|
@@ -47,7 +47,6 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
47 |
$dropbox_folder = trailingslashit(UpdraftPlus_Options::get_updraft_option('updraft_dropbox_folder'));
|
48 |
|
49 |
foreach($backup_array as $file) {
|
50 |
-
$updraftplus->log("Dropbox: Attempt to upload: $file");
|
51 |
|
52 |
$file_success = 1;
|
53 |
|
@@ -69,13 +68,16 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
69 |
$upload_id = null;
|
70 |
}
|
71 |
|
72 |
-
// I did erroneously have $dropbox_folder as the third parameter in chunkedUpload... this causes a sub-directory to be created
|
73 |
// Old-style, single file put: $put = $dropbox->putFile($updraft_dir.'/'.$file, $dropbox_folder.$file);
|
74 |
|
75 |
$ourself = $this;
|
76 |
|
|
|
|
|
|
|
|
|
77 |
try {
|
78 |
-
$dropbox->chunkedUpload($updraft_dir.'/'.$file,
|
79 |
} catch (Exception $e) {
|
80 |
$updraftplus->log("Exception: ".$e->getMessage());
|
81 |
if (preg_match("/Submitted input out of alignment: got \[(\d+)\] expected \[(\d+)\]/i", $e->getMessage(), $matches)) {
|
@@ -84,15 +86,15 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
84 |
$dropbox_wanted = $matches[2];
|
85 |
$updraftplus->log("Dropbox alignment error: tried=$we_tried, wanted=$dropbox_wanted; will attempt recovery");
|
86 |
try {
|
87 |
-
$dropbox->chunkedUpload($updraft_dir.'/'.$file,
|
88 |
} catch (Exception $e) {
|
89 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
90 |
-
$updraftplus->error("Dropbox error: failed to upload file $
|
91 |
$file_success = 0;
|
92 |
}
|
93 |
} else {
|
94 |
$updraftplus->log('Dropbox error: '.$e->getMessage());
|
95 |
-
$updraftplus->error("Dropbox error: failed to upload file $
|
96 |
$file_success = 0;
|
97 |
}
|
98 |
}
|
@@ -119,7 +121,6 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
119 |
function delete($file) {
|
120 |
|
121 |
global $updraftplus;
|
122 |
-
$updraftplus->log("Dropbox: request deletion: $file");
|
123 |
|
124 |
if (UpdraftPlus_Options::get_updraft_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
125 |
$updraftplus->log('You do not appear to be authenticated with Dropbox');
|
@@ -135,31 +136,19 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
135 |
return false;
|
136 |
}
|
137 |
|
138 |
-
$
|
|
|
|
|
139 |
|
140 |
-
$file_success = 1;
|
141 |
try {
|
142 |
-
|
143 |
-
$
|
144 |
} catch (Exception $e) {
|
145 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
146 |
-
// TODO
|
147 |
-
// Add this back October 2013 when removing the block below
|
148 |
-
//$updraftplus->error("Dropbox error: failed to delete file ($file): see log file for more info");
|
149 |
-
$file_success = 0;
|
150 |
}
|
151 |
-
|
|
|
152 |
$updraftplus->log('Dropbox: delete succeeded');
|
153 |
-
} else {
|
154 |
-
$file_success = 1;
|
155 |
-
// We created the file in the wrong place for a while. This code is needed until October 2013, when it can be removed.
|
156 |
-
try {
|
157 |
-
$dropbox->delete($dropbox_folder.'/'.$file);
|
158 |
-
} catch (Exception $e) {
|
159 |
-
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
160 |
-
$file_success = 0;
|
161 |
-
}
|
162 |
-
if ($file_success) $updraftplus->log('Dropbox: delete succeeded (alternative path)');
|
163 |
}
|
164 |
|
165 |
}
|
@@ -184,20 +173,23 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
184 |
$microtime = microtime(true);
|
185 |
|
186 |
$try_the_other_one = false;
|
|
|
|
|
|
|
187 |
try {
|
188 |
-
$get = $dropbox->getFile($
|
189 |
} catch (Exception $e) {
|
190 |
// TODO: Remove this October 2013 (we stored in the wrong place for a while...)
|
191 |
$try_the_other_one = true;
|
192 |
$possible_error = $e->getMessage();
|
|
|
193 |
}
|
194 |
|
195 |
-
// TODO: Remove this October 2013 (we stored in the wrong place for a while...)
|
196 |
if ($try_the_other_one) {
|
197 |
$dropbox_folder = trailingslashit(UpdraftPlus_Options::get_updraft_option('updraft_dropbox_folder'));
|
198 |
-
$updraftplus->error('Dropbox error: '.$e);
|
199 |
try {
|
200 |
-
$get = $dropbox->getFile($file, $updraft_dir.'/'.$file, null, true);
|
201 |
if (isset($get['response']['body'])) {
|
202 |
$updraftplus->log("Dropbox: downloaded ".round(strlen($get['response']['body'])/1024,1).' Kb');
|
203 |
}
|
@@ -220,6 +212,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
220 |
</td>
|
221 |
</tr>
|
222 |
|
|
|
|
|
223 |
<tr class="updraftplusmethod dropbox">
|
224 |
<th>Authenticate with Dropbox:</th>
|
225 |
<td><p><?php if (UpdraftPlus_Options::get_updraft_option('updraft_dropboxtk_request_token','xyz') != 'xyz') echo "<strong>(You appear to be already authenticated).</strong>"; ?> <a href="?page=updraftplus&action=updraftmethod-dropbox-auth&updraftplus_dropboxauth=doit"><strong>After</strong> you have saved your settings (by clicking "Save Changes" below), then come back here once and click this link to complete authentication with Dropbox.</a>
|
@@ -248,11 +242,6 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
248 |
</td>
|
249 |
</tr>
|
250 |
|
251 |
-
<?php
|
252 |
-
// This setting should never have been used - it is legacy/deprecated
|
253 |
-
?>
|
254 |
-
<input type="hidden" name="updraft_dropbox_folder" value="">
|
255 |
-
|
256 |
<?php
|
257 |
// Legacy: only show this next setting to old users who had a setting stored
|
258 |
if (UpdraftPlus_Options::get_updraft_option('updraft_dropbox_appkey')) {
|
@@ -269,30 +258,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
269 |
|
270 |
<?php } ?>
|
271 |
|
272 |
-
<!-- <tr class="updraftplusmethod dropbox">
|
273 |
-
<th></th>
|
274 |
-
<td><p><button id="updraft-dropbox-test" type="button" class="button-primary" style="font-size:18px !important">Test Dropbox Settings</button></p></td>
|
275 |
-
</tr>-->
|
276 |
<?php
|
277 |
}
|
278 |
-
/*
|
279 |
-
function config_print_javascript_onready() {
|
280 |
-
?>
|
281 |
-
jQuery('#updraft-dropbox-test').click(function(){
|
282 |
-
var data = {
|
283 |
-
action: 'updraft_credentials_test',
|
284 |
-
method: 'dropbox',
|
285 |
-
nonce: '<?php echo wp_create_nonce('updraftplus-credentialtest-nonce'); ?>',
|
286 |
-
appkey: jQuery('#updraft_dropbox_appkey').val(),
|
287 |
-
secret: jQuery('#updraft_dropbox_secret').val(),
|
288 |
-
folder: jQuery('#updraft_dropbox_folder').val()
|
289 |
-
};
|
290 |
-
jQuery.post(ajaxurl, data, function(response) {
|
291 |
-
alert('Settings test result: ' + response);
|
292 |
-
});
|
293 |
-
});
|
294 |
-
<?php
|
295 |
-
}*/
|
296 |
|
297 |
public static function action_auth() {
|
298 |
if ( isset( $_GET['oauth_token'] ) ) {
|
16 |
|
17 |
if ($this->current_file_size > 0) {
|
18 |
$percent = round(100*($offset/$this->current_file_size),1);
|
19 |
+
$updraftplus->record_uploaded_chunk($percent, "$uploadid, $offset");
|
20 |
} else {
|
21 |
$updraftplus->log("Dropbox: Chunked Upload: $offset bytes uploaded");
|
22 |
}
|
47 |
$dropbox_folder = trailingslashit(UpdraftPlus_Options::get_updraft_option('updraft_dropbox_folder'));
|
48 |
|
49 |
foreach($backup_array as $file) {
|
|
|
50 |
|
51 |
$file_success = 1;
|
52 |
|
68 |
$upload_id = null;
|
69 |
}
|
70 |
|
|
|
71 |
// Old-style, single file put: $put = $dropbox->putFile($updraft_dir.'/'.$file, $dropbox_folder.$file);
|
72 |
|
73 |
$ourself = $this;
|
74 |
|
75 |
+
$ufile = apply_filters('updraftplus_dropbox_modpath', $file);
|
76 |
+
|
77 |
+
$updraftplus->log("Dropbox: Attempt to upload: $file to: $ufile");
|
78 |
+
|
79 |
try {
|
80 |
+
$dropbox->chunkedUpload($updraft_dir.'/'.$file, '', $ufile, true, $offset, $upload_id, array($ourself, 'chunked_callback'));
|
81 |
} catch (Exception $e) {
|
82 |
$updraftplus->log("Exception: ".$e->getMessage());
|
83 |
if (preg_match("/Submitted input out of alignment: got \[(\d+)\] expected \[(\d+)\]/i", $e->getMessage(), $matches)) {
|
86 |
$dropbox_wanted = $matches[2];
|
87 |
$updraftplus->log("Dropbox alignment error: tried=$we_tried, wanted=$dropbox_wanted; will attempt recovery");
|
88 |
try {
|
89 |
+
$dropbox->chunkedUpload($updraft_dir.'/'.$file, '', $ufile, true, $dropbox_wanted, $upload_id, array($ourself, 'chunked_callback'));
|
90 |
} catch (Exception $e) {
|
91 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
92 |
+
$updraftplus->error("Dropbox error: failed to upload file to $ufile (see full log for more)");
|
93 |
$file_success = 0;
|
94 |
}
|
95 |
} else {
|
96 |
$updraftplus->log('Dropbox error: '.$e->getMessage());
|
97 |
+
$updraftplus->error("Dropbox error: failed to upload file to $ufile (see full log for more)");
|
98 |
$file_success = 0;
|
99 |
}
|
100 |
}
|
121 |
function delete($file) {
|
122 |
|
123 |
global $updraftplus;
|
|
|
124 |
|
125 |
if (UpdraftPlus_Options::get_updraft_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
126 |
$updraftplus->log('You do not appear to be authenticated with Dropbox');
|
136 |
return false;
|
137 |
}
|
138 |
|
139 |
+
$ufile = apply_filters('updraftplus_dropbox_modpath', $file);
|
140 |
+
|
141 |
+
$updraftplus->log("Dropbox: request deletion: $ufile");
|
142 |
|
|
|
143 |
try {
|
144 |
+
$dropbox->delete($ufile);
|
145 |
+
$file_success = 1;
|
146 |
} catch (Exception $e) {
|
147 |
$updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
+
|
150 |
+
if (isset($file_success)) {
|
151 |
$updraftplus->log('Dropbox: delete succeeded');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
}
|
153 |
|
154 |
}
|
173 |
$microtime = microtime(true);
|
174 |
|
175 |
$try_the_other_one = false;
|
176 |
+
|
177 |
+
$ufile = apply_filters('updraftplus_dropbox_modpath', $file);
|
178 |
+
|
179 |
try {
|
180 |
+
$get = $dropbox->getFile($ufile, $updraft_dir.'/'.$file, null, true);
|
181 |
} catch (Exception $e) {
|
182 |
// TODO: Remove this October 2013 (we stored in the wrong place for a while...)
|
183 |
$try_the_other_one = true;
|
184 |
$possible_error = $e->getMessage();
|
185 |
+
$updraftplus->log('Dropbox error: '.$e);
|
186 |
}
|
187 |
|
188 |
+
// TODO: Remove this October 2013 (we stored files in the wrong place for a while...)
|
189 |
if ($try_the_other_one) {
|
190 |
$dropbox_folder = trailingslashit(UpdraftPlus_Options::get_updraft_option('updraft_dropbox_folder'));
|
|
|
191 |
try {
|
192 |
+
$get = $dropbox->getFile($dropbox_folder.'/'.$file, $updraft_dir.'/'.$file, null, true);
|
193 |
if (isset($get['response']['body'])) {
|
194 |
$updraftplus->log("Dropbox: downloaded ".round(strlen($get['response']['body'])/1024,1).' Kb');
|
195 |
}
|
212 |
</td>
|
213 |
</tr>
|
214 |
|
215 |
+
<?php echo apply_filters('updraftplus_dropbox_extra_config', '<tr class="updraftplusmethod dropbox"><td></td><td><strong>Need to use sub-folders?</strong> Backups are saved in apps/UpdraftPlus. If you back up several sites into the same Dropbox and want to organise with sub-folders, then <a href="http://updraftplus.com/shop/">there\'s an add-on for that.</a></td></tr>'); ?>
|
216 |
+
|
217 |
<tr class="updraftplusmethod dropbox">
|
218 |
<th>Authenticate with Dropbox:</th>
|
219 |
<td><p><?php if (UpdraftPlus_Options::get_updraft_option('updraft_dropboxtk_request_token','xyz') != 'xyz') echo "<strong>(You appear to be already authenticated).</strong>"; ?> <a href="?page=updraftplus&action=updraftmethod-dropbox-auth&updraftplus_dropboxauth=doit"><strong>After</strong> you have saved your settings (by clicking "Save Changes" below), then come back here once and click this link to complete authentication with Dropbox.</a>
|
242 |
</td>
|
243 |
</tr>
|
244 |
|
|
|
|
|
|
|
|
|
|
|
245 |
<?php
|
246 |
// Legacy: only show this next setting to old users who had a setting stored
|
247 |
if (UpdraftPlus_Options::get_updraft_option('updraft_dropbox_appkey')) {
|
258 |
|
259 |
<?php } ?>
|
260 |
|
|
|
|
|
|
|
|
|
261 |
<?php
|
262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
public static function action_auth() {
|
265 |
if ( isset( $_GET['oauth_token'] ) ) {
|
methods/webdav.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class UpdraftPlus_BackupModule_webdav {
|
4 |
+
|
5 |
+
// backup method: takes an array, and shovels them off to the cloud storage
|
6 |
+
function backup($backup_array) {
|
7 |
+
|
8 |
+
global $updraftplus;
|
9 |
+
|
10 |
+
$addon_exists = apply_filters('updraft_webdav_exists', 'no');
|
11 |
+
if ($addon_exists !== 'yes') {
|
12 |
+
$updraftplus->log('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
13 |
+
$updraftplus->error('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
14 |
+
return false;
|
15 |
+
}
|
16 |
+
|
17 |
+
// Do our uploading stuff...
|
18 |
+
|
19 |
+
// If successful, then you must do this:
|
20 |
+
// $updraftplus->uploaded_file($file);
|
21 |
+
|
22 |
+
do_action('updraft_webdav_upload_files', $backup_array, $this);
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
// delete method: takes a file name (base name), and removes it from the cloud storage
|
27 |
+
function delete($file, $method_obj) {
|
28 |
+
|
29 |
+
global $updraftplus;
|
30 |
+
|
31 |
+
$addon_exists = apply_filters('updraft_webdav_exists', 'no');
|
32 |
+
if ($addon_exists !== 'yes') {
|
33 |
+
$updraftplus->log('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
34 |
+
$updraftplus->error('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
do_action('updraft_webdav_delete_file', $file, $method_obj);
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
// download method: takes a file name (base name), and removes it from the cloud storage
|
43 |
+
function download($file) {
|
44 |
+
|
45 |
+
global $updraftplus;
|
46 |
+
|
47 |
+
$addon_exists = apply_filters('updraft_webdav_exists', 'no');
|
48 |
+
if ($addon_exists !== 'yes') {
|
49 |
+
$updraftplus->log('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
50 |
+
$updraftplus->error('You do not have the UpdraftPlus WebDAV add-on installed - get it from http://updraftplus.com/shop/');
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
do_action('updraft_webdav_download_file', $file);
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
// config_print: prints out table rows for the configuration screen
|
59 |
+
// Your rows need to have a class exactly matching your method (in this example, webdav), and also a class of updraftplusmethod
|
60 |
+
// Note that logging is not available from this context; it will do nothing.
|
61 |
+
function config_print() {
|
62 |
+
|
63 |
+
$default = <<<ENDHERE
|
64 |
+
<tr class="updraftplusmethod webdav">
|
65 |
+
<th>WebDAV:</th>
|
66 |
+
<td>WebDAV support is available as an add-on - <a href="http://updraftplus.com/shop/webdav/">follow this link to get it.</a></td>
|
67 |
+
</tr>
|
68 |
+
ENDHERE;
|
69 |
+
|
70 |
+
echo apply_filters('updraft_webdav_config_print', $default);
|
71 |
+
}
|
72 |
+
|
73 |
+
public static function config_print_javascript_onready() {
|
74 |
+
do_action('updraft_webdav_config_javascript');
|
75 |
+
}
|
76 |
+
|
77 |
+
public static function credentials_test() {
|
78 |
+
|
79 |
+
do_action('updraft_webdav_credentials_test');
|
80 |
+
|
81 |
+
die;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
options.php
CHANGED
@@ -46,6 +46,7 @@ class UpdraftPlus_Options {
|
|
46 |
register_setting('updraft-options-group', 'updraft_s3_remote_path' );
|
47 |
|
48 |
register_setting('updraft-options-group', 'updraft_sftp_settings' );
|
|
|
49 |
|
50 |
register_setting('updraft-options-group', 'updraft_dropbox_appkey' );
|
51 |
register_setting('updraft-options-group', 'updraft_dropbox_secret' );
|
46 |
register_setting('updraft-options-group', 'updraft_s3_remote_path' );
|
47 |
|
48 |
register_setting('updraft-options-group', 'updraft_sftp_settings' );
|
49 |
+
register_setting('updraft-options-group', 'updraft_webdav_settings' );
|
50 |
|
51 |
register_setting('updraft-options-group', 'updraft_dropbox_appkey' );
|
52 |
register_setting('updraft-options-group', 'updraft_dropbox_secret' );
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== UpdraftPlus Backup ===
|
2 |
Contributors: David Anderson
|
3 |
-
Tags: backup, restore, database, cloud, amazon, s3, dropbox, google drive, ftp,
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 3.5.1
|
6 |
-
Stable tag: 1.4.
|
7 |
Author URI: http://updraftplus.com
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
@@ -13,9 +13,9 @@ Various tweaks and bug-fixes; plus, asynchronous downloading
|
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
<a href="http://updraftplus.com">UpdraftPlus</a> simplifies backups (and restoration). Backup into the cloud (Amazon S3, Dropbox, Google Drive, FTP, SFTP and email) and restore with a single click. Backups of files and database can have separate schedules.
|
17 |
|
18 |
-
* Supports backups to Amazon S3, Dropbox, Google Drive, FTP (including SSL), email, SFTP
|
19 |
* One-click restore
|
20 |
* Backup automatically on a repeating schedule
|
21 |
* Files and databases can have separate schedules
|
@@ -85,7 +85,7 @@ You can check the changelog for changes; but the original Updraft, before I fork
|
|
85 |
|
86 |
= Any known bugs ? =
|
87 |
|
88 |
-
Not a bug, but one issue to be aware of is that backups of very large sites (lots of uploaded media) are quite complex matters, given the limits of running inside WordPress on a huge variety of different web hosting setups. With large sites, you need to use Amazon S3, which UpdraftPlus supports (since 0.9.20)
|
89 |
|
90 |
= My site was hacked, and I have no backups! I thought UpdraftPlus was working! Can I kill you? =
|
91 |
|
@@ -101,6 +101,9 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
|
|
101 |
|
102 |
== Changelog ==
|
103 |
|
|
|
|
|
|
|
104 |
= 1.4.29 - 02/23/2013 =
|
105 |
* Now remembers what cloud service you used for historical backups, if you later switch
|
106 |
* Now performs user downloads from the settings page asynchronously, meaning that enormous backups can be fetched this way
|
1 |
=== UpdraftPlus Backup ===
|
2 |
Contributors: David Anderson
|
3 |
+
Tags: backup, restore, database, cloud, amazon, s3, dropbox, google drive, ftp, webdav, back up, multisite
|
4 |
Requires at least: 3.2
|
5 |
Tested up to: 3.5.1
|
6 |
+
Stable tag: 1.4.30
|
7 |
Author URI: http://updraftplus.com
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
<a href="http://updraftplus.com">UpdraftPlus</a> simplifies backups (and restoration). Backup into the cloud (Amazon S3, Dropbox, Google Drive, FTP, SFTP, WebDAV and email) and restore with a single click. Backups of files and database can have separate schedules.
|
17 |
|
18 |
+
* Supports backups to Amazon S3, Dropbox, Google Drive, FTP (including SSL), email, SFTP and WebDAV
|
19 |
* One-click restore
|
20 |
* Backup automatically on a repeating schedule
|
21 |
* Files and databases can have separate schedules
|
85 |
|
86 |
= Any known bugs ? =
|
87 |
|
88 |
+
Not a bug, but one issue to be aware of is that backups of very large sites (lots of uploaded media) are quite complex matters, given the limits of running inside WordPress on a huge variety of different web hosting setups. With large sites, you need to use Amazon S3, which UpdraftPlus supports (since 0.9.20), Google Drive (0.9.21), Dropbox (since 1.2.19) or WebDAV (since 1.4.30), because these support chunked, resumable uploads. Other backup methods have code (since 0.9.0) to retry failed uploads of an archive, but the upload cannot be chunked, so if an archive is enormous (i.e. cannot be completely uploaded in the time that PHP is allowed for running on your web host) it cannot work.
|
89 |
|
90 |
= My site was hacked, and I have no backups! I thought UpdraftPlus was working! Can I kill you? =
|
91 |
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
+
= 1.4.30 - 03/04/2013 =
|
105 |
+
* Hooks for WebDAV support via add-on
|
106 |
+
|
107 |
= 1.4.29 - 02/23/2013 =
|
108 |
* Now remembers what cloud service you used for historical backups, if you later switch
|
109 |
* Now performs user downloads from the settings page asynchronously, meaning that enormous backups can be fetched this way
|
updraftplus.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
/*
|
3 |
Plugin Name: UpdraftPlus - Backup/Restore
|
4 |
Plugin URI: http://updraftplus.com
|
5 |
-
Description: Backup and restore: your
|
6 |
Author: David Anderson
|
7 |
-
Version: 1.4.
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
10 |
Author URI: http://wordshell.net
|
@@ -109,6 +109,7 @@ class UpdraftPlus {
|
|
109 |
"googledrive" => "Google Drive",
|
110 |
"ftp" => "FTP",
|
111 |
'sftp' => 'SFTP',
|
|
|
112 |
"email" => "Email"
|
113 |
);
|
114 |
|
@@ -163,6 +164,8 @@ class UpdraftPlus {
|
|
163 |
add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
|
164 |
add_action('init', array($this, 'handle_url_actions'));
|
165 |
|
|
|
|
|
166 |
}
|
167 |
|
168 |
// Handle actions passed on to method plugins; e.g. Google OAuth 2.0 - ?page=updraftplus&action=updraftmethod-googledrive-auth
|
@@ -253,8 +256,9 @@ class UpdraftPlus {
|
|
253 |
// The values of the POST array were checked before
|
254 |
set_transient('ud_dlmess_'.$_POST['timestamp'].'_'.$_POST['type'], $line." (".date('M d H:i:s').")", 3600);
|
255 |
} else {
|
256 |
-
UpdraftPlus_Options::update_updraft_option(
|
257 |
}
|
|
|
258 |
}
|
259 |
|
260 |
// This function is used by cloud methods to provide standardised logging, but more importantly to help us detect that meaningful activity took place during a resumption run, so that we can schedule further resumptions if it is worthwhile
|
@@ -863,7 +867,7 @@ class UpdraftPlus {
|
|
863 |
# The paths in the zip should then begin with '$whichone', having removed WP_CONTENT_DIR from the front
|
864 |
$zipcode = $this->make_zipfile($create_from_dir, $zip_name);
|
865 |
if ($zipcode !== true) {
|
866 |
-
$this->log("ERROR: Zip failure:
|
867 |
$this->error("Could not create $whichone zip: code $zipcode. Consult the log file for more information.");
|
868 |
return false;
|
869 |
} else {
|
@@ -1501,7 +1505,7 @@ class UpdraftPlus {
|
|
1501 |
}
|
1502 |
|
1503 |
// TODO: FIXME: Failed downloads may leave log files forever (though they are small)
|
1504 |
-
//
|
1505 |
if ($debug_mode) $this->logfile_open($this->nonce);
|
1506 |
|
1507 |
$this->log("Requested to obtain file: timestamp=$timestamp, type=$type");
|
2 |
/*
|
3 |
Plugin Name: UpdraftPlus - Backup/Restore
|
4 |
Plugin URI: http://updraftplus.com
|
5 |
+
Description: Backup and restore: your site can be backed up locally or to Amazon S3, Dropbox, Google Drive, (S)FTP, WebDAV & email, on automatic schedules.
|
6 |
Author: David Anderson
|
7 |
+
Version: 1.4.30
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
10 |
Author URI: http://wordshell.net
|
109 |
"googledrive" => "Google Drive",
|
110 |
"ftp" => "FTP",
|
111 |
'sftp' => 'SFTP',
|
112 |
+
'webdav' => 'WebDAV',
|
113 |
"email" => "Email"
|
114 |
);
|
115 |
|
164 |
add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
|
165 |
add_action('init', array($this, 'handle_url_actions'));
|
166 |
|
167 |
+
if (defined('UPDRAFTPLUS_PREFERPCLZIP') && UPDRAFTPLUS_PREFERPCLZIP === true) { $this->zip_preferpcl = true; }
|
168 |
+
|
169 |
}
|
170 |
|
171 |
// Handle actions passed on to method plugins; e.g. Google OAuth 2.0 - ?page=updraftplus&action=updraftmethod-googledrive-auth
|
256 |
// The values of the POST array were checked before
|
257 |
set_transient('ud_dlmess_'.$_POST['timestamp'].'_'.$_POST['type'], $line." (".date('M d H:i:s').")", 3600);
|
258 |
} else {
|
259 |
+
UpdraftPlus_Options::update_updraft_option('updraft_lastmessage', $line." (".date('M d H:i:s').")");
|
260 |
}
|
261 |
+
if (isset($_SERVER['KONSOLE_DBUS_SESSION'])) print $line."\n";
|
262 |
}
|
263 |
|
264 |
// This function is used by cloud methods to provide standardised logging, but more importantly to help us detect that meaningful activity took place during a resumption run, so that we can schedule further resumptions if it is worthwhile
|
867 |
# The paths in the zip should then begin with '$whichone', having removed WP_CONTENT_DIR from the front
|
868 |
$zipcode = $this->make_zipfile($create_from_dir, $zip_name);
|
869 |
if ($zipcode !== true) {
|
870 |
+
$this->log("ERROR: Zip failure: Could not create $whichone zip: code=$zipcode");
|
871 |
$this->error("Could not create $whichone zip: code $zipcode. Consult the log file for more information.");
|
872 |
return false;
|
873 |
} else {
|
1505 |
}
|
1506 |
|
1507 |
// TODO: FIXME: Failed downloads may leave log files forever (though they are small)
|
1508 |
+
// Note that log() assumes that the data is in _POST, not _GET
|
1509 |
if ($debug_mode) $this->logfile_open($this->nonce);
|
1510 |
|
1511 |
$this->log("Requested to obtain file: timestamp=$timestamp, type=$type");
|