All-in-One WP Migration - Version 5.42

Version Description

  • Catch E_PARSE error on mu-plugins import
  • Fix an issue with stop export that doesn't clean up the storage directory
  • Initialize new cache instead of flushing the existing one on import/export
Download this release

Release Info

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

Code changes from version 5.41 to 5.42

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.41
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.42
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.41' );
43
 
44
  // ===============
45
  // = Plugin Name =
@@ -181,21 +181,6 @@ define( 'AI1WM_IMPORT_NAME', 'import.log' );
181
  // ==================
182
  define( 'AI1WM_ERROR_NAME', 'error.log' );
183
 
184
- // ======================
185
- // = Export Options Key =
186
- // ======================
187
- define( 'AI1WM_EXPORT_OPTIONS', 'ai1wm_export_options' );
188
-
189
- // =====================
190
- // = Error Handler Key =
191
- // =====================
192
- define( 'AI1WM_ERROR_HANDLER', 'ai1wm_error_handler' );
193
-
194
- // =========================
195
- // = Exception Handler Key =
196
- // =========================
197
- define( 'AI1WM_EXCEPTION_HANDLER', 'ai1wm_exception_handler' );
198
-
199
  // ==========
200
  // = URL IP =
201
  // ==========
39
  // ==================
40
  // = Plugin Version =
41
  // ==================
42
+ define( 'AI1WM_VERSION', '5.42' );
43
 
44
  // ===============
45
  // = Plugin Name =
181
  // ==================
182
  define( 'AI1WM_ERROR_NAME', 'error.log' );
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  // ==========
185
  // = URL IP =
186
  // ==========
functions.php CHANGED
@@ -575,7 +575,7 @@ function ai1wm_active_servmask_plugins( $plugins = array() ) {
575
  * @return array
576
  */
577
  function ai1wm_active_sitewide_plugins() {
578
- return array_keys( get_site_option( AI1WM_ACTIVE_SITEWIDE_PLUGINS, array(), false ) );
579
  }
580
 
581
  /**
575
  * @return array
576
  */
577
  function ai1wm_active_sitewide_plugins() {
578
+ return array_keys( get_site_option( AI1WM_ACTIVE_SITEWIDE_PLUGINS, array() ) );
579
  }
580
 
581
  /**
lib/controller/class-ai1wm-backups-controller.php CHANGED
@@ -30,12 +30,12 @@ class Ai1wm_Backups_Controller {
30
 
31
  // Username
32
  if ( isset( $_POST['ai1wm-username'] ) ) {
33
- update_site_option( AI1WM_AUTH_USER, $_POST['ai1wm-username'] );
34
  }
35
 
36
  // Password
37
  if ( isset( $_POST['ai1wm-password'] ) ) {
38
- update_site_option( AI1WM_AUTH_PASSWORD, $_POST['ai1wm-password'] );
39
  }
40
 
41
  Ai1wm_Template::render(
@@ -44,8 +44,8 @@ class Ai1wm_Backups_Controller {
44
  'backups' => $model->get_files(),
45
  'free_space' => $model->get_free_space(),
46
  'total_space' => $model->get_total_space(),
47
- 'username' => get_site_option( AI1WM_AUTH_USER, false ),
48
- 'password' => get_site_option( AI1WM_AUTH_PASSWORD, false ),
49
  )
50
  );
51
  }
30
 
31
  // Username
32
  if ( isset( $_POST['ai1wm-username'] ) ) {
33
+ update_option( AI1WM_AUTH_USER, $_POST['ai1wm-username'] );
34
  }
35
 
36
  // Password
37
  if ( isset( $_POST['ai1wm-password'] ) ) {
38
+ update_option( AI1WM_AUTH_PASSWORD, $_POST['ai1wm-password'] );
39
  }
40
 
41
  Ai1wm_Template::render(
44
  'backups' => $model->get_files(),
45
  'free_space' => $model->get_free_space(),
46
  'total_space' => $model->get_total_space(),
47
+ 'username' => get_option( AI1WM_AUTH_USER ),
48
+ 'password' => get_option( AI1WM_AUTH_PASSWORD ),
49
  )
50
  );
51
  }
lib/controller/class-ai1wm-export-controller.php CHANGED
@@ -53,10 +53,10 @@ class Ai1wm_Export_Controller {
53
  }
54
 
55
  // Verify secret key by using the value in the database, not in cache
56
- if ( $secret_key !== get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
57
  Ai1wm_Status::error(
58
- __( "Unable to authenticate your request with secret_key = \"{$secret_key}\"", AI1WM_PLUGIN_NAME ),
59
- __( "Unable to export", AI1WM_PLUGIN_NAME )
60
  );
61
  exit;
62
  }
@@ -81,11 +81,13 @@ class Ai1wm_Export_Controller {
81
  }
82
 
83
  // Log request
84
- Ai1wm_Log::export( $params );
 
 
85
 
86
  // Do request
87
  if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
88
- return Ai1wm_Http::get( admin_url( 'admin-ajax.php?action=ai1wm_export' ), $params );
89
  }
90
  }
91
 
53
  }
54
 
55
  // Verify secret key by using the value in the database, not in cache
56
+ if ( $secret_key !== get_option( AI1WM_SECRET_KEY ) ) {
57
  Ai1wm_Status::error(
58
+ sprintf( __( 'Unable to authenticate your request with secret_key = "%s"', AI1WM_PLUGIN_NAME ), $secret_key ),
59
+ __( 'Unable to export', AI1WM_PLUGIN_NAME )
60
  );
61
  exit;
62
  }
81
  }
82
 
83
  // Log request
84
+ if ( empty( $params['priority'] ) || is_file( ai1wm_export_path( $params ) ) ) {
85
+ Ai1wm_Log::export( $params );
86
+ }
87
 
88
  // Do request
89
  if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
90
+ return Ai1wm_Http::post( admin_url( 'admin-ajax.php?action=ai1wm_export' ), $params );
91
  }
92
  }
93
 
lib/controller/class-ai1wm-import-controller.php CHANGED
@@ -53,10 +53,10 @@ class Ai1wm_Import_Controller {
53
  }
54
 
55
  // Verify secret key by using the value in the database, not in cache
56
- if ( $secret_key !== get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
57
  Ai1wm_Status::error(
58
- __( "Unable to authenticate your request with secret_key = \"{$secret_key}\"", AI1WM_PLUGIN_NAME ),
59
- __( "Unable to import", AI1WM_PLUGIN_NAME )
60
  );
61
  exit;
62
  }
@@ -81,11 +81,13 @@ class Ai1wm_Import_Controller {
81
  }
82
 
83
  // Log request
84
- Ai1wm_Log::import( $params );
 
 
85
 
86
  // Do request
87
  if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
88
- return Ai1wm_Http::get( admin_url( 'admin-ajax.php?action=ai1wm_import' ), $params );
89
  }
90
  }
91
 
53
  }
54
 
55
  // Verify secret key by using the value in the database, not in cache
56
+ if ( $secret_key !== get_option( AI1WM_SECRET_KEY ) ) {
57
  Ai1wm_Status::error(
58
+ sprintf( __( 'Unable to authenticate your request with secret_key = "%s"', AI1WM_PLUGIN_NAME ), $secret_key ),
59
+ __( 'Unable to import', AI1WM_PLUGIN_NAME )
60
  );
61
  exit;
62
  }
81
  }
82
 
83
  // Log request
84
+ if ( empty( $params['priority'] ) || is_file( ai1wm_import_path( $params ) ) ) {
85
+ Ai1wm_Log::import( $params );
86
+ }
87
 
88
  // Do request
89
  if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
90
+ return Ai1wm_Http::post( admin_url( 'admin-ajax.php?action=ai1wm_import' ), $params );
91
  }
92
  }
93
 
lib/controller/class-ai1wm-main-controller.php CHANGED
@@ -412,7 +412,7 @@ class Ai1wm_Main_Controller {
412
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
413
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
414
  ),
415
- 'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
416
  ) );
417
  }
418
 
@@ -454,7 +454,7 @@ class Ai1wm_Main_Controller {
454
  'multipart' => true,
455
  'multipart_params' => array(
456
  'priority' => 5,
457
- 'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
458
  ),
459
  'filters' => array(
460
  'ai1wm_archive_extension' => array( 'wpress', 'bin' ),
@@ -479,29 +479,28 @@ class Ai1wm_Main_Controller {
479
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
480
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
481
  ),
482
- 'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
483
  'oversize' => sprintf(
484
  __(
485
- 'The file that you are trying to import is over the maximum upload file size limit of <strong>%s</strong>.' .
486
- '<br />You can remove this restriction by purchasing our ' .
487
  '<a href="https://servmask.com/products/unlimited-extension" target="_blank">Unlimited Extension</a>.',
488
  AI1WM_PLUGIN_NAME
489
  ),
490
  size_format( apply_filters( 'ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE ) )
491
  ),
492
- 'invalid_extension' =>
493
- sprintf(
494
- __(
495
- 'Version 2.1.1 of All in One WP Migration introduces new compression algorithm. ' .
496
- 'It makes exporting and importing 10 times faster.' .
497
- '<br />Unfortunately, the new format is not back compatible with backups made with earlier ' .
498
- 'versions of the plugin.' .
499
- '<br />You can either create a new backup with the latest version of the ' .
500
- 'plugin, or convert the archive to the new format using our tools ' .
501
- '<a href="%s" target="_blank">here</a>.',
502
- AI1WM_PLUGIN_NAME
503
- ),
504
- AI1WM_ARCHIVE_TOOLS_URL
505
  ),
506
  ) );
507
  }
@@ -546,7 +545,7 @@ class Ai1wm_Main_Controller {
546
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
547
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
548
  ),
549
- 'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
550
  ) );
551
  }
552
 
@@ -597,20 +596,20 @@ class Ai1wm_Main_Controller {
597
  */
598
  public function init() {
599
  // Set secret key
600
- if ( ! get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
601
- update_site_option( AI1WM_SECRET_KEY, wp_generate_password( 12, false ) );
602
  }
603
 
604
  // Set username
605
  if ( isset( $_SERVER['PHP_AUTH_USER'] ) ) {
606
- update_site_option( AI1WM_AUTH_USER, $_SERVER['PHP_AUTH_USER'] );
607
  } else if ( isset( $_SERVER['REMOTE_USER'] ) ) {
608
- update_site_option( AI1WM_AUTH_USER, $_SERVER['REMOTE_USER'] );
609
  }
610
 
611
  // Set password
612
  if ( isset( $_SERVER['PHP_AUTH_PW'] ) ) {
613
- update_site_option( AI1WM_AUTH_PASSWORD, $_SERVER['PHP_AUTH_PW'] );
614
  }
615
 
616
  // Check for updates
412
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
413
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
414
  ),
415
+ 'secret_key' => get_option( AI1WM_SECRET_KEY ),
416
  ) );
