All-in-One WP Migration - Version 7.37

Version Description

Added

  • Improved detection of pretty permalink support
  • Improved DB error handling
Download this release

Release Info

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

Code changes from version 7.36 to 7.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: 7.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: 7.37
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.36' );
39
 
40
  // ===============
41
  // = Plugin Name =
@@ -208,10 +208,15 @@ define( 'AI1WM_GD_SYSTEM_PLUGIN_NAME', 'gd-system-plugin.php' );
208
  define( 'AI1WM_WP_STACK_CACHE_NAME', 'wp-stack-cache.php' );
209
 
210
  // ===========================
211
- // = WP.com Site Helper Name =
212
  // ===========================
213
  define( 'AI1WM_WP_COMSH_LOADER_NAME', 'wpcomsh-loader.php' );
214
 
 
 
 
 
 
215
  // ================================
216
  // = WP Engine System Plugin Name =
217
  // ================================
35
  // ==================
36
  // = Plugin Version =
37
  // ==================
38
+ define( 'AI1WM_VERSION', '7.37' );
39
 
40
  // ===============
41
  // = Plugin Name =
208
  define( 'AI1WM_WP_STACK_CACHE_NAME', 'wp-stack-cache.php' );
209
 
210
  // ===========================
211
+ // = WP.com Site Loader Name =
212
  // ===========================
213
  define( 'AI1WM_WP_COMSH_LOADER_NAME', 'wpcomsh-loader.php' );
214
 
215
+ // ===========================
216
+ // = WP.com Site Helper Name =
217
+ // ===========================
218
+ define( 'AI1WM_WP_COMSH_HELPER_NAME', 'wpcomsh' );
219
+
220
  // ================================
221
  // = WP Engine System Plugin Name =
222
  // ================================
functions.php CHANGED
@@ -1804,38 +1804,26 @@ function ai1wm_escape_windows_directory_separator( $path ) {
1804
  }
1805
 
1806
  /**
1807
- * Returns whether the server supports URL rewriting.
1808
- * Detects Apache's mod_rewrite, IIS 7.0+ permalink support, and nginx.
1809
  *
1810
- * @return boolean Whether the server supports URL rewriting.
1811
- */
1812
- function ai1wm_got_url_rewrite() {
1813
- if ( iis7_supports_permalinks() ) {
1814
- return true;
1815
- } elseif ( ! empty( $GLOBALS['is_nginx'] ) ) {
1816
- return true;
1817
- }
1818
-
1819
- return apache_mod_loaded( 'mod_rewrite', false );
1820
- }
1821
-
1822
- /**
1823
- * Returns whether the server supports URL permalinks.
1824
- * Detects Apache's mod_rewrite and URL permalinks.
1825
- *
1826
- * @return boolean Whether the server supports URL permalinks.
1827
  */
1828
- function ai1wm_got_url_permalinks() {
1829
  global $wp_rewrite, $is_apache;
1830
- if ( $wp_rewrite->using_permalinks() ) {
1831
- return true;
1832
- }
1833
 
1834
- if ( $is_apache ) {
1835
- return apache_mod_loaded( 'mod_rewrite', false );
 
 
 
 
 
 
 
1836
  }
1837
 
1838
- return true;
1839
  }
1840
 
1841
  /**
1804
  }
1805
 
1806
  /**
1807
+ * Should reset WordPress permalinks?
 
1808
  *
1809
+ * @param array $params Request parameters
1810
+ * @return boolean
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1811
  */
1812
+ function ai1wm_should_reset_permalinks( $params ) {
1813
  global $wp_rewrite, $is_apache;
 
 
 
1814
 
1815
+ // Permalinks are not supported
1816
+ if ( empty( $params['using_permalinks'] ) ) {
1817
+ if ( $wp_rewrite->using_permalinks() ) {
1818
+ if ( $is_apache ) {
1819
+ if ( ! apache_mod_loaded( 'mod_rewrite', false ) ) {
1820
+ return true;
1821
+ }
1822
+ }
1823
+ }
1824
  }
1825
 
1826
+ return false;
1827
  }
1828
 
