Version Description
Added
- Improved upload path replacement
- Set permalinks structure to default when pretty permalinks are not supported
Fixed
- Exclude media from advanced options
Download this release
Release Info
| Developer | bangelov |
| Plugin | |
| Version | 7.22 |
| Comparing to | |
| See all releases | |
Code changes from version 7.21 to 7.22
- all-in-one-wp-migration.php +1 -1
- constants.php +1 -1
- functions.php +16 -0
- lib/model/import/class-ai1wm-import-database.php +16 -24
- lib/model/import/class-ai1wm-import-done.php +9 -3
- lib/vendor/servmask/filter/class-ai1wm-recursive-exclude-filter.php +4 -0
- lib/view/import/done.php +14 -6
- lib/view/import/oxygen.php +15 -6
- readme.txt +11 -1
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: 7.
|
| 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: 7.22
|
| 9 |
* Text Domain: all-in-one-wp-migration
|
| 10 |
* Domain Path: /languages
|
| 11 |
* Network: True
|
constants.php
CHANGED
|
@@ -35,7 +35,7 @@ define( 'AI1WM_DEBUG', false );
|
|
| 35 |
// ==================
|
| 36 |
// = Plugin Version =
|
| 37 |
// ==================
|
| 38 |
-
define( 'AI1WM_VERSION', '7.
|
| 39 |
|
| 40 |
// ===============
|
| 41 |
// = Plugin Name =
|
| 35 |
// ==================
|
| 36 |
// = Plugin Version =
|
| 37 |
// ==================
|
| 38 |
+
define( 'AI1WM_VERSION', '7.22' );
|
| 39 |
|
| 40 |
// ===============
|
| 41 |
// = Plugin Name =
|
functions.php
CHANGED
|
@@ -1779,3 +1779,19 @@ function ai1wm_replace_directory_separator_with_forward_slash( $path ) {
|
|
| 1779 |
function ai1wm_escape_windows_directory_separator( $path ) {
|
| 1780 |
return preg_replace( '/[\\\\]+/', '\\\\\\\\', $path );
|
| 1781 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1779 |
function ai1wm_escape_windows_directory_separator( $path ) {
|
| 1780 |
return preg_replace( '/[\\\\]+/', '\\\\\\\\', $path );
|
| 1781 |
}
|
| 1782 |
+
|
| 1783 |
+
/**
|
| 1784 |
+
* Returns whether the server supports URL rewriting.
|
| 1785 |
+
* Detects Apache's mod_rewrite, IIS 7.0+ permalink support, and nginx.
|
| 1786 |
+
*
|
| 1787 |
+
* @return boolean Whether the server supports URL rewriting.
|
| 1788 |
+
*/
|
| 1789 |
+
function ai1wm_got_url_rewrite() {
|
| 1790 |
+
if ( iis7_supports_permalinks() ) {
|
| 1791 |
+
return true;
|
| 1792 |
+
} elseif ( ! empty( $GLOBALS['is_nginx'] ) ) {
|
| 1793 |
+
return true;
|
| 1794 |
+
}
|
| 1795 |
+
|
| 1796 |
+
return apache_mod_loaded( 'mod_rewrite', false );
|
| 1797 |
+
}
|
lib/model/import/class-ai1wm-import-database.php
CHANGED
|
@@ -456,10 +456,6 @@ class Ai1wm_Import_Database {
|
|
| 456 |
// Replace Uploads URL
|
| 457 |
foreach ( array( $uploads_url, $uploads_url_www_inversion ) as $url ) {
|
| 458 |
|
| 459 |
-
// Get domain
|
| 460 |
-
$old_domain = parse_url( $url, PHP_URL_HOST );
|
| 461 |
-
$new_domain = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_HOST );
|
| 462 |
-
|
| 463 |
// Get path
|
| 464 |
$old_path = parse_url( $url, PHP_URL_PATH );
|
| 465 |
$new_path = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_PATH );
|
|
@@ -467,16 +463,16 @@ class Ai1wm_Import_Database {
|
|
| 467 |
// Get scheme
|
| 468 |
$new_scheme = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_SCHEME );
|
| 469 |
|
| 470 |
-
// Add
|
| 471 |
-
if ( ! in_array( sprintf( "='%s
|
| 472 |
-
$old_replace_values[] = sprintf( "='%s
|
| 473 |
-
$new_replace_values[] = sprintf( "='%s
|
| 474 |
}
|
| 475 |
|
| 476 |
-
// Add
|
| 477 |
-
if ( ! in_array( sprintf( '="%s
|
| 478 |
-
$old_replace_values[] = sprintf( '="%s
|
| 479 |
-
$new_replace_values[] = sprintf( '="%s
|
| 480 |
}
|
| 481 |
|
| 482 |
// Set Uploads URL scheme
|
|
@@ -754,10 +750,6 @@ class Ai1wm_Import_Database {
|
|
| 754 |
// Replace Uploads URL
|
| 755 |
foreach ( array( $uploads_url, $uploads_url_www_inversion ) as $url ) {
|
| 756 |
|
| 757 |
-
// Get domain
|
| 758 |
-
$old_domain = parse_url( $url, PHP_URL_HOST );
|
| 759 |
-
$new_domain = parse_url( ai1wm_get_uploads_url(), PHP_URL_HOST );
|
| 760 |
-
|
| 761 |
// Get path
|
| 762 |
$old_path = parse_url( $url, PHP_URL_PATH );
|
| 763 |
$new_path = parse_url( ai1wm_get_uploads_url(), PHP_URL_PATH );
|
|
@@ -765,16 +757,16 @@ class Ai1wm_Import_Database {
|
|
| 765 |
// Get scheme
|
| 766 |
$new_scheme = parse_url( ai1wm_get_uploads_url(), PHP_URL_SCHEME );
|
| 767 |
|
| 768 |
-
// Add
|
| 769 |
-
if ( ! in_array( sprintf( "='%s
|
| 770 |
-
$old_replace_values[] = sprintf( "='%s
|
| 771 |
-
$new_replace_values[] = sprintf( "='%s
|
| 772 |
}
|
| 773 |
|
| 774 |
-
// Add
|
| 775 |
-
if ( ! in_array( sprintf( '="%s
|
| 776 |
-
$old_replace_values[] = sprintf( '="%s
|
| 777 |
-
$new_replace_values[] = sprintf( '="%s
|
| 778 |
}
|
| 779 |
|
| 780 |
// Add Uploads URL scheme
|
| 456 |
// Replace Uploads URL
|
| 457 |
foreach ( array( $uploads_url, $uploads_url_www_inversion ) as $url ) {
|
| 458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
// Get path
|
| 460 |
$old_path = parse_url( $url, PHP_URL_PATH );
|
| 461 |
$new_path = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_PATH );
|
| 463 |
// Get scheme
|
| 464 |
$new_scheme = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_SCHEME );
|
| 465 |
|
| 466 |
+
// Add path with single quote
|
| 467 |
+
if ( ! in_array( sprintf( "='%s", trailingslashit( $old_path ) ), $old_replace_values ) ) {
|
| 468 |
+
$old_replace_values[] = sprintf( "='%s", trailingslashit( $old_path ) );
|
| 469 |
+
$new_replace_values[] = sprintf( "='%s", trailingslashit( $new_path ) );
|
| 470 |
}
|
| 471 |
|
| 472 |
+
// Add path with double quote
|
| 473 |
+
if ( ! in_array( sprintf( '="%s', trailingslashit( $old_path ) ), $old_replace_values ) ) {
|
| 474 |
+
$old_replace_values[] = sprintf( '="%s', trailingslashit( $old_path ) );
|
| 475 |
+
$new_replace_values[] = sprintf( '="%s', trailingslashit( $new_path ) );
|
| 476 |
}
|
| 477 |
|
| 478 |
// Set Uploads URL scheme
|
| 750 |
// Replace Uploads URL
|
| 751 |
foreach ( array( $uploads_url, $uploads_url_www_inversion ) as $url ) {
|
| 752 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 753 |
// Get path
|
| 754 |
$old_path = parse_url( $url, PHP_URL_PATH );
|
| 755 |
$new_path = parse_url( ai1wm_get_uploads_url(), PHP_URL_PATH );
|
| 757 |
// Get scheme
|
| 758 |
$new_scheme = parse_url( ai1wm_get_uploads_url(), PHP_URL_SCHEME );
|
| 759 |
|
| 760 |
+
// Add path with single quote
|
| 761 |
+
if ( ! in_array( sprintf( "='%s", trailingslashit( $old_path ) ), $old_replace_values ) ) {
|
| 762 |
+
$old_replace_values[] = sprintf( "='%s", trailingslashit( $old_path ) );
|
| 763 |
+
$new_replace_values[] = sprintf( "='%s", trailingslashit( $new_path ) );
|
| 764 |
}
|
| 765 |
|
| 766 |
+
// Add path with double quote
|
| 767 |
+
if ( ! in_array( sprintf( '="%s', trailingslashit( $old_path ) ), $old_replace_values ) ) {
|
| 768 |
+
$old_replace_values[] = sprintf( '="%s', trailingslashit( $old_path ) );
|
| 769 |
+
$new_replace_values[] = sprintf( '="%s', trailingslashit( $new_path ) );
|
| 770 |
}
|
| 771 |
|
| 772 |
// Add Uploads URL scheme
|
lib/model/import/class-ai1wm-import-done.php
CHANGED
|
@@ -30,9 +30,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 30 |
class Ai1wm_Import_Done {
|
| 31 |
|
| 32 |
public static function execute( $params ) {
|
|
|
|
| 33 |
|
| 34 |
// Check multisite.json file
|
| 35 |
-
if (
|
| 36 |
|
| 37 |
// Read multisite.json file
|
| 38 |
$handle = ai1wm_open( ai1wm_multisite_path( $params ), 'r' );
|
|
@@ -94,7 +95,7 @@ class Ai1wm_Import_Done {
|
|
| 94 |
} else {
|
| 95 |
|
| 96 |
// Check package.json file
|
| 97 |
-
if (
|
| 98 |
|
| 99 |
// Read package.json file
|
| 100 |
$handle = ai1wm_open( ai1wm_package_path( $params ), 'r' );
|
|
@@ -166,7 +167,7 @@ class Ai1wm_Import_Done {
|
|
| 166 |
}
|
| 167 |
|
| 168 |
// Check blogs.json file
|
| 169 |
-
if (
|
| 170 |
|
| 171 |
// Read blogs.json file
|
| 172 |
$handle = ai1wm_open( ai1wm_blogs_path( $params ), 'r' );
|
|
@@ -240,6 +241,11 @@ class Ai1wm_Import_Done {
|
|
| 240 |
}
|
| 241 |
}
|
| 242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
// Set progress
|
| 244 |
if ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
|
| 245 |
Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/oxygen' ) );
|
| 30 |
class Ai1wm_Import_Done {
|
| 31 |
|
| 32 |
public static function execute( $params ) {
|
| 33 |
+
global $wp_rewrite;
|
| 34 |
|
| 35 |
// Check multisite.json file
|
| 36 |
+
if ( is_file( ai1wm_multisite_path( $params ) ) ) {
|
| 37 |
|
| 38 |
// Read multisite.json file
|
| 39 |
$handle = ai1wm_open( ai1wm_multisite_path( $params ), 'r' );
|
| 95 |
} else {
|
| 96 |
|
| 97 |
// Check package.json file
|
| 98 |
+
if ( is_file( ai1wm_package_path( $params ) ) ) {
|
| 99 |
|
| 100 |
// Read package.json file
|
| 101 |
$handle = ai1wm_open( ai1wm_package_path( $params ), 'r' );
|
| 167 |
}
|
| 168 |
|
| 169 |
// Check blogs.json file
|
| 170 |
+
if ( is_file( ai1wm_blogs_path( $params ) ) ) {
|
| 171 |
|
| 172 |
// Read blogs.json file
|
| 173 |
$handle = ai1wm_open( ai1wm_blogs_path( $params ), 'r' );
|
| 241 |
}
|
| 242 |
}
|
| 243 |
|
| 244 |
+
// Switch to default permalink structure
|
| 245 |
+
if ( ! ai1wm_got_url_rewrite() ) {
|
| 246 |
+
$wp_rewrite->set_permalink_structure( '' );
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
// Set progress
|
| 250 |
if ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
|
| 251 |
Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/oxygen' ) );
|
lib/vendor/servmask/filter/class-ai1wm-recursive-exclude-filter.php
CHANGED
|
@@ -49,6 +49,10 @@ class Ai1wm_Recursive_Exclude_Filter extends RecursiveFilterIterator {
|
|
| 49 |
return false;
|
| 50 |
}
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
if ( strpos( $this->getInnerIterator()->getSubPathname(), "\n" ) !== false ) {
|
| 53 |
return false;
|
| 54 |
}
|
| 49 |
return false;
|
| 50 |
}
|
| 51 |
|
| 52 |
+
if ( in_array( ai1wm_replace_forward_slash_with_directory_separator( $this->getInnerIterator()->getPath() ), $this->exclude ) ) {
|
| 53 |
+
return false;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
if ( strpos( $this->getInnerIterator()->getSubPathname(), "\n" ) !== false ) {
|
| 57 |
return false;
|
| 58 |
}
|
lib/view/import/done.php
CHANGED
|
@@ -27,11 +27,19 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 27 |
die( 'Kangaroos cannot jump here' );
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 34 |
AI1WM_PLUGIN_NAME
|
| 35 |
-
)
|
| 36 |
-
|
| 37 |
-
);
|
| 27 |
die( 'Kangaroos cannot jump here' );
|
| 28 |
}
|
| 29 |
|
| 30 |
+
if ( ai1wm_got_url_rewrite() ) {
|
| 31 |
+
printf(
|
| 32 |
+
__(
|
| 33 |
+
'» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
|
| 34 |
+
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 35 |
+
AI1WM_PLUGIN_NAME
|
| 36 |
+
),
|
| 37 |
+
admin_url( 'options-permalink.php#submit' )
|
| 38 |
+
);
|
| 39 |
+
} else {
|
| 40 |
+
_e(
|
| 41 |
+
'» Permalinks are set to default. <a class="ai1wm-no-underline" href="https://help.servmask.com/knowledgebase/permalinks-are-set-to-default/" target="_blank">Why?</a> (opens a new window)<br />' .
|
| 42 |
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 43 |
AI1WM_PLUGIN_NAME
|
| 44 |
+
);
|
| 45 |
+
}
|
|
|
lib/view/import/oxygen.php
CHANGED
|
@@ -27,12 +27,21 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 27 |
die( 'Kangaroos cannot jump here' );
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
'» <a class="ai1wm-no-underline" href="https://oxygenbuilder.com/documentation/other/importing-exporting/#resigning" target="_blank">Re-sign Oxygen Builder shortcodes</a>. (opens a new window)<br />' .
|
| 34 |
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 35 |
AI1WM_PLUGIN_NAME
|
| 36 |
-
)
|
| 37 |
-
|
| 38 |
-
);
|
| 27 |
die( 'Kangaroos cannot jump here' );
|
| 28 |
}
|
| 29 |
|
| 30 |
+
if ( ai1wm_got_url_rewrite() ) {
|
| 31 |
+
printf(
|
| 32 |
+
__(
|
| 33 |
+
'» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
|
| 34 |
+
'» <a class="ai1wm-no-underline" href="https://oxygenbuilder.com/documentation/other/importing-exporting/#resigning" target="_blank">Re-sign Oxygen Builder shortcodes</a>. (opens a new window)<br />' .
|
| 35 |
+
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 36 |
+
AI1WM_PLUGIN_NAME
|
| 37 |
+
),
|
| 38 |
+
admin_url( 'options-permalink.php#submit' )
|
| 39 |
+
);
|
| 40 |
+
} else {
|
| 41 |
+
_e(
|
| 42 |
+
'» Permalinks are set to default. <a class="ai1wm-no-underline" href="https://help.servmask.com/knowledgebase/permalinks-are-set-to-default/" target="_blank">Why?</a> (opens a new window)<br />' .
|
| 43 |
'» <a class="ai1wm-no-underline" href="https://oxygenbuilder.com/documentation/other/importing-exporting/#resigning" target="_blank">Re-sign Oxygen Builder shortcodes</a>. (opens a new window)<br />' .
|
| 44 |
'» <a class="ai1wm-no-underline" href="https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform" target="_blank">Optionally, review the plugin</a>. (opens a new window)',
|
| 45 |
AI1WM_PLUGIN_NAME
|
| 46 |
+
);
|
| 47 |
+
}
|
|
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Tags: move, transfer, copy, migrate, backup, clone, restore, db migration, wordp
|
|
| 4 |
Requires at least: 3.3
|
| 5 |
Tested up to: 5.4
|
| 6 |
Requires PHP: 5.2.17
|
| 7 |
-
Stable tag: 7.
|
| 8 |
License: GPLv2 or later
|
| 9 |
|
| 10 |
Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
|
|
@@ -108,6 +108,16 @@ Alternatively you can download the plugin using the download button on this page
|
|
| 108 |
All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
|
| 109 |
|
| 110 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
= 7.21 =
|
| 112 |
**Added**
|
| 113 |
|
| 4 |
Requires at least: 3.3
|
| 5 |
Tested up to: 5.4
|
| 6 |
Requires PHP: 5.2.17
|
| 7 |
+
Stable tag: 7.22
|
| 8 |
License: GPLv2 or later
|
| 9 |
|
| 10 |
Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
|
| 108 |
All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
|
| 109 |
|
| 110 |
== Changelog ==
|
| 111 |
+
= 7.22 =
|
| 112 |
+
**Added**
|
| 113 |
+
|
| 114 |
+
* Improved upload path replacement
|
| 115 |
+
* Set permalinks structure to default when pretty permalinks are not supported
|
| 116 |
+
|
| 117 |
+
**Fixed**
|
| 118 |
+
|
| 119 |
+
* Exclude media from advanced options
|
| 120 |
+
|
| 121 |
= 7.21 =
|
| 122 |
**Added**
|
| 123 |
|