417
  }
418
 
454
  'multipart' => true,
455
  'multipart_params' => array(
456
  'priority' => 5,
457
+ 'secret_key' => get_option( AI1WM_SECRET_KEY ),
458
  ),
459
  'filters' => array(
460
  'ai1wm_archive_extension' => array( 'wpress', 'bin' ),
479
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
480
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
481
  ),
482
+ 'secret_key' => get_option( AI1WM_SECRET_KEY ),
483
  'oversize' => sprintf(
484
  __(
485
+ 'The file that you are trying to import is over the maximum upload file size limit of <strong>%s</strong>.<br />' .
486
+ 'You can remove this restriction by purchasing our ' .
487
  '<a href="https://servmask.com/products/unlimited-extension" target="_blank">Unlimited Extension</a>.',
488
  AI1WM_PLUGIN_NAME
489
  ),
490
  size_format( apply_filters( 'ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE ) )
491
  ),
492
+ 'invalid_extension' => sprintf(
493
+ __(
494
+ 'Version 2.1.1 of All in One WP Migration introduces new compression algorithm. ' .
495
+ 'It makes exporting and importing 10 times faster.' .
496
+ '<br />Unfortunately, the new format is not back compatible with backups made with earlier ' .
497
+ 'versions of the plugin.' .
498
+ '<br />You can either create a new backup with the latest version of the ' .
499
+ 'plugin, or convert the archive to the new format using our tools ' .
500
+ '<a href="%s" target="_blank">here</a>.',
501
+ AI1WM_PLUGIN_NAME
502
+ ),
503
+ AI1WM_ARCHIVE_TOOLS_URL
 
504
  ),
505
  ) );
506
  }
545
  'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
546
  'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
547
  ),
548
+ 'secret_key' => get_option( AI1WM_SECRET_KEY ),
549
  ) );
550
  }
551
 
596
  */
597
  public function init() {
598
  // Set secret key
599
+ if ( ! get_option( AI1WM_SECRET_KEY ) ) {
600
+ update_option( AI1WM_SECRET_KEY, wp_generate_password( 12, false ) );
601
  }
602
 
603
  // Set username
604
  if ( isset( $_SERVER['PHP_AUTH_USER'] ) ) {
605
+ update_option( AI1WM_AUTH_USER, $_SERVER['PHP_AUTH_USER'] );
606
  } else if ( isset( $_SERVER['REMOTE_USER'] ) ) {
607
+ update_option( AI1WM_AUTH_USER, $_SERVER['REMOTE_USER'] );
608
  }
609
 
610
  // Set password
611
  if ( isset( $_SERVER['PHP_AUTH_PW'] ) ) {
612
+ update_option( AI1WM_AUTH_PASSWORD, $_SERVER['PHP_AUTH_PW'] );
613
  }
614
 
615
  // Check for updates
lib/controller/class-ai1wm-resolve-controller.php CHANGED
@@ -42,25 +42,25 @@ class Ai1wm_Resolve_Controller {
42
  }
43
 
44
  // Verify secret key by using the value in the database, not in cache
45
- if ( $secret_key !== get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
46
  Ai1wm_Status::error(
47
- __( "Unable to authenticate your request with secret_key = \"{$secret_key}\"", AI1WM_PLUGIN_NAME ),
48
- __( "Unable to resolve", AI1WM_PLUGIN_NAME )
49
  );
50
  exit;
51
  }
52
 
53
  // Set IP address
54
  if ( isset( $params['url_ip'] ) && ( $ip = $params['url_ip' ] ) ) {
55
- update_site_option( AI1WM_URL_IP, $ip );
56
  }
57
 
58
  // Set transport layer
59
  if ( isset( $params['url_transport'] ) && ( $transport = $params['url_transport'] ) ) {
60
  if ( $transport === 'curl' ) {
61
- update_site_option( AI1WM_URL_TRANSPORT, array( 'curl', 'ai1wm' ) );
62
  } else {
63
- update_site_option( AI1WM_URL_TRANSPORT, array( 'ai1wm', 'curl' ) );
64
  }
65
  }
66
  }
42
  }
43
 
44
  // Verify secret key by using the value in the database, not in cache
45
+ if ( $secret_key !== get_option( AI1WM_SECRET_KEY ) ) {
46
  Ai1wm_Status::error(
47
+ sprintf( __( 'Unable to authenticate your request with secret_key = "%s"', AI1WM_PLUGIN_NAME ), $secret_key ),
48
+ __( 'Unable to resolve', AI1WM_PLUGIN_NAME )
49
  );
50
  exit;
51
  }
52
 
53
  // Set IP address
54
  if ( isset( $params['url_ip'] ) && ( $ip = $params['url_ip' ] ) ) {
55
+ update_option( AI1WM_URL_IP, $ip );
56
  }
57
 
58
  // Set transport layer
59
  if ( isset( $params['url_transport'] ) && ( $transport = $params['url_transport'] ) ) {
60
  if ( $transport === 'curl' ) {
61
+ update_option( AI1WM_URL_TRANSPORT, array( 'curl', 'ai1wm' ) );
62
  } else {
63
+ update_option( AI1WM_URL_TRANSPORT, array( 'ai1wm', 'curl' ) );
64
  }
65
  }
66
  }
lib/controller/class-ai1wm-updater-controller.php CHANGED
@@ -69,7 +69,7 @@ class Ai1wm_Updater_Controller {
69
 
70
  // Verify whether extension exists
71
  if ( isset( $extensions[ $extension ] ) ) {
72
- update_site_option( $extensions[ $extension ]['key'], $uuid );
73
  }
74
  }
75
  }
69
 
70
  // Verify whether extension exists
71
  if ( isset( $extensions[ $extension ] ) ) {
72
+ update_option( $extensions[ $extension ]['key'], $uuid );
73
  }
74
  }
75
  }
lib/model/class-ai1wm-compatibility.php CHANGED
@@ -53,11 +53,11 @@ class Ai1wm_Compatibility {
53
  if ( $extension['version'] !== 'develop' ) {
54
  if ( version_compare( $extension['version'], $extension['requires'], '<' ) ) {
55
  $plugin = get_plugin_data( sprintf( '%s/%s', WP_PLUGIN_DIR, $extension['basename'] ) );
56
- return __( sprintf(
57
  '<strong>%s</strong> is not the latest version. ' .
58
- 'You must update the plugin before you can use it.',
59
- $plugin['Name']
60
- ), AI1WM_PLUGIN_NAME );
61
  }
62
  }
63
  }