1829
  /**
lib/controller/class-ai1wm-export-controller.php CHANGED
@@ -72,6 +72,15 @@ class Ai1wm_Export_Controller {
72
  // Log request
73
  Ai1wm_Log::export( $params );
74
 
 
 
 
 
 
 
 
 
 
75
  } catch ( Exception $e ) {
76
  if ( defined( 'WP_CLI' ) ) {
77
  WP_CLI::error( sprintf( __( 'Unable to export: %s', AI1WM_PLUGIN_NAME ), $e->getMessage() ) );
72
  // Log request
73
  Ai1wm_Log::export( $params );
74
 
75
+ } catch ( Ai1wm_Database_Exception $e ) {
76
+ if ( defined( 'WP_CLI' ) ) {
77
+ WP_CLI::error( sprintf( __( 'Unable to export. Error code: %s. %s', AI1WM_PLUGIN_NAME ), $e->getCode(), $e->getMessage() ) );
78
+ } else {
79
+ status_header( $e->getCode() );
80
+ echo json_encode( array( 'errors' => array( array( 'code' => $e->getCode(), 'message' => $e->getMessage() ) ) ) );
81
+ }
82
+ Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
83
+ exit;
84
  } catch ( Exception $e ) {
85
  if ( defined( 'WP_CLI' ) ) {
86
  WP_CLI::error( sprintf( __( 'Unable to export: %s', AI1WM_PLUGIN_NAME ), $e->getMessage() ) );
lib/controller/class-ai1wm-main-controller.php CHANGED
@@ -171,6 +171,7 @@ class Ai1wm_Main_Controller {
171
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Validate::execute', 50 );
172
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Confirm::execute', 100 );
173
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Blogs::execute', 150 );
 
174
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Enumerate::execute', 200 );
175
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Content::execute', 250 );
176
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Mu_Plugins::execute', 270 );
171
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Validate::execute', 50 );
172
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Confirm::execute', 100 );
173
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Blogs::execute', 150 );
174
+ add_filter( 'ai1wm_import', 'Ai1wm_Import_Permalinks::execute', 170 );
175
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Enumerate::execute', 200 );
176
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Content::execute', 250 );
177
  add_filter( 'ai1wm_import', 'Ai1wm_Import_Mu_Plugins::execute', 270 );
lib/model/import/class-ai1wm-import-done.php CHANGED
@@ -79,6 +79,7 @@ class Ai1wm_Import_Done {
79
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
80
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
81
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
 
82
  )
83
  );
84
 
@@ -182,6 +183,7 @@ class Ai1wm_Import_Done {
182
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
183
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
184
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
 
185
  )
186
  );
187
 
@@ -288,6 +290,7 @@ class Ai1wm_Import_Done {
288
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
289
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
290
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
 
291
  )
292
  );
293
 
@@ -334,18 +337,20 @@ class Ai1wm_Import_Done {
334
  }
335
  }
336
 
 
 
337
  // Switch to default permalink structure
338
- if ( ! ai1wm_got_url_permalinks() ) {
339
  $wp_rewrite->set_permalink_structure( '' );
340
  }
341
 
342
  // Set progress
343
  if ( ai1wm_validate_plugin_basename( 'fusion-builder/fusion-builder.php' ) ) {
344
- Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/avada' ) );
345
  } elseif ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
346
- Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/oxygen' ) );
347
  } else {
348
- Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/done' ) );
349
  }
350
 
351
  return $params;
79
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
80
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
81
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
82
+ ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
83
  )
84
  );
85
 
183
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
184
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
185
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
186
+ ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
187
  )
188
  );
189
 
290
  ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
291
  ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
292
  ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
293
+ ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
294
  )
295
  );
296
 
337
  }
338
  }
339
 
340
+ $should_reset_permalinks = false;
341
+
342
  // Switch to default permalink structure
343
+ if ( ( $should_reset_permalinks = ai1wm_should_reset_permalinks( $params ) ) ) {
344
  $wp_rewrite->set_permalink_structure( '' );
345
  }
346
 
347
  // Set progress
348
  if ( ai1wm_validate_plugin_basename( 'fusion-builder/fusion-builder.php' ) ) {
349
+ Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/avada', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
350
  } elseif ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
351
+ Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/oxygen', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
352
  } else {
353
+ Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/done', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
354
  }
355
 
356
  return $params;
lib/model/import/class-ai1wm-import-mu-plugins.php CHANGED
@@ -41,6 +41,7 @@ class Ai1wm_Import_Mu_Plugins {
41
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_GD_SYSTEM_PLUGIN_NAME,
42
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_STACK_CACHE_NAME,
43
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_COMSH_LOADER_NAME,
 
44
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SYSTEM_PLUGIN_NAME,
45
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WPE_SIGN_ON_PLUGIN_NAME,
46
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SECURITY_AUDITOR_NAME,
41
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_GD_SYSTEM_PLUGIN_NAME,
42
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_STACK_CACHE_NAME,
43
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_COMSH_LOADER_NAME,
44
+ AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_COMSH_HELPER_NAME,
45
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SYSTEM_PLUGIN_NAME,
46
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WPE_SIGN_ON_PLUGIN_NAME,
47
  AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SECURITY_AUDITOR_NAME,
lib/model/import/class-ai1wm-import-permalinks.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2014-2020 ServMask Inc.
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ *
18
+ * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
19
+ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
20
+ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
21
+ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
22
+ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
+ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
+ */
25
+
26
+ if ( ! defined( 'ABSPATH' ) ) {
27
+ die( 'Kangaroos cannot jump here' );
28
+ }
29
+
30
+ class Ai1wm_Import_Permalinks {
31
+
32
+ public static function execute( $params ) {
33
+ global $wp_rewrite;
34
+
35
+ // Set progress
36
+ Ai1wm_Status::info( __( 'Getting WordPress permalinks settings...', AI1WM_PLUGIN_NAME ) );
37
+
38
+ // Get using permalinks
39
+ $params['using_permalinks'] = (int) $wp_rewrite->using_permalinks();
40
+
41
+ // Set progress
42
+ Ai1wm_Status::info( __( 'Done getting WordPress permalinks settings.', AI1WM_PLUGIN_NAME ) );
43
+
44
+ return $params;
45
+ }
46
+ }
lib/vendor/servmask/archiver/class-ai1wm-archiver.php CHANGED
@@ -86,17 +86,17 @@ abstract class Ai1wm_Archiver {
86
  if ( $write ) {
87
  // Open archive file for writing
88
  if ( ( $this->file_handle = @fopen( $file_name, 'cb' ) ) === false ) {
89
- throw new Ai1wm_Not_Accessible_Exception( sprintf( 'Unable to open file for writing. File: %s', $this->file_name ) );
90
  }
91
 
92
  // Seek to end of archive file
93
  if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
94
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to end of file. File: %s', $this->file_name ) );
95
  }
96
  } else {
97
  // Open archive file for reading
98
  if ( ( $this->file_handle = @fopen( $file_name, 'rb' ) ) === false ) {
99
- throw new Ai1wm_Not_Accessible_Exception( sprintf( 'Unable to open file for reading. File: %s', $this->file_name ) );
100
  }
101
  }
