All-in-One WP Migration - Version 3.9

Version Description

  • Fix could not resolve domain name on export/import
Download this release

Release Info

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

Code changes from version 3.8 to 3.9

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.8
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.9
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.8' );
42
 
43
  // ===============
44
  // = Plugin Name =
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
+ define( 'AI1WM_VERSION', '3.9' );
42
 
43
  // ===============
44
  // = Plugin Name =
lib/model/class-ai1wm-export-abstract.php CHANGED
@@ -404,9 +404,10 @@ abstract class Ai1wm_Export_Abstract {
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'] ) ) {
@@ -417,20 +418,16 @@ abstract class Ai1wm_Export_Abstract {
417
  $ip = $_SERVER['SERVER_NAME'];
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
 
436
  // HTTP request
404
  // Resolve domain
405
  $url = admin_url( 'admin-ajax.php?action=ai1wm_export' );
406
  $hostname = parse_url( $url, PHP_URL_HOST );
407
+ $ip = gethostbyname( $hostname );
408
 
409
+ // Could not resolve host
410
+ if ( $hostname === $ip ) {
411
 
412
  // Get server IP address
413
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
418
  $ip = $_SERVER['SERVER_NAME'];
419
  }
420
 
421
+ // Add IPv6 support
422
+ if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
423
+ $ip = "[$ip]";
424
+ }
 
 
 
425
 
426
+ // Replace URL
427
+ $url = preg_replace( sprintf( '/%s/', preg_quote( $hostname, '-' ) ), $ip, $url, 1 );
428
 
429
+ // Set host header
430
+ $headers['Host'] = $hostname;
 
431
  }
432
 
433
  // HTTP request
lib/model/class-ai1wm-import-abstract.php CHANGED
@@ -394,9 +394,10 @@ abstract class Ai1wm_Import_Abstract {
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'] ) ) {
@@ -407,20 +408,16 @@ abstract class Ai1wm_Import_Abstract {
407
  $ip = $_SERVER['SERVER_NAME'];
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
 
426
  // HTTP request
394
  // Resolve domain
395
  $url = admin_url( 'admin-ajax.php?action=ai1wm_import' );
396
  $hostname = parse_url( $url, PHP_URL_HOST );
397
+ $ip = gethostbyname( $hostname );
398
 
399
+ // Could not resolve host
400
+ if ( $hostname === $ip ) {
401
 
402
  // Get server IP address
403
  if ( ! empty( $_SERVER['SERVER_ADDR'] ) ) {
408
  $ip = $_SERVER['SERVER_NAME'];
409
  }
410
 
411
+ // Add IPv6 support
412
+ if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
413
+ $ip = "[$ip]";
414
+ }
 
 
 
415
 
416
+ // Replace URL
417
+ $url = preg_replace( sprintf( '/%s/', preg_quote( $hostname, '-' ) ), $ip, $url, 1 );
418
 
419
+ // Set host header
420
+ $headers['Host'] = $hostname;
 
421
  }
422
 
423
  // HTTP request
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.8
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.8 =
61
  * Fix undefined method on Backups page if PHP version is < 5.3.6
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.9
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.9 =
61
+ * Fix could not resolve domain name on export/import
62
+
63
  = 3.8 =
64
  * Fix undefined method on Backups page if PHP version is < 5.3.6
65