Backup and Restore WordPress – WPBackItUp Backup Plugin - Version 1.12.3

Version Description

*Release Date - April 18, 2016

  • FIX : Fix issue with license activation
Download this release

Release Info

Developer cssimmon
Plugin Icon 128x128 Backup and Restore WordPress – WPBackItUp Backup Plugin
Version 1.12.3
Comparing to
See all releases

Code changes from version 1.12.2 to 1.12.3

lib/includes/class-wpbackitup-admin.php CHANGED
@@ -441,7 +441,7 @@ class WPBackitup_Admin {
441
  require_once( WPBACKITUP__PLUGIN_PATH . '/lib/includes/class-job-task.php' );
442
  require_once( WPBACKITUP__PLUGIN_PATH . '/lib/includes/class-job-item.php' );
443
 
444
- $languages_path = dirname(dirname(dirname( plugin_basename( __FILE__ )))) . '/languages/';
445
 
446
  load_plugin_textdomain(
447
  'wp-backitup',
@@ -1334,31 +1334,14 @@ class WPBackitup_Admin {
1334
  'time_zone' => get_option( 'timezone_string' ),
1335
  );
1336
 
1337
- $url = WPBACKITUP__SECURESITE_URL; //PRD
1338
- $post_url = $url . '/api/wpbackitup/register_lite';
1339
-
1340
- WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registration Post URL: ' . $post_url );
1341
- WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registration Post Form Data: ' );
1342
- WPBackItUp_LoggerV2::log($registration_logname,$form_data );
1343
-
1344
- $response = wp_remote_post( $post_url, array(
1345
- 'method' => 'POST',
1346
- 'timeout' => 45,
1347
- 'blocking' => true,
1348
- 'headers' => array(),
1349
- 'body' => $form_data,
1350
- 'cookies' => array()
1351
- )
1352
- );
1353
-
1354
- if ( is_wp_error( $response ) ) {
1355
- $error_message = $response->get_error_message();
1356
- WPBackItUp_LoggerV2::log_error($registration_logname,__METHOD__, 'Lite User Registration Error: ' . $error_message );
1357
- } else {
1358
- WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registered Successfully:' );
1359
- WPBackItUp_LoggerV2::log($registration_logname,$response );
1360
  }
1361
-
1362
  }
1363
  }
1364
 
@@ -1368,6 +1351,39 @@ class WPBackitup_Admin {
1368
  }
1369
  }
1370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1371
  /**
1372
  * Hook into plugin_action_links filter
1373
  *
@@ -1398,14 +1414,14 @@ class WPBackitup_Admin {
1398
  public function get($property) {
1399
 
1400
  //fetch from options
1401
- $property = $this->get_option($property);
1402
 
1403
  //If empty return default
1404
- if (empty($property)) {
1405
- $property=$this->defaults[$property];
1406
  }
1407
 
1408
- return $property;
1409
 
1410
  }
1411
 
@@ -1913,30 +1929,17 @@ class WPBackitup_Admin {
1913
  $data['license_sitecount']= 1;
1914
  $data['license_type']= 0;
1915
  } else {
1916
- //CALL EDD_ACTIVATE_LICENSE to get activation information
1917
- $api_params = array(
1918
- 'edd_action'=> 'activate_license',
1919
- 'license' => $license,
1920
- 'item_name' => urlencode( WPBACKITUP__ITEM_NAME ), // the name of product in EDD
1921
- //'url' => home_url()
1922
- );
1923
-
1924
- WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Activate License Request Info:');
1925
- WPBackItUp_LoggerV2::log($activation_logname,$api_params);
1926
-
1927
- //try 30 secs when connected to web.
1928
- $response = wp_remote_get(
1929
- add_query_arg( $api_params, WPBACKITUP__SECURESITE_URL ),
1930
- array(
1931
- 'timeout' => 25,
1932
- 'sslverify' => false
1933
- )
1934
- );
1935
- WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Validation Response:');
1936
- WPBackItUp_LoggerV2::log($activation_logname,$response);
1937
-
1938
- if ( is_wp_error( $response ) ){
1939
- WPBackItUp_LoggerV2::log_error($activation_logname,__METHOD__, 'Error Message:' .$response->get_error_message());
1940
  //update license last checked date and
1941
  $this->set_option('license_last_check_date', $data['license_last_check_date']);
1942
 
@@ -1953,10 +1956,7 @@ class WPBackitup_Admin {
1953
 
1954
  return false; //Exit and don't update license
1955
  }
1956
-
1957
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
1958
- WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'License Object Info');
1959
- WPBackItUp_LoggerV2::log($activation_logname,$license_data);
1960
 
1961
  //If no json object than error
1962
  if (null==$license_data || false===$license_data){
@@ -2069,7 +2069,48 @@ class WPBackitup_Admin {
2069
  }
2070
  return true;
2071
  }
2072
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2073
  /**-------------- END LICENSE FUNCTIONS ---------------**/