102
  }
@@ -112,7 +112,7 @@ abstract class Ai1wm_Archiver {
112
  */
113
  public function set_file_pointer( $offset ) {
114
  if ( @fseek( $this->file_handle, $offset, SEEK_SET ) === -1 ) {
115
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $offset ) );
116
  }
117
  }
118
 
@@ -125,7 +125,7 @@ abstract class Ai1wm_Archiver {
125
  */
126
  public function get_file_pointer() {
127
  if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
128
- throw new Ai1wm_Not_Tellable_Exception( sprintf( 'Unable to tell offset of file. File: %s', $this->file_name ) );
129
  }
130
 
131
  return $offset;
@@ -143,16 +143,16 @@ abstract class Ai1wm_Archiver {
143
  protected function append_eof() {
144
  // Seek to end of archive file
145
  if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
146
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to end of file. File: %s', $this->file_name ) );
147
  }
148
 
149
  // Write end of file block
150
  if ( ( $file_bytes = @fwrite( $this->file_handle, $this->eof ) ) !== false ) {
151
  if ( strlen( $this->eof ) !== $file_bytes ) {
152
- throw new Ai1wm_Quota_Exceeded_Exception( sprintf( 'Out of disk space. Unable to write end of block to file. File: %s', $this->file_name ) );
153
  }
154
  } else {
155
- throw new Ai1wm_Not_Writable_Exception( sprintf( 'Unable to write end of block to file. File: %s', $this->file_name ) );
156
  }
157
  }
158
 
@@ -225,12 +225,12 @@ abstract class Ai1wm_Archiver {
225
  */
226
  public function truncate() {
227
  if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
228
- throw new Ai1wm_Not_Tellable_Exception( sprintf( 'Unable to tell offset of file. File: %s', $this->file_name ) );
229
  }
230
 
231
  if ( @filesize( $this->file_name ) > $offset ) {
232
  if ( @ftruncate( $this->file_handle, $offset ) === false ) {
233
- throw new Ai1wm_Not_Truncatable_Exception( sprintf( 'Unable to truncate file. File: %s', $this->file_name ) );
234
  }
235
  }
236
  }
@@ -251,7 +251,7 @@ abstract class Ai1wm_Archiver {
251
  }
252
 
253
  if ( @fclose( $this->file_handle ) === false ) {
254
- throw new Ai1wm_Not_Closable_Exception( sprintf( 'Unable to close file. File: %s', $this->file_name ) );
255
  }
256
  }
257
  }
