All-in-One WP Migration - Version 3.7

Version Description

  • Add IPv6 support on export/import
Download this release

Release Info

Developer bangelov
Plugin Icon 128x128 All-in-One WP Migration
Version 3.7
Comparing to
See all releases

Code changes from version 3.6 to 3.7

all-in-one-wp-migration.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
- * Version: 3.6
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
+ * Version: 3.7
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
constants.php CHANGED
@@ -38,7 +38,7 @@ if ( function_exists( 'gethostname' ) && in_array( gethostname(), $local ) ) {
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
- define( 'AI1WM_VERSION', '3.6' );
42
 
43
  // ===============
44
  // = Plugin Name =
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
+ define( 'AI1WM_VERSION', '3.7' );
42
 
43
  // ===============
44
  // = Plugin Name =
lib/model/class-ai1wm-export-abstract.php CHANGED
@@ -402,10 +402,12 @@ abstract class Ai1wm_Export_Abstract {
402
  }
403
 
404
  // Resolve domain
405
- $url = admin_url( 'admin-ajax.php?action=ai1wm_export' );
406
- $parsed_url = parse_url( $url, PHP_URL_HOST );
 
 
 
407
 
408
- if ( false !== $parsed_url ) {
409
  // Get server IP address
410
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
411
  $ip = $_SERVER['SERVER_ADDR'];
@@ -416,9 +418,18 @@ abstract class Ai1wm_Export_Abstract {
416
  }
417
 
418
  // Set IP address
419
- if ( $ip !== $parsed_url ) {
420
- $url = preg_replace( sprintf( '/%s/', preg_quote( $parsed_url, '-' ) ), $ip, $url, 1 );
421
- $headers['Host'] = $parsed_url;
 
 
 
 
 
 
 
 
 
422
  }
423
  }
424
 
402
  }
403
 
404
  // Resolve domain
405
+ $url = admin_url( 'admin-ajax.php?action=ai1wm_export' );
406
+ $hostname = parse_url( $url, PHP_URL_HOST );
407
+
408
+ // Set hostname
409
+ if ( false !== $hostname ) {
410
 
 
411
  // Get server IP address
412
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
413
  $ip = $_SERVER['SERVER_ADDR'];
418
  }
419
 
420
  // Set IP address
421
+ if ( $ip !== $hostname ) {
422
+
423
+ // Add IPv6 support
424
+ if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
425
+ $ip = "[$ip]";
426
+ }
427
+
428
+ // Replace URL
429
+ $url = preg_replace( sprintf( '/%s/', preg_quote( $hostname, '-' ) ), $ip, $url, 1 );
430
+
431
+ // Set host header
432
+ $headers['Host'] = $hostname;
433
  }
434
  }
435
 
lib/model/class-ai1wm-import-abstract.php CHANGED
@@ -392,10 +392,12 @@ abstract class Ai1wm_Import_Abstract {
392
  }
393
 
394
  // Resolve domain
395
- $url = admin_url( 'admin-ajax.php?action=ai1wm_import' );
396
- $parsed_url = parse_url( $url, PHP_URL_HOST );
 
 
 
397
 
398
- if ( false !== $parsed_url ) {
399
  // Get server IP address
400
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
401
  $ip = $_SERVER['SERVER_ADDR'];
@@ -406,9 +408,18 @@ abstract class Ai1wm_Import_Abstract {
406
  }
407
 
408
  // Set IP address
409
- if ( $ip !== $parsed_url ) {
410
- $url = preg_replace( sprintf( '/%s/', preg_quote( $parsed_url, '-' ) ), $ip, $url, 1 );
411
- $headers['Host'] = $parsed_url;
 
 
 
 
 
 
 
 
 
412
  }
413
  }
414
 
392
  }
393
 
394
  // Resolve domain
395
+ $url = admin_url( 'admin-ajax.php?action=ai1wm_import' );
396
+ $hostname = parse_url( $url, PHP_URL_HOST );
397
+
398
+ // Set hostname
399
+ if ( false !== $hostname ) {
400
 
 
401
  // Get server IP address
402
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
403
  $ip = $_SERVER['SERVER_ADDR'];
408
  }
409
 
410
  // Set IP address
411
+ if ( $ip !== $hostname ) {
412
+
413
+ // Add IPv6 support
414
+ if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
415
+ $ip = "[$ip]";
416
+ }
417
+
418
+ // Replace URL
419
+ $url = preg_replace( sprintf( '/%s/', preg_quote( $hostname, '-' ) ), $ip, $url, 1 );
420
+
421
+ // Set host header
422
+ $headers['Host'] = $hostname;
423
  }
424
  }
425
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: yani.iliev, bangelov, pimjitsawang
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.2
6
- Stable tag: 3.6
7
  License: GPLv2 or later
8
 
9
  All-in-One WP Migration is the only tool that you will ever need to migrate a WordPress site.
@@ -57,6 +57,9 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
57
  3. Plugin Menu
58
 
59
  == Changelog ==
 
 
 
60
  = 3.6 =
61
  * Fixed undefined constant warnings
62
 
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.2
6
+ Stable tag: 3.7
7
  License: GPLv2 or later
8
 
9
  All-in-One WP Migration is the only tool that you will ever need to migrate a WordPress site.
57
  3. Plugin Menu
58
 
59
  == Changelog ==
60
+ = 3.7 =
61
+ * Add IPv6 support on export/import
62
+
63
  = 3.6 =
64
  * Fixed undefined constant warnings
65