UpdraftPlus WordPress Backup Plugin - Version 1.2.38

Version Description

  • 01/17/2013 =
  • Easier Dropbox setup (we are now an official production app)
  • 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.38
Comparing to
See all releases

Code changes from version 1.2.36 to 1.2.38

Files changed (4) hide show
  1. images/dropbox-logo.png +0 -0
  2. methods/dropbox.php +80 -95
  3. readme.txt +37 -21
  4. updraftplus.php +10 -16
images/dropbox-logo.png ADDED
Binary file
methods/dropbox.php CHANGED
@@ -16,9 +16,9 @@ class UpdraftPlus_BackupModule_dropbox {
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
  }
@@ -26,20 +26,20 @@ class UpdraftPlus_BackupModule_dropbox {
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');
33
- $updraftplus->error('You do not appear to be authenticated with DropBox');
34
  return false;
35
  }
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: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
42
- $updraftplus->error('DropBox error: '.$e->getMessage().' (see log file for more)');
43
  return false;
44
  }
45
 
@@ -47,7 +47,7 @@ class UpdraftPlus_BackupModule_dropbox {
47
  $dropbox_folder = trailingslashit(get_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
 
@@ -82,17 +82,17 @@ class UpdraftPlus_BackupModule_dropbox {
82
  // Try the indicated offset
83
  $we_tried = $matches[1];
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, $file, '', true, $dropbox_wanted, $upload_id, array($ourself, 'chunked_callback'));
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 $file (see full log for more)");
91
  $file_success = 0;
92
  }
93
  } else {
94
- $updraftplus->log('DropBox error: '.$e->getMessage());
95
- $updraftplus->error("DropBox error: failed to upload file $file (see full log for more)");
96
  $file_success = 0;
97
  }
98
  }
@@ -101,7 +101,7 @@ class UpdraftPlus_BackupModule_dropbox {
101
  $microtime_elapsed = microtime(true)-$microtime;
102
  $speedps = $filesize/$microtime_elapsed;
103
  $speed = sprintf("%.2d",$filesize)." Kb in ".sprintf("%.2d",$microtime_elapsed)."s (".sprintf("%.2d", $speedps)." Kb/s)";
104
- $updraftplus->log("DropBox: File upload success (".$dropbox_folder.$file."): $speed");
105
  delete_transient('updraft_duido_'.$hash);
106
  delete_transient('updraft_duidi_'.$hash);
107
  }
@@ -112,22 +112,26 @@ class UpdraftPlus_BackupModule_dropbox {
112
 
113
  }
114
 
 
 
 
 
115
  function delete($file) {
116
 
117
  global $updraftplus;
118
- $updraftplus->log("DropBox: request deletion: $file");
119
 
120
- if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
121
- $updraftplus->log('You do not appear to be authenticated with DropBox');
122
- //$updraftplus->error('You do not appear to be authenticated with DropBox');
123
  return false;
124
  }
125
 
126
  try {
127
- $dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
128
  } catch (Exception $e) {
129
- $updraftplus->log('DropBox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
130
- //$updraftplus->error('DropBox error: failed to access DropBox (see log file for more)');
131
  return false;
132
  }
133
 
@@ -138,24 +142,24 @@ class UpdraftPlus_BackupModule_dropbox {
138
  // Apparently $dropbox_folder is not needed
139
  $dropbox->delete($file);
140
  } catch (Exception $e) {
141
- $updraftplus->log('DropBox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
142
  // TODO
143
  // Add this back October 2013 when removing the block below
144
- //$updraftplus->error("DropBox error: failed to delete file ($file): see log file for more info");
145
  $file_success = 0;
146
  }
147
  if ($file_success) {
148
- $updraftplus->log('DropBox: delete succeeded');
149
  } else {
150
  $file_success = 1;
151
  // We created the file in the wrong place for a while. This code is needed until October 2013, when it can be removed.
152
  try {
153
  $dropbox->delete($dropbox_folder.'/'.$file);
154
  } catch (Exception $e) {
155
- $updraftplus->log('DropBox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
156
  $file_success = 0;
157
  }
158
- if ($file_success) $updraftplus->log('DropBox: delete succeeded (alternative path)');
159
  }
160
 
161
  }
@@ -164,15 +168,15 @@ class UpdraftPlus_BackupModule_dropbox {
164
 
165
  global $updraftplus;
166
 
167
- if (!get_option('updraft_dropbox_appkey') || get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
168
- $updraftplus->error('You do not appear to be authenticated with DropBox');
169
  return false;
170
  }
171
 
172
  try {
173
- $dropbox = $this->bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
174
  } catch (Exception $e) {
175
- $updraftplus->log('DropBox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
176
  return false;
177
  }
178
 
@@ -191,7 +195,7 @@ class UpdraftPlus_BackupModule_dropbox {
191
  // TODO: Remove this October 2013 (we stored in the wrong place for a while...)
192
  if ($try_the_other_one) {
193
  $dropbox_folder = trailingslashit(get_option('updraft_dropbox_folder'));
194
- $updraftplus->error('DropBox error: '.$e);
195
  try {
196
  $get = $dropbox->getFile($file, $updraft_dir.'/'.$file);
197
  } catch (Exception $e) {
@@ -207,27 +211,17 @@ class UpdraftPlus_BackupModule_dropbox {
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>
216
- <p>Once you have an active DropBox account, you will need to set up an 'app' - <a href="https://www.dropbox.com/developers/apps">get your app key and secret from here</a>. <strong>Set up App Folder access, and select the &quot;Core API&quot;.</strong> (You can give the app whatever name and description you like).</p>
 
217
  </td>
218
  </tr>
219
 
220
  <tr class="updraftplusmethod dropbox">
221
- <th>Your DropBox App Key:</th>
222
- <td><input type="text" autocomplete="off" style="width:332px" id="updraft_dropbox_appkey" name="updraft_dropbox_appkey" value="<?php echo htmlspecialchars(get_option('updraft_dropbox_appkey')) ?>" /></td>
223
- </tr>
224
- <tr class="updraftplusmethod dropbox">
225
- <th>Your DropBox App Secret:</th>
226
- <td><input type="text" style="width:332px" id="updraft_dropbox_secret" name="updraft_dropbox_secret" value="<?php echo htmlspecialchars(get_option('updraft_dropbox_secret')); ?>" /></td>
227
- </tr>
228
- <tr class="updraftplusmethod dropbox">
229
- <th>DropBox Folder:</th>
230
- <td><input type="text" style="width:332px" id="updraft_dropbox_folder" name="updraft_dropbox_folder" value="<?php echo htmlspecialchars(get_option('updraft_dropbox_folder')); ?>" /> <em>N.B. This is inside your &quot;apps&quot; folder</em></td>
231
  </tr>
232
 
233
  <tr class="updraftplusmethod dropbox">
@@ -236,31 +230,45 @@ class UpdraftPlus_BackupModule_dropbox {
236
  <?php
237
  // Check requirements.
238
  if (!function_exists('mcrypt_encrypt')) {
239
- ?><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
240
  }
241
  if (!function_exists("curl_init")) {
242
- ?><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
243
  } else {
244
  $curl_version = curl_version();
245
  $curl_ssl_supported= ($curl_version['features'] & CURL_VERSION_SSL);
246
  if (!$curl_ssl_supported) {
247
- ?><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
248
  }
249
  }
250
  ?>
251
  </td>
252
  </tr>
253
 
254
- <tr class="updraftplusmethod dropbox">
255
- <th>Authenticate with DropBox:</th>
256
- <td><p><?php if (get_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 &quot;Save Changes&quot; below), then come back here once and click this link to complete authentication with DropBox.</a>
257
- </p>
258
- </td>
259
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  <!-- <tr class="updraftplusmethod dropbox">
262
  <th></th>
263
- <td><p><button id="updraft-dropbox-test" type="button" class="button-primary" style="font-size:18px !important">Test DropBox Settings</button></p></td>
264
  </tr>-->
265
  <?php
266
  }
@@ -294,16 +302,16 @@ class UpdraftPlus_BackupModule_dropbox {
294
  function show_authed_admin_warning() {
295
  global $updraftplus;
296
 
297
- $dropbox = self::bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
298
  $accountInfo = $dropbox->accountInfo();
299
 
300
- $message = "<strong>Success</strong>: you have authenticated your DropBox account";
301
 
302
  if ($accountInfo['code'] != "200") {
303
  $message .= " (though part of the returned information was not as expected - your mileage may vary)". $accountInfo['code'];
304
  } else {
305
  $body = $accountInfo['body'];
306
- $message .= ". Your DropBox account name: ".htmlspecialchars($body->display_name);
307
  }
308
  $updraftplus->show_admin_warning($message);
309
 
@@ -311,7 +319,7 @@ class UpdraftPlus_BackupModule_dropbox {
311
 
312
  function auth_token() {
313
  $previous_token = get_option("updraft_dropboxtk_request_token","xyz");
314
- self::bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
315
  $new_token = get_option("updraft_dropboxtk_request_token","xyz");
316
  if ($new_token && $new_token != "xyz") {
317
  add_action('admin_notices', array('UpdraftPlus_BackupModule_dropbox', 'show_authed_admin_warning') );
@@ -321,12 +329,12 @@ class UpdraftPlus_BackupModule_dropbox {
321
  // Acquire single-use authorization code
322
  function auth_request() {
323
 
324
- self::bootstrap(get_option('updraft_dropbox_appkey'), get_option('updraft_dropbox_secret'));
325
 
326
  }
327
 
328
  // This basically reproduces the relevant bits of bootstrap.php from the SDK
329
- function bootstrap($key, $secret) {
330
 
331
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
332
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/Exception.php');
@@ -338,6 +346,10 @@ class UpdraftPlus_BackupModule_dropbox {
338
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/Curl.php');
339
  // require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/WordPress.php');
340
 
 
 
 
 
341
  // Set the callback URL
342
  $callback = admin_url('options-general.php?page=updraftplus&action=updraftmethod-dropbox-auth');
343
 
@@ -349,37 +361,10 @@ class UpdraftPlus_BackupModule_dropbox {
349
 
350
  // WordPress consumer does not yet work
351
  // $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
352
- $OAuth = new Dropbox_Curl($key, $secret, $storage, $callback);
 
 
353
  return new Dropbox_API($OAuth);
354
  }
355
 
356
- function credentials_test() {
357
-
358
- $key = $_POST['appkey'];
359
- $secret = $_POST['secret'];
360
- $folder = $_POST['folder'];
361
-
362
- if (empty($folder)) {
363
- echo "Failure: No folder details were given.";
364
- return;
365
- }
366
- if (empty($key)) {
367
- echo "Failure: No API key was given.";
368
- return;
369
- }
370
- if (empty($secret)) {
371
- echo "Failure: No API secret was given.";
372
- return;
373
- }
374
-
375
- echo "Not yet implemented. $key $secret $folder";
376
-
377
- $dropbox = self::bootstrap($key, $secret);
378
-
379
- $account_info = $dropbox->accountInfo();
380
-
381
- print_r($account_info);
382
-
383
- }
384
-
385
  }
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
  }
26
  function backup($backup_array) {
27
 
28
  global $updraftplus;
29
+ $updraftplus->log("Dropbox: begin cloud upload");
30
 
31
+ if (get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
32
+ $updraftplus->log('You do not appear to be authenticated with Dropbox');
33
+ $updraftplus->error('You do not appear to be authenticated with Dropbox');
34
  return false;
35
  }
36
 
37
  try {
38
+ $dropbox = $this->bootstrap();
39
  $dropbox->setChunkSize(524288); // 512Kb
40
  } catch (Exception $e) {
41
+ $updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
42
+ $updraftplus->error('Dropbox error: '.$e->getMessage().' (see log file for more)');
43
  return false;
44
  }
45
 
47
  $dropbox_folder = trailingslashit(get_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
 
82
  // Try the indicated offset
83
  $we_tried = $matches[1];
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, $file, '', true, $dropbox_wanted, $upload_id, array($ourself, 'chunked_callback'));
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 $file (see full log for more)");
91
  $file_success = 0;
92
  }
93
  } else {
94
+ $updraftplus->log('Dropbox error: '.$e->getMessage());
95
+ $updraftplus->error("Dropbox error: failed to upload file $file (see full log for more)");
96
  $file_success = 0;
97
  }
98
  }
101
  $microtime_elapsed = microtime(true)-$microtime;
102
  $speedps = $filesize/$microtime_elapsed;
103
  $speed = sprintf("%.2d",$filesize)." Kb in ".sprintf("%.2d",$microtime_elapsed)."s (".sprintf("%.2d", $speedps)." Kb/s)";
104
+ $updraftplus->log("Dropbox: File upload success (".$file."): $speed");
105
  delete_transient('updraft_duido_'.$hash);
106
  delete_transient('updraft_duidi_'.$hash);
107
  }
112
 
113
  }
114
 
115
+ function defaults() {
116
+ return array('Z3Q3ZmkwbnplNHA0Zzlx', 'bTY0bm9iNmY4eWhjODRt');
117
+ }
118
+
119
  function delete($file) {
120
 
121
  global $updraftplus;
122
+ $updraftplus->log("Dropbox: request deletion: $file");
123
 
124
+ if (get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
125
+ $updraftplus->log('You do not appear to be authenticated with Dropbox');
126
+ //$updraftplus->error('You do not appear to be authenticated with Dropbox');
127
  return false;
128
  }
129
 
130
  try {
131
+ $dropbox = $this->bootstrap();
132
  } catch (Exception $e) {
133
+ $updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
134
+ //$updraftplus->error('Dropbox error: failed to access Dropbox (see log file for more)');
135
  return false;
136
  }
137
 
142
  // Apparently $dropbox_folder is not needed
143
  $dropbox->delete($file);
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
  if ($file_success) {
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
  }
168
 
169
  global $updraftplus;
170
 
171
+ if (get_option('updraft_dropboxtk_request_token', 'xyz') == 'xyz') {
172
+ $updraftplus->error('You do not appear to be authenticated with Dropbox');
173
  return false;
174
  }
175
 
176
  try {
177
+ $dropbox = $this->bootstrap();
178
  } catch (Exception $e) {
179
+ $updraftplus->log('Dropbox error: '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
180
  return false;
181
  }
182
 
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(get_option('updraft_dropbox_folder'));
198
+ $updraftplus->error('Dropbox error: '.$e);
199
  try {
200
  $get = $dropbox->getFile($file, $updraft_dir.'/'.$file);
201
  } catch (Exception $e) {
211
  ?>
212
  <tr class="updraftplusmethod dropbox">
213
  <td></td>
 
 
 
 
 
214
  <td>
215
+ <img alt="Dropbox logo" src="<?php echo UPDRAFTPLUS_URL.'/images/dropbox-logo.png' ?>">
216
+ <p><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></p>
217
  </td>
218
  </tr>
219
 
220
  <tr class="updraftplusmethod dropbox">
221
+ <th>Authenticate with Dropbox:</th>
222
+ <td><p><?php if (get_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 &quot;Save Changes&quot; below), then come back here once and click this link to complete authentication with Dropbox.</a>
223
+ </p>
224
+ </td>
 
 
 
 
 
 
225
  </tr>
226
 
227
  <tr class="updraftplusmethod dropbox">
230
  <?php
231
  // Check requirements.
232
  if (!function_exists('mcrypt_encrypt')) {
233
+ ?><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
234
  }
235
  if (!function_exists("curl_init")) {
236
+ ?><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
237
  } else {
238
  $curl_version = curl_version();
239
  $curl_ssl_supported= ($curl_version['features'] & CURL_VERSION_SSL);
240
  if (!$curl_ssl_supported) {
241
+ ?><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
242
  }
243
  }
244
  ?>
245
  </td>
246
  </tr>
247
 
248
+ <?php
249
+ // This setting should never have been used - it is legacy/deprecated
250
+ ?>
251
+ <input type="hidden" name="updraft_dropbox_folder" value="">
252
+
253
+ <?php
254
+ // Legacy: only show this next setting to old users who had a setting stored
255
+ if (get_option('updraft_dropbox_appkey')) {
256
+ ?>
257
+
258
+ <tr class="updraftplusmethod dropbox">
259
+ <th>Your Dropbox App Key:</th>
260
+ <td><input type="text" autocomplete="off" style="width:332px" id="updraft_dropbox_appkey" name="updraft_dropbox_appkey" value="<?php echo htmlspecialchars(get_option('updraft_dropbox_appkey')) ?>" /></td>
261
+ </tr>
262
+ <tr class="updraftplusmethod dropbox">
263
+ <th>Your Dropbox App Secret:</th>
264
+ <td><input type="text" style="width:332px" id="updraft_dropbox_secret" name="updraft_dropbox_secret" value="<?php echo htmlspecialchars(get_option('updraft_dropbox_secret')); ?>" /></td>
265
+ </tr>
266
+
267
+ <?php } ?>
268
 
269
  <!-- <tr class="updraftplusmethod dropbox">
270
  <th></th>
271
+ <td><p><button id="updraft-dropbox-test" type="button" class="button-primary" style="font-size:18px !important">Test Dropbox Settings</button></p></td>
272
  </tr>-->
273
  <?php
274
  }
302
  function show_authed_admin_warning() {
303
  global $updraftplus;
304
 
305
+ $dropbox = self::bootstrap();
306
  $accountInfo = $dropbox->accountInfo();
307
 
308
+ $message = "<strong>Success</strong>: you have authenticated your Dropbox account";
309
 
310
  if ($accountInfo['code'] != "200") {
311
  $message .= " (though part of the returned information was not as expected - your mileage may vary)". $accountInfo['code'];
312
  } else {
313
  $body = $accountInfo['body'];
314
+ $message .= ". Your Dropbox account name: ".htmlspecialchars($body->display_name);
315
  }
316
  $updraftplus->show_admin_warning($message);
317
 
319
 
320
  function auth_token() {
321
  $previous_token = get_option("updraft_dropboxtk_request_token","xyz");
322
+ self::bootstrap();
323
  $new_token = get_option("updraft_dropboxtk_request_token","xyz");
324
  if ($new_token && $new_token != "xyz") {
325
  add_action('admin_notices', array('UpdraftPlus_BackupModule_dropbox', 'show_authed_admin_warning') );
329
  // Acquire single-use authorization code
330
  function auth_request() {
331
 
332
+ self::bootstrap();
333
 
334
  }
335
 
336
  // This basically reproduces the relevant bits of bootstrap.php from the SDK
337
+ function bootstrap() {
338
 
339
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/API.php');
340
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/Exception.php');
346
  require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/Curl.php');
347
  // require_once(UPDRAFTPLUS_DIR.'/includes/Dropbox/OAuth/Consumer/WordPress.php');
348
 
349
+ // This formulation was required by Dropbox's developer programme, for what reasons you should ask them!
350
+ $sec = get_option(base64_decode('dXBkcmFmdF9kcm9wYm94X2FwcGtleQ=='));
351
+ $key = get_option(base64_decode('dXBkcmFmdF9kcm9wYm94X3NlY3JldA=='));
352
+
353
  // Set the callback URL
354
  $callback = admin_url('options-general.php?page=updraftplus&action=updraftmethod-dropbox-auth');
355
 
361
 
362
  // WordPress consumer does not yet work
363
  // $OAuth = new Dropbox_ConsumerWordPress($key, $secret, $storage, $callback);
364
+ list($d2, $d1) = self::defaults();
365
+ if (empty($sec)) { $sec = base64_decode($d1); }; if (empty($key)) { $key = base64_decode($d2); }
366
+ $OAuth = new Dropbox_Curl($sec, $key, $storage, $callback);
367
  return new Dropbox_API($OAuth);
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  }
readme.txt CHANGED
@@ -1,20 +1,20 @@
1
  === UpdraftPlus Backup ===
2
  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.36
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
 
15
- UpdraftPlus simplifies backups (and restoration). Backup into the cloud (Amazon S3, DropBox, Google Drive, FTP, and email) and restore with a single click. Backups of files and database can have separate schedules.
16
 
17
- * Supports backups to Amazon S3, DropBox, Google Drive, FTP (including SSL), email
18
  * One-click restore
19
  * Backup automatically on a repeating schedule
20
  * Files and databases can have separate schedules
@@ -24,6 +24,14 @@ UpdraftPlus simplifies backups (and restoration). Backup into the cloud (Amazon
24
  * Debug mode that gives full logging
25
  * Thousands of users: widely tested and reliable
26
 
 
 
 
 
 
 
 
 
27
  == Installation ==
28
 
29
  Standard WordPress plugin installation:
@@ -36,7 +44,7 @@ Standard WordPress plugin installation:
36
 
37
  = What exactly does UpdraftPlus back up ? =
38
 
39
- Unless you disable any of these, it will back up your database (all tables which have been prefixed with the prefix for this WordPress installation, both core tables and extra ones added by plugins), your plugins folder, your themes folder, your uploads folder and any extra folders that other plugins have created in the WordPress content directory.
40
 
41
  = What does UpdraftPlus not back up ? =
42
 
@@ -76,7 +84,7 @@ Again, if you backed up using a cloud method, then on UpdraftPlus's settings pag
76
 
77
  = I want to restore, but have either cannot, or have failed to do so from the WP Admin console =
78
 
79
- That's no problem. If you have access to your backed files (i.e. you have the emailed copies, or have obtained the backed up copies directly from Amazon S3, DropBox, Google Drive, FTP or whatever store you were using), then you simply need to unzip them into the right places. UpdraftPlus does not back up the WordPress core - you can just get a fresh copy of that from www.wordpress.org. So, if you are starting from nothing, then first download and unzip a WordPress zip from www.wordpress.org. After doing that, then unzip the zip files for your uploads, themes, plugins and other filesback into the wp-content directory. Then re-install the database (e.g. by running it through PHPMyAdmin - see also the later question on how to decrypt if your database backup was encrypted). These are all basic operations and not difficult for anyone with simple skills; but if you need help and cannot find someone to assist, then send me a meaningful donation - http://david.dw-perspective.org.uk/donate - and I can help.
80
 
81
  = Anything essential to know? =
82
 
@@ -84,15 +92,15 @@ After you have set up UpdraftPlus, you must check that your backups are taking p
84
 
85
  = My enormous website is hosted by a dirt-cheap provider who starve my account of resources, and UpdraftPlus runs out of time! Help! Please make UpdraftPlus deal with this situation so that I can save two dollars! =
86
 
87
- UpdraftPlus supports resuming backup runs, so that it does not need to do everything in a single go; but this has limits. If your website is huge and your web hosting company gives your tiny resources on an over-loaded server, then your solution is to purchase better web hosting, or to hire me professionally. Otherwise, this is not considered a bug. UpdraftPlus is known to successfully back up websites that run into the gigabytes on web servers that are not resource-starved.
88
 
89
  = How is this better than the original Updraft? =
90
 
91
- You can check the changelog for changes; but the original Updraft, before I forked it, had three major problems. Firstly, it only backed up WP core tables from the database; if any of your plugins stored data in extra tables, then they were not backed up. Secondly, it only backed up your plugins/themes/uploads and not any further directories inside wp-content that other plugins might have created. Thirdly, the database backup did not include charset information, which meant that you needed to know some SQL wizardry to actually be able to use the backup. I made UpdraftPlus out of my experience of trying to back up several sites with Updraft. Then, I added encryption for the database file for extra peace of mind, and future-proofed by getting rid of some deprecated aspects. Since then, many new features have been added, e.g. resuming of failed uploads, and DropBox support.
92
 
93
  = Any known bugs ? =
94
 
95
- Not a bug as such, but one issue to be aware of is that backups of very large sites (lots of uploaded media) can fail, or require a longer period of time to succeed, due to timing out. This depends on how many seconds your web host allows a PHP process to run and how many resources they give you. 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.
96
 
97
  = I encrypted my database - how do I decrypt it? =
98
 
@@ -108,7 +116,7 @@ No, there's no warranty or guarantee, etc. It's completely up to you to verify t
108
 
109
  = Does UpdraftPlus delete all its settings when it is de-installed? =
110
 
111
- 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.
112
 
113
  = I am not running the most recent version of UpdraftPlus. Should I upgrade? =
114
 
@@ -119,13 +127,15 @@ 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.36 - 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
128
- * Fixed cases where DropBox failed to resume chunked uploading
129
  * Can now create uncreated zip files on a resumption attempt
130
  * FTP method now supports SSL (automatically detected)
131
  * New "Test FTP settings" button
@@ -133,21 +143,21 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
133
  * Fix bug (in 1.2.30) that prevented some database uploads completing
134
 
135
  = 1.2.20 - 01/12/2013 =
136
- * DropBox no longer limited to 150Mb uploads
137
- * DropBox can upload in chunks and resume uploading chunks
138
- * Improved DropBox help text
139
 
140
  = 1.2.18 - 01/11/2013 =
141
- * Revert DropBox to CURL-only - was not working properly with WordPress's built-in methods
142
- * Add note that only up to 150Mb is possible for a DropBox upload, until we change our API usage
143
  * Fix unnecessary repetition of database dump upon resumption of a failed backup
144
 
145
  = 1.2.14 - 01/08/2013 =
146
- * DropBox support (no chunked uploading yet, but otherwise complete)
147
  * Make the creation of the database dump also resumable, for people with really slow servers
148
  * Database table backups are now timed
149
  * FTP logging slightly improved
150
- * DropBox support uses WordPress's built-in HTTP functions
151
 
152
  = 1.1.16 - 01/07/2013 =
153
  * Requested feature: more frequent scheduling options requested
@@ -255,6 +265,12 @@ Thanks for asking - yes, I have. Check out my profile page - http://profiles.wor
255
 
256
  1. Configuration page
257
 
 
 
 
 
 
 
258
 
259
  == License ==
260
 
1
  === UpdraftPlus Backup ===
2
  Contributors: David Anderson
3
+ Tags: backup, restore, database, cloud, amazon, s3, dropbox, google drive, gdrive, ftp, cloud, updraft, back up
4
  Requires at least: 3.2
5
  Tested up to: 3.5
6
+ Stable tag: 1.2.38
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
 
15
+ UpdraftPlus simplifies backups (and restoration). Backup into the cloud (Amazon S3, Dropbox, Google Drive, FTP, and email) and restore with a single click. Backups of files and database can have separate schedules.
16
 
17
+ * Supports backups to Amazon S3, Dropbox, Google Drive, FTP (including SSL), email
18
  * One-click restore
19
  * Backup automatically on a repeating schedule
20
  * Files and databases can have separate schedules
24
  * Debug mode that gives full logging
25
  * Thousands of users: widely tested and reliable
26
 
27
+ = Best New WordPress Plugin =
28
+
29
+ That's according to WordPress big cheese, Vladimir Prelovac. Check out his weekly chart to see where UpdraftPlus is right now: http://www.prelovac.com/vladimir/wordpress-plugins-rising-stars
30
+
31
+ = Professional / Enterprise support agreements available =
32
+
33
+ UpdraftPlus is written by professional WordPress developers. If your site needs guaranteed support, then we are available. Get in touch - https://www.simbahosting.co.uk/s3/products-and-services/wordpress-experts/ - to arrange the support contract that your site needs.
34
+
35
  == Installation ==
36
 
37
  Standard WordPress plugin installation:
44
 
45
  = What exactly does UpdraftPlus back up ? =
46
 
47
+ Basically, everything, unless you did something very exotic (which you would then know about) to your WordPress install. Unless you disable any of these, it will back up your database (all tables which have been prefixed with the prefix for this WordPress installation, both core tables and extra ones added by plugins), your plugins folder, your themes folder, your uploads folder and any extra folders that other plugins have created in the WordPress content directory.
48
 
49
  = What does UpdraftPlus not back up ? =
50
 
84
 
85
  = I want to restore, but have either cannot, or have failed to do so from the WP Admin console =
86
 
87
+ That's no problem. If you have access to your backed files (i.e. you have the emailed copies, or have obtained the backed up copies directly from Amazon S3, Dropbox, Google Drive, FTP or whatever store you were using), then you simply need to unzip them into the right places. UpdraftPlus does not back up the WordPress core - you can just get a fresh copy of that from www.wordpress.org. So, if you are starting from nothing, then first download and unzip a WordPress zip from www.wordpress.org. After doing that, then unzip the zip files for your uploads, themes, plugins and other filesback into the wp-content directory. Then re-install the database (e.g. by running it through PHPMyAdmin - see also the later question on how to decrypt if your database backup was encrypted). These are all basic operations and not difficult for anyone with simple skills; but if you need help and cannot find someone to assist, then send me a meaningful donation - http://david.dw-perspective.org.uk/donate - and I can help.
88
 
89
  = Anything essential to know? =
90
 
92
 
93
  = My enormous website is hosted by a dirt-cheap provider who starve my account of resources, and UpdraftPlus runs out of time! Help! Please make UpdraftPlus deal with this situation so that I can save two dollars! =
94
 
95
+ UpdraftPlus supports resuming backup runs right from the beginning, so that it does not need to do everything in a single go; but this has limits. If your website is huge and your web hosting company gives your tiny resources on an over-loaded server, then your solution is to purchase better web hosting, or to hire me professionally. Otherwise, this is not considered a bug. UpdraftPlus is known to successfully back up websites that run into the gigabytes on web servers that are not resource-starved.
96
 
97
  = How is this better than the original Updraft? =
98
 
99
+ You can check the changelog for changes; but the original Updraft, before I forked it, had three major problems. Firstly, it only backed up WP core tables from the database; if any of your plugins stored data in extra tables, then they were not backed up. Secondly, it only backed up your plugins/themes/uploads and not any further directories inside wp-content that other plugins might have created. Thirdly, the database backup did not include charset information, which meant that you needed to know some SQL wizardry to actually be able to use the backup. I made UpdraftPlus out of my experience of trying to back up several sites with Updraft. Then, I added encryption for the database file for extra peace of mind, and future-proofed by getting rid of some deprecated aspects. Since then, many new features have been added, e.g. resuming of failed uploads, and Dropbox support.
100
 
101
  = Any known bugs ? =
102
 
103
+ Not a bug as such, but one issue to be aware of is that backups of very large sites (lots of uploaded media) can fail, or require a longer period of time to succeed, due to timing out. This depends on how many seconds your web host allows a PHP process to run and how many resources they give you. 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.
104
 
105
  = I encrypted my database - how do I decrypt it? =
106
 
116
 
117
  = Does UpdraftPlus delete all its settings when it is de-installed? =
118
 
119
+ 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. If you want to remove all UpdraftPlus's settings, then there's a button down at the bottom of the settings page.
120
 
121
  = I am not running the most recent version of UpdraftPlus. Should I upgrade? =
122
 
127
  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.
128
 
129
  == Changelog ==
130
+
131
+ = 1.2.38 - 01/17/2013 =
132
+ * Easier Dropbox setup (we are now an official production app)
133
  * New button to delete all existing settings
134
  * Admin console now displays rolling status updates
135
 
136
  = 1.2.31 - 01/15/2013 =
137
+ * Fixed bug with Dropbox deletions
138
+ * Fixed cases where Dropbox failed to resume chunked uploading
139
  * Can now create uncreated zip files on a resumption attempt
140
  * FTP method now supports SSL (automatically detected)
141
  * New "Test FTP settings" button
143
  * Fix bug (in 1.2.30) that prevented some database uploads completing
144
 
145
  = 1.2.20 - 01/12/2013 =
146
+ * Dropbox no longer limited to 150Mb uploads
147
+ * Dropbox can upload in chunks and resume uploading chunks
148
+ * Improved Dropbox help text
149
 
150
  = 1.2.18 - 01/11/2013 =
151
+ * Revert Dropbox to CURL-only - was not working properly with WordPress's built-in methods
152
+ * Add note that only up to 150Mb is possible for a Dropbox upload, until we change our API usage
153
  * Fix unnecessary repetition of database dump upon resumption of a failed backup
154
 
155
  = 1.2.14 - 01/08/2013 =
156
+ * Dropbox support (no chunked uploading yet, but otherwise complete)
157
  * Make the creation of the database dump also resumable, for people with really slow servers
158
  * Database table backups are now timed
159
  * FTP logging slightly improved
160
+ * Dropbox support uses WordPress's built-in HTTP functions
161
 
162
  = 1.1.16 - 01/07/2013 =
163
  * Requested feature: more frequent scheduling options requested
265
 
266
  1. Configuration page
267
 
268
+ We recognise and thank the following for code and/or libraries used and/or modified under the terms of their licences:
269
+ * UpdraftPlus is based on the original Updraft by Paul Kehrer (Twitter: http://twitter.com/reaperhulk, Blog: http://langui.sh)
270
+ * Sorin Iclanzan, http://profiles.wordpress.org/hel.io/
271
+ * Ben Tadiar, https://github.com/BenTheDesigner/Dropbox
272
+ * Beau Brownlee, http://www.solutionbot.com/2009/01/02/php-ftp-class/
273
+ * Donovan Schonknecht, http://undesigned.org.za/2007/10/22/amazon-s3-php-class
274
 
275
  == License ==
276
 
updraftplus.php CHANGED
@@ -2,9 +2,9 @@
2
  /*
3
  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.36
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
@@ -60,16 +60,17 @@ if (!$updraftplus->memory_check(192)) {
60
  }
61
 
62
  define('UPDRAFTPLUS_DIR', dirname(__FILE__));
 
63
  define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
64
 
65
  class UpdraftPlus {
66
 
67
- var $version = '1.2.36';
68
 
69
  // Choices will be shown in the admin menu in the order used here
70
  var $backup_methods = array (
71
  "s3" => "Amazon S3",
72
- "dropbox" => "DropBox",
73
  "googledrive" => "Google Drive",
74
  "ftp" => "FTP",
75
  "email" => "Email"
@@ -1494,7 +1495,7 @@ class UpdraftPlus {
1494
  add_action('admin_notices', array($this,'show_admin_warning_googledrive') );
1495
  }
1496
 
1497
- if (current_user_can('manage_options') && get_option('updraft_service') == "dropbox" && get_option('updraft_dropbox_appkey') != "" && get_option('updraft_dropboxtk_request_token','xyz') == 'xyz') {
1498
  add_action('admin_notices', array($this,'show_admin_warning_dropbox') );
1499
  }
1500
  }
@@ -1917,7 +1918,7 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
1917
 
1918
  <table class="form-table" style="width:850px;">
1919
  <tr>
1920
- <th>Remote backup:</th>
1921
  <td><select name="updraft_service" id="updraft-service">
1922
  <?php
1923
  $debug_mode = (get_option('updraft_debug_mode')) ? 'checked="checked"' : "";
@@ -1940,10 +1941,6 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
1940
  ?>
1941
  </select></td>
1942
  </tr>
1943
- <tr class="backup-service-description">
1944
- <td></td><td>Choose your backup method.</td>
1945
-
1946
- </tr>
1947
  <?php
1948
  foreach ($this->backup_methods as $method => $description) {
1949
  require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
@@ -1995,8 +1992,8 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
1995
  <td></td><td><?php echo $dir_info ?> This is where Updraft Backup/Restore will write the zip files it creates initially. This directory must be writable by your web server. Typically you'll want to have it inside your wp-content folder (this is the default). <b>Do not</b> place it inside your uploads dir, as that will cause recursion issues (backups of backups of backups of...).</td>
1996
  </tr>
1997
  <tr>
1998
- <th>Debug mode:</th>
1999
- <td><input type="checkbox" name="updraft_debug_mode" value="1" <?php echo $debug_mode; ?> /> <br>Check this to potentially receive more information and emails on the backup process - useful if something is going wrong. You <strong>must</strong> send me this log if you are filing a bug report.</td>
2000
  </tr>
2001
  <tr>
2002
  <td></td>
@@ -2051,9 +2048,6 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
2051
  </div>
2052
  <?php } ?>
2053
 
2054
- <p><em>UpdraftPlus is based on the original Updraft by <b>Paul Kehrer</b> (<a href="http://langui.sh" target="_blank">Blog</a> | <a href="http://twitter.com/reaperhulk" target="_blank">Twitter</a> )</em></p>
2055
-
2056
-
2057
  <script type="text/javascript">
2058
  /* <![CDATA[ */
2059
  jQuery(document).ready(function() {
@@ -2084,7 +2078,7 @@ echo $delete_local; ?> /> <br>Check this to delete the local backup file (only s
2084
  }
2085
 
2086
  function show_admin_warning_dropbox() {
2087
- $this->show_admin_warning('<strong>UpdraftPlus notice:</strong> <a href="?page=updraftplus&action=updraftmethod-dropbox-auth&updraftplus_dropboxauth=doit">Click here to authenticate your DropBox account (you will not be able to back up to DropBox without it).</a>');
2088
  }
2089
 
2090
  function show_admin_warning_googledrive() {
2
  /*
3
  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.38
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Author URI: http://wordshell.net
60
  }
61
 
62
  define('UPDRAFTPLUS_DIR', dirname(__FILE__));
63
+ define('UPDRAFTPLUS_URL', plugins_url('', __FILE__));
64
  define('UPDRAFT_DEFAULT_OTHERS_EXCLUDE','upgrade,cache,updraft,index.php');
65
 
66
  class UpdraftPlus {
67
 
68
+ var $version = '1.2.38';
69
 
70
  // Choices will be shown in the admin menu in the order used here
71
  var $backup_methods = array (
72
  "s3" => "Amazon S3",
73
+ "dropbox" => "Dropbox",
74
  "googledrive" => "Google Drive",
75
  "ftp" => "FTP",
76
  "email" => "Email"
1495
  add_action('admin_notices', array($this,'show_admin_warning_googledrive') );
1496
  }
1497
 
1498
+ if (current_user_can('manage_options') && get_option('updraft_service') == "dropbox" && get_option('updraft_dropboxtk_request_token','xyz') == 'xyz') {
1499
  add_action('admin_notices', array($this,'show_admin_warning_dropbox') );
1500
  }
1501
  }
1918
 
1919
  <table class="form-table" style="width:850px;">
1920
  <tr>
1921
+ <th>Choose your remote storage:</th>
1922
  <td><select name="updraft_service" id="updraft-service">
1923
  <?php
1924
  $debug_mode = (get_option('updraft_debug_mode')) ? 'checked="checked"' : "";
1941
  ?>
1942
  </select></td>
1943
  </tr>
 
 
 
 
1944
  <?php
1945
  foreach ($this->backup_methods as $method => $description) {
1946
  require_once(UPDRAFTPLUS_DIR.'/methods/'.$method.'.php');
1992
  <td></td><td><?php echo $dir_info ?> This is where Updraft Backup/Restore will write the zip files it creates initially. This directory must be writable by your web server. Typically you'll want to have it inside your wp-content folder (this is the default). <b>Do not</b> place it inside your uploads dir, as that will cause recursion issues (backups of backups of backups of...).</td>
1993
  </tr>
1994
  <tr>
1995
+ <th>Debug / Expert mode:</th>
1996
+ <td><input type="checkbox" name="updraft_debug_mode" value="1" <?php echo $debug_mode; ?> /> <br>Check this to enable some more options below (that will appear after you save), and potentially receive more information and emails on the backup process - useful if something is going wrong. You <strong>must</strong> send me this log if you are filing a bug report.</td>
1997
  </tr>
1998
  <tr>
1999
  <td></td>
2048
  </div>
2049
  <?php } ?>
2050
 
 
 
 
2051
  <script type="text/javascript">
2052
  /* <![CDATA[ */
2053
  jQuery(document).ready(function() {
2078
  }
2079
 
2080
  function show_admin_warning_dropbox() {
2081
+ $this->show_admin_warning('<strong>UpdraftPlus notice:</strong> <a href="?page=updraftplus&action=updraftmethod-dropbox-auth&updraftplus_dropboxauth=doit">Click here to authenticate your Dropbox account (you will not be able to back up to Dropbox without it).</a>');
2082
  }
2083
 
2084
  function show_admin_warning_googledrive() {