86
  if ( $write ) {
87
  // Open archive file for writing
88
  if ( ( $this->file_handle = @fopen( $file_name, 'cb' ) ) === false ) {
89
+ throw new Ai1wm_Not_Accessible_Exception( sprintf( __( 'Unable to open file for writing. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
90
  }
91
 
92
  // Seek to end of archive file
93
  if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
94
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to end of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
95
  }
96
  } else {
97
  // Open archive file for reading
98
  if ( ( $this->file_handle = @fopen( $file_name, 'rb' ) ) === false ) {
99
+ throw new Ai1wm_Not_Accessible_Exception( sprintf( __( 'Unable to open file for reading. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
100
  }
101
  }
102
  }
112
  */
113
  public function set_file_pointer( $offset ) {
114
  if ( @fseek( $this->file_handle, $offset, SEEK_SET ) === -1 ) {
115
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $offset ) );
116
  }
117
  }
118
 
125
  */
126
  public function get_file_pointer() {
127
  if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
128
+ throw new Ai1wm_Not_Tellable_Exception( sprintf( __( 'Unable to tell offset of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
129
  }
130
 
131
  return $offset;
143
  protected function append_eof() {
144
  // Seek to end of archive file
145
  if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
146
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to end of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
147
  }
148
 
149
  // Write end of file block
150
  if ( ( $file_bytes = @fwrite( $this->file_handle, $this->eof ) ) !== false ) {
151
  if ( strlen( $this->eof ) !== $file_bytes ) {
152
+ throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write end of block to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
153
  }
154
  } else {
155
+ throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write end of block to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
156
  }
157
  }
158
 
225
  */
226
  public function truncate() {
227
  if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
228
+ throw new Ai1wm_Not_Tellable_Exception( sprintf( __( 'Unable to tell offset of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
229
  }
230
 
231
  if ( @filesize( $this->file_name ) > $offset ) {
232
  if ( @ftruncate( $this->file_handle, $offset ) === false ) {
233
+ throw new Ai1wm_Not_Truncatable_Exception( sprintf( __( 'Unable to truncate file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
234
  }
235
  }
236
  }
251
  }
252
 
253
  if ( @fclose( $this->file_handle ) === false ) {
254
+ throw new Ai1wm_Not_Closable_Exception( sprintf( __( 'Unable to close file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
255
  }
256
  }
257
  }
lib/vendor/servmask/archiver/class-ai1wm-compressor.php CHANGED
@@ -78,10 +78,10 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
78
  if ( $file_offset === 0 ) {
79
  if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
80
  if ( strlen( $block ) !== $file_bytes ) {
81
- throw new Ai1wm_Quota_Exceeded_Exception( sprintf( 'Out of disk space. Unable to write header to file. File: %s', $this->file_name ) );
82
  }
83
  } else {
84
- throw new Ai1wm_Not_Writable_Exception( sprintf( 'Unable to write header to file. File: %s', $this->file_name ) );
85
  }
86
  }
87
 
@@ -95,10 +95,10 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
95
  if ( ( $file_content = @fread( $file_handle, 512000 ) ) !== false ) {
96
  if ( ( $file_bytes = @fwrite( $this->file_handle, $file_content ) ) !== false ) {
97
  if ( strlen( $file_content ) !== $file_bytes ) {
98
- throw new Ai1wm_Quota_Exceeded_Exception( sprintf( 'Out of disk space. Unable to write content to file. File: %s', $this->file_name ) );
99
  }
100
  } else {
101
- throw new Ai1wm_Not_Writable_Exception( sprintf( 'Unable to write content to file. File: %s', $this->file_name ) );
102
  }
103
 
104
  // Set file written
@@ -123,27 +123,21 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
123
 
124
  // Seek to beginning of file size
125
  if ( @fseek( $this->file_handle, - $file_offset - 4096 - 12 - 14, SEEK_CUR ) === -1 ) {
126
- throw new Ai1wm_Not_Seekable_Exception(
127
- 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. ' .
128
- '<a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>'
129
- );
130
  }
131
 
132
  // Write file size to file header
133
  if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
134
  if ( strlen( $block ) !== $file_bytes ) {
135
- throw new Ai1wm_Quota_Exceeded_Exception( sprintf( 'Out of disk space. Unable to write size to file. File: %s', $this->file_name ) );
136
  }
137
  } else {
138
- throw new Ai1wm_Not_Writable_Exception( sprintf( 'Unable to write size to file. File: %s', $this->file_name ) );
139
  }
140
 
141
  // Seek to end of file content
142
  if ( @fseek( $this->file_handle, + $file_offset + 4096 + 12, SEEK_CUR ) === -1 ) {
143
- throw new Ai1wm_Not_Seekable_Exception(
144
- 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. ' .
145
- '<a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>'
146
- );
147
  }
148
  }
149
  }
78
  if ( $file_offset === 0 ) {
79
  if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
80
  if ( strlen( $block ) !== $file_bytes ) {
81
+ throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write header to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
82
  }
83
  } else {
84
+ throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write header to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
85
  }
86
  }
87
 
95
  if ( ( $file_content = @fread( $file_handle, 512000 ) ) !== false ) {
96
  if ( ( $file_bytes = @fwrite( $this->file_handle, $file_content ) ) !== false ) {
97
  if ( strlen( $file_content ) !== $file_bytes ) {
98
+ throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
99
  }
100
  } else {
101
+ throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
102
  }
103
 
104
  // Set file written
123
 
124
  // Seek to beginning of file size
125
  if ( @fseek( $this->file_handle, - $file_offset - 4096 - 12 - 14, SEEK_CUR ) === -1 ) {
126
+ throw new Ai1wm_Not_Seekable_Exception( __( 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. <a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ) );
 
 
 
127
  }
128
 
129
  // Write file size to file header
130
  if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
131
  if ( strlen( $block ) !== $file_bytes ) {
132
+ throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write size to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
133
  }
134
  } else {
135
+ throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write size to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
136
  }
137
 
138
  // Seek to end of file content
139
  if ( @fseek( $this->file_handle, + $file_offset + 4096 + 12, SEEK_CUR ) === -1 ) {
140
+ throw new Ai1wm_Not_Seekable_Exception( __( 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. <a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ) );
 
 
 
141
  }
142
  }
143
  }
lib/vendor/servmask/archiver/class-ai1wm-extractor.php CHANGED
@@ -69,7 +69,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
69
 
70
  // Seek to beginning of archive file
71
  if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
72
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to beginning of file. File: %s', $this->file_name ) );
73
  }
74
 
75
  // Loop over files
@@ -91,7 +91,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
91
 
92
  // Skip file content so we can move forward to the next file
93
  if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
94
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $data['size'] ) );
95
  }
96
  }
97
  }
@@ -116,7 +116,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
116
 
117
  // Seek to beginning of archive file
118
  if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
119
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to beginning of file. File: %s', $this->file_name ) );
120
  }
121
 
122
  // Loop over files
@@ -138,7 +138,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
138
 
139
  // Skip file content so we can move forward to the next file
140
  if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
141
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $data['size'] ) );
142
  }
143
  }
144
  }
@@ -165,7 +165,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
165
  */