2074
 
2075
  /**
441
  require_once( WPBACKITUP__PLUGIN_PATH . '/lib/includes/class-job-task.php' );
442
  require_once( WPBACKITUP__PLUGIN_PATH . '/lib/includes/class-job-item.php' );
443
 
444
+ $languages_path = dirname(dirname(dirname( plugin_basename( __FILE__ )))) . '/languages/';
445
 
446
  load_plugin_textdomain(
447
  'wp-backitup',
1334
  'time_zone' => get_option( 'timezone_string' ),
1335
  );
1336
 
1337
+ $registration_response = $this->register_lite(WPBACKITUP__SECURESITE_URL,$form_data);
1338
+ if ( false===$registration_response ) {
1339
+ WPBackItUp_LoggerV2::log_error($registration_logname,__METHOD__, 'Unable to register using SSL - attempting NONSSL' );
1340
+ //try without SSL
1341
+ if ( false===$this->register_lite(WPBACKITUP__SITE_URL,$form_data) ) {
1342
+ WPBackItUp_LoggerV2::log_error($registration_logname,__METHOD__, 'Unable to register using SSL' );
1343
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1344
  }
 
1345
  }
1346
  }
1347
 
1351
  }
1352
  }
1353
 
1354
+ private function register_lite($url,$form_data){
1355
+ $registration_logname='debug_registration';
1356
+ $post_url = $url . '/api/wpbackitup/register_lite';
1357
+
1358
+ WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registration Post URL: ' . $post_url );
1359
+ WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registration Post Form Data: ' );
1360
+ WPBackItUp_LoggerV2::log($registration_logname,$form_data );
1361
+
1362
+ $response = wp_remote_post( $post_url, array(
1363
+ 'method' => 'POST',
1364
+ 'timeout' => 45,
1365
+ 'blocking' => true,
1366
+ 'headers' => array(),
1367
+ 'body' => $form_data,
1368
+ 'cookies' => array()
1369
+ )
1370
+ );
1371
+
1372
+ if ( is_wp_error( $response ) ) {
1373
+ $error_message = $response->get_error_message();
1374
+ WPBackItUp_LoggerV2::log_error($registration_logname,__METHOD__, 'Lite User Registration Error: ' . $error_message );
1375
+
1376
+ return false;
1377
+
1378
+ } else {
1379
+ WPBackItUp_LoggerV2::log_info($registration_logname,__METHOD__, 'Lite User Registered Successfully:' );
1380
+ WPBackItUp_LoggerV2::log($registration_logname,$response );
1381
+
1382
+ return true;
1383
+ }
1384
+
1385
+ }
1386
+
1387
  /**
1388
  * Hook into plugin_action_links filter
1389
  *
1414
  public function get($property) {
1415
 
1416
  //fetch from options
1417
+ $property_value = $this->get_option($property);
1418
 
1419
  //If empty return default
1420
+ if (empty($property_value)) {
1421
+ $property_value=$this->defaults[$property];
1422
  }
1423
 
1424
+ return $property_value;
1425
 
1426
  }
1427
 
1929
  $data['license_sitecount']= 1;
1930
  $data['license_type']= 0;
1931
  } else {
1932
+
1933
+ //activate license using SSL
1934
+ $license_data= $this->activate_license(WPBACKITUP__SECURESITE_URL,$license);
1935
+
1936
+ //if false try without SSL - added because of siteground issue with SSL cert
1937
+ if ( false === $license_data) {
1938
+ WPBackItUp_LoggerV2::log_error($activation_logname,__METHOD__, 'Unable to activate using SSL - attemtping without SSL');
1939
+ $license_data= $this->activate_license(WPBACKITUP__SITE_URL,$license);
1940
+ }
1941
+
1942
+ if ( false === $license_data){
 
 
 
 
 
 
 
 
 
 
 
 
 
1943
  //update license last checked date and
1944
  $this->set_option('license_last_check_date', $data['license_last_check_date']);
1945
 
1956
 
1957
  return false; //Exit and don't update license
1958
  }
1959
+
 
 
 
1960
 
1961
  //If no json object than error
1962
  if (null==$license_data || false===$license_data){
2069
  }
2070
  return true;
2071
  }
2072
+
2073
+ private function activate_license($activation_url,$license){
2074
+ $activation_logname='debug_activation';
2075
+
2076
+ //CALL EDD_ACTIVATE_LICENSE to get activation information
2077
+ $api_params = array(
2078
+ 'edd_action'=> 'activate_license',
2079
+ 'license' => $license,
2080
+ 'item_name' => urlencode( WPBACKITUP__ITEM_NAME ), // the name of product in EDD
2081
+ //'url' => home_url()
2082
+ );
2083
+
2084
+ WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Activate License Request Info:');
2085
+ WPBackItUp_LoggerV2::log($activation_logname,$api_params);
2086
+
2087
+ //try 30 secs when connected to web.
2088
+ $response = wp_remote_get(
2089
+ add_query_arg( $api_params, $activation_url ),
2090
+ array(
2091
+ 'timeout' => 25,
2092
+ 'sslverify' => false
2093
+ )
2094
+ );
2095
+ WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Validation Response:');
2096
+ WPBackItUp_LoggerV2::log($activation_logname,$response);
2097
+
2098
+ if ( is_wp_error( $response ) ){
2099
+ WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Requesting Server Name:'. $_SERVER['SERVER_NAME']);
2100
+ WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'Requesting IP:'. $_SERVER['SERVER_ADDR']);
2101
+
2102
+ WPBackItUp_LoggerV2::log_error($activation_logname,__METHOD__, 'Response Info:' .var_export($response,true));
2103
+
2104
+ return false;
2105
+ }
2106
+
2107
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
2108
+ WPBackItUp_LoggerV2::log_info($activation_logname,__METHOD__, 'License Object Info');
2109
+ WPBackItUp_LoggerV2::log($activation_logname,$license_data);
2110
+
2111
+ return $license_data;
2112
+
2113
+ }
2114
  /**-------------- END LICENSE FUNCTIONS ---------------**/
2115
 
2116
  /**
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === WPBackItUp Backup & Restore ===
2
  Contributors: wpbackitup, cssimmon, alaminopu
3
  Donate link: http://www.wpbackitup.com
4
  Tags: backup, backups, restore, migrate, clone, duplicate, multisite, database, archive, malware, download, mysql
@@ -168,6 +168,11 @@ Our online documentation and full list of FAQs can be found at [support.wpbackit
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
171
  = 1.12.2 =
172
  *Release Date - March 10, 2016
173
 
1
+ === Backup & Restore WPBackItUp ===
2
  Contributors: wpbackitup, cssimmon, alaminopu
3
  Donate link: http://www.wpbackitup.com
4
  Tags: backup, backups, restore, migrate, clone, duplicate, multisite, database, archive, malware, download, mysql
168
 
169
  == Changelog ==
170
 
171
+ = 1.12.3 =
172
+ *Release Date - April 18, 2016
173
+
174
+ * FIX : Fix issue with license activation
175
+
176
  = 1.12.2 =
177
  *Release Date - March 10, 2016
178
 
wp-backitup.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
7
  * Author: Chris Simmons
8
  * Author URI: https://www.wpbackitup.com
9
- * Version: 1.12.2
10
  * Text Domain: wp-backitup
11
  * Domain Path: /languages
12
  *
@@ -32,7 +32,7 @@ define( 'WPBACKITUP__NAMESPACE', 'wp-backitup' );
32
  define( 'WPBACKITUP__CLASSNAMESPACE', 'WPBackItUp' );
33
  define( 'WPBACKITUP__MAJOR_VERSION', 1);
34
  define( 'WPBACKITUP__MINOR_VERSION', 12);
35
- define( 'WPBACKITUP__MAINTENANCE_VERSION', 2); //Dont forget to update version in header on WP release
36
  define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
37
  define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));
38
  define( 'WPBACKITUP__DB_VERSION', 4);
6
  * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
7
  * Author: Chris Simmons
8
  * Author URI: https://www.wpbackitup.com
9
+ * Version: 1.12.3
10
  * Text Domain: wp-backitup
11
  * Domain Path: /languages
12
  *
32
  define( 'WPBACKITUP__CLASSNAMESPACE', 'WPBackItUp' );
33
  define( 'WPBACKITUP__MAJOR_VERSION', 1);
34
  define( 'WPBACKITUP__MINOR_VERSION', 12);
35
+ define( 'WPBACKITUP__MAINTENANCE_VERSION', 3); //Dont forget to update version in header on WP release
36
  define( 'WPBACKITUP__BUILD_VERSION', 0); //Used for hotfix releases
37
  define( 'WPBACKITUP__VERSION',sprintf("%d.%d.%d.%d", WPBACKITUP__MAJOR_VERSION, WPBACKITUP__MINOR_VERSION,WPBACKITUP__MAINTENANCE_VERSION,WPBACKITUP__BUILD_VERSION));
38
  define( 'WPBACKITUP__DB_VERSION', 4);