53
  if ( $extension['version'] !== 'develop' ) {
54
  if ( version_compare( $extension['version'], $extension['requires'], '<' ) ) {
55
  $plugin = get_plugin_data( sprintf( '%s/%s', WP_PLUGIN_DIR, $extension['basename'] ) );
56
+ return sprintf( __(
57
  '<strong>%s</strong> is not the latest version. ' .
58
+ 'You must update the plugin before you can use it. ',
59
+ AI1WM_PLUGIN_NAME
60
+ ), $plugin['Name'] );
61
  }
62
  }
63
  }
lib/model/class-ai1wm-feedback.php CHANGED
@@ -52,12 +52,9 @@ class Ai1wm_Feedback {
52
  AI1WM_FEEDBACK_URL,
53
  array(
54
  'body' => array(
55
- 'type' => $type,
56
- 'email' => $email,
57
- 'message' => $message,
58
- 'export_options' => json_encode( get_site_option( AI1WM_EXPORT_OPTIONS, array() ) ),
59
- 'error_handler' => json_encode( get_site_option( AI1WM_ERROR_HANDLER, array() ) ),
60
- 'exception_handler' => json_encode( get_site_option( AI1WM_EXCEPTION_HANDLER, array() ) ),
61
  ),
62
  )
63
  );
52
  AI1WM_FEEDBACK_URL,
53
  array(
54
  'body' => array(
55
+ 'type' => $type,
56
+ 'email' => $email,
57
+ 'message' => $message,
 
 
 
58
  ),
59
  )
60
  );
lib/model/class-ai1wm-http.php CHANGED
@@ -27,7 +27,7 @@ class Ai1wm_Http {
27
 
28
  public static $transports = array( 'ai1wm', 'curl' );
29
 
30
- public static function get( $url, $params = array() ) {
31
 
32
  // Check the status, maybe we need to stop it
33
  if ( ! is_file( ai1wm_export_path( $params ) ) && ! is_file( ai1wm_import_path( $params ) ) ) {
@@ -35,7 +35,7 @@ class Ai1wm_Http {
35
  }
36
 
37
  // Get IP address
38
- $ip = get_site_option( AI1WM_URL_IP, false, false );
39
 
40
  // HTTP request
41
  Ai1wm_Http::request( $url, $ip, $params );
@@ -44,11 +44,11 @@ class Ai1wm_Http {
44
  public static function resolve( $url ) {
45
 
46
  // Reset IP address and transport layer
47
- delete_site_option( AI1WM_URL_IP );
48
- delete_site_option( AI1WM_URL_TRANSPORT );
49
 
50
  // Set secret
51
- $secret_key = get_site_option( AI1WM_SECRET_KEY, false, false );
52
 
53
  // Set scheme
54
  $scheme = parse_url( $url, PHP_URL_SCHEME );
@@ -85,18 +85,11 @@ class Ai1wm_Http {
85
  // HTTP response
86
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
87
 
88
- // Clear WP options cache
89
- wp_cache_flush();
90
-
91
- // Clear WP notoptions cache
92
- wp_cache_delete( 'notoptions', 'options' );
93
-
94
- // Set WP notoptions cache
95
- wp_cache_set( 'notoptions', array(), 'options' );
96
 
97
  // Is valid transport layer?
98
- if ( get_site_option( AI1WM_URL_IP, false, false )
99
- && get_site_option( AI1WM_URL_TRANSPORT, false, false ) ) {
100
  return;
101
  }
102
  }
@@ -123,7 +116,7 @@ class Ai1wm_Http {
123
  $headers = array( 'Accept' => '*/*' );
124
 
125
  // Add authorization header
126
- if ( ( $user = get_site_option( AI1WM_AUTH_USER ) ) && ( $password = get_site_option( AI1WM_AUTH_PASSWORD ) ) ) {
127
  $headers['Authorization'] = sprintf( 'Basic %s', base64_encode( "{$user}:{$password}" ) );
128
  }
129
 
@@ -159,6 +152,6 @@ class Ai1wm_Http {
159
  }
160
 
161
  public static function transports( $transports ) {
162
- return get_site_option( AI1WM_URL_TRANSPORT, Ai1wm_Http::$transports, false );
163
  }
164
  }
27
 
28
  public static $transports = array( 'ai1wm', 'curl' );
29
 
30
+ public static function post( $url, $params = array() ) {
31
 
32
  // Check the status, maybe we need to stop it
33
  if ( ! is_file( ai1wm_export_path( $params ) ) && ! is_file( ai1wm_import_path( $params ) ) ) {
35
  }
36
 
37
  // Get IP address
38
+ $ip = get_option( AI1WM_URL_IP );
39
 
40
  // HTTP request
41
  Ai1wm_Http::request( $url, $ip, $params );
44
  public static function resolve( $url ) {
45
 
46
  // Reset IP address and transport layer
47
+ delete_option( AI1WM_URL_IP );
48
+ delete_option( AI1WM_URL_TRANSPORT );
49
 
50
  // Set secret
51
+ $secret_key = get_option( AI1WM_SECRET_KEY );
52
 
53
  // Set scheme
54
  $scheme = parse_url( $url, PHP_URL_SCHEME );
85
  // HTTP response
86
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
87
 
88
+ // Initialize empty WP cache
89
+ wp_cache_init();
 
 
 
 
 
 
90
 
91
  // Is valid transport layer?
92
+ if ( get_option( AI1WM_URL_IP ) && get_option( AI1WM_URL_TRANSPORT ) ) {
 
93
  return;
94
  }
95
  }
116
  $headers = array( 'Accept' => '*/*' );
117
 
118
  // Add authorization header
119
+ if ( ( $user = get_option( AI1WM_AUTH_USER ) ) && ( $password = get_option( AI1WM_AUTH_PASSWORD ) ) ) {
120
  $headers['Authorization'] = sprintf( 'Basic %s', base64_encode( "{$user}:{$password}" ) );
121
  }
122
 
152
  }
153
 
154
  public static function transports( $transports ) {
155
+ return get_option( AI1WM_URL_TRANSPORT, Ai1wm_Http::$transports );
156
  }
157
  }
lib/model/class-ai1wm-log.php CHANGED
@@ -38,11 +38,9 @@ class Ai1wm_Log {
38
  $data[] = PHP_EOL;
39
 
40
  // Write log data
41
- if ( empty( $params['priority'] ) || is_file( ai1wm_export_path( $params ) ) ) {
42
- if ( $handle = fopen( ai1wm_export_path( $params ), 'a' ) ) {
43
- fwrite( $handle, implode( $data, PHP_EOL ) );
44
- fclose( $handle );
45
- }
46
  }
47
  }
48
 
@@ -59,11 +57,9 @@ class Ai1wm_Log {
59
  $data[] = PHP_EOL;
60
 
61
  // Write log data
62
- if ( empty( $params['priority'] ) || is_file( ai1wm_import_path( $params ) ) ) {
63
- if ( $handle = fopen( ai1wm_import_path( $params ), 'a' ) ) {
64
- fwrite( $handle, implode( $data, PHP_EOL ) );
65
- fclose( $handle );
66
- }
67
  }
68
  }
69
 
@@ -81,7 +77,7 @@ class Ai1wm_Log {
81
 
82
  // Write log data
83
  if ( $handle = fopen( ai1wm_error_path(), 'a' ) ) {
84
- fwrite( $handle, implode( $data, PHP_EOL ) );
85
  fclose( $handle );
86
  }
87
  }
38
  $data[] = PHP_EOL;
39
 
40
  // Write log data
41
+ if ( $handle = fopen( ai1wm_export_path( $params ), 'a' ) ) {
42
+ fwrite( $handle, implode( PHP_EOL, $data ) );
43
+ fclose( $handle );
 
 
44
  }
45
  }
46
 
57
  $data[] = PHP_EOL;
58
 
59
  // Write log data
60
+ if ( $handle = fopen( ai1wm_import_path( $params ), 'a' ) ) {
61
+ fwrite( $handle, implode( PHP_EOL, $data ) );
62
+ fclose( $handle );
 
 
63
  }
64
  }
65
 
77
 
78
  // Write log data
79
  if ( $handle = fopen( ai1wm_error_path(), 'a' ) ) {
80
+ fwrite( $handle, implode( PHP_EOL, $data ) );
81
  fclose( $handle );
82
  }
83
  }
lib/model/class-ai1wm-report.php CHANGED
@@ -49,14 +49,12 @@ class Ai1wm_Report {
49
  AI1WM_REPORT_URL,
50
  array(
51
  'body' => array(
52
- 'email' => $email,
53
- 'message' => $message,
54
- 'export_options' => json_encode( get_site_option( AI1WM_EXPORT_OPTIONS, array() ) ),
55
- 'error_handler' => json_encode( get_site_option( AI1WM_ERROR_HANDLER, array() ) ),
56
- 'exception_handler' => json_encode( get_site_option( AI1WM_EXCEPTION_HANDLER, array() ) ),
57
  ),
58
  )
59
  );
 
60
  if ( is_wp_error( $response ) ) {
61
  $errors[] = sprintf( __( 'Something went wrong: %s', AI1WM_PLUGIN_NAME ), $response->get_error_message() );
62
  }
49
  AI1WM_REPORT_URL,
50
  array(
51
  'body' => array(
52
+ 'email' => $email,
53
+ 'message' => $message,
 
 
 
54
  ),
55
  )
56
  );
