All-in-One WP Migration - Version 5.37

Version Description

  • Validate the archive before import
Download this release

Release Info

Developer yani.iliev
Plugin Icon 128x128 All-in-One WP Migration
Version 5.37
Comparing to
See all releases

Code changes from version 5.36 to 5.37

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: 5.36
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: 5.37
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
constants.php CHANGED
@@ -39,7 +39,7 @@ if ( function_exists( 'gethostname' ) && in_array( gethostname(), $local ) ) {
39
  // ==================
40
  // = Plugin Version =
41
  // ==================
42
- define( 'AI1WM_VERSION', '5.36' );
43
 
44
  // ===============
45
  // = Plugin Name =
39
  // ==================
40
  // = Plugin Version =
41
  // ==================
42
+ define( 'AI1WM_VERSION', '5.37' );
43
 
44
  // ===============
45
  // = Plugin Name =
lib/model/import/class-ai1wm-import-done.php CHANGED
@@ -35,7 +35,7 @@ class Ai1wm_Import_Done {
35
  __(
36
  "You need to perform two more steps:<br />" .
37
  "<strong>1. You must save your permalinks structure twice. <a class=\"ai1wm-no-underline\" href=\"{$permalink}\" target=\"_blank\">Permalinks Settings</a></strong> <small>(opens a new window)</small><br />" .
38
- "<strong>2. <a class=\"ai1wm-no-underline\" href=\"https://wordpress.org/support/view/plugin-reviews/all-in-one-wp-migration?rate=5#postform\" target=\"_blank\">Review the plugin</a>.</strong> <small>(opens a new window)</small>",
39
  AI1WM_PLUGIN_NAME
40
  ),
41
  __(
35
  __(
36
  "You need to perform two more steps:<br />" .
37
  "<strong>1. You must save your permalinks structure twice. <a class=\"ai1wm-no-underline\" href=\"{$permalink}\" target=\"_blank\">Permalinks Settings</a></strong> <small>(opens a new window)</small><br />" .
38
+ "<strong>2. <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>.</strong> <small>(opens a new window)</small>",
39
  AI1WM_PLUGIN_NAME
40
  ),
41
  __(
lib/model/import/class-ai1wm-import-validate.php CHANGED
@@ -33,6 +33,17 @@ class Ai1wm_Import_Validate {
33
  // Open the archive file for reading
34
  $archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
35
 
 
 
 
 
 
 
 
 
 
 
 
36
  // Unpack package.json and database.sql files
37
  $archive->extract_by_files_array(
38
  ai1wm_storage_path( $params ),
33
  // Open the archive file for reading
34
  $archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
35
 
36
+ // Validate the archive file consistency
37
+ if ( ! $archive->is_valid() ) {
38
+ throw new Ai1wm_Import_Exception(
39
+ __(
40
+ 'The archive file is corrupted. Follow this article to resolve the problem: ' .
41
+ '<a href="https://help.servmask.com/knowledgebase/corrupted-archive/" target="_blank">https://help.servmask.com/knowledgebase/corrupted-archive/</a>',
42
+ AI1WM_PLUGIN_NAME
43
+ )
44
+ );
45
+ }
46
+
47
  // Unpack package.json and database.sql files
48
  $archive->extract_by_files_array(
49
  ai1wm_storage_path( $params ),
lib/vendor/servmask/archiver/class-ai1wm-archiver.php CHANGED
@@ -194,6 +194,26 @@ abstract class Ai1wm_Archiver {
194
  $this->write_to_handle( $this->file_handle, $this->eof, $this->filename );
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  /**
198
  * Get current file size
199
  *
194
  $this->write_to_handle( $this->file_handle, $this->eof, $this->filename );
195
  }
196
 
197
+ /**
198
+ * Validate file
199
+ *
200
+ * return bool
201
+ */
202
+ public function is_valid() {
203
+ $offset = ftell( $this->file_handle );
204
+
205
+ // set file offset
206
+ if ( fseek( $this->file_handle, -4377, SEEK_END ) !== -1 ) {
207
+ if ( fread( $this->file_handle, 4377 ) === $this->eof ) {
208
+ if ( fseek( $this->file_handle, $offset, SEEK_SET ) !== -1 ) {
209
+ return true;
210
+ }
211
+ }
212
+ }
213
+
214
+ return false;
215
+ }
216
+
217
  /**
218
  * Get current file size
219
  *
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.4
6
- Stable tag: 5.36
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.
@@ -75,6 +75,13 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
75
  3. Plugin Menu
76
 
77
  == Changelog ==
 
 
 
 
 
 
 
78
  = 5.35 =
79
  * Add OneDrive to export/import pages
80
  * Fix a bug when WordPress was used without a db prefix
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.4
6
+ Stable tag: 5.37
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.
75
  3. Plugin Menu
76
 
77
  == Changelog ==
78
+ = 5.37 =
79
+ * Validate the archive before import
80
+
81
+ = 5.36 =
82
+ * Add OneDrive to readme.txt
83
+ * Fix a typo on import
84
+
85
  = 5.35 =
86
  * Add OneDrive to export/import pages
87
  * Fix a bug when WordPress was used without a db prefix