166
  public function extract_one_file_to( $location, $exclude_files = array(), $exclude_extensions = array(), $old_paths = array(), $new_paths = array(), &$file_written = 0, &$file_offset = 0 ) {
167
  if ( false === is_dir( $location ) ) {
168
- throw new Ai1wm_Not_Directory_Exception( sprintf( 'Location is not a directory: %s', $location ) );
169
  }
170
 
171
  // Replace forward slash with current directory separator in location
@@ -177,7 +177,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
177
  // Seek to file offset to archive file
178
  if ( $file_offset > 0 ) {
179
  if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
180
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, - $file_offset - 4377 ) );
181
  }
182
  }
183
 
@@ -270,7 +270,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
270
 
271
  // We don't have a match, skip file content
272
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
273
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $file_size ) );
274
  }
275
  }
276
  }
@@ -297,7 +297,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
297
  */
298
  public function extract_by_files_array( $location, $include_files = array(), $exclude_files = array(), $exclude_extensions = array(), &$file_written = 0, &$file_offset = 0 ) {
299
  if ( false === is_dir( $location ) ) {
300
- throw new Ai1wm_Not_Directory_Exception( sprintf( 'Location is not a directory: %s', $location ) );
301
  }
302
 
303
  // Replace forward slash with current directory separator in location
@@ -312,7 +312,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
312
  // Seek to file offset to archive file
313
  if ( $file_offset > 0 ) {
314
  if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
315
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, - $file_offset - 4377 ) );
316
  }
317
  }
318
 
@@ -396,7 +396,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
396
 
397
  // We don't have a match, skip file content
398
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
399
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $file_size ) );
400
  }
401
  }
402
 
@@ -441,7 +441,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
441
  // Seek to file offset to archive file
442
  if ( $file_offset > 0 ) {
443
  if ( @fseek( $this->file_handle, $file_offset, SEEK_CUR ) === -1 ) {
444
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $file_size ) );
445
  }
446
  }
447
 
@@ -464,7 +464,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
464
 
465
  // Read the file in chunks of 512KB from archiver
466
  if ( ( $file_content = @fread( $this->file_handle, $chunk_size ) ) === false ) {
467
- throw new Ai1wm_Not_Readable_Exception( sprintf( 'Unable to read content from file. File: %s', $this->file_name ) );
468
  }
469
 
470
  // Remove the amount of bytes we read
@@ -473,7 +473,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
473
  // Write file contents
474
  if ( ( $file_bytes = @fwrite( $file_handle, $file_content ) ) !== false ) {
475
  if ( strlen( $file_content ) !== $file_bytes ) {
476
- throw new Ai1wm_Quota_Exceeded_Exception( sprintf( 'Out of disk space. Unable to write content to file. File: %s', $file_name ) );
477
  }
478
  }
479
 
@@ -506,7 +506,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
506
 
507
  // We don't have file permissions, skip file content
508
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
509
- throw new Ai1wm_Not_Seekable_Exception( sprintf( 'Unable to seek to offset of file. File: %s Offset: %d', $this->file_name, $file_size ) );
510
  }
511
  }
512
 
69
 
70
  // Seek to beginning of archive file
71
  if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
72
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to beginning of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
73
  }
74
 
75
  // Loop over files
91
 
92
  // Skip file content so we can move forward to the next file
93
  if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
94
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $data['size'] ) );
95
  }
96
  }
97
  }
116
 
117
  // Seek to beginning of archive file
118
  if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
119
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to beginning of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
120
  }
121
 
122
  // Loop over files
138
 
139
  // Skip file content so we can move forward to the next file
140
  if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
141
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $data['size'] ) );
142
  }
143
  }
144
  }
165
  */
166
  public function extract_one_file_to( $location, $exclude_files = array(), $exclude_extensions = array(), $old_paths = array(), $new_paths = array(), &$file_written = 0, &$file_offset = 0 ) {
167
  if ( false === is_dir( $location ) ) {
168
+ throw new Ai1wm_Not_Directory_Exception( sprintf( __( 'Location is not a directory: %s', AI1WM_PLUGIN_NAME ), $location ) );
169
  }
170
 
171
  // Replace forward slash with current directory separator in location
177
  // Seek to file offset to archive file
178
  if ( $file_offset > 0 ) {
179
  if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
180
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, - $file_offset - 4377 ) );
181
  }
182
  }
183
 
270
 
271
  // We don't have a match, skip file content
272
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
273
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
274
  }
275
  }
276
  }
297
  */
298
  public function extract_by_files_array( $location, $include_files = array(), $exclude_files = array(), $exclude_extensions = array(), &$file_written = 0, &$file_offset = 0 ) {
299
  if ( false === is_dir( $location ) ) {
300
+ throw new Ai1wm_Not_Directory_Exception( sprintf( __( 'Location is not a directory: %s', AI1WM_PLUGIN_NAME ), $location ) );
301
  }
302
 
303
  // Replace forward slash with current directory separator in location
312
  // Seek to file offset to archive file
313
  if ( $file_offset > 0 ) {
314
  if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
315
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, - $file_offset - 4377 ) );
316
  }
317
  }
318
 
396
 
397
  // We don't have a match, skip file content
398
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
399
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
400
  }
401
  }
402
 
441
  // Seek to file offset to archive file
442
  if ( $file_offset > 0 ) {
443
  if ( @fseek( $this->file_handle, $file_offset, SEEK_CUR ) === -1 ) {
444
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
445
  }
446
  }
447
 
464
 
465
  // Read the file in chunks of 512KB from archiver
