WP Staging – DB & File Duplicator & Migration - Version 2.2.7

Version Description

  • Fix: Serialize replace is not working properly for serialized strings
  • Fix: WP_SITEURL & WP_HOME not replaced if constant contains php generated string
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 WP Staging – DB & File Duplicator & Migration
Version 2.2.7
Comparing to
See all releases

Code changes from version 2.2.6 to 2.2.7

apps/Backend/Modules/Jobs/Data.php CHANGED
@@ -499,12 +499,12 @@ class Data extends JobExecutable {
499
 
500
 
501
  // Get WP_HOME from wp-config.php
502
- preg_match( "/define\s*\(\s*'WP_HOME'\s*,\s*'(.*)'\s*\);/", $content, $matches );
503
 
504
  if( !empty( $matches[1] ) ) {
505
  $matches[1];
506
 
507
- $pattern = "/define\s*\(\s*'WP_HOME'\s*,\s*'(.*)'\s*\);/";
508
 
509
  $replace = "define('WP_HOME','" . $this->getStagingSiteUrl() . "'); // " . $matches[1];
510
  $replace.= " // Changed by WP-Staging";
@@ -541,12 +541,12 @@ class Data extends JobExecutable {
541
 
542
 
543
  // Get WP_SITEURL from wp-config.php
544
- preg_match( "/define\s*\(\s*'WP_SITEURL'\s*,\s*'(.*)'\s*\);/", $content, $matches );
545
 
546
  if( !empty( $matches[1] ) ) {
547
  $matches[1];
548
 
549
- $pattern = "/define\s*\(\s*'WP_SITEURL'\s*,\s*'(.*)'\s*\);/";
550
 
551
  $replace = "define('WP_SITEURL','" . $this->getStagingSiteUrl() . "'); // " . $matches[1];
552
  $replace.= " // Changed by WP-Staging";
499
 
500
 
501
  // Get WP_HOME from wp-config.php
502
+ preg_match( "/define\s*\(\s*'WP_HOME'\s*,\s*(.*)\s*\);/", $content, $matches );
503
 
504
  if( !empty( $matches[1] ) ) {
505
  $matches[1];
506
 
507
+ $pattern = "/define\s*\(\s*'WP_HOME'\s*,\s*(.*)\s*\);/";
508
 
509
  $replace = "define('WP_HOME','" . $this->getStagingSiteUrl() . "'); // " . $matches[1];
510
  $replace.= " // Changed by WP-Staging";
541
 
542
 
543
  // Get WP_SITEURL from wp-config.php
544
+ preg_match( "/define\s*\(\s*'WP_SITEURL'\s*,\s*(.*)\s*\);/", $content, $matches );
545
 
546
  if( !empty( $matches[1] ) ) {
547
  $matches[1];
548
 
549
+ $pattern = "/define\s*\(\s*'WP_SITEURL'\s*,\s*(.*)\s*\);/";
550
 
551
  $replace = "define('WP_SITEURL','" . $this->getStagingSiteUrl() . "'); // " . $matches[1];
552
  $replace.= " // Changed by WP-Staging";
apps/Backend/Modules/Jobs/SearchReplace.php CHANGED
@@ -414,11 +414,11 @@ class SearchReplace extends JobExecutable {
414
  }
415
 
416
  $data = $_tmp;
417
- unset( $_tmp );
418
- } elseif( is_serialized_string( $data ) ) {
419
- if( $data = $this->unserialize( $data ) !== false ) {
420
- $data = $this->str_replace( $from, $to, $data, $case_insensitive );
421
- $data = serialize( $data );
422
  }
423
  } else {
424
  if( is_string( $data ) ) {
414
  }
415
 
416
  $data = $_tmp;
417
+ unset($_tmp);
418
+ } elseif (is_serialized_string($data)) {
419
+ if (false !== ($data = $this->unserialize($data)) ) {
420
+ $data = $this->str_replace($from, $to, $data, $case_insensitive);
421
+ $data = serialize($data);
422
  }
423
  } else {
424
  if( is_string( $data ) ) {
apps/Core/WPStaging.php CHANGED
@@ -29,7 +29,7 @@ final class WPStaging {
29
  /**
30
  * Plugin version
31
  */
32
- const VERSION = "2.2.6";
33
 
34
  /**
35
  * Plugin name
29
  /**
30
  * Plugin version
31
  */
32
+ const VERSION = "2.2.7";
33
 
34
  /**
35
  * Plugin name
readme.txt CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: staging, duplication, cloning, clone, migration, sandbox, test site, testing, backup, post, admin, administration, duplicate posts
10
  Requires at least: 3.6+
11
  Tested up to: 4.9
12
- Stable tag: 2.2.6
13
  Requires PHP: 5.3
14
 
15
  A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
@@ -146,6 +146,11 @@ https://wp-staging.com
146
 
147
  == Changelog ==
148
 
 
 
 
 
 
149
  = 2.2.6 =
150
  * Fix: If WPML is used the live site is not reachable
151
  * Fix: Can not disable optimizer
@@ -242,5 +247,6 @@ Complete changelog: [https://wp-staging.com/changelog.txt](https://wp-staging.co
242
 
243
  == Upgrade Notice ==
244
 
245
- = 2.2.5 =
246
- 2.2.5 * New: Compatible to WP 4.9.5
 
9
  Tags: staging, duplication, cloning, clone, migration, sandbox, test site, testing, backup, post, admin, administration, duplicate posts
10
  Requires at least: 3.6+
11
  Tested up to: 4.9
12
+ Stable tag: 2.2.7
13
  Requires PHP: 5.3
14
 
15
  A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
146
 
147
  == Changelog ==
148
 
149
+ = 2.2.7 =
150
+ * Fix: Serialize replace is not working properly for serialized strings
151
+ * Fix: WP_SITEURL & WP_HOME not replaced if constant contains php generated string
152
+
153
+
154
  = 2.2.6 =
155
  * Fix: If WPML is used the live site is not reachable
156
  * Fix: Can not disable optimizer
247
 
248
  == Upgrade Notice ==
249
 
250
+ = 2.2.7 =
251
+ * Fix: Serialize replace is not working properly for serialized strings
252
+ * Fix: WP_SITEURL & WP_HOME not replaced if constant contains php generated string
wp-staging.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author: WP-Staging
8
  * Author URI: https://wp-staging.com
9
  * Contributors: ReneHermi, ilgityildirim
10
- * Version: 2.2.6
11
  * Text Domain: wpstg
12
  * Domain Path: /languages/
13
 
7
  * Author: WP-Staging
8
  * Author URI: https://wp-staging.com
9
  * Contributors: ReneHermi, ilgityildirim
10
+ * Version: 2.2.7
11
  * Text Domain: wpstg
12
  * Domain Path: /languages/
13