All-in-One WP Migration - Version 7.16

Version Description

Added

  • Store upload_path in the backup
Download this release

Release Info

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

Code changes from version 7.15 to 7.16

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.15
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.16
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.15' );
39
 
40
  // ===============
41
  // = Plugin Name =
35
  // ==================
36
  // = Plugin Version =
37
  // ==================
38
+ define( 'AI1WM_VERSION', '7.16' );
39
 
40
  // ===============
41
  // = Plugin Name =
lib/controller/class-ai1wm-main-controller.php CHANGED
@@ -48,19 +48,13 @@ class Ai1wm_Main_Controller {
48
  * @return void
49
  */
50
  public function activation_hook() {
51
- if ( is_dir( AI1WM_BACKUPS_PATH ) ) {
52
- $this->create_backups_htaccess( AI1WM_BACKUPS_HTACCESS );
53
- $this->create_backups_webconfig( AI1WM_BACKUPS_WEBCONFIG );
54
- $this->create_backups_index_php( AI1WM_BACKUPS_INDEX_PHP );
55
- $this->create_backups_index_html( AI1WM_BACKUPS_INDEX_HTML );
56
- }
57
-
58
  if ( extension_loaded( 'litespeed' ) ) {
59
  $this->create_litespeed_htaccess( AI1WM_WORDPRESS_HTACCESS );
60
  }
61
 
62
- $this->setup_folders();
63
- $this->create_secret_key();
 
64
  }
65
 
66
  /**
@@ -84,11 +78,14 @@ class Ai1wm_Main_Controller {
84
  // Router
85
  add_action( 'admin_init', array( $this, 'router' ) );
86
 
87
- // Setup folders
88
- add_action( 'admin_init', array( $this, 'setup_folders' ) );
89
 
90
- // Create secret key
91
- add_action( 'admin_init', array( $this, 'create_secret_key' ) );
 
 
 
92
 
93
  // Check user role capability
94
  add_action( 'admin_init', array( $this, 'check_user_role_capability' ) );
@@ -211,9 +208,6 @@ class Ai1wm_Main_Controller {
211
  // Add automatic plugins update
212
  add_action( 'wp_maybe_auto_update', 'Ai1wm_Updater_Controller::check_for_updates' );
213
 
214
- // Add updater process complete
215
- add_action( 'upgrader_process_complete', 'Ai1wm_Updater_Controller::upgrader_process_complete', 10, 2 );
216
-
217
  // Add HTTP export headers
218
  add_filter( 'ai1wm_http_export_headers', 'Ai1wm_Export_Controller::http_export_headers' );
219
 
@@ -251,50 +245,27 @@ class Ai1wm_Main_Controller {
251
  }
252
 
253
  /**
254
- * Create folders and files needed for plugin operation, if they don't exist
255
  *
256
  * @return void
257
  */
258
- public function setup_folders() {
259
- // Check if storage folder is created
260
- if ( ! is_dir( AI1WM_STORAGE_PATH ) ) {
261
- $this->create_storage_folder( AI1WM_STORAGE_PATH );
262
- }
263
-
264
- // Check if backups folder is created
265
- if ( ! is_dir( AI1WM_BACKUPS_PATH ) ) {
266
- $this->create_backups_folder( AI1WM_BACKUPS_PATH );
267
- }
268
-
269
- // Check if index.php is created in storage folder
270
- if ( ! is_file( AI1WM_STORAGE_INDEX_PHP ) ) {
271
- $this->create_storage_index_php( AI1WM_STORAGE_INDEX_PHP );
272
- }
273
-
274
- // Check if index.html is created in storage folder
275
- if ( ! is_file( AI1WM_STORAGE_INDEX_HTML ) ) {
276
- $this->create_storage_index_html( AI1WM_STORAGE_INDEX_HTML );
277
- }
278
-
279
- // Check if index.php is created in backups folder
280
- if ( ! is_file( AI1WM_BACKUPS_INDEX_PHP ) ) {
281
- $this->create_backups_index_php( AI1WM_BACKUPS_INDEX_PHP );
282
- }
283
-
284
- // Check if index.html is created in backups folder
285
- if ( ! is_file( AI1WM_BACKUPS_INDEX_HTML ) ) {
286
- $this->create_backups_index_html( AI1WM_BACKUPS_INDEX_HTML );
287
- }
288
-
289
- // Check if .htaccess is created in backups folder
290
- if ( ! is_file( AI1WM_BACKUPS_HTACCESS ) ) {
291
- $this->create_backups_htaccess( AI1WM_BACKUPS_HTACCESS );
292
- }
293
 
294
- // Check if web.config is created in backups folder
295
- if ( ! is_file( AI1WM_BACKUPS_WEBCONFIG ) ) {
296
- $this->create_backups_webconfig( AI1WM_BACKUPS_WEBCONFIG );
297
- }
 
 
 
 
 
298
  }
299
 
300
  /**
@@ -302,7 +273,7 @@ class Ai1wm_Main_Controller {
302
  *
303
  * @return void
304
  */
305
- public function create_secret_key() {
306
  if ( ! get_option( AI1WM_SECRET_KEY ) ) {
307
  update_option( AI1WM_SECRET_KEY, ai1wm_generate_random_string( 12 ) );
308
  }
@@ -331,15 +302,11 @@ class Ai1wm_Main_Controller {
331
  * @return void
332
  */
333
  public function schedule_crons() {
334
- // Delete old cleanup cronjob
335
- if ( Ai1wm_Cron::exists( 'ai1wm_cleanup_cron' ) ) {
336
- Ai1wm_Cron::clear( 'ai1wm_cleanup_cron' );
337
- }
338
-
339
- // Schedule a new daily cleanup
340
  if ( ! Ai1wm_Cron::exists( 'ai1wm_storage_cleanup' ) ) {
341
  Ai1wm_Cron::add( 'ai1wm_storage_cleanup', 'daily', time() );
342
  }
 
 
343
  }
344
 
345
  /**
48
  * @return void
49
  */
50
  public function activation_hook() {
 
 
 
 
 
 
 
51
  if ( extension_loaded( 'litespeed' ) ) {
52
  $this->create_litespeed_htaccess( AI1WM_WORDPRESS_HTACCESS );
53
  }
54
 
55
+ $this->setup_backups_folder();
56
+ $this->setup_storage_folder();
57
+ $this->setup_secret_key();
58
  }
59
 
60
  /**
78
  // Router
79
  add_action( 'admin_init', array( $this, 'router' ) );
80
 
81
+ // Setup backups folder
82
+ add_action( 'admin_init', array( $this, 'setup_backups_folder' ) );
83
 
84
+ // Setup storage folder
85
+ add_action( 'admin_init', array( $this, 'setup_storage_folder' ) );
86
+
87
+ // Setup secret key
88
+ add_action( 'admin_init', array( $this, 'setup_secret_key' ) );
89
 
90
  // Check user role capability
91
  add_action( 'admin_init', array( $this, 'check_user_role_capability' ) );
208
  // Add automatic plugins update
209
  add_action( 'wp_maybe_auto_update', 'Ai1wm_Updater_Controller::check_for_updates' );
210
 
 
 
 
211
  // Add HTTP export headers
212
  add_filter( 'ai1wm_http_export_headers', 'Ai1wm_Export_Controller::http_export_headers' );
213
 
245
  }
246
 
247
  /**
248
+ * Create backups folder with index.php, index.html, .htaccess and web.config files
249
  *
250
  * @return void
251
  */
252
+ public function setup_backups_folder() {
253
+ $this->create_backups_folder( AI1WM_BACKUPS_PATH );
254
+ $this->create_backups_htaccess( AI1WM_BACKUPS_HTACCESS );
255
+ $this->create_backups_webconfig( AI1WM_BACKUPS_WEBCONFIG );
256
+ $this->create_backups_index_php( AI1WM_BACKUPS_INDEX_PHP );
257
+ $this->create_backups_index_html( AI1WM_BACKUPS_INDEX_HTML );
258
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
+ /**
261
+ * Create storage folder with index.php and index.html files
262
+ *
263
+ * @return void
264
+ */
265
+ public function setup_storage_folder() {
266
+ $this->create_storage_folder( AI1WM_STORAGE_PATH );
267
+ $this->create_storage_index_php( AI1WM_STORAGE_INDEX_PHP );
268
+ $this->create_storage_index_html( AI1WM_STORAGE_INDEX_HTML );
269
  }
270
 
271
  /**
273
  *
274
  * @return void
275
  */
276
+ public function setup_secret_key() {
277
  if ( ! get_option( AI1WM_SECRET_KEY ) ) {
278
  update_option( AI1WM_SECRET_KEY, ai1wm_generate_random_string( 12 ) );
279
  }
302
  * @return void
303
  */
304
  public function schedule_crons() {
 
 
 
 
 
 
305
  if ( ! Ai1wm_Cron::exists( 'ai1wm_storage_cleanup' ) ) {
306
  Ai1wm_Cron::add( 'ai1wm_storage_cleanup', 'daily', time() );
307
  }
308
+
309
+ Ai1wm_Cron::clear( 'ai1wm_cleanup_cron' );
310
  }
311
 
312
  /**
lib/controller/class-ai1wm-updater-controller.php CHANGED
@@ -85,40 +85,4 @@ class Ai1wm_Updater_Controller {
85
  }
86
  }
87
  }
88
-
89
- public static function upgrader_process_complete( $upgrader_object, $options ) {
90
- if ( ! isset( $options['action'], $options['type'], $options['plugins'] ) ) {
91
- return;
92
- }
93
-
94
- if ( $options['action'] !== 'update' ) {
95
- return;
96
- }
97
-
98
- if ( $options['type'] !== 'plugin' ) {
99
- return;
100
- }
101
-
102
- // Check if base plugin is updated
103
- if ( ! in_array( AI1WM_PLUGIN_BASENAME, $options['plugins'] ) ) {
104
- return;
105
- }
106
-
107
- // Check if storage folder is created
108
- if ( ! is_dir( AI1WM_STORAGE_PATH ) ) {
109
- Ai1wm_Directory::create( AI1WM_STORAGE_PATH );
110
- }
111
-
112
- // Check if backups folder is created
113
- if ( ! is_dir( AI1WM_BACKUPS_PATH ) ) {
114
- Ai1wm_Directory::create( AI1WM_BACKUPS_PATH );
115
- }
116
-
117
- Ai1wm_File_Index::create( AI1WM_STORAGE_INDEX_PHP );
118
- Ai1wm_File_Index::create( AI1WM_STORAGE_INDEX_HTML );
119
- Ai1wm_File_Index::create( AI1WM_BACKUPS_INDEX_PHP );
120
- Ai1wm_File_Index::create( AI1WM_BACKUPS_INDEX_HTML );
121
- Ai1wm_File_Htaccess::create( AI1WM_BACKUPS_HTACCESS );
122
- Ai1wm_File_Webconfig::create( AI1WM_BACKUPS_WEBCONFIG );
123
- }
124
  }
85
  }
86
  }
87
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
lib/model/export/class-ai1wm-export-config.php CHANGED
@@ -149,6 +149,9 @@ class Ai1wm_Export_Config {
149
  // Set active stylesheet
150
  $config['Stylesheet'] = ai1wm_active_stylesheet();
151
 
 
 
 
152
  // Save package.json file
153
  $handle = ai1wm_open( ai1wm_package_path( $params ), 'w' );
154
  ai1wm_write( $handle, json_encode( $config ) );
149
  // Set active stylesheet
150
  $config['Stylesheet'] = ai1wm_active_stylesheet();
151
 
152
+ // Set upload path
153
+ $config['Uploads'] = get_option( 'upload_path' );
154
+
155
  // Save package.json file
156
  $handle = ai1wm_open( ai1wm_package_path( $params ), 'w' );
157
  ai1wm_write( $handle, json_encode( $config ) );
lib/vendor/servmask/filesystem/class-ai1wm-directory.php CHANGED
@@ -36,6 +36,10 @@ class Ai1wm_Directory {
36
  * @return boolean
37
  */
38
  public static function create( $path ) {
 
 
 
 
39
  return @mkdir( $path, 0777, true );
40
  }
41
 
36
  * @return boolean
37
  */
38
  public static function create( $path ) {
39
+ if ( @is_dir( $path ) ) {
40
+ return true;
41
+ }
42
+
43
  return @mkdir( $path, 0777, true );
44
  }
45
 
lib/vendor/servmask/filesystem/class-ai1wm-file.php CHANGED
@@ -49,6 +49,13 @@ class Ai1wm_File {
49
  return false;
50
  }
51
 
 
 
 
 
 
 
 
52
  $is_written = false;
53
  if ( ( $handle = @fopen( $path, 'w' ) ) !== false ) {
54
  if ( @fwrite( $handle, $content ) !== false ) {
@@ -80,6 +87,10 @@ class Ai1wm_File {
80
  * @return boolean
81
  */
82
  public static function delete( $path ) {
 
 
 
 
83
  return @unlink( $path );
84
  }
85
  }
49
  return false;
50
  }
51
 
52
+ // No changes were added
53
+ if ( function_exists( 'md5_file' ) ) {
54
+ if ( @md5_file( $path ) === md5( $content ) ) {
55
+ return true;
56
+ }
57
+ }
58
+
59
  $is_written = false;
60
  if ( ( $handle = @fopen( $path, 'w' ) ) !== false ) {
61
  if ( @fwrite( $handle, $content ) !== false ) {
87
  * @return boolean
88
  */
89
  public static function delete( $path ) {
90
+ if ( ! @file_exists( $path ) ) {
91
+ return false;
92
+ }
93
+
94
  return @unlink( $path );
95
  }
96
  }
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.3
6
  Requires PHP: 5.2.17
7
- Stable tag: 7.15
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,11 @@ 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.15 =
112
  **Added**
113
 
4
  Requires at least: 3.3
5
  Tested up to: 5.3
6
  Requires PHP: 5.2.17
7
+ Stable tag: 7.16
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.16 =
112
+ **Added**
113
+
114
+ * Store upload_path in the backup
115
+
116
  = 7.15 =
117
  **Added**
118