466
  if ( ( $file_content = @fread( $this->file_handle, $chunk_size ) ) === false ) {
467
+ throw new Ai1wm_Not_Readable_Exception( sprintf( __( 'Unable to read content from file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
468
  }
469
 
470
  // Remove the amount of bytes we read
473
  // Write file contents
474
  if ( ( $file_bytes = @fwrite( $file_handle, $file_content ) ) !== false ) {
475
  if ( strlen( $file_content ) !== $file_bytes ) {
476
+ throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $file_name ) );
477
  }
478
  }
479
 
506
 
507
  // We don't have file permissions, skip file content
508
  if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
509
+ throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
510
  }
511
  }
512
 
lib/vendor/servmask/database/class-ai1wm-database-mysql.php CHANGED
@@ -32,11 +32,33 @@ class Ai1wm_Database_Mysql extends Ai1wm_Database {
32
  /**
33
  * Run MySQL query
34
  *
35
- * @param string $input SQL query
36
- * @return resource
37
  */
38
  public function query( $input ) {
39
- return mysql_query( $input, $this->wpdb->dbh );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  /**
32
  /**
33
  * Run MySQL query
34
  *
35
+ * @param string $input SQL query
36
+ * @return mixed
37
  */
38
  public function query( $input ) {
39
+ if ( ! ( $result = mysql_query( $input, $this->wpdb->dbh ) ) ) {
40
+ $mysql_errno = 0;
41
+
42
+ // Get MySQL error code
43
+ if ( ! empty( $this->wpdb->dbh ) ) {
44
+ if ( is_resource( $this->wpdb->dbh ) ) {
45
+ $mysql_errno = mysql_errno( $this->wpdb->dbh );
46
+ } else {
47
+ $mysql_errno = 2006;
48
+ }
49
+ }
50
+
51
+ // MySQL server has gone away, try to reconnect
52
+ if ( empty( $this->wpdb->dbh ) || 2006 === $mysql_errno ) {
53
+ if ( ! $this->wpdb->check_connection( false ) ) {
54
+ throw new Ai1wm_Database_Exception( __( 'Error reconnecting to the database. <a href="https://help.servmask.com/knowledgebase/mysql-error-reconnecting/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ), 503 );
55
+ }
56
+
57
+ $result = mysql_query( $input, $this->wpdb->dbh );
58
+ }
59
+ }
60
+
61
+ return $result;
62
  }
63
 
64
  /**
lib/vendor/servmask/database/class-ai1wm-database-mysqli.php CHANGED
@@ -32,18 +32,38 @@ class Ai1wm_Database_Mysqli extends Ai1wm_Database {
32
  /**
33
  * Run MySQL query
34
  *
35
- * @param string $input SQL query
36
- * @return resource
37
  */
38
  public function query( $input ) {
39
- if ( mysqli_real_query( $this->wpdb->dbh, $input ) ) {
40
- // Copy results from the internal mysqlnd buffer into the PHP variables fetched
41
- if ( defined( 'MYSQLI_STORE_RESULT_COPY_DATA' ) ) {
42
- return mysqli_store_result( $this->wpdb->dbh, MYSQLI_STORE_RESULT_COPY_DATA );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
 
44
 
45
- return mysqli_store_result( $this->wpdb->dbh );
 
 
46
  }
 
 
47
  }
48
 
49
  /**
32
  /**
33
  * Run MySQL query
34
  *
35
+ * @param string $input SQL query
36
+ * @return mixed
37
  */
38
  public function query( $input ) {
39
+ if ( ! mysqli_real_query( $this->wpdb->dbh, $input ) ) {
40
+ $mysqli_errno = 0;
41
+
42
+ // Get MySQL error code
43
+ if ( ! empty( $this->wpdb->dbh ) ) {
44
+ if ( $this->wpdb->dbh instanceof mysqli ) {
45
+ $mysqli_errno = mysqli_errno( $this->wpdb->dbh );
46
+ } else {
47
+ $mysqli_errno = 2006;
48
+ }
49
+ }
50
+
51
+ // MySQL server has gone away, try to reconnect
52
+ if ( empty( $this->wpdb->dbh ) || 2006 === $mysqli_errno ) {
53
+ if ( ! $this->wpdb->check_connection( false ) ) {
54
+ throw new Ai1wm_Database_Exception( __( 'Error reconnecting to the database. <a href="https://help.servmask.com/knowledgebase/mysql-error-reconnecting/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ), 503 );
55
+ }
56
+
57
+ mysqli_real_query( $this->wpdb->dbh, $input );
58
  }
59
+ }
60
 
61
+ // Copy results from the internal mysqlnd buffer into the PHP variables fetched
62
+ if ( defined( 'MYSQLI_STORE_RESULT_COPY_DATA' ) ) {
63
+ return mysqli_store_result( $this->wpdb->dbh, MYSQLI_STORE_RESULT_COPY_DATA );
64
  }
65
+
66
+ return mysqli_store_result( $this->wpdb->dbh );
67
  }
68
 
69
  /**
lib/vendor/servmask/database/class-ai1wm-database.php CHANGED
@@ -188,9 +188,12 @@ abstract class Ai1wm_Database {
188
  if ( is_resource( $this->wpdb->dbh ) ) {
189
  if ( get_resource_type( $this->wpdb->dbh ) === 'SQL Server Connection' ) {
190
  throw new Ai1wm_Database_Exception(
191
- 'Your WordPress installation uses Microsoft SQL Server. ' .
192
- 'To use All-in-One WP Migration, please change your installation to MySQL and try again. ' .
193
- '<a href="https://help.servmask.com/knowledgebase/microsoft-sql-server/" target="_blank">Technical details</a>',
 
 
 
194
  501
195
  );
196
  }
@@ -1039,30 +1042,42 @@ abstract class Ai1wm_Database {
1039
  if ( $this->errno() === 1226 ) {
1040
  if ( stripos( $this->error(), 'max_queries_per_hour' ) !== false ) {
1041
  throw new Ai1wm_Database_Exception(
1042
- 'Your WordPress installation has reached the maximum allowed queries per hour set by your server admin or hosting provider. ' .
1043
- 'To use All-in-One WP Migration, please increase MySQL max_queries_per_hour limit. ' .
1044
- '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-queries-per-hour" target="_blank">Technical details</a>',
 
 
 
1045
  503
1046
  );
1047
  } elseif ( stripos( $this->error(), 'max_updates_per_hour' ) !== false ) {
1048
  throw new Ai1wm_Database_Exception(
1049
- 'Your WordPress installation has reached the maximum allowed updates per hour set by your server admin or hosting provider. ' .
1050
- 'To use All-in-One WP Migration, please increase MySQL max_updates_per_hour limit. ' .
1051
- '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-updates-per-hour" target="_blank">Technical details</a>',
 
 
 
1052
  503
1053
  );
1054
  } elseif ( stripos( $this->error(), 'max_connections_per_hour' ) !== false ) {
1055
  throw new Ai1wm_Database_Exception(
1056
- 'Your WordPress installation has reached the maximum allowed connections per hour set by your server admin or hosting provider. ' .
1057
- 'To use All-in-One WP Migration, please increase MySQL max_connections_per_hour limit. ' .
1058
- '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-connections-per-hour" target="_blank">Technical details</a>',
 
 
 
1059
  503
1060
  );
1061
  } elseif ( stripos( $this->error(), 'max_user_connections' ) !== false ) {
1062
  throw new Ai1wm_Database_Exception(
1063
- 'Your WordPress installation has reached the maximum allowed user connections set by your server admin or hosting provider. ' .
1064
- 'To use All-in-One WP Migration, please increase MySQL max_user_connections limit. ' .
1065
- '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-user-connections" target="_blank">Technical details</a>',
 
 
 
1066
  503
1067
  );
1068
  }
188
  if ( is_resource( $this->wpdb->dbh ) ) {
189
  if ( get_resource_type( $this->wpdb->dbh ) === 'SQL Server Connection' ) {
190
  throw new Ai1wm_Database_Exception(
191
+ __(
192
+ 'Your WordPress installation uses Microsoft SQL Server. ' .
193
+ 'To use All-in-One WP Migration, please change your installation to MySQL and try again. ' .
194
+ '<a href="https://help.servmask.com/knowledgebase/microsoft-sql-server/" target="_blank">Technical details</a>',
195
+ AI1WM_PLUGIN_NAME
196
+ ),
197
  501
198
  );
199
  }
1042
  if ( $this->errno() === 1226 ) {
1043
  if ( stripos( $this->error(), 'max_queries_per_hour' ) !== false ) {
1044
  throw new Ai1wm_Database_Exception(
1045
+ __(
1046
+ 'Your WordPress installation has reached the maximum allowed queries per hour set by your server admin or hosting provider. ' .
1047
+ 'To use All-in-One WP Migration, please increase MySQL max_queries_per_hour limit. ' .
1048
+ '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-queries-per-hour" target="_blank">Technical details</a>',
1049
+ AI1WM_PLUGIN_NAME
1050
+ ),
1051
  503
1052
  );
1053
  } elseif ( stripos( $this->error(), 'max_updates_per_hour' ) !== false ) {
1054
  throw new Ai1wm_Database_Exception(
1055
+ __(
1056
+ 'Your WordPress installation has reached the maximum allowed updates per hour set by your server admin or hosting provider. ' .
1057
+ 'To use All-in-One WP Migration, please increase MySQL max_updates_per_hour limit. ' .
1058
+ '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-updates-per-hour" target="_blank">Technical details</a>',
1059
+ AI1WM_PLUGIN_NAME
1060
+ ),
1061
  503
1062
  );
1063
  } elseif ( stripos( $this->error(), 'max_connections_per_hour' ) !== false ) {
1064
  throw new Ai1wm_Database_Exception(
1065
+ __(
1066
+ 'Your WordPress installation has reached the maximum allowed connections per hour set by your server admin or hosting provider. ' .
1067
+ 'To use All-in-One WP Migration, please increase MySQL max_connections_per_hour limit. ' .
1068
+ '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-connections-per-hour" target="_blank">Technical details</a>',
1069
+ AI1WM_PLUGIN_NAME
1070
+ ),
1071
  503
1072
  );
1073
  } elseif ( stripos( $this->error(), 'max_user_connections' ) !== false ) {
1074
  throw new Ai1wm_Database_Exception(
1075
+ __(
1076
+ 'Your WordPress installation has reached the maximum allowed user connections set by your server admin or hosting provider. ' .
1077
+ 'To use All-in-One WP Migration, please increase MySQL max_user_connections limit. ' .
1078
+ '<a href="https://help.servmask.com/knowledgebase/mysql-error-codes/#max-user-connections" target="_blank">Technical details</a>',
1079
+ AI1WM_PLUGIN_NAME
1080
+ ),
1081
  503
1082
  );
1083
  }
lib/view/import/avada.php CHANGED
@@ -27,10 +27,10 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
- if ( ai1wm_got_url_permalinks() ) {
31
- printf( __( '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />', AI1WM_PLUGIN_NAME ), admin_url( 'options-permalink.php#submit' ) );
32
- } else {
33
  print( __( '» 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 />', AI1WM_PLUGIN_NAME ) );
 
 
34
  }
35
 
36
  if ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
+ if ( $should_reset_permalinks ) {
 
 
31
  print( __( '» 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 />', AI1WM_PLUGIN_NAME ) );
32
+ } else {
33
+ printf( __( '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />', AI1WM_PLUGIN_NAME ), admin_url( 'options-permalink.php#submit' ) );
34
  }
35
 
36
  if ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
lib/view/import/done.php CHANGED
@@ -27,7 +27,13 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
- if ( ai1wm_got_url_permalinks() ) {
 
 
 
 
 
 
31
  printf(
32
  __(
33
  '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
@@ -36,10 +42,4 @@ if ( ai1wm_got_url_permalinks() ) {
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
  }
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
+ if ( $should_reset_permalinks ) {
31
+ _e(
32
+ '» 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 />' .
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
+ } else {
37
  printf(
38
  __(
39
  '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
42
  ),
43
  admin_url( 'options-permalink.php#submit' )
44
  );
 
 
 
 
 
 
45
  }
lib/view/import/oxygen.php CHANGED
@@ -27,7 +27,14 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
- if ( ai1wm_got_url_permalinks() ) {
 
 
 
 
 
 
 
31
  printf(
32
  __(
33
  '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
@@ -37,11 +44,4 @@ if ( ai1wm_got_url_permalinks() ) {
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
  }
27
  die( 'Kangaroos cannot jump here' );
28
  }
29
 
30
+ if ( $should_reset_permalinks ) {
31
+ _e(
32
+ '» 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 />' .
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
+ } else {
38
  printf(
39
  __(
40
  '» <a class="ai1wm-no-underline" href="%s" target="_blank">Save permalinks structure</a>. (opens a new window)<br />' .
44
  ),
45
  admin_url( 'options-permalink.php#submit' )
46
  );
 
 
 
 
 
 
 
47
  }
loader.php CHANGED
@@ -275,23 +275,27 @@ require_once AI1WM_EXPORT_PATH .
275
 
276
  require_once AI1WM_IMPORT_PATH .
277
  DIRECTORY_SEPARATOR .
278
- 'class-ai1wm-import-compatibility.php';
279
 
280
  require_once AI1WM_IMPORT_PATH .
281
  DIRECTORY_SEPARATOR .
282
- 'class-ai1wm-import-upload.php';
283
 
284
  require_once AI1WM_IMPORT_PATH .
285
  DIRECTORY_SEPARATOR .
286
  'class-ai1wm-import-validate.php';
287
 
 
 
 
 
288
  require_once AI1WM_IMPORT_PATH .
289
  DIRECTORY_SEPARATOR .
290
  'class-ai1wm-import-blogs.php';
291
 
292
  require_once AI1WM_IMPORT_PATH .
293
  DIRECTORY_SEPARATOR .
294
- 'class-ai1wm-import-confirm.php';
295
 
296
  require_once AI1WM_IMPORT_PATH .
297
  DIRECTORY_SEPARATOR .
275
 
276
  require_once AI1WM_IMPORT_PATH .
277
  DIRECTORY_SEPARATOR .
278
+ 'class-ai1wm-import-upload.php';
279
 
280
  require_once AI1WM_IMPORT_PATH .
281
  DIRECTORY_SEPARATOR .
282
+ 'class-ai1wm-import-compatibility.php';
283
 
284
  require_once AI1WM_IMPORT_PATH .
285
  DIRECTORY_SEPARATOR .
286
  'class-ai1wm-import-validate.php';
287
 
288
+ require_once AI1WM_IMPORT_PATH .
289
+ DIRECTORY_SEPARATOR .
290
+ 'class-ai1wm-import-confirm.php';
291
+
292
  require_once AI1WM_IMPORT_PATH .
293
  DIRECTORY_SEPARATOR .
294
  'class-ai1wm-import-blogs.php';
295
 
296
  require_once AI1WM_IMPORT_PATH .
297
  DIRECTORY_SEPARATOR .
298
+ 'class-ai1wm-import-permalinks.php';
299
 
300
  require_once AI1WM_IMPORT_PATH .
301
  DIRECTORY_SEPARATOR .
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.6
6
  Requires PHP: 5.2.17
7
- Stable tag: 7.36
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,12 @@ 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.36 =
112
  **Added**
113
 
4
  Requires at least: 3.3
5
  Tested up to: 5.6
6
  Requires PHP: 5.2.17
7
+ Stable tag: 7.37
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.37 =
112
+ **Added**
113
+
114
+ * Improved detection of pretty permalink support
115
+ * Improved DB error handling
116
+
117
  = 7.36 =
118
  **Added**
119