57
+
58
  if ( is_wp_error( $response ) ) {
59
  $errors[] = sprintf( __( 'Something went wrong: %s', AI1WM_PLUGIN_NAME ), $response->get_error_message() );
60
  }
lib/model/class-ai1wm-updater.php CHANGED
@@ -44,7 +44,7 @@ class Ai1wm_Updater {
44
  if ( isset( $args->slug ) && isset( $extensions[ $args->slug ] ) && $action === 'plugin_information' ) {
45
 
46
  // Get current updates
47
- $updates = get_site_option( AI1WM_UPDATER, array() );
48
 
49
  // Plugin details
50
  if ( isset( $updates[ $args->slug ] ) && ( $details = $updates[ $args->slug ] ) ) {
@@ -65,19 +65,19 @@ class Ai1wm_Updater {
65
  $extensions = Ai1wm_Extensions::get();
66
 
67
  // Get current updates
68
- $updates = get_site_option( AI1WM_UPDATER, array() );
69
 
70
  // Get extension updates
71
  foreach ( $updates as $slug => $update ) {
72
  if ( isset( $extensions[ $slug ]) && ( $extension = $extensions[ $slug ] ) ) {
73
- if ( get_site_option( $extension['key'] ) ) {
74
  if ( version_compare( $extension['version'], $update['version'], '<' ) ) {
75
 
76
  // Get Site URL
77
  $url = urlencode( get_site_url() );
78
 
79
  // Get Purchase ID
80
- $key = get_site_option( $extension['key'], false, false );
81
 
82
  // Set plugin details
83
  $transient->response[ $extension['basename'] ] = (object) array(
@@ -102,7 +102,7 @@ class Ai1wm_Updater {
102
  */
103
  public static function check_for_updates() {
104
  // Get current updates
105
- $updates = get_site_option( AI1WM_UPDATER, array() );
106
 
107
  // Get extension updates
108
  foreach ( Ai1wm_Extensions::get() as $slug => $extension ) {
@@ -140,7 +140,7 @@ class Ai1wm_Updater {
140
  }
141
 
142
  // Set new updates
143
- update_site_option( AI1WM_UPDATER, $updates );
144
  }
145
 
146
  /**
@@ -162,7 +162,7 @@ class Ai1wm_Updater {
162
  $url = add_query_arg( array( 'ai1wm_updater' => 1 ), network_admin_url( 'plugins.php' ) );
163
 
164
  // Check Purchase ID
165
- if ( get_site_option( $extension['key'] ) ) {
166
 
167
  // Add "Check for updates" link
168
  $links[] = Ai1wm_Template::get_content( 'updater/check', array(
44
  if ( isset( $args->slug ) && isset( $extensions[ $args->slug ] ) && $action === 'plugin_information' ) {
45
 
46
  // Get current updates
47
+ $updates = get_option( AI1WM_UPDATER, array() );
48
 
49
  // Plugin details
50
  if ( isset( $updates[ $args->slug ] ) && ( $details = $updates[ $args->slug ] ) ) {
65
  $extensions = Ai1wm_Extensions::get();
66
 
67
  // Get current updates
68
+ $updates = get_option( AI1WM_UPDATER, array() );
69
 
70
  // Get extension updates
71
  foreach ( $updates as $slug => $update ) {
72
  if ( isset( $extensions[ $slug ]) && ( $extension = $extensions[ $slug ] ) ) {
73
+ if ( get_option( $extension['key'] ) ) {
74
  if ( version_compare( $extension['version'], $update['version'], '<' ) ) {
75
 
76
  // Get Site URL
77
  $url = urlencode( get_site_url() );
78
 
79
  // Get Purchase ID
80
+ $key = get_option( $extension['key'] );
81
 
82
  // Set plugin details
83
  $transient->response[ $extension['basename'] ] = (object) array(
102
  */
103
  public static function check_for_updates() {
104
  // Get current updates
105
+ $updates = get_option( AI1WM_UPDATER, array() );
106
 
107
  // Get extension updates
108
  foreach ( Ai1wm_Extensions::get() as $slug => $extension ) {
140
  }
141
 
142
  // Set new updates
143
+ update_option( AI1WM_UPDATER, $updates );
144
  }
145
 
146
  /**
162
  $url = add_query_arg( array( 'ai1wm_updater' => 1 ), network_admin_url( 'plugins.php' ) );
163
 
164
  // Check Purchase ID
165
+ if ( get_option( $extension['key'] ) ) {
166
 
167
  // Add "Check for updates" link
168
  $links[] = Ai1wm_Template::get_content( 'updater/check', array(
lib/model/export/class-ai1wm-export-compatibility.php CHANGED
@@ -28,18 +28,27 @@ class Ai1wm_Export_Compatibility {
28
  public static function execute( $params ) {
29
  $messages = Ai1wm_Compatibility::get( $params );
30
 
 
31
  if ( empty( $messages ) ) {
32
  return $params;
33
  }
34
 
 
35
  Ai1wm_Status::error( implode( $messages ) );
36
 
37
- if ( ! isset( $params['ai1wm-manual-export'] ) ) {
 
38
  if ( function_exists( 'wp_mail' ) ) {
39
- $recipient = get_site_option( 'admin_email', '' );
 
 
 
40
  $subject = __( 'Unable to backup your site', AI1WM_PLUGIN_NAME );
41
- $message = __( sprintf( 'All-in-One WP Migration was unable to backup %s.', site_url() ) );
42
- $message .= implode( $messages );
 
 
 
43
  wp_mail( $recipient, $subject, $message );
44
  }
45
  }
28
  public static function execute( $params ) {
29
  $messages = Ai1wm_Compatibility::get( $params );
30
 
31
+ // Set messages
32
  if ( empty( $messages ) ) {
33
  return $params;
34
  }
35
 
36
+ // Set progress
37
  Ai1wm_Status::error( implode( $messages ) );
38
 
39
+ // Manual export
40
+ if ( empty( $params['ai1wm_manual_export'] ) ) {
41
  if ( function_exists( 'wp_mail' ) ) {
42
+ // Set recipient
43
+ $recipient = get_option( 'admin_email', '' );
44
+
45
+ // Set subject
46
  $subject = __( 'Unable to backup your site', AI1WM_PLUGIN_NAME );
47
+
48
+ // Set message
49
+ $message = sprintf( __( 'All-in-One WP Migration was unable to backup %s. %s', AI1WM_PLUGIN_NAME ), site_url(), implode( $messages ) );
50
+
51
+ // Send email
52
  wp_mail( $recipient, $subject, $message );
53
  }
54
  }
lib/model/export/class-ai1wm-export-config.php CHANGED
@@ -31,8 +31,8 @@ class Ai1wm_Export_Config {
31
  // Set progress
32
  Ai1wm_Status::info( __( 'Adding configuration to archive...', AI1WM_PLUGIN_NAME ) );
33
 
34
- // Clear WP options cache
35
- wp_cache_flush();
36
 
37
  // Get options
38
  $options = wp_load_alloptions();
31
  // Set progress
32
  Ai1wm_Status::info( __( 'Adding configuration to archive...', AI1WM_PLUGIN_NAME ) );
33
 
34
+ // Initialize empty WP cache
35
+ wp_cache_init();
36
 
37
  // Get options
38
  $options = wp_load_alloptions();
lib/model/export/class-ai1wm-export-content.php CHANGED
@@ -88,7 +88,7 @@ class Ai1wm_Export_Content {
88
  try {
89
 
90
  // Add file to archive
91
- if ( ( $content_offset = $archive->add_file( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path, $path, $content_offset, 3 ) ) ) {
92
 
93
  // Set progress
94
  if ( ( $processed += $content_offset ) ) {
@@ -126,8 +126,8 @@ class Ai1wm_Export_Content {
126
  // Increment processed files
127
  $processed += $archive->get_current_filesize();
128
 
129
- // More than 3 seconds have passed, break and do another request
130
- if ( ( microtime( true ) - $start ) > 3 ) {
131
  $completed = false;
132
  break;
133
  }
88
  try {
89
 
90
  // Add file to archive
91
+ if ( ( $content_offset = $archive->add_file( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path, $path, $content_offset, 10 ) ) ) {
92
 
93
  // Set progress
94
  if ( ( $processed += $content_offset ) ) {
126
  // Increment processed files
127
  $processed += $archive->get_current_filesize();
128
 
129
+ // More than 10 seconds have passed, break and do another request
130
+ if ( ( microtime( true ) - $start ) > 10 ) {
131
  $completed = false;
132
  break;
133
  }
lib/model/export/class-ai1wm-export-download.php CHANGED
@@ -45,13 +45,20 @@ class Ai1wm_Export_Download {
45
  $name = ai1wm_site_name();
46
 
47
  // Set progress
48
- Ai1wm_Status::download( __(
49
- "<a href=\"{$link}\" class=\"ai1wm-button-green ai1wm-emphasize\">" .
50
- "<span>Download {$name}</span>" .
51
- "<em>Size: {$size}</em>" .
52
- "</a>",
53
- AI1WM_PLUGIN_NAME
54
- ) );
 
 
 
 
 
 
 
55
  }
56
 
57
  return $params;
45
  $name = ai1wm_site_name();
46
 
47
  // Set progress
48
+ Ai1wm_Status::download(
49
+ sprintf(
50
+ __(
51
+ '<a href="%s" class="ai1wm-button-green ai1wm-emphasize">' .
52
+ '<span>Download %s</span>' .
53
+ '<em>Size: %s</em>' .
54
+ '</a>',
55
+ AI1WM_PLUGIN_NAME
56
+ ),
57
+ $link,
58
+ $name,
59
+ $size
60
+ )
61
+ );
62
  }
63
 
64
  return $params;
lib/model/export/class-ai1wm-export-enumerate.php CHANGED
@@ -67,12 +67,6 @@ class Ai1wm_Export_Enumerate {
67
  // Create map file
68
  $filemap = fopen( ai1wm_filemap_path( $params ) , 'a+' );
69
 
70
- // Start time
71
- $start = microtime( true );
72
-
73
- // Flag to hold if all files have been processed
74
- $completed = true;
75
-
76
  try {
77
 
78
  // Iterate over content directory
@@ -84,9 +78,6 @@ class Ai1wm_Export_Enumerate {
84
  // Recursively iterate over content directory
85
  $iterator = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
86
 
87
- // Limit content directory
88
- $iterator = new LimitIterator( $iterator, $total_files );
89
-
90
  // Write path line
91
  foreach ( $iterator as $item ) {
92
  if ( $item->isFile() ) {
@@ -97,35 +88,24 @@ class Ai1wm_Export_Enumerate {
97
  $total_size += filesize( $iterator->getPathname() );
98
  }
99
  }
100
-
101
- // More than 3 seconds have passed, break and do another request
102
- if ( ( microtime( true ) - $start ) > 3 ) {
103
- $completed = false;
104
- break;
105
- }
106
  }
107
 
108
  } catch ( Exception $e ) {
109
  // Skip bad file permissions
110
  }
111
 
112
- // Set progress
113
- if ( $completed ) {
114
- Ai1wm_Status::info( __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME ) );
115
- }
116
-
117
  // Set total files
118
  $params['total_files'] = $total_files;
119
 
120
  // Set total size
121
  $params['total_size'] = $total_size;
122
 
123
- // Set completed flag
124
- $params['completed'] = $completed;
125
-
126
  // Close the filemap file
127
  fclose( $filemap );
128
 
 
 
 
129
  return $params;
130
  }
131
  }
67
  // Create map file
68
  $filemap = fopen( ai1wm_filemap_path( $params ) , 'a+' );
69
 
 
 
 
 
 
 
70
  try {
71
 
72
  // Iterate over content directory
78
  // Recursively iterate over content directory
79
  $iterator = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
80
 
 
 
 
81
  // Write path line
82
  foreach ( $iterator as $item ) {
83
  if ( $item->isFile() ) {
88
  $total_size += filesize( $iterator->getPathname() );
89
  }
90
  }
 
 
 
 
 
 
91
  }
92
 
93
  } catch ( Exception $e ) {
94
  // Skip bad file permissions
95
  }
96
 
 
 
 
 
 
97
  // Set total files
98
  $params['total_files'] = $total_files;
99
 
100
  // Set total size
101
  $params['total_size'] = $total_size;
102
 
 
 
 
103
  // Close the filemap file
104
  fclose( $filemap );
105
 
106
+ // Set progress
107
+ Ai1wm_Status::info( __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME ) );
108
+
109
  return $params;
110
  }
111
  }
lib/model/import/class-ai1wm-import-compatibility.php CHANGED
@@ -28,11 +28,14 @@ class Ai1wm_Import_Compatibility {
28
  public static function execute( $params ) {
29
  $messages = Ai1wm_Compatibility::get( $params );
30
 
 
31
  if ( empty( $messages ) ) {
32
  return $params;
33
  }
34
 
 
35
  Ai1wm_Status::error( implode( $messages ) );
 
36
  exit;
37
  }
38
  }
28
  public static function execute( $params ) {
29
  $messages = Ai1wm_Compatibility::get( $params );
30
 
31
+ // Set messages
32
  if ( empty( $messages ) ) {
33
  return $params;
34
  }
35
 
36
+ // Set progress
37
  Ai1wm_Status::error( implode( $messages ) );
38
+
39
  exit;
40
  }
41
  }
lib/model/import/class-ai1wm-import-confirm.php CHANGED
@@ -27,33 +27,6 @@ class Ai1wm_Import_Confirm {
27
 
28
  public static function execute( $params ) {
29
 
30
- // Obtain the name of the archive
31
- $name = ai1wm_archive_name( $params );
32
-
33
- // Obtain the size of the archive
34
- $size = ai1wm_archive_bytes( $params );
35
-
36
- // Check file size of the archive
37
- if ( false === $size ) {
38
- throw new Ai1wm_Not_Accesible_Exception(
39
- __( "Unable to get the file size of <strong>{$name}</strong>", AI1WM_PLUGIN_NAME )
40
- );
41
- }
42
-
43
- $allowed_size = apply_filters( 'ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE );
44
-
45
- // Let's check the size of the file to make sure it is less than the maximum allowed
46
- if ( ( $allowed_size > 0 ) && ( $size > $allowed_size ) ) {
47
- throw new Ai1wm_Import_Exception(
48
- __(
49
- "The file that you are trying to import is over the maximum upload file size limit of {$allowed_size}.<br />" .
50
- "You can remove this restriction by purchasing our " .
51
- "<a href=\"https://servmask.com/products/unlimited-extension\" target=\"_blank\">Unlimited Extension</a>.",
52
- AI1WM_PLUGIN_NAME
53
- )
54
- );
55
- }
56
-
57
  // Set progress
58
  Ai1wm_Status::confirm( __(
59
  'The import process will overwrite your database, media, plugins, and themes. ' .
27
 
28
  public static function execute( $params ) {
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  // Set progress
31
  Ai1wm_Status::confirm( __(
32
  'The import process will overwrite your database, media, plugins, and themes. ' .
lib/model/import/class-ai1wm-import-content.php CHANGED
@@ -108,7 +108,7 @@ class Ai1wm_Import_Content {
108
  try {
109
 
110
  // Extract a file from archive to WP_CONTENT_DIR
111
- if ( ( $content_offset = $archive->extract_one_file_to( WP_CONTENT_DIR, array( AI1WM_PACKAGE_NAME, AI1WM_MULTISITE_NAME, AI1WM_DATABASE_NAME, AI1WM_MUPLUGINS_NAME ), $old_paths, $new_paths, $content_offset, 3 ) ) ) {
112
 
113
  // Set progress
114
  if ( ( $processed += $content_offset ) ) {
@@ -146,8 +146,8 @@ class Ai1wm_Import_Content {
146
  // Increment processed files
147
  $processed += $archive->get_current_filesize();
148
 
149
- // More than 3 seconds have passed, break and do another request
150
- if ( ( microtime( true ) - $start ) > 3 ) {
151
  $completed = false;
152
  break;
153
  }
108
  try {
109
 
110
  // Extract a file from archive to WP_CONTENT_DIR
111
+ if ( ( $content_offset = $archive->extract_one_file_to( WP_CONTENT_DIR, array( AI1WM_PACKAGE_NAME, AI1WM_MULTISITE_NAME, AI1WM_DATABASE_NAME, AI1WM_MUPLUGINS_NAME ), $old_paths, $new_paths, $content_offset, 10 ) ) ) {
112
 
113
  // Set progress
114
  if ( ( $processed += $content_offset ) ) {
146
  // Increment processed files
147
  $processed += $archive->get_current_filesize();
148
 
149
+ // More than 10 seconds have passed, break and do another request
150
+ if ( ( microtime( true ) - $start ) > 10 ) {
151
  $completed = false;
152
  break;
153
  }
lib/model/import/class-ai1wm-import-database.php CHANGED
@@ -302,19 +302,19 @@ class Ai1wm_Import_Database {
302
  }
303
 
304
  // Get URL IP
305
- $url_ip = get_site_option( AI1WM_URL_IP, false, false );
306
 
307
  // Get URL transport
308
- $url_transport = get_site_option( AI1WM_URL_TRANSPORT, false, false );
309
 
310
  // Get secret key
311
- $secret_key = get_site_option( AI1WM_SECRET_KEY, false, false );
312
 
313
  // Get HTTP user
314
- $auth_user = get_site_option( AI1WM_AUTH_USER, false, false );
315
 
316
  // Get HTTP password
317
- $auth_password = get_site_option( AI1WM_AUTH_PASSWORD, false, false );
318
 
319
  // Get active ServMask plugins
320
  $active_servmask_plugins = ai1wm_active_servmask_plugins();
@@ -378,26 +378,26 @@ class Ai1wm_Import_Database {
378
  // Import database
379
  $client->import( ai1wm_database_path( $params ) );
380
 
381
- // Clear WP options cache
382
- wp_cache_flush();
383
 
384
  // Activate plugins
385
- activate_plugins( $active_servmask_plugins, null , is_multisite() );
386
 
387
  // Set the new URL IP
388
- update_site_option( AI1WM_URL_IP, $url_ip );
389
 
390
  // Set the new URL transport
391
- update_site_option( AI1WM_URL_TRANSPORT, $url_transport );
392
 
393
  // Set the new secret key value
394
- update_site_option( AI1WM_SECRET_KEY, $secret_key );
395
 
396
  // Set the new HTTP user
397
- update_site_option( AI1WM_AUTH_USER, $auth_user );
398
 
399
  // Set the new HTTP password
400
- update_site_option( AI1WM_AUTH_PASSWORD, $auth_password );
401
 
402
  return $params;
403
  }
302
  }
303
 
304
  // Get URL IP
305
+ $url_ip = get_option( AI1WM_URL_IP );
306
 
307
  // Get URL transport
308
+ $url_transport = get_option( AI1WM_URL_TRANSPORT );
309
 
310
  // Get secret key
311
+ $secret_key = get_option( AI1WM_SECRET_KEY );
312
 
313
  // Get HTTP user
314
+ $auth_user = get_option( AI1WM_AUTH_USER );
315
 
316
  // Get HTTP password
317
+ $auth_password = get_option( AI1WM_AUTH_PASSWORD );
318
 
319
  // Get active ServMask plugins
320
  $active_servmask_plugins = ai1wm_active_servmask_plugins();
378
  // Import database
379
  $client->import( ai1wm_database_path( $params ) );
380
 
381
+ // Initialize empty WP cache
382
+ wp_cache_init();
383
 
384
  // Activate plugins
385
+ activate_plugins( $active_servmask_plugins, null, is_multisite() );
386
 
387
  // Set the new URL IP
388
+ update_option( AI1WM_URL_IP, $url_ip );
389
 
390
  // Set the new URL transport
391
+ update_option( AI1WM_URL_TRANSPORT, $url_transport );
392
 
393
  // Set the new secret key value
394
+ update_option( AI1WM_SECRET_KEY, $secret_key );
395
 
396
  // Set the new HTTP user
397
+ update_option( AI1WM_AUTH_USER, $auth_user );
398
 
399
  // Set the new HTTP password
400
+ update_option( AI1WM_AUTH_PASSWORD, $auth_password );
401
 
402
  return $params;
403
  }
lib/model/import/class-ai1wm-import-done.php CHANGED
@@ -77,28 +77,42 @@ class Ai1wm_Import_Done {
77
  public static function shutdown() {
78
  $error = error_get_last();
79
 
80
- // Deactivate must-use plugins on fatal errors
81
- if ( $error ) {
82
- if ( $error['type'] === E_ERROR && stripos( $error['file'], AI1WM_MUPLUGINS_NAME ) !== false ) {
83
- if ( is_dir( ai1wm_content_path( AI1WM_MUPLUGINS_NAME ) ) ) {
84
- @rename( ai1wm_content_path( AI1WM_MUPLUGINS_NAME ), sprintf( '%s-%s', ai1wm_content_path( AI1WM_MUPLUGINS_NAME ), date( 'YmdHis' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
  }
87
  }
88
 
89
- // Get permalink URL
90
- $permalink = admin_url( 'options-permalink.php#submit' );
91
-
92
  // Set progress
93
  Ai1wm_Status::done(
94
- __(
95
- "You need to perform two more steps:<br />" .
96
- "<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 />" .
97
- "<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>",
98
- AI1WM_PLUGIN_NAME
 
 
 
99
  ),
100
  __(
101
- "Your data has been imported successfuly!",
102
  AI1WM_PLUGIN_NAME
103
  )
104
  );
77
  public static function shutdown() {
78
  $error = error_get_last();
79
 
80
+ // Set error type
81
+ $type = null;
82
+ if ( isset( $error['type'] ) ) {
83
+ $type = $error['type'];
84
+ }
85
+
86
+ // Set error file
87
+ $file = null;
88
+ if ( isset( $error['file'] ) ) {
89
+ $file = $error['file'];
90
+ }
91
+
92
+ // Deactivate must-use plugins on fatal and parse errors
93
+ if ( in_array( $type, array( E_ERROR, E_PARSE ) ) && stripos( $file, AI1WM_MUPLUGINS_NAME ) !== false ) {
94
+ foreach ( wp_get_mu_plugins() as $mu_plugin ) {
95
+ if ( copy( $mu_plugin, sprintf( '%s-%s', $mu_plugin, date( 'YmdHis' ) ) ) ) {
96
+ if ( ( $handle = fopen( $mu_plugin, 'w' ) ) ) {
97
+ fclose( $handle );
98
+ }
99
  }
100
  }
101
  }
102
 
 
 
 
103
  // Set progress
104
  Ai1wm_Status::done(
105
+ sprintf(
106
+ __(
107
+ 'You need to perform two more steps:<br />' .
108
+ '<strong>1. You must save your permalinks structure twice. <a class="ai1wm-no-underline" href="%s" target="_blank">Permalinks Settings</a></strong> <small>(opens a new window)</small><br />' .
109
+ '<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>',
110
+ AI1WM_PLUGIN_NAME
111
+ ),
112
+ admin_url( 'options-permalink.php#submit' )
113
  ),
114
  __(
115
+ 'Your data has been imported successfuly!',
116
  AI1WM_PLUGIN_NAME
117
  )
118
  );
lib/model/import/class-ai1wm-import-validate.php CHANGED
@@ -44,6 +44,36 @@ class Ai1wm_Import_Validate {
44
  );
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  // Unpack package.json, multisite.json and database.sql files
48
  $archive->extract_by_files_array(
49
  ai1wm_storage_path( $params ),
44
  );
45
  }
46
 
47
+ // Obtain the name of the archive
48
+ $name = ai1wm_archive_name( $params );
49
+
50
+ // Obtain the size of the archive
51
+ $size = ai1wm_archive_bytes( $params );
52
+
53
+ // Check file size of the archive
54
+ if ( false === $size ) {
55
+ throw new Ai1wm_Not_Accesible_Exception(
56
+ sprintf( __( 'Unable to get the file size of <strong>%s</strong>', AI1WM_PLUGIN_NAME ), $name )
57
+ );
58
+ }
59
+
60
+ $allowed_size = apply_filters( 'ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE );
61
+
62
+ // Let's check the size of the file to make sure it is less than the maximum allowed
63
+ if ( ( $allowed_size > 0 ) && ( $size > $allowed_size ) ) {
64
+ throw new Ai1wm_Import_Exception(
65
+ sprintf(
66
+ __(
67
+ 'The file that you are trying to import is over the maximum upload file size limit of <strong>%s</strong>.<br />' .
68
+ 'You can remove this restriction by purchasing our ' .
69
+ '<a href="https://servmask.com/products/unlimited-extension" target="_blank">Unlimited Extension</a>.',
70
+ AI1WM_PLUGIN_NAME
71
+ ),
72
+ size_format( $allowed_size )
73
+ )
74
+ );
75
+ }
76
+
77
  // Unpack package.json, multisite.json and database.sql files
78
  $archive->extract_by_files_array(
79
  ai1wm_storage_path( $params ),
lib/view/assets/javascript/export.min.js CHANGED
@@ -1 +1 @@
1
- !function e(t,a,i){function o(r,s){if(!a[r]){if(!t[r]){var c="function"==typeof require&&require;if(!s&&c)return c(r,!0);if(n)return n(r,!0);throw new Error("Cannot find module '"+r+"'")}var p=a[r]={exports:{}};t[r][0].call(p.exports,function(e){var a=t[r][1][e];return o(a?a:e)},p,p.exports,e,t,a,i)}return a[r].exports}for(var n="function"==typeof require&&require,r=0;r<i.length;r++)o(i[r]);return o}({1:[function(e,t){var a=e("../servmask/util"),i=e("./modal"),o=jQuery,n=function(){var e=this;this.params=[],this.modal=new i,this.modal.onStop=function(t){e.onStop(t)}};n.prototype.setParams=function(e){this.params=a.list(e)},n.prototype.start=function(e){var t=this;o(window).bind("beforeunload",function(){return"You are about to stop exporting your website, are you sure?"}),this.stop=!1,this.setStatus({type:"info",message:"Preparing to export..."});var i=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key});e&&(i=i.concat(a.list(e))),o.post(ai1wm_export.ajax.url,i).done(function(){t.getStatus(ai1wm_export.status.php)}).fail(function(){t.setStatus({type:"error",message:"Unable to start the export. Refresh the page and try again"})})},n.prototype.clean=function(e){var t=this;this.stop=!0;var i=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key}).concat({name:"priority",value:350});e&&(i=i.concat(a.list(e))),o.post(ai1wm_export.ajax.url,i).done(function(){o(window).unbind("beforeunload")}).fail(function(){t.setStatus({type:"error",message:"Unable to clean the export. Refresh the page and try again"})})},n.prototype.getStatus=function(e,t){var a=this,t=t||0;this.stop||o.ajax({cache:!1,url:e,dataType:"json"}).done(function(i){if(i)switch(a.setStatus(i),i.type){case"done":case"error":case"download":return o(window).unbind("beforeunload"),void 0}setTimeout(function(){a.getStatus(e,t)},3e3)}).fail(function(){t++,t>=6?a.setStatus({type:"error",message:"Unable to retrieve status of the export. Is your server running?"}):t>=3?a.getStatus(ai1wm_export.status.js,t):a.getStatus(ai1wm_export.status.php,t)})},n.prototype.setStatus=function(e){this.modal.render(e)},n.prototype.onStop=function(e){this.clean(e)},t.exports=n},{"../servmask/util":10,"./modal":2}],2:[function(e,t){var a=jQuery,i=function(){var e=this;this.error=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a("<span></span>").addClass("ai1wm-title-red").text("Unable to export"),p=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.info=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a('<span class="ai1wm-loader"></span>'),p=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').on("click",function(){a(this).attr("disabled","disabled"),e.onStop(),e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.done=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a("<span></span>").addClass("ai1wm-title-green").text(t.title),p=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.download=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=(a("<h1></h1>"),a("<p></p>").html(t.message)),r=a("<div></div>"),s=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});r.append(s),o.append(n),i.append(o).append(r),e.modal.html(i).show(),e.overlay.show()},this.overlay=a('<div class="ai1wm-overlay"></div>'),this.modal=a('<div class="ai1wm-modal-container"></div>'),a("body").append(this.overlay).append(this.modal)};i.prototype.render=function(e){switch(e.type){case"error":this.error(e);break;case"info":this.info(e);break;case"done":this.done(e);break;case"download":this.download(e)}},t.exports=i},{}],3:[function(e){(function(t){var a=(e("./jquery/query"),e("./jquery/find_replace"),e("./servmask/report"),e("./servmask/feedback"),e("./servmask/util")),i=(e("./servmask/deprecated"),e("./export/export"));jQuery(document).ready(function(e){"use strict";var t=new i;e("#ai1wm-export-file").click(function(e){var i=a.random(12),o=a.form("#ai1wm-export-form").concat({name:"storage",value:i});t.setParams(o),t.start(),e.preventDefault()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()}),t.Ai1wm={Util:a,Export:i}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export/export":1,"./jquery/find_replace":4,"./jquery/query":5,"./servmask/deprecated":6,"./servmask/feedback":8,"./servmask/report":9,"./servmask/util":10}],4:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],5:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),o=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";o.text(t)}),this}}(jQuery)},{}],6:[function(e){var t=(e("./util"),e("./dialog")),a={s3:"Amazon S3 Extension",url:"URL Extension",ftp:"FTP Extension",gdrive:"Google Drive Extension",dropbox:"Dropbox Extension"};window.Ai1wmExportController=function(e){this._export={},this._provider=e},window.Ai1wmExportController.prototype.start=function(){new t("<strong>All in One WP Migration</strong> is not compatible with current version of <strong>"+a[this._provider]+'</strong>. Please contact <a href="mailto:support@servmask.com">support@servmask.com</a> for more details.')},window.Ai1wmImportController=function(e){this._import={},this._provider=e},window.Ai1wmImportController.prototype.init=function(){},window.Ai1wmImportController.prototype.download=function(){new t("<strong>All in One WP Migration</strong> is not compatible with current version of <strong>"+a[this._provider]+'</strong>. Please contact <a href="mailto:support@servmask.com">support@servmask.com</a> for more details.')}},{"./dialog":7,"./util":10}],7:[function(e,t){var a=jQuery,i=function(e){var t=this;this.overlay=a('<div class="ai1wm-overlay"></div>'),this.container=a("<div></div>"),this.modal=a('<div class="ai1wm-modal-container"></div>'),this.section=a("<section></section>"),this.message=a("<p></p>").addClass("ai1wm-dialog-message").html(e),this.action=a("<div></div>"),this.closeButton=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){t.modal.hide(),t.overlay.hide()}),this.action.append(this.closeButton),this.section.append(this.message),this.container.append(this.section).append(this.action),this.modal.html(this.container).show(),this.overlay.show(),a("body").append(this.overlay).append(this.modal)};t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),i=e(".ai1wm-feedback-message").val(),o=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:ai1wm_feedback.ajax.url,data:{"ai1wm-type":t,"ai1wm-email":a,"ai1wm-message":i,"ai1wm-terms":+o},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),i=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:ai1wm_report.ajax.url,data:{"ai1wm-email":t,"ai1wm-message":a,"ai1wm-terms":+i},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}],10:[function(e,t){var a=jQuery;t.exports={random:function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},form:function(e){return a(e).serializeArray()},ucfirst:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},list:function(e){if(a.isPlainObject(e)){var t=[],i=decodeURIComponent(a.param(e)).split("&");return a.each(i,function(e,a){var i=a.split("=");t.push({name:i[0],value:i[1]})}),t}return e}}},{}]},{},[3]);
1
+ !function e(t,a,i){function o(r,s){if(!a[r]){if(!t[r]){var c="function"==typeof require&&require;if(!s&&c)return c(r,!0);if(n)return n(r,!0);throw new Error("Cannot find module '"+r+"'")}var p=a[r]={exports:{}};t[r][0].call(p.exports,function(e){var a=t[r][1][e];return o(a?a:e)},p,p.exports,e,t,a,i)}return a[r].exports}for(var n="function"==typeof require&&require,r=0;r<i.length;r++)o(i[r]);return o}({1:[function(e,t){var a=e("../servmask/util"),i=e("./modal"),o=jQuery,n=function(){var e=this;this.params=[],this.modal=new i,this.modal.onStop=function(t){e.onStop(t)}};n.prototype.setParams=function(e){this.params=a.list(e)},n.prototype.start=function(e){var t=this;o(window).bind("beforeunload",function(){return"You are about to stop exporting your website, are you sure?"}),this.stop=!1,this.setStatus({type:"info",message:"Preparing to export..."});var i=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key});e&&(i=i.concat(a.list(e))),o.post(ai1wm_export.ajax.url,i).done(function(){t.getStatus(ai1wm_export.status.php)}).fail(function(){t.setStatus({type:"error",message:"Unable to start the export. Refresh the page and try again"})})},n.prototype.clean=function(e){var t=this;this.stop=!0;var i=this.params.concat({name:"secret_key",value:ai1wm_export.secret_key}).concat({name:"priority",value:300});e&&(i=i.concat(a.list(e))),o.post(ai1wm_export.ajax.url,i).done(function(){o(window).unbind("beforeunload")}).fail(function(){t.setStatus({type:"error",message:"Unable to clean the export. Refresh the page and try again"})})},n.prototype.getStatus=function(e,t){var a=this,t=t||0;this.stop||o.ajax({cache:!1,url:e,dataType:"json"}).done(function(i){if(i)switch(a.setStatus(i),i.type){case"done":case"error":case"download":return o(window).unbind("beforeunload"),void 0}setTimeout(function(){a.getStatus(e,t)},3e3)}).fail(function(){t++,t>=6?a.setStatus({type:"error",message:"Unable to retrieve status of the export. Is your server running?"}):t>=3?a.getStatus(ai1wm_export.status.js,t):a.getStatus(ai1wm_export.status.php,t)})},n.prototype.setStatus=function(e){this.modal.render(e)},n.prototype.onStop=function(e){this.clean(e)},t.exports=n},{"../servmask/util":10,"./modal":2}],2:[function(e,t){var a=jQuery,i=function(){var e=this;this.error=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a("<span></span>").addClass("ai1wm-title-red").text("Unable to export"),p=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.info=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a('<span class="ai1wm-loader"></span>'),p=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').on("click",function(){a(this).attr("disabled","disabled"),e.onStop(),e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.done=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=a("<h1></h1>"),r=a("<p></p>").html(t.message),s=a("<div></div>"),c=a("<span></span>").addClass("ai1wm-title-green").text(t.title),p=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});s.append(p),n.append(c),o.append(n).append(r),i.append(o).append(s),e.modal.html(i).show(),e.overlay.show()},this.download=function(t){var i=a("<div></div>"),o=a("<section></section>"),n=(a("<h1></h1>"),a("<p></p>").html(t.message)),r=a("<div></div>"),s=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){e.modal.hide(),e.overlay.hide()});r.append(s),o.append(n),i.append(o).append(r),e.modal.html(i).show(),e.overlay.show()},this.overlay=a('<div class="ai1wm-overlay"></div>'),this.modal=a('<div class="ai1wm-modal-container"></div>'),a("body").append(this.overlay).append(this.modal)};i.prototype.render=function(e){switch(e.type){case"error":this.error(e);break;case"info":this.info(e);break;case"done":this.done(e);break;case"download":this.download(e)}},t.exports=i},{}],3:[function(e){(function(t){var a=(e("./jquery/query"),e("./jquery/find_replace"),e("./servmask/report"),e("./servmask/feedback"),e("./servmask/util")),i=(e("./servmask/deprecated"),e("./export/export"));jQuery(document).ready(function(e){"use strict";var t=new i;e("#ai1wm-export-file").click(function(e){var i=a.random(12),o=a.form("#ai1wm-export-form").concat({name:"storage",value:i});t.setParams(o),t.start(),e.preventDefault()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()}),t.Ai1wm={Util:a,Export:i}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export/export":1,"./jquery/find_replace":4,"./jquery/query":5,"./servmask/deprecated":6,"./servmask/feedback":8,"./servmask/report":9,"./servmask/util":10}],4:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],5:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),o=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";o.text(t)}),this}}(jQuery)},{}],6:[function(e){var t=(e("./util"),e("./dialog")),a={s3:"Amazon S3 Extension",url:"URL Extension",ftp:"FTP Extension",gdrive:"Google Drive Extension",dropbox:"Dropbox Extension"};window.Ai1wmExportController=function(e){this._export={},this._provider=e},window.Ai1wmExportController.prototype.start=function(){new t("<strong>All in One WP Migration</strong> is not compatible with current version of <strong>"+a[this._provider]+'</strong>. Please contact <a href="mailto:support@servmask.com">support@servmask.com</a> for more details.')},window.Ai1wmImportController=function(e){this._import={},this._provider=e},window.Ai1wmImportController.prototype.init=function(){},window.Ai1wmImportController.prototype.download=function(){new t("<strong>All in One WP Migration</strong> is not compatible with current version of <strong>"+a[this._provider]+'</strong>. Please contact <a href="mailto:support@servmask.com">support@servmask.com</a> for more details.')}},{"./dialog":7,"./util":10}],7:[function(e,t){var a=jQuery,i=function(e){var t=this;this.overlay=a('<div class="ai1wm-overlay"></div>'),this.container=a("<div></div>"),this.modal=a('<div class="ai1wm-modal-container"></div>'),this.section=a("<section></section>"),this.message=a("<p></p>").addClass("ai1wm-dialog-message").html(e),this.action=a("<div></div>"),this.closeButton=a('<button class="ai1wm-button-red">Close</button>').on("click",function(){t.modal.hide(),t.overlay.hide()}),this.action.append(this.closeButton),this.section.append(this.message),this.container.append(this.section).append(this.action),this.modal.html(this.container).show(),this.overlay.show(),a("body").append(this.overlay).append(this.modal)};t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),i=e(".ai1wm-feedback-message").val(),o=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:ai1wm_feedback.ajax.url,data:{"ai1wm-type":t,"ai1wm-email":a,"ai1wm-message":i,"ai1wm-terms":+o},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),i=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:ai1wm_report.ajax.url,data:{"ai1wm-email":t,"ai1wm-message":a,"ai1wm-terms":+i},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}],10:[function(e,t){var a=jQuery;t.exports={random:function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},form:function(e){return a(e).serializeArray()},ucfirst:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},list:function(e){if(a.isPlainObject(e)){var t=[],i=decodeURIComponent(a.param(e)).split("&");return a.each(i,function(e,a){var i=a.split("=");t.push({name:i[0],value:i[1]})}),t}return e}}},{}]},{},[3]);
lib/view/export/index.php CHANGED
@@ -44,7 +44,7 @@
44
 
45
  <?php do_action( 'ai1wm_export_left_end' ); ?>
46
 
47
- <input type="hidden" name="ai1wm-manual-export" value="1" />
48
  </form>
49
  </div>
50
  </div>
44
 
45
  <?php do_action( 'ai1wm_export_left_end' ); ?>
46
 
47
+ <input type="hidden" name="ai1wm_manual_export" value="1" />
48
  </form>
49
  </div>
50
  </div>
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.5
6
- Stable tag: 5.41
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,11 @@ 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.41 =
79
  * Fix an issue when replacing serialized values on import
80
  * List files in chunks
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.5
6
+ Stable tag: 5.42
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.42 =
79
+ * Catch E_PARSE error on mu-plugins import
80
+ * Fix an issue with stop export that doesn't clean up the storage directory
81
+ * Initialize new cache instead of flushing the existing one on import/export
82
+
83
  = 5.41 =
84
  * Fix an issue when replacing serialized values on import
85
  * List files in chunks
uninstall.php CHANGED
@@ -35,14 +35,9 @@ if ( defined( 'WP_UNINSTALL_PLUGIN' ) ) {
35
  global $wpdb, $wp_filesystem;
36
 
37
  // Delete any options or other data stored in the database here
38
- delete_site_option( AI1WM_EXPORT_OPTIONS );
39
- delete_site_option( AI1WM_ERROR_HANDLER );
40
- delete_site_option( AI1WM_EXCEPTION_HANDLER );
41
- delete_site_option( AI1WM_MAINTENANCE_MODE );
42
- delete_site_option( AI1WM_URL_IP );
43
- delete_site_option( AI1WM_URL_TRANSPORT );
44
- delete_site_option( AI1WM_SECRET_KEY );
45
- delete_site_option( AI1WM_AUTH_USER );
46
- delete_site_option( AI1WM_AUTH_PASSWORD );
47
- delete_site_option( AI1WM_MESSAGES );
48
  }
35
  global $wpdb, $wp_filesystem;
36
 
37
  // Delete any options or other data stored in the database here
38
+ delete_option( AI1WM_URL_IP );
39
+ delete_option( AI1WM_URL_TRANSPORT );
40
+ delete_option( AI1WM_SECRET_KEY );
41
+ delete_option( AI1WM_AUTH_USER );
42
+ delete_option( AI1WM_AUTH_PASSWORD );
 
 
 
 
 
43
  }