UpdraftPlus WordPress Backup Plugin - Version 1.11.3

Version Description

  • 13/Aug/2015 =

  • FIX: Fix access to S3 for PHP 5.2 users using buckets in the US-WEST-1 region

  • FIX: Fix access to UpdraftPlus Vault for some PHP 5.2 users

Download this release

Release Info

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

Code changes from version 1.11.2 to 1.11.3

methods/dreamobjects.php CHANGED
@@ -19,7 +19,7 @@ if (!is_array(UpdraftPlus_Options::get_updraft_option('updraft_dreamobjects')) &
19
 
20
  class UpdraftPlus_BackupModule_dreamobjects extends UpdraftPlus_BackupModule_s3 {
21
 
22
- protected function set_region($obj, $region) {
23
  $config = $this->get_config();
24
  global $updraftplus;
25
  $updraftplus->log("Set endpoint: ".$config['endpoint']);
19
 
20
  class UpdraftPlus_BackupModule_dreamobjects extends UpdraftPlus_BackupModule_s3 {
21
 
22
+ protected function set_region($obj, $region, $bucket_name='') {
23
  $config = $this->get_config();
24
  global $updraftplus;
25
  $updraftplus->log("Set endpoint: ".$config['endpoint']);
methods/s3.php CHANGED
@@ -176,7 +176,7 @@ class UpdraftPlus_BackupModule_s3 {
176
  return $this->s3_object;
177
  }
178
 
179
- protected function set_region($obj, $region) {
180
  global $updraftplus;
181
  switch ($region) {
182
  case 'EU':
@@ -210,6 +210,12 @@ class UpdraftPlus_BackupModule_s3 {
210
  }
211
 
212
  $updraftplus->log("Set endpoint: $endpoint");
 
 
 
 
 
 
213
  return $obj->setEndpoint($endpoint);
214
  }
215
  }
@@ -257,12 +263,12 @@ class UpdraftPlus_BackupModule_s3 {
257
  }
258
 
259
  // This needs to cope with both original S3 and others (where there is no getBucketLocation())
260
- $region = ($config['key'] == 's3') ? @$s3->getBucketLocation($bucket_name) : 'n/a';
261
 
262
  // See if we can detect the region (which implies the bucket exists and is ours), or if not create it
263
  if (!empty($region) || @$s3->putBucket($bucket_name, 'private') || ('s3' == $config['key'] && false !== ($s3 = $this->use_dns_bucket_name($s3, $bucket_name)) && false !== @$s3->getBucket($bucket_name, null, null, 1))) {
264
- if (empty($region) && $config['key'] == 's3') $region = $s3->getBucketLocation($bucket_name);
265
- if (!empty($region)) $this->set_region($s3, $region);
266
 
267
  $updraft_dir = trailingslashit($updraftplus->backups_dir_location());
268
 
@@ -453,7 +459,7 @@ class UpdraftPlus_BackupModule_s3 {
453
 
454
  $region = ($config['key'] == 'dreamobjects' || $config['key'] == 's3generic') ? 'n/a' : @$s3->getBucketLocation($bucket_name);
455
  if (!empty($region)) {
456
- $this->set_region($s3, $region);
457
  } else {
458
  # Final thing to attempt - see if it was just the location request that failed
459
  $s3 = $this->use_dns_bucket_name($s3, $bucket_name);
@@ -525,7 +531,7 @@ class UpdraftPlus_BackupModule_s3 {
525
 
526
  $region = ($config['key'] == 'dreamobjects' || $config['key'] == 's3generic') ? 'n/a' : @$s3->getBucketLocation($bucket_name);
527
  if (!empty($region)) {
528
- $this->set_region($s3, $region);
529
  } else {
530
  # Final thing to attempt - see if it was just the location request that failed
531
  $s3 = $this->use_dns_bucket_name($s3, $bucket_name);
@@ -608,7 +614,7 @@ class UpdraftPlus_BackupModule_s3 {
608
  }
609
 
610
  if (!empty($region) || !empty($keep_going)) {
611
- $this->set_region($s3, $region);
612
  $fullpath = $updraftplus->backups_dir_location().'/'.$file;
613
  if (!$s3->getObject($bucket_name, $bucket_path.$file, $fullpath, true)) {
614
  $updraftplus->log("$whoweare Error: Failed to download $file. Check your permissions and credentials.");
@@ -818,9 +824,9 @@ class UpdraftPlus_BackupModule_s3 {
818
  return;
819
  }
820
 
821
- $location = ('s3' == $config['key']) ? @$s3->getBucketLocation($bucket) : 'n/a';
822
 
823
- if ('s3' != $config['key']) $this->set_region($s3, $endpoint);
824
 
825
  if ($location && 'n/a' != $location) {
826
  if ('s3' == $config['key']) {
@@ -863,7 +869,7 @@ class UpdraftPlus_BackupModule_s3 {
863
 
864
  if (isset($bucket_exists)) {
865
  $try_file = md5(rand());
866
- if ($config['key'] != 'dreamobjects' && $config['key'] != 's3generic') $this->set_region($s3, $location);
867
  $s3->setExceptions(true);
868
  try {
869
  if (!$s3->putObjectString($try_file, $bucket, $path.$try_file)) {
176
  return $this->s3_object;
177
  }
178
 
179
+ protected function set_region($obj, $region, $bucket_name = '') {
180
  global $updraftplus;
181
  switch ($region) {
182
  case 'EU':
210
  }
211
 
212
  $updraftplus->log("Set endpoint: $endpoint");
213
+
214
+ if ($region == 'us-west-1') {
215
+ $obj->useDNSBucketName(true, $bucket_name);
216
+ return;
217
+ }
218
+
219
  return $obj->setEndpoint($endpoint);
220
  }
221
  }
263
  }
264
 
265
  // This needs to cope with both original S3 and others (where there is no getBucketLocation())
266
+ $region = ($config['key'] == 's3' || $config['key'] == 'updraftvault') ? @$s3->getBucketLocation($bucket_name) : 'n/a';
267
 
268
  // See if we can detect the region (which implies the bucket exists and is ours), or if not create it
269
  if (!empty($region) || @$s3->putBucket($bucket_name, 'private') || ('s3' == $config['key'] && false !== ($s3 = $this->use_dns_bucket_name($s3, $bucket_name)) && false !== @$s3->getBucket($bucket_name, null, null, 1))) {
270
+ if (empty($region) && ($config['key'] == 's3' || $config['key'] == 'updraftvault')) $region = $s3->getBucketLocation($bucket_name);
271
+ if (!empty($region)) $this->set_region($s3, $region, $bucket_name);
272
 
273
  $updraft_dir = trailingslashit($updraftplus->backups_dir_location());
274
 
459
 
460
  $region = ($config['key'] == 'dreamobjects' || $config['key'] == 's3generic') ? 'n/a' : @$s3->getBucketLocation($bucket_name);
461
  if (!empty($region)) {
462
+ $this->set_region($s3, $region, $bucket_name);
463
  } else {
464
  # Final thing to attempt - see if it was just the location request that failed
465
  $s3 = $this->use_dns_bucket_name($s3, $bucket_name);
531
 
532
  $region = ($config['key'] == 'dreamobjects' || $config['key'] == 's3generic') ? 'n/a' : @$s3->getBucketLocation($bucket_name);
533
  if (!empty($region)) {
534
+ $this->set_region($s3, $region, $bucket_name);
535
  } else {
536
  # Final thing to attempt - see if it was just the location request that failed
537
  $s3 = $this->use_dns_bucket_name($s3, $bucket_name);
614
  }
615
 
616
  if (!empty($region) || !empty($keep_going)) {
617
+ $this->set_region($s3, $region, $bucket_name);
618
  $fullpath = $updraftplus->backups_dir_location().'/'.$file;
619
  if (!$s3->getObject($bucket_name, $bucket_path.$file, $fullpath, true)) {
620
  $updraftplus->log("$whoweare Error: Failed to download $file. Check your permissions and credentials.");
824
  return;
825
  }
826
 
827
+ $location = ('s3' == $config['key'] || 'updraftvault' == $config['key']) ? @$s3->getBucketLocation($bucket) : 'n/a';
828
 
829
+ if ('s3' != $config['key']) $this->set_region($s3, $endpoint, $bucket);
830
 
831
  if ($location && 'n/a' != $location) {
832
  if ('s3' == $config['key']) {
869
 
870
  if (isset($bucket_exists)) {
871
  $try_file = md5(rand());
872
+ if ($config['key'] != 'dreamobjects' && $config['key'] != 's3generic') $this->set_region($s3, $location, $bucket);
873
  $s3->setExceptions(true);
874
  try {
875
  if (!$s3->putObjectString($try_file, $bucket, $path.$try_file)) {
methods/s3generic.php CHANGED
@@ -21,7 +21,7 @@ if (!is_array(UpdraftPlus_Options::get_updraft_option('updraft_s3generic')) && '
21
 
22
  class UpdraftPlus_BackupModule_s3generic extends UpdraftPlus_BackupModule_s3 {
23
 
24
- protected function set_region($obj, $region = '') {
25
  $config = $this->get_config();
26
  $endpoint = ($region != '' && $region != 'n/a') ? $region : $config['endpoint'];
27
  global $updraftplus;
21
 
22
  class UpdraftPlus_BackupModule_s3generic extends UpdraftPlus_BackupModule_s3 {
23
 
24
+ protected function set_region($obj, $region = '', $bucket_name = '') {
25
  $config = $this->get_config();
26
  $endpoint = ($region != '' && $region != 'n/a') ? $region : $config['endpoint'];
27
  global $updraftplus;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Backup with UpdraftPlus, DavidAnderson
3
  Tags: backup, backups, restore, amazon backup, s3 backup, dropbox backup, google drive backup, rackspace cloud files, rackspace backup, dreamhost, dreamobjects backup, ftp backup, webdav backup, google cloud storage, onedrive, microsoft one drive, back up, multisite, restoration, sftp backup, ftps, scp backup, migrate, duplicate, copy, mysql backup, database backup, db backups, website backup, wordpress backup, full backup, openstack backup, sicherung
4
  Requires at least: 3.2
5
  Tested up to: 4.3
6
- Stable tag: 1.11.2
7
  Author URI: https://updraftplus.com
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
@@ -120,11 +120,16 @@ The <a href="https://updraftplus.com/news/">UpdraftPlus backup blog</a> is the b
120
 
121
  N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.10.3 of the free version correspond to changes made in 2.10.3.x of the paid version.
122
 
123
- = 1.11.2 - 11/Aug/2015
 
 
 
 
 
124
 
125
  * TWEAK: Handle the results when someone with no UpdraftPlus Vault quota attempts to connect more gracefully
126
 
127
- = 1.11.1 - 10/Aug/2015
128
 
129
  * FEATURE: UpdraftPlus Vault storage - simple to set up storage from your trusted provider: https://updraftplus.com/landing/vault - with 1Gb of free storage for UpdraftPlus Premium customers ( https://updraftplus.com/shop/updraftplus-premium/ ) - and more storage available for anyone to purchase. All other storage options (Dropbox, Google Drive, etc.) remain available, of course!
130
  * FEATURE: S3 enhanced wizard now allows the user to optionally deny the new Amazon Web Services IAM user download and/or delete permissions, for an even more secure setup (at the cost of some convenience - you will need to download/restore/delete S3 backups outside of UpdraftPlus).
@@ -1602,4 +1607,4 @@ We recognise and thank the following for code and/or libraries used and/or modif
1602
 
1603
 
1604
  == Upgrade Notice ==
1605
- * 1.11.2 : UpdraftPlus Vault. Speed improvements. S3 improvements. Many tweaks and small fixes.
3
  Tags: backup, backups, restore, amazon backup, s3 backup, dropbox backup, google drive backup, rackspace cloud files, rackspace backup, dreamhost, dreamobjects backup, ftp backup, webdav backup, google cloud storage, onedrive, microsoft one drive, back up, multisite, restoration, sftp backup, ftps, scp backup, migrate, duplicate, copy, mysql backup, database backup, db backups, website backup, wordpress backup, full backup, openstack backup, sicherung
4
  Requires at least: 3.2
5
  Tested up to: 4.3
6
+ Stable tag: 1.11.3
7
  Author URI: https://updraftplus.com
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
120
 
121
  N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.10.3 of the free version correspond to changes made in 2.10.3.x of the paid version.
122
 
123
+ = 1.11.3 - 13/Aug/2015 =
124
+
125
+ * FIX: Fix access to S3 for PHP 5.2 users using buckets in the US-WEST-1 region
126
+ * FIX: Fix access to UpdraftPlus Vault for some PHP 5.2 users
127
+
128
+ = 1.11.2 - 11/Aug/2015 =
129
 
130
  * TWEAK: Handle the results when someone with no UpdraftPlus Vault quota attempts to connect more gracefully
131
 
132
+ = 1.11.1 - 10/Aug/2015 =
133
 
134
  * FEATURE: UpdraftPlus Vault storage - simple to set up storage from your trusted provider: https://updraftplus.com/landing/vault - with 1Gb of free storage for UpdraftPlus Premium customers ( https://updraftplus.com/shop/updraftplus-premium/ ) - and more storage available for anyone to purchase. All other storage options (Dropbox, Google Drive, etc.) remain available, of course!
135
  * FEATURE: S3 enhanced wizard now allows the user to optionally deny the new Amazon Web Services IAM user download and/or delete permissions, for an even more secure setup (at the cost of some convenience - you will need to download/restore/delete S3 backups outside of UpdraftPlus).
1607
 
1608
 
1609
  == Upgrade Notice ==
1610
+ * 1.11.3 : Fixes for PHP 5.2 users for S3/Vault storage in some regions
updraftplus.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: UpdraftPlus - Backup/Restore
4
  Plugin URI: https://updraftplus.com
5
  Description: Backup and restore: take backups locally, or backup to Amazon S3, Dropbox, Google Drive, Rackspace, (S)FTP, WebDAV & email, on automatic schedules.
6
  Author: UpdraftPlus.Com, DavidAnderson
7
- Version: 1.11.2
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Text Domain: updraftplus
4
  Plugin URI: https://updraftplus.com
5
  Description: Backup and restore: take backups locally, or backup to Amazon S3, Dropbox, Google Drive, Rackspace, (S)FTP, WebDAV & email, on automatic schedules.
6
  Author: UpdraftPlus.Com, DavidAnderson
7
+ Version: 1.11.3
8
  Donate link: http://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
10
  Text Domain: updraftplus