Version Description
- 01/11/2013 =
- DropBox no longer limited to 150Mb uploads
- DropBox can upload in chunks and resume uploading chunks
Download this release
Release Info
Developer | DavidAnderson |
Plugin | UpdraftPlus WordPress Backup Plugin |
Version | 1.2.19 |
Comparing to | |
See all releases |
Code changes from version 1.2.17 to 1.2.19
- includes/Dropbox/API.php +11 -3
- methods/dropbox.php +57 -15
- methods/googledrive.php +2 -2
- methods/s3.php +6 -6
- readme.txt +10 -5
- updraftplus.php +4 -3
includes/Dropbox/API.php
CHANGED
@@ -140,15 +140,19 @@ class Dropbox_API
|
|
140 |
* @param string|bool $filename The destination filename of the uploaded file
|
141 |
* @param string $path Path to upload the file to, relative to root
|
142 |
* @param boolean $overwrite Should the file be overwritten? (Default: true)
|
|
|
|
|
|
|
143 |
* @return stdClass
|
144 |
*/
|
145 |
-
public function chunkedUpload($file, $filename = false, $path = '', $overwrite = true)
|
146 |
{
|
147 |
if (file_exists($file)) {
|
148 |
if ($handle = @fopen($file, 'r')) {
|
149 |
// Set initial upload ID and offset
|
150 |
-
$
|
151 |
-
|
|
|
152 |
|
153 |
// Read from the file handle until EOF, uploading each chunk
|
154 |
while ($data = fread($handle, $this->chunkSize)) {
|
@@ -169,6 +173,10 @@ class Dropbox_API
|
|
169 |
// Set the data offset
|
170 |
$offset += mb_strlen($data, '8bit');
|
171 |
|
|
|
|
|
|
|
|
|
172 |
// Close the file handle for this chunk
|
173 |
fclose($chunkHandle);
|
174 |
}
|
140 |
* @param string|bool $filename The destination filename of the uploaded file
|
141 |
* @param string $path Path to upload the file to, relative to root
|
142 |
* @param boolean $overwrite Should the file be overwritten? (Default: true)
|
143 |
+
* @param integer $offset position to seek to when opening the file
|
144 |
+
* @param string $uploadID existing upload_id to resume an upload
|
145 |
+
* @param string|array function to call back to upon each chunk
|
146 |
* @return stdClass
|
147 |
*/
|
148 |
+
public function chunkedUpload($file, $filename = false, $path = '', $overwrite = true, $offset = 0, $uploadID = null, $callback = null)
|
149 |
{
|
150 |
if (file_exists($file)) {
|
151 |
if ($handle = @fopen($file, 'r')) {
|
152 |
// Set initial upload ID and offset
|
153 |
+
if ($offset > 0) {
|
154 |
+
fseek($handle, $offset);
|
155 |
+
}
|
156 |
|
157 |
// Read from the file handle until EOF, uploading each chunk
|
158 |
while ($data = fread($handle, $this->chunkSize)) {
|
173 |
// Set the data offset
|
174 |
$offset += mb_strlen($data, '8bit');
|
175 |
|
176 |
+
if ($callback) {
|
177 |
+
call_user_func($callback, $offset, $uploadID);
|
178 |
+
}
|
179 |
+
|
180 |
// Close the file handle for this chunk
|
181 |
fclose($chunkHandle);
|
182 |
}
|
methods/dropbox.php
CHANGED
@@ -4,11 +4,29 @@
|
|
4 |
|
5 |
class UpdraftPlus_BackupModule_dropbox {
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
function backup($backup_array) {
|
8 |
|
9 |
global $updraftplus;
|
10 |
$updraftplus->log("DropBox: begin cloud upload");
|
11 |
-
if (!class_exists("DropBox_API")) require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
12 |
|
13 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
14 |
$updraftplus->log('You do not appear to be authenticated with DropBox');
|
@@ -18,9 +36,10 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
18 |
|
19 |
try {
|
20 |
$dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
|
|
|
21 |
} catch (Exception $e) {
|
22 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
23 |
-
$updraftplus->error('DropBox error:
|
24 |
return false;
|
25 |
}
|
26 |
|
@@ -32,14 +51,30 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
32 |
|
33 |
$file_success = 1;
|
34 |
|
35 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
$microtime = microtime(true);
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
try {
|
39 |
-
|
|
|
40 |
} catch (Exception $e) {
|
41 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
42 |
-
$updraftplus->error(
|
43 |
$file_success = 0;
|
44 |
}
|
45 |
if ($file_success) {
|
@@ -48,6 +83,8 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
48 |
$speedps = $filesize/$microtime_elapsed;
|
49 |
$speed = sprintf("%.2d",$filesize)." Kb in ".sprintf("%.2d",$microtime_elapsed)."s (".sprintf("%.2d", $speedps)." Kb/s)";
|
50 |
$updraftplus->log("DropBox: File upload success (".$dropbox_folder.$file."): $speed");
|
|
|
|
|
51 |
}
|
52 |
|
53 |
}
|
@@ -60,11 +97,10 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
60 |
|
61 |
global $updraftplus;
|
62 |
$updraftplus->log("DropBox: request deletion: $file");
|
63 |
-
if (!class_exists("DropBox_API")) require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
64 |
|
65 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
66 |
$updraftplus->log('You do not appear to be authenticated with DropBox');
|
67 |
-
|
68 |
return false;
|
69 |
}
|
70 |
|
@@ -72,7 +108,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
72 |
$dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
|
73 |
} catch (Exception $e) {
|
74 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
75 |
-
|
76 |
return false;
|
77 |
}
|
78 |
|
@@ -84,7 +120,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
84 |
$dropbox->delete($file);
|
85 |
} catch (Exception $e) {
|
86 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
87 |
-
$updraftplus->error(
|
88 |
$file_success = 0;
|
89 |
}
|
90 |
if ($file_success) $updraftplus->log('DropBox: delete succeeded');
|
@@ -95,8 +131,6 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
95 |
|
96 |
global $updraftplus;
|
97 |
|
98 |
-
if (!class_exists("DropBox_API")) require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
99 |
-
|
100 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
101 |
$updraftplus->error('You do not appear to be authenticated with DropBox');
|
102 |
return false;
|
@@ -149,12 +183,20 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
149 |
<tr class="updraftplusmethod dropbox">
|
150 |
<th></th>
|
151 |
<td>
|
152 |
-
<p><strong>Warning:</strong> UpdraftPlus's DropBox support cannot yet upload anything bigger than 150Mb. If any of your created dumps (plugins, themes, content, database) exceed this, then you cannot use DropBox. We are working on it!</p>
|
153 |
<?php
|
154 |
-
// Check requirements.
|
155 |
if (!function_exists('mcrypt_encrypt')) {
|
156 |
?><p><strong>Warning:</strong> Your web server's PHP installation does not included a required module (MCrypt). Please contact your web hosting provider's support. UpdraftPlus's DropBox module <strong>requires</strong> MCrypt. Please do not file any support requests; there is no alternative.</p><?php
|
157 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
?>
|
159 |
</td>
|
160 |
</tr>
|
@@ -236,6 +278,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
236 |
// This basically reproduces the relevant bits of bootstrap.php from the SDK
|
237 |
function bootstrap($key, $secret) {
|
238 |
|
|
|
239 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/Exception.php');
|
240 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
241 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/ConsumerAbstract.php');
|
@@ -254,6 +297,7 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
254 |
// Instantiate the storage
|
255 |
$storage = new Dropbox_WordPress($encrypter, "updraft_dropboxtk_");
|
256 |
|
|
|
257 |
// $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
|
258 |
$OAuth = new Dropbox_Curl($key, $secret, $storage, $callback);
|
259 |
return new Dropbox_API($OAuth);
|
@@ -278,8 +322,6 @@ class UpdraftPlus_BackupModule_dropbox {
|
|
278 |
return;
|
279 |
}
|
280 |
|
281 |
-
if (!class_exists("DropBox_API")) require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
282 |
-
|
283 |
echo "Not yet implemented. $key $secret $folder";
|
284 |
|
285 |
$dropbox = self::bootstrap($key, $secret);
|
4 |
|
5 |
class UpdraftPlus_BackupModule_dropbox {
|
6 |
|
7 |
+
private $current_file_hash;
|
8 |
+
private $current_file_size;
|
9 |
+
|
10 |
+
function chunked_callback($offset, $uploadid) {
|
11 |
+
global $updraftplus;
|
12 |
+
|
13 |
+
// Update upload ID
|
14 |
+
set_transient('updraf_dbid_'.$this->current_file_hash, $uploadid, 3600*3);
|
15 |
+
set_transient('updraf_dbof_'.$this->current_file_hash, $offset, 3600*3);
|
16 |
+
|
17 |
+
if ($this->current_file_size > 0) {
|
18 |
+
$percent = round(100*($offset/$this->current_file_size),1);
|
19 |
+
$updraftplus->log("DropBox: Chunked Upload: ${percent}% ($uploadid, $offset)");
|
20 |
+
} else {
|
21 |
+
$updraftplus->log("DropBox: Chunked Upload: $offset bytes uploaded");
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
function backup($backup_array) {
|
27 |
|
28 |
global $updraftplus;
|
29 |
$updraftplus->log("DropBox: begin cloud upload");
|
|
|
30 |
|
31 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
32 |
$updraftplus->log('You do not appear to be authenticated with DropBox');
|
36 |
|
37 |
try {
|
38 |
$dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
|
39 |
+
$dropbox->setChunkSize(524288); // 512Kb
|
40 |
} catch (Exception $e) {
|
41 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
42 |
+
$updraftplus->error('DropBox error: failed to access DropBox (see log file for more)');
|
43 |
return false;
|
44 |
}
|
45 |
|
51 |
|
52 |
$file_success = 1;
|
53 |
|
54 |
+
$hash = md5($file);
|
55 |
+
$this->current_file_hash=$hash;
|
56 |
+
|
57 |
+
$filesize = filesize($updraft_dir.'/'.$file);
|
58 |
+
$this->current_file_size = $filesize;
|
59 |
+
// Into Kb
|
60 |
+
$filesize = $filesize/1024;
|
61 |
$microtime = microtime(true);
|
62 |
|
63 |
+
if ($upload_id = get_transient('updraf_dbid_'.$hash)) {
|
64 |
+
# Resume
|
65 |
+
$offset = get_transient('updraf_dbof_'.$hash);
|
66 |
+
$updraftplus->log("This is a resumption: $offset bytes had already been uploaded");
|
67 |
+
} else {
|
68 |
+
$offset = 0;
|
69 |
+
$upload_id = null;
|
70 |
+
}
|
71 |
+
|
72 |
try {
|
73 |
+
//$put = $dropbox->putFile($updraft_dir.'/'.$file, $dropbox_folder.$file);
|
74 |
+
$dropbox->chunkedUpload($updraft_dir.'/'.$file, $file, $dropbox_folder, true, $offset, $upload_id, array($this, 'chunked_callback'));
|
75 |
} catch (Exception $e) {
|
76 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
77 |
+
$updraftplus->error("DropBox error: failed to upload file $file (see full log for more)");
|
78 |
$file_success = 0;
|
79 |
}
|
80 |
if ($file_success) {
|
83 |
$speedps = $filesize/$microtime_elapsed;
|
84 |
$speed = sprintf("%.2d",$filesize)." Kb in ".sprintf("%.2d",$microtime_elapsed)."s (".sprintf("%.2d", $speedps)." Kb/s)";
|
85 |
$updraftplus->log("DropBox: File upload success (".$dropbox_folder.$file."): $speed");
|
86 |
+
delete_transient('updraft_duido_'.$hash);
|
87 |
+
delete_transient('updraft_duidi_'.$hash);
|
88 |
}
|
89 |
|
90 |
}
|
97 |
|
98 |
global $updraftplus;
|
99 |
$updraftplus->log("DropBox: request deletion: $file");
|
|
|
100 |
|
101 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
102 |
$updraftplus->log('You do not appear to be authenticated with DropBox');
|
103 |
+
//$updraftplus->error('You do not appear to be authenticated with DropBox');
|
104 |
return false;
|
105 |
}
|
106 |
|
108 |
$dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
|
109 |
} catch (Exception $e) {
|
110 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
111 |
+
//$updraftplus->error('DropBox error: failed to access DropBox (see log file for more)');
|
112 |
return false;
|
113 |
}
|
114 |
|
120 |
$dropbox->delete($file);
|
121 |
} catch (Exception $e) {
|
122 |
$updraftplus->log('DropBox error: '.print_r($e, true));
|
123 |
+
$updraftplus->error("DropBox error: failed to delete file ($file): see log file for more info");
|
124 |
$file_success = 0;
|
125 |
}
|
126 |
if ($file_success) $updraftplus->log('DropBox: delete succeeded');
|
131 |
|
132 |
global $updraftplus;
|
133 |
|
|
|
|
|
134 |
if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
|
135 |
$updraftplus->error('You do not appear to be authenticated with DropBox');
|
136 |
return false;
|
183 |
<tr class="updraftplusmethod dropbox">
|
184 |
<th></th>
|
185 |
<td>
|
|
|
186 |
<?php
|
187 |
+
// Check requirements.
|
188 |
if (!function_exists('mcrypt_encrypt')) {
|
189 |
?><p><strong>Warning:</strong> Your web server's PHP installation does not included a required module (MCrypt). Please contact your web hosting provider's support. UpdraftPlus's DropBox module <strong>requires</strong> MCrypt. Please do not file any support requests; there is no alternative.</p><?php
|
190 |
}
|
191 |
+
if (!function_exists("curl_init")) {
|
192 |
+
?><p><strong>Warning:</strong> Your web server's PHP installation does not included a required module (Curl). Please contact your web hosting provider's support. UpdraftPlus's DropBox module <strong>requires</strong> Curl. Your only options to get this working are 1) Install/enable curl or 2) Hire us or someone else to code additional support options into UpdraftPlus. 3) Wait, possibly forever, for someone else to do this.</p><?php
|
193 |
+
} else {
|
194 |
+
$curl_version = curl_version();
|
195 |
+
$curl_ssl_supported= ($curl_version['features'] & CURL_VERSION_SSL);
|
196 |
+
if (!$curl_ssl_supported) {
|
197 |
+
?><p><strong>Warning:</strong> Your web server's PHP/Curl installation does not support https access. We cannot access DropBox without this support. Please contact your web hosting provider's support. UpdraftPlus's DropBox module <strong>requires</strong> Curl+https. Your only options to get this working are 1) Install/enable curl with https or 2) Hire us or someone else to code additional support options into UpdraftPlus. 3) Wait, possibly forever, for someone else to do this.</p><?php
|
198 |
+
}
|
199 |
+
}
|
200 |
?>
|
201 |
</td>
|
202 |
</tr>
|
278 |
// This basically reproduces the relevant bits of bootstrap.php from the SDK
|
279 |
function bootstrap($key, $secret) {
|
280 |
|
281 |
+
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
282 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/Exception.php');
|
283 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
|
284 |
require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/ConsumerAbstract.php');
|
297 |
// Instantiate the storage
|
298 |
$storage = new Dropbox_WordPress($encrypter, "updraft_dropboxtk_");
|
299 |
|
300 |
+
// WordPress consumer does not yet work
|
301 |
// $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
|
302 |
$OAuth = new Dropbox_Curl($key, $secret, $storage, $callback);
|
303 |
return new Dropbox_API($OAuth);
|
322 |
return;
|
323 |
}
|
324 |
|
|
|
|
|
325 |
echo "Not yet implemented. $key $secret $folder";
|
326 |
|
327 |
$dropbox = self::bootstrap($key, $secret);
|
methods/googledrive.php
CHANGED
@@ -207,7 +207,7 @@ class UpdraftPlus_BackupModule_googledrive {
|
|
207 |
|
208 |
if ( is_wp_error( $res ) || $res !== true) {
|
209 |
$updraftplus->log( "An error occurred during GoogleDrive upload (2)" );
|
210 |
-
$updraftplus->error( "An error occurred during GoogleDrive upload (
|
211 |
if (is_wp_error( $res )) {
|
212 |
foreach ($res->get_error_messages() as $msg) $updraftplus->log($msg);
|
213 |
}
|
@@ -236,7 +236,7 @@ class UpdraftPlus_BackupModule_googledrive {
|
|
236 |
|
237 |
// Do we have an access token?
|
238 |
if ( !$access_token = $updraftplus->access_token( get_option('updraft_googledrive_token'), get_option('updraft_googledrive_clientid'), get_option('updraft_googledrive_secret') )) {
|
239 |
-
$updraftplus->error('
|
240 |
return false;
|
241 |
}
|
242 |
|
207 |
|
208 |
if ( is_wp_error( $res ) || $res !== true) {
|
209 |
$updraftplus->log( "An error occurred during GoogleDrive upload (2)" );
|
210 |
+
$updraftplus->error( "An error occurred during GoogleDrive upload (see log for more details" );
|
211 |
if (is_wp_error( $res )) {
|
212 |
foreach ($res->get_error_messages() as $msg) $updraftplus->log($msg);
|
213 |
}
|
236 |
|
237 |
// Do we have an access token?
|
238 |
if ( !$access_token = $updraftplus->access_token( get_option('updraft_googledrive_token'), get_option('updraft_googledrive_clientid'), get_option('updraft_googledrive_secret') )) {
|
239 |
+
$updraftplus->error('Have not yet obtained an access token from Google (has the user authorised?)');
|
240 |
return false;
|
241 |
}
|
242 |
|
methods/s3.php
CHANGED
@@ -36,8 +36,8 @@ class UpdraftPlus_BackupModule_s3 {
|
|
36 |
// This is extra code for the 1-chunk case, but less overhead (no bothering with transients)
|
37 |
if ($chunks < 2) {
|
38 |
if (!$s3->putObjectFile($fullpath, $bucket_name, $filepath)) {
|
39 |
-
$updraftplus->log("S3 regular upload: failed");
|
40 |
-
$updraftplus->error("S3 Error: Failed to upload $
|
41 |
} else {
|
42 |
$updraftplus->log("S3 regular upload: success");
|
43 |
$updraftplus->uploaded_file($file);
|
@@ -88,7 +88,7 @@ class UpdraftPlus_BackupModule_s3 {
|
|
88 |
$updraftplus->uploaded_file($file);
|
89 |
} else {
|
90 |
$updraftplus->log("S3 upload: re-assembly failed");
|
91 |
-
$updraftplus->error("S3 upload: re-assembly failed");
|
92 |
}
|
93 |
} else {
|
94 |
$updraftplus->log("S3 upload: upload was not completely successful on this run");
|
@@ -123,10 +123,10 @@ class UpdraftPlus_BackupModule_s3 {
|
|
123 |
$rest = $rest->getResponse();
|
124 |
if ($rest->error === false && $rest->code !== 204) {
|
125 |
$updraftplus->log("S3 Error: Expected HTTP response 204; got: ".$rest->code);
|
126 |
-
|
127 |
} elseif ($rest->error !== false) {
|
128 |
$updraftplus->log("S3 Error: ".$rest->error['code'].": ".$rest->error['message']);
|
129 |
-
|
130 |
}
|
131 |
|
132 |
}
|
@@ -148,7 +148,7 @@ class UpdraftPlus_BackupModule_s3 {
|
|
148 |
if (@$s3->getBucketLocation($bucket_name)) {
|
149 |
$fullpath = trailingslashit(get_option('updraft_dir')).$file;
|
150 |
if (!$s3->getObject($bucket_name, $bucket_path.$file, $fullpath)) {
|
151 |
-
$updraftplus->error("S3 Error: Failed to download $
|
152 |
}
|
153 |
} else {
|
154 |
$updraftplus->error("S3 Error: Failed to access bucket $bucket_name. Check your permissions and credentials.");
|
36 |
// This is extra code for the 1-chunk case, but less overhead (no bothering with transients)
|
37 |
if ($chunks < 2) {
|
38 |
if (!$s3->putObjectFile($fullpath, $bucket_name, $filepath)) {
|
39 |
+
$updraftplus->log("S3 regular upload: failed ($fullpath)");
|
40 |
+
$updraftplus->error("S3 Error: Failed to upload $file.");
|
41 |
} else {
|
42 |
$updraftplus->log("S3 regular upload: success");
|
43 |
$updraftplus->uploaded_file($file);
|
88 |
$updraftplus->uploaded_file($file);
|
89 |
} else {
|
90 |
$updraftplus->log("S3 upload: re-assembly failed");
|
91 |
+
$updraftplus->error("S3 upload: re-assembly failed ($file)");
|
92 |
}
|
93 |
} else {
|
94 |
$updraftplus->log("S3 upload: upload was not completely successful on this run");
|
123 |
$rest = $rest->getResponse();
|
124 |
if ($rest->error === false && $rest->code !== 204) {
|
125 |
$updraftplus->log("S3 Error: Expected HTTP response 204; got: ".$rest->code);
|
126 |
+
//$updraftplus->error("S3 Error: Unexpected HTTP response code ".$rest->code." (expected 204)");
|
127 |
} elseif ($rest->error !== false) {
|
128 |
$updraftplus->log("S3 Error: ".$rest->error['code'].": ".$rest->error['message']);
|
129 |
+
//$updraftplus->error("S3 delete error: ".$rest->error['code'].": ".$rest->error['message']);
|
130 |
}
|
131 |
|
132 |
}
|
148 |
if (@$s3->getBucketLocation($bucket_name)) {
|
149 |
$fullpath = trailingslashit(get_option('updraft_dir')).$file;
|
150 |
if (!$s3->getObject($bucket_name, $bucket_path.$file, $fullpath)) {
|
151 |
+
$updraftplus->error("S3 Error: Failed to download $file. Check your permissions and credentials.");
|
152 |
}
|
153 |
} else {
|
154 |
$updraftplus->error("S3 Error: Failed to access bucket $bucket_name. Check your permissions and credentials.");
|
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.
|
7 |
Donate link: http://david.dw-perspective.org.uk/donate
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
== Upgrade Notice ==
|
11 |
-
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -84,7 +84,7 @@ It does not back up WordPress core (since you can always get another copy of thi
|
|
84 |
|
85 |
= Any known bugs ? =
|
86 |
|
87 |
-
Not a bug as such, but one major issue to be aware of is that backups of very large sites (lots of uploaded media) can fail due to timing out. This depends on how many seconds your web host allows a PHP process to run. With such sites, you need to use Amazon S3, which UpdraftPlus supports (since 0.9.20) or Google Drive (since 0.9.21) with 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.
|
88 |
|
89 |
= I encrypted my database - how do I decrypt it? =
|
90 |
|
@@ -112,8 +112,13 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
|
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
-
= 1.2.
|
116 |
-
*
|
|
|
|
|
|
|
|
|
|
|
117 |
* Fix unnecessary repetition of database dump upon resumption of a failed backup
|
118 |
|
119 |
= 1.2.14 - 01/08/2013 =
|
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.19
|
7 |
Donate link: http://david.dw-perspective.org.uk/donate
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
== Upgrade Notice ==
|
11 |
+
DropBox can now support larger, resumable uploads
|
12 |
|
13 |
== Description ==
|
14 |
|
84 |
|
85 |
= Any known bugs ? =
|
86 |
|
87 |
+
Not a bug as such, but one major issue to be aware of is that backups of very large sites (lots of uploaded media) can fail due to timing out. This depends on how many seconds your web host allows a PHP process to run. With such sites, you need to use Amazon S3, which UpdraftPlus supports (since 0.9.20) or Google Drive (since 0.9.21) or DropBox (since 1.2.19) with 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.
|
88 |
|
89 |
= I encrypted my database - how do I decrypt it? =
|
90 |
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
+
= 1.2.19 - 01/11/2013 =
|
116 |
+
* DropBox no longer limited to 150Mb uploads
|
117 |
+
* DropBox can upload in chunks and resume uploading chunks
|
118 |
+
|
119 |
+
= 1.2.18 - 01/11/2013 =
|
120 |
+
* Revert DropBox to CURL-only - was not working properly with WordPress's built-in methods
|
121 |
+
* Add note that only up to 150Mb is possible for a DropBox upload, until we change our API usage
|
122 |
* Fix unnecessary repetition of database dump upon resumption of a failed backup
|
123 |
|
124 |
= 1.2.14 - 01/08/2013 =
|
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: All your 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.
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
10 |
Author URI: http://wordshell.net
|
@@ -17,6 +17,7 @@ TODO
|
|
17 |
//?? On 'backup now', open up a Lightbox, count down 5 seconds, then start examining the log file (if it can be found)
|
18 |
//Should make clear in dashboard what is a non-fatal error (i.e. can be retried) - leads to unnecessary bug reports
|
19 |
//Eventually, when everything can be resumed, we will no longer need the backup() routine; it can be replaced with the resume() routine
|
|
|
20 |
|
21 |
Encrypt filesystem, if memory allows (and have option for abort if not); split up into multiple zips when needed
|
22 |
// Does not delete old custom directories upon a restore?
|
@@ -58,7 +59,7 @@ define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
|
|
58 |
|
59 |
class UpdraftPlus {
|
60 |
|
61 |
-
var $version = '1.2.
|
62 |
|
63 |
// Choices will be shown in the admin menu in the order used here
|
64 |
var $backup_methods = array (
|
@@ -1584,7 +1585,7 @@ ENDHERE;
|
|
1584 |
$current_time = date('D, F j, Y H:i T',time());
|
1585 |
$updraft_last_backup = get_option('updraft_last_backup');
|
1586 |
if($updraft_last_backup) {
|
1587 |
-
$last_backup = ($updraft_last_backup['success']) ? date('D, F j, Y H:i T',$updraft_last_backup['backup_time']) :
|
1588 |
$last_backup_color = ($updraft_last_backup['success']) ? 'green' : 'red';
|
1589 |
if (!empty($updraft_last_backup['backup_nonce'])) {
|
1590 |
$potential_log_file = $updraft_dir."/log.".$updraft_last_backup['backup_nonce'].".txt";
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/updraftplus
|
5 |
Description: Backup and restore: All your 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.19
|
8 |
Donate link: http://david.dw-perspective.org.uk/donate
|
9 |
License: GPLv3 or later
|
10 |
Author URI: http://wordshell.net
|
17 |
//?? On 'backup now', open up a Lightbox, count down 5 seconds, then start examining the log file (if it can be found)
|
18 |
//Should make clear in dashboard what is a non-fatal error (i.e. can be retried) - leads to unnecessary bug reports
|
19 |
//Eventually, when everything can be resumed, we will no longer need the backup() routine; it can be replaced with the resume() routine
|
20 |
+
// Should we resume if the only errors were upon deletion (i.e. the backup itself was fine?) Presently we do, but it displays errors for the user to confuse them.
|
21 |
|
22 |
Encrypt filesystem, if memory allows (and have option for abort if not); split up into multiple zips when needed
|
23 |
// Does not delete old custom directories upon a restore?
|
59 |
|
60 |
class UpdraftPlus {
|
61 |
|
62 |
+
var $version = '1.2.19';
|
63 |
|
64 |
// Choices will be shown in the admin menu in the order used here
|
65 |
var $backup_methods = array (
|
1585 |
$current_time = date('D, F j, Y H:i T',time());
|
1586 |
$updraft_last_backup = get_option('updraft_last_backup');
|
1587 |
if($updraft_last_backup) {
|
1588 |
+
$last_backup = ($updraft_last_backup['success']) ? date('D, F j, Y H:i T',$updraft_last_backup['backup_time']) : implode("<br>",$updraft_last_backup['errors']);
|
1589 |
$last_backup_color = ($updraft_last_backup['success']) ? 'green' : 'red';
|
1590 |
if (!empty($updraft_last_backup['backup_nonce'])) {
|
1591 |
$potential_log_file = $updraft_dir."/log.".$updraft_last_backup['backup_nonce'].".txt";
|