All-in-One WP Migration - Version 4.19

Version Description

  • Fixed an issue with options cache
Download this release

Release Info

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

Code changes from version 4.18 to 4.19

Files changed (48) hide show
  1. all-in-one-wp-migration.php +1 -1
  2. constants.php +128 -2
  3. functions.php +5 -0
  4. lib/controller/class-ai1wm-backup-controller.php +1 -1
  5. lib/controller/class-ai1wm-export-controller.php +1 -1
  6. lib/controller/class-ai1wm-feedback-controller.php +1 -1
  7. lib/controller/class-ai1wm-import-controller.php +1 -0
  8. lib/controller/class-ai1wm-main-controller.php +113 -212
  9. lib/controller/class-ai1wm-message-controller.php +1 -1
  10. lib/controller/class-ai1wm-report-controller.php +1 -1
  11. lib/controller/class-ai1wm-updater-controller.php +75 -0
  12. lib/model/class-ai1wm-backup.php +1 -1
  13. lib/model/class-ai1wm-export-abstract.php +2 -1
  14. lib/model/class-ai1wm-export-file.php +1 -1
  15. lib/model/class-ai1wm-feedback.php +1 -1
  16. lib/model/class-ai1wm-http.php +5 -2
  17. lib/model/class-ai1wm-import-abstract.php +1 -1
  18. lib/model/class-ai1wm-import-file.php +1 -1
  19. lib/model/class-ai1wm-logger.php +1 -1
  20. lib/model/class-ai1wm-maintenance.php +1 -1
  21. lib/model/class-ai1wm-message.php +1 -1
  22. lib/model/class-ai1wm-report.php +1 -1
  23. lib/model/class-ai1wm-status.php +1 -1
  24. lib/model/class-ai1wm-storage.php +1 -1
  25. lib/model/class-ai1wm-template.php +1 -1
  26. lib/model/class-ai1wm-updater.php +277 -0
  27. lib/model/service/class-ai1wm-service-database.php +6 -10
  28. lib/model/service/class-ai1wm-service-interface.php +0 -1
  29. lib/model/service/class-ai1wm-service-package.php +0 -1
  30. lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpInterface.php +10 -5
  31. lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpPDO.php +91 -62
  32. lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpSQL.php +91 -63
  33. lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpUtility.php +4 -4
  34. lib/vendor/servmask/archiver/class-ai1wm-archiver.php +2 -2
  35. lib/vendor/servmask/archiver/class-ai1wm-compressor.php +4 -4
  36. lib/vendor/servmask/archiver/class-ai1wm-extractor.php +1 -0
  37. lib/view/assets/css/updater.min.css +1 -0
  38. lib/view/assets/javascript/updater.min.js +1 -0
  39. lib/view/main/admin-head.php +94 -0
  40. lib/view/main/backups-notice.php +15 -0
  41. lib/view/main/get-support.php +1 -0
  42. lib/view/main/index-notice.php +15 -0
  43. lib/view/main/multisite-notice.php +15 -0
  44. lib/view/main/storage-notice.php +15 -0
  45. lib/view/updater/check.php +1 -0
  46. lib/view/updater/modal.php +27 -0
  47. loader.php +8 -0
  48. readme.txt +4 -1
all-in-one-wp-migration.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
- * Version: 4.18
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: 4.19
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
constants.php CHANGED
@@ -24,7 +24,7 @@
24
  */
25
 
26
  $local = array(
27
- 'ИЛИЕВ™',
28
  'dev.servmask.com',
29
  'Borislav-MacBook-Pro.local',
30
  );
@@ -38,7 +38,7 @@ if ( function_exists( 'gethostname' ) && in_array( gethostname(), $local ) ) {
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
- define( 'AI1WM_VERSION', '4.18' );
42
 
43
  // ===============
44
  // = Plugin Name =
@@ -200,6 +200,11 @@ define( 'AI1WM_ACTIVE_PLUGINS', 'active_plugins' );
200
  // ================
201
  define( 'AI1WM_MESSAGES', 'ai1wm_messages' );
202
 
 
 
 
 
 
203
  // =================
204
  // = Support Email =
205
  // =================
@@ -260,6 +265,20 @@ if ( defined( 'AI1WMDE_PLUGIN_BASENAME' ) ) {
260
  define( 'AI1WMDE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-dropbox-extension' );
261
  }
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  // ===================================
264
  // = Google Drive Extension Base Dir =
265
  // ===================================
@@ -269,6 +288,20 @@ if ( defined( 'AI1WMGE_PLUGIN_BASENAME' ) ) {
269
  define( 'AI1WMGE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-gdrive-extension' );
270
  }
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  // ================================
273
  // = Amazon S3 Extension Base Dir =
274
  // ================================
@@ -278,6 +311,20 @@ if ( defined( 'AI1WMSE_PLUGIN_BASENAME' ) ) {
278
  define( 'AI1WMSE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-s3-extension' );
279
  }
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  // ================================
282
  // = Multisite Extension Base Dir =
283
  // ================================
@@ -287,6 +334,20 @@ if ( defined( 'AI1WMME_PLUGIN_BASENAME' ) ) {
287
  define( 'AI1WMME_PLUGIN_BASEDIR', 'all-in-one-wp-migration-multisite-extension' );
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  // ================================
291
  // = Unlimited Extension Base Dir =
292
  // ================================
@@ -296,6 +357,20 @@ if ( defined( 'AI1WMUE_PLUGIN_BASENAME' ) ) {
296
  define( 'AI1WMUE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-unlimited-extension' );
297
  }
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  // ==========================
300
  // = FTP Extension Base Dir =
301
  // ==========================
@@ -305,6 +380,20 @@ if ( defined( 'AI1WMFE_PLUGIN_BASENAME' ) ) {
305
  define( 'AI1WMFE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-ftp-extension' );
306
  }
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  // ==========================
309
  // = URL Extension Base Dir =
310
  // ==========================
@@ -313,3 +402,40 @@ if ( defined( 'AI1WMLE_PLUGIN_BASENAME' ) ) {
313
  } else {
314
  define( 'AI1WMLE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-url-extension' );
315
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  */
25
 
26
  $local = array(
27
+ 'iliev.local',
28
  'dev.servmask.com',
29
  'Borislav-MacBook-Pro.local',
30
  );
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
+ define( 'AI1WM_VERSION', '4.19' );
42
 
43
  // ===============
44
  // = Plugin Name =
200
  // ================
201
  define( 'AI1WM_MESSAGES', 'ai1wm_messages' );
202
 
203
+ // ===============
204
+ // = Updater Key =
205
+ // ===============
206
+ define( 'AI1WM_UPDATER', 'ai1wm_updater' );
207
+
208
  // =================
209
  // = Support Email =
210
  // =================
265
  define( 'AI1WMDE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-dropbox-extension' );
266
  }
267
 
268
+ // ===========================
269
+ // = Dropbox Extension About =
270
+ // ===========================
271
+ if ( ! defined( 'AI1WMDE_PLUGIN_ABOUT' ) ) {
272
+ define( 'AI1WMDE_PLUGIN_ABOUT', 'https://servmask.com/products/dropbox-extension/about' );
273
+ }
274
+
275
+ // =========================
276
+ // = Dropbox Extension Key =
277
+ // =========================
278
+ if ( ! defined( 'AI1WMDE_PLUGIN_KEY' ) ) {
279
+ define( 'AI1WMDE_PLUGIN_KEY', 'ai1wmde_plugin_key' );
280
+ }
281
+
282
  // ===================================
283
  // = Google Drive Extension Base Dir =
284
  // ===================================
288
  define( 'AI1WMGE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-gdrive-extension' );
289
  }
290
 
291
+ // ================================
292
+ // = Google Drive Extension About =
293
+ // ================================
294
+ if ( ! defined( 'AI1WMGE_PLUGIN_ABOUT' ) ) {
295
+ define( 'AI1WMGE_PLUGIN_ABOUT', 'https://servmask.com/products/google-drive-extension/about' );
296
+ }
297
+
298
+ // ==============================
299
+ // = Google Drive Extension Key =
300
+ // ==============================
301
+ if ( ! defined( 'AI1WMGE_PLUGIN_KEY' ) ) {
302
+ define( 'AI1WMGE_PLUGIN_KEY', 'ai1wmge_plugin_key' );
303
+ }
304
+
305
  // ================================
306
  // = Amazon S3 Extension Base Dir =
307
  // ================================
311
  define( 'AI1WMSE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-s3-extension' );
312
  }
313
 
314
+ // =============================
315
+ // = Amazon S3 Extension About =
316
+ // =============================
317
+ if ( ! defined( 'AI1WMSE_PLUGIN_ABOUT' ) ) {
318
+ define( 'AI1WMSE_PLUGIN_ABOUT', 'https://servmask.com/products/amazon-s3-extension/about' );
319
+ }
320
+
321
+ // ===========================
322
+ // = Amazon S3 Extension Key =
323
+ // ===========================
324
+ if ( ! defined( 'AI1WMSE_PLUGIN_KEY' ) ) {
325
+ define( 'AI1WMSE_PLUGIN_KEY', 'ai1wmse_plugin_key' );
326
+ }
327
+
328
  // ================================
329
  // = Multisite Extension Base Dir =
330
  // ================================
334
  define( 'AI1WMME_PLUGIN_BASEDIR', 'all-in-one-wp-migration-multisite-extension' );
335
  }
336
 
337
+ // =============================
338
+ // = Multisite Extension About =
339
+ // =============================
340
+ if ( ! defined( 'AI1WMME_PLUGIN_ABOUT' ) ) {
341
+ define( 'AI1WMME_PLUGIN_ABOUT', 'https://servmask.com/products/multisite-extension/about' );
342
+ }
343
+
344
+ // ===========================
345
+ // = Multisite Extension Key =
346
+ // ===========================
347
+ if ( ! defined( 'AI1WMME_PLUGIN_KEY' ) ) {
348
+ define( 'AI1WMME_PLUGIN_KEY', 'ai1wmme_plugin_key' );
349
+ }
350
+
351
  // ================================
352
  // = Unlimited Extension Base Dir =
353
  // ================================
357
  define( 'AI1WMUE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-unlimited-extension' );
358
  }
359
 
360
+ // =============================
361
+ // = Unlimited Extension About =
362
+ // =============================
363
+ if ( ! defined( 'AI1WMUE_PLUGIN_ABOUT' ) ) {
364
+ define( 'AI1WMUE_PLUGIN_ABOUT', 'https://servmask.com/products/unlimited-extension/about' );
365
+ }
366
+
367
+ // ===========================
368
+ // = Unlimited Extension Key =
369
+ // ===========================
370
+ if ( ! defined( 'AI1WMUE_PLUGIN_KEY' ) ) {
371
+ define( 'AI1WMUE_PLUGIN_KEY', 'ai1wmue_plugin_key' );
372
+ }
373
+
374
  // ==========================
375
  // = FTP Extension Base Dir =
376
  // ==========================
380
  define( 'AI1WMFE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-ftp-extension' );
381
  }
382
 
383
+ // =======================
384
+ // = FTP Extension About =
385
+ // =======================
386
+ if ( ! defined( 'AI1WMFE_PLUGIN_ABOUT' ) ) {
387
+ define( 'AI1WMFE_PLUGIN_ABOUT', 'https://servmask.com/products/ftp-extension/about' );
388
+ }
389
+
390
+ // =====================
391
+ // = FTP Extension Key =
392
+ // =====================
393
+ if ( ! defined( 'AI1WMFE_PLUGIN_KEY' ) ) {
394
+ define( 'AI1WMFE_PLUGIN_KEY', 'ai1wmfe_plugin_key' );
395
+ }
396
+
397
  // ==========================
398
  // = URL Extension Base Dir =
399
  // ==========================
402
  } else {
403
  define( 'AI1WMLE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-url-extension' );
404
  }
405
+
406
+ // =======================
407
+ // = URL Extension About =
408
+ // =======================
409
+ if ( ! defined( 'AI1WMLE_PLUGIN_ABOUT' ) ) {
410
+ define( 'AI1WMLE_PLUGIN_ABOUT', 'https://servmask.com/products/url-extension/about' );
411
+ }
412
+
413
+ // =====================
414
+ // = URL Extension Key =
415
+ // =====================
416
+ if ( ! defined( 'AI1WMLE_PLUGIN_KEY' ) ) {
417
+ define( 'AI1WMLE_PLUGIN_KEY', 'ai1wmle_plugin_key' );
418
+ }
419
+
420
+ // ===============================
421
+ // = OneDrive Extension Base Dir =
422
+ // ===============================
423
+ if ( defined( 'AI1WMOE_PLUGIN_BASENAME' ) ) {
424
+ define( 'AI1WMOE_PLUGIN_BASEDIR', dirname( AI1WMOE_PLUGIN_BASENAME ) );
425
+ } else {
426
+ define( 'AI1WMOE_PLUGIN_BASEDIR', 'all-in-one-wp-migration-onedrive-extension' );
427
+ }
428
+
429
+ // ============================
430
+ // = OneDrive Extension About =
431
+ // ============================
432
+ if ( ! defined( 'AI1WMOE_PLUGIN_ABOUT' ) ) {
433
+ define( 'AI1WMOE_PLUGIN_ABOUT', 'https://servmask.com/products/onedrive-extension/about' );
434
+ }
435
+
436
+ // ==========================
437
+ // = OneDrive Extension Key =
438
+ // ==========================
439
+ if ( ! defined( 'AI1WMOE_PLUGIN_KEY' ) ) {
440
+ define( 'AI1WMOE_PLUGIN_KEY', 'ai1wmoe_plugin_key' );
441
+ }
functions.php CHANGED
@@ -90,5 +90,10 @@ function ai1wm_active_plugins( $plugins = array() ) {
90
  $plugins[] = AI1WMLE_PLUGIN_BASENAME;
91
  }
92
 
 
 
 
 
 
93
  return $plugins;
94
  }
90
  $plugins[] = AI1WMLE_PLUGIN_BASENAME;
91
  }
92
 
93
+ // OneDrive Extension
94
+ if ( defined( 'AI1WMOE_PLUGIN_BASENAME' ) ) {
95
+ $plugins[] = AI1WMOE_PLUGIN_BASENAME;
96
+ }
97
+
98
  return $plugins;
99
  }
lib/controller/class-ai1wm-backup-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Backup_Controller {
27
 
28
  public static function index() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Backup_Controller {
27
 
28
  public static function index() {
lib/controller/class-ai1wm-export-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Export_Controller {
27
 
28
  public static function index() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Export_Controller {
27
 
28
  public static function index() {
lib/controller/class-ai1wm-feedback-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Feedback_Controller {
27
 
28
  public static function leave_feedback() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Feedback_Controller {
27
 
28
  public static function leave_feedback() {
lib/controller/class-ai1wm-import-controller.php CHANGED
@@ -22,6 +22,7 @@
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
 
25
  class Ai1wm_Import_Controller {
26
 
27
  public static function index() {
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Import_Controller {
27
 
28
  public static function index() {
lib/controller/class-ai1wm-main-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Main_Controller {
27
 
28
  /**
@@ -45,8 +45,7 @@ class Ai1wm_Main_Controller {
45
  * @return Object Instance of this class
46
  */
47
  public function activation_hook() {
48
- // Generate secret key
49
- $this->generate_secret_key();
50
  }
51
 
52
  /**
@@ -55,22 +54,11 @@ class Ai1wm_Main_Controller {
55
  * @return Object Instance of this class
56
  */
57
  private function activate_textdomain() {
58
- load_plugin_textdomain( AI1WM_PLUGIN_NAME, false, dirname( plugin_basename( __FILE__ ) ) );
59
 
60
  return $this;
61
  }
62
 
63
- /**
64
- * Generate plugin secret key
65
- *
66
- * @return boolean
67
- */
68
- public function generate_secret_key() {
69
- if ( false === get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
70
- return update_site_option( AI1WM_SECRET_KEY, wp_generate_password( 12, false ) );
71
- }
72
- }
73
-
74
  /**
75
  * Register listeners for actions
76
  *
@@ -87,12 +75,17 @@ class Ai1wm_Main_Controller {
87
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
88
  }
89
 
 
90
  add_action( 'admin_init', array( $this, 'router' ) );
91
  add_action( 'admin_init', array( $this, 'create_folders' ) );
92
- add_action( 'admin_init', array( $this, 'http_authentication' ) );
93
  add_action( 'admin_head', array( $this, 'admin_head' ) );
94
  add_action( 'get_header', array( $this, 'get_header' ) );
95
- add_action( 'init', array( $this, 'generate_secret_key' ) );
 
 
 
 
 
96
 
97
  return $this;
98
  }
@@ -115,6 +108,18 @@ class Ai1wm_Main_Controller {
115
  // Add chunk size limit
116
  add_filter( 'ai1wm_max_chunk_size', 'Ai1wm_Import_Controller::max_chunk_size' );
117
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  return $this;
119
  }
120
 
@@ -124,23 +129,7 @@ class Ai1wm_Main_Controller {
124
  * @return void
125
  */
126
  public function multisite_notice() {
127
- ?>
128
- <div class="error">
129
- <p>
130
- <?php
131
- _e(
132
- 'WordPress Multisite is supported via our All in One WP Migration Multisite Extension. ' .
133
- 'You can get a copy of it here',
134
- AI1WM_PLUGIN_NAME
135
- );
136
- ?>
137
- <a href="https://servmask.com/products/multisite-extension" target="_blank" class="ai1wm-label">
138
- <i class="ai1wm-icon-notification"></i>
139
- <?php _e( 'Get multisite', AI1WM_PLUGIN_NAME ); ?>
140
- </a>
141
- </p>
142
- </div>
143
- <?php
144
  }
145
 
146
  /**
@@ -149,23 +138,7 @@ class Ai1wm_Main_Controller {
149
  * @return void
150
  */
151
  public function storage_notice() {
152
- ?>
153
- <div class="error">
154
- <p>
155
- <?php
156
- printf(
157
- __(
158
- 'All in One WP Migration is not able to create <strong>%s</strong> folder. ' .
159
- 'You will need to create this folder and grant it read/write/execute permissions (0777) ' .
160
- 'for the All in One WP Migration plugin to function properly.',
161
- AI1WM_PLUGIN_NAME
162
- ),
163
- AI1WM_STORAGE_PATH
164
- )
165
- ?>
166
- </p>
167
- </div>
168
- <?php
169
  }
170
 
171
  /**
@@ -174,23 +147,7 @@ class Ai1wm_Main_Controller {
174
  * @return void
175
  */
176
  public function index_notice() {
177
- ?>
178
- <div class="error">
179
- <p>
180
- <?php
181
- printf(
182
- __(
183
- 'All in One WP Migration is not able to create <strong>%s</strong> file. ' .
184
- 'Try to change permissions of the parent folder or send us an email at ' .
185
- '<a href="mailto:support@servmask.com">support@servmask.com</a> for assistance.',
186
- AI1WM_PLUGIN_NAME
187
- ),
188
- AI1WM_DIRECTORY_INDEX
189
- )
190
- ?>
191
- </p>
192
- </div>
193
- <?php
194
  }
195
 
196
  /**
@@ -199,23 +156,7 @@ class Ai1wm_Main_Controller {
199
  * @return void
200
  */
201
  public function backups_notice() {
202
- ?>
203
- <div class="error">
204
- <p>
205
- <?php
206
- printf(
207
- __(
208
- 'All in One WP Migration is not able to create <strong>%s</strong> folder. ' .
209
- 'You will need to create this folder and grant it read/write/execute permissions (0777) ' .
210
- 'for the All in One WP Migration plugin to function properly.',
211
- AI1WM_PLUGIN_NAME
212
- ),
213
- AI1WM_BACKUPS_PATH
214
- )
215
- ?>
216
- </p>
217
- </div>
218
- <?php
219
  }
220
 
221
  /**
@@ -225,7 +166,7 @@ class Ai1wm_Main_Controller {
225
  */
226
  public function plugin_row_meta( $links, $file ) {
227
  if ( $file == AI1WM_PLUGIN_BASENAME ) {
228
- $links[] = __( '<a href="https://servmask.com/help" target="_blank">Get Support</a>', AI1WM_PLUGIN_NAME );
229
  }
230
 
231
  return $links;
@@ -240,6 +181,37 @@ class Ai1wm_Main_Controller {
240
  Ai1wm_Maintenance::display();
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  /**
244
  * Register initial router
245
  *
@@ -251,22 +223,30 @@ class Ai1wm_Main_Controller {
251
  add_action( 'wp_ajax_nopriv_ai1wm_import', 'Ai1wm_Import_Controller::import' );
252
  add_action( 'wp_ajax_nopriv_ai1wm_resolve', 'Ai1wm_Resolve_Controller::resolve' );
253
 
 
 
 
 
254
 
255
- // Private
256
- if ( ! current_user_can( 'export' ) || ! current_user_can( 'import' ) ) {
257
- return;
258
  }
259
 
260
- // Register ajax calls
261
- add_action( 'wp_ajax_ai1wm_export', 'Ai1wm_Export_Controller::export' );
262
- add_action( 'wp_ajax_ai1wm_import', 'Ai1wm_Import_Controller::import' );
263
- add_action( 'wp_ajax_ai1wm_leave_feedback', 'Ai1wm_Feedback_Controller::leave_feedback' );
264
- add_action( 'wp_ajax_ai1wm_report_problem', 'Ai1wm_Report_Controller::report_problem' );
265
- add_action( 'wp_ajax_ai1wm_close_message', 'Ai1wm_Message_Controller::close_message' );
266
- add_action( 'wp_ajax_ai1wm_backup_delete', 'Ai1wm_Backup_Controller::delete' );
267
- add_action( 'wp_ajax_ai1wm_disable_maintenance', 'Ai1wm_Maintenance::disable' );
268
- add_action( 'wp_ajax_ai1wm_resolve', 'Ai1wm_Resolve_Controller::resolve' );
269
 
 
 
 
 
 
 
 
 
 
270
  }
271
 
272
  /**
@@ -277,8 +257,10 @@ class Ai1wm_Main_Controller {
277
  public function create_folders() {
278
  // Check if storage folder exist
279
  if ( ! file_exists( AI1WM_STORAGE_PATH ) ) {
 
280
  // Folder doesn't exist, attempt to create it
281
  if ( ! mkdir( AI1WM_STORAGE_PATH ) ) {
 
282
  // We couldn't create the folder, so let's tell the user
283
  if ( is_multisite() ) {
284
  return add_action( 'network_admin_notices', array( $this, 'storage_notice' ) );
@@ -293,8 +275,10 @@ class Ai1wm_Main_Controller {
293
 
294
  // Check if backups folder exist
295
  if ( ! file_exists( AI1WM_BACKUPS_PATH ) ) {
 
296
  // Folder doesn't exist, attempt to create it
297
  if ( ! mkdir( AI1WM_BACKUPS_PATH ) ) {
 
298
  // We couldn't create the folder, so let's tell the user
299
  if ( is_multisite() ) {
300
  return add_action( 'network_admin_notices', array( $this, 'backups_notice' ) );
@@ -324,11 +308,13 @@ class Ai1wm_Main_Controller {
324
 
325
  // Check if the file exists
326
  if ( ! file_exists( $file ) ) {
 
327
  // File doesn't exist attempt to create ti
328
  $handle = fopen( $file, 'w' );
329
 
330
  // Check if we were able to open the file
331
  if ( false === $handle ) {
 
332
  // We couldn't create the folder, so let's tell the user
333
  if ( is_multisite() ) {
334
  return add_action( 'network_admin_notices', array( $this, 'index_notice' ) );
@@ -342,25 +328,6 @@ class Ai1wm_Main_Controller {
342
  }
343
  }
344
 
345
- /**
346
- * Store HTTP authentication credentials
347
- *
348
- * @return void
349
- */
350
- public function http_authentication() {
351
- // Set username
352
- if ( isset( $_SERVER['PHP_AUTH_USER'] ) ) {
353
- update_site_option( AI1WM_AUTH_USER, $_SERVER['PHP_AUTH_USER'] );
354
- } else if ( isset( $_SERVER['REMOTE_USER'] ) ) {
355
- update_site_option( AI1WM_AUTH_USER, $_SERVER['REMOTE_USER'] );
356
- }
357
-
358
- // Set password
359
- if ( isset( $_SERVER['PHP_AUTH_PW'] ) ) {
360
- update_site_option( AI1WM_AUTH_PASSWORD, $_SERVER['PHP_AUTH_PW'] );
361
- }
362
- }
363
-
364
  /**
365
  * Register plugin menus
366
  *
@@ -425,102 +392,8 @@ class Ai1wm_Main_Controller {
425
  */
426
  public function admin_head() {
427
  global $wp_version;
428
- ?>
429
- <style type="text/css" media="all">
430
- @font-face {
431
- font-family: 'servmask';
432
- src: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.eot?v=<?php echo AI1WM_VERSION; ?>');
433
- src: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.eot?v=<?php echo AI1WM_VERSION; ?>#iefix') format('embedded-opentype'),
434
- url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.woff?v=<?php echo AI1WM_VERSION; ?>') format('woff'),
435
- url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.ttf?v=<?php echo AI1WM_VERSION; ?>') format('truetype'),
436
- url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.svg?v=<?php echo AI1WM_VERSION; ?>#servmask') format('svg');
437
- font-weight: normal;
438
- font-style: normal;
439
- }
440
-
441
- [class^="ai1wm-icon-"], [class*=" ai1wm-icon-"] {
442
- font-family: 'servmask';
443
- speak: none;
444
- font-style: normal;
445
- font-weight: normal;
446
- font-variant: normal;
447
- text-transform: none;
448
- line-height: 1;
449
-
450
- /* Better Font Rendering =========== */
451
- -webkit-font-smoothing: antialiased;
452
- -moz-osx-font-smoothing: grayscale;
453
- }
454
-
455
- .ai1wm-icon-notification:before {
456
- content: "\e619";
457
- }
458
-
459
- .ai1wm-label {
460
- border: 1px solid #5cb85c;
461
- background-color: transparent;
462
- color: #5cb85c;
463
- cursor: pointer;
464
- text-transform: uppercase;
465
- font-weight: 600;
466
- outline: none;
467
- transition: background-color 0.2s ease-out;
468
- padding: .2em .6em;
469
- font-size: 0.8em;
470
- border-radius: 5px;
471
- text-decoration: none !important;
472
- }
473
-
474
- .ai1wm-label:hover {
475
- background-color: #5cb85c;
476
- color: #fff;
477
- }
478
-
479
- <?php if ( version_compare( $wp_version, '3.8', '<' ) ) : ?>
480
- .toplevel_page_site-migration-export > div.wp-menu-image {
481
- background: none !important;
482
- }
483
-
484
- .toplevel_page_site-migration-export > div.wp-menu-image:before {
485
- line-height: 27px !important;
486
- content: '';
487
- background: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/img/logo.svg') no-repeat center center;
488
- speak: none !important;
489
- font-style: normal !important;
490
- font-weight: normal !important;
491
- font-variant: normal !important;
492
- text-transform: none !important;
493
- margin-left: 7px;
494
- /* Better Font Rendering =========== */
495
- -webkit-font-smoothing: antialiased !important;
496
- -moz-osx-font-smoothing: grayscale !important;
497
- }
498
-
499
- <?php else : ?>
500
- .toplevel_page_site-migration-export > div.wp-menu-image:before {
501
- position: relative;
502
- display: inline-block;
503
- content: '';
504
- background: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/img/logo.svg') no-repeat center center;
505
- speak: none !important;
506
- font-style: normal !important;
507
- font-weight: normal !important;
508
- font-variant: normal !important;
509
- text-transform: none !important;
510
- line-height: 1 !important;
511
- /* Better Font Rendering =========== */
512
- -webkit-font-smoothing: antialiased !important;
513
- -moz-osx-font-smoothing: grayscale !important;
514
- }
515
 
516
- .wp-menu-open.toplevel_page_site-migration-export,
517
- .wp-menu-open.toplevel_page_site-migration-export > a {
518
- background-color: #111 !important;
519
- }
520
-
521
- <?php endif; ?>
522
- </style>
523
- <?php
524
  }
525
 
526
  /**
@@ -708,4 +581,32 @@ class Ai1wm_Main_Controller {
708
  ),
709
  ) );
710
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711
  }
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Main_Controller {
27
 
28
  /**
45
  * @return Object Instance of this class
46
  */
47
  public function activation_hook() {
48
+
 
49
  }
50
 
51
  /**
54
  * @return Object Instance of this class
55
  */
56
  private function activate_textdomain() {
57
+ load_plugin_textdomain( AI1WM_PLUGIN_NAME, false, false );
58
 
59
  return $this;
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
62
  /**
63
  * Register listeners for actions
64
  *
75
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
76
  }
77
 
78
+ add_action( 'admin_init', array( $this, 'init' ) );
79
  add_action( 'admin_init', array( $this, 'router' ) );
80
  add_action( 'admin_init', array( $this, 'create_folders' ) );
 
81
  add_action( 'admin_head', array( $this, 'admin_head' ) );
82
  add_action( 'get_header', array( $this, 'get_header' ) );
83
+
84
+ // Add automatic plugins updates
85
+ add_action( 'wp_maybe_auto_update', 'Ai1wm_Updater_Controller::check_for_updates' );
86
+
87
+ // Add updater scripts and styles
88
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_updater_scripts_and_styles' ) );
89
 
90
  return $this;
91
  }
108
  // Add chunk size limit
109
  add_filter( 'ai1wm_max_chunk_size', 'Ai1wm_Import_Controller::max_chunk_size' );
110
 
111
+ // Add plugins api
112
+ add_filter( 'plugins_api', 'Ai1wm_Updater_Controller::plugins_api', 20, 3 );
113
+
114
+ // Add plugins updates
115
+ add_filter( 'pre_set_site_transient_update_plugins', 'Ai1wm_Updater_Controller::pre_update_plugins' );
116
+
117
+ // Add plugins metadata
118
+ add_filter( 'site_transient_update_plugins', 'Ai1wm_Updater_Controller::update_plugins' );
119
+
120
+ // Add "Check for updates" link to plugin list page
121
+ add_filter( 'plugin_row_meta', 'Ai1wm_Updater_Controller::plugin_row_meta', 10, 2 );
122
+
123
  return $this;
124
  }
125
 
129
  * @return void
130
  */
131
  public function multisite_notice() {
132
+ Ai1wm_Template::render( 'main/multisite-notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
 
135
  /**
138
  * @return void
139
  */
140
  public function storage_notice() {
141
+ Ai1wm_Template::render( 'main/storage-notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
143
 
144
  /**
147
  * @return void
148
  */
149
  public function index_notice() {
150
+ Ai1wm_Template::render( 'main/index-notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
 
153
  /**
156
  * @return void
157
  */
158
  public function backups_notice() {
159
+ Ai1wm_Template::render( 'main/backups-notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
 
162
  /**
166
  */
167
  public function plugin_row_meta( $links, $file ) {
168
  if ( $file == AI1WM_PLUGIN_BASENAME ) {
169
+ $links[] = Ai1wm_Template::get_content( 'main/get-support' );
170
  }
171
 
172
  return $links;
181
  Ai1wm_Maintenance::display();
182
  }
183
 
184
+ /**
185
+ * Register initial parameters
186
+ *
187
+ * @return void
188
+ */
189
+ public function init() {
190
+ // Set secret key
191
+ if ( ! get_site_option( AI1WM_SECRET_KEY, false, false ) ) {
192
+ update_site_option( AI1WM_SECRET_KEY, wp_generate_password( 12, false ) );
193
+ }
194
+
195
+ // Set username
196
+ if ( isset( $_SERVER['PHP_AUTH_USER'] ) ) {
197
+ update_site_option( AI1WM_AUTH_USER, $_SERVER['PHP_AUTH_USER'] );
198
+ } else if ( isset( $_SERVER['REMOTE_USER'] ) ) {
199
+ update_site_option( AI1WM_AUTH_USER, $_SERVER['REMOTE_USER'] );
200
+ }
201
+
202
+ // Set password
203
+ if ( isset( $_SERVER['PHP_AUTH_PW'] ) ) {
204
+ update_site_option( AI1WM_AUTH_PASSWORD, $_SERVER['PHP_AUTH_PW'] );
205
+ }
206
+
207
+ // Check for updates
208
+ if ( isset( $_GET['ai1wm_updater'] ) ) {
209
+ if ( current_user_can( 'update_plugins' ) && check_admin_referer( 'ai1wm_updater_nonce' ) ) {
210
+ Ai1wm_Updater::check_for_updates();
211
+ }
212
+ }
213
+ }
214
+
215
  /**
216
  * Register initial router
217
  *
223
  add_action( 'wp_ajax_nopriv_ai1wm_import', 'Ai1wm_Import_Controller::import' );
224
  add_action( 'wp_ajax_nopriv_ai1wm_resolve', 'Ai1wm_Resolve_Controller::resolve' );
225
 
226
+ // Update
227
+ if ( current_user_can( 'update_plugins' ) ) {
228
+ add_action( 'wp_ajax_ai1wm_updater', 'Ai1wm_Updater_Controller::updater' );
229
+ }
230
 
231
+ // Export
232
+ if ( current_user_can( 'export' ) ) {
233
+ add_action( 'wp_ajax_ai1wm_export', 'Ai1wm_Export_Controller::export' );
234
  }
235
 
236
+ // Import
237
+ if ( current_user_can( 'import' ) ) {
238
+ add_action( 'wp_ajax_ai1wm_import', 'Ai1wm_Import_Controller::import' );
239
+ }
 
 
 
 
 
240
 
241
+ // Both
242
+ if ( current_user_can( 'export' ) || current_user_can( 'import' ) ) {
243
+ add_action( 'wp_ajax_ai1wm_backup_delete', 'Ai1wm_Backup_Controller::delete' );
244
+ add_action( 'wp_ajax_ai1wm_leave_feedback', 'Ai1wm_Feedback_Controller::leave_feedback' );
245
+ add_action( 'wp_ajax_ai1wm_report_problem', 'Ai1wm_Report_Controller::report_problem' );
246
+ add_action( 'wp_ajax_ai1wm_close_message', 'Ai1wm_Message_Controller::close_message' );
247
+ add_action( 'wp_ajax_ai1wm_disable_maintenance', 'Ai1wm_Maintenance::disable' );
248
+ add_action( 'wp_ajax_ai1wm_resolve', 'Ai1wm_Resolve_Controller::resolve' );
249
+ }
250
  }
251
 
252
  /**
257
  public function create_folders() {
258
  // Check if storage folder exist
259
  if ( ! file_exists( AI1WM_STORAGE_PATH ) ) {
260
+
261
  // Folder doesn't exist, attempt to create it
262
  if ( ! mkdir( AI1WM_STORAGE_PATH ) ) {
263
+
264
  // We couldn't create the folder, so let's tell the user
265
  if ( is_multisite() ) {
266
  return add_action( 'network_admin_notices', array( $this, 'storage_notice' ) );
275
 
276
  // Check if backups folder exist
277
  if ( ! file_exists( AI1WM_BACKUPS_PATH ) ) {
278
+
279
  // Folder doesn't exist, attempt to create it
280
  if ( ! mkdir( AI1WM_BACKUPS_PATH ) ) {
281
+
282
  // We couldn't create the folder, so let's tell the user
283
  if ( is_multisite() ) {
284
  return add_action( 'network_admin_notices', array( $this, 'backups_notice' ) );
308
 
309
  // Check if the file exists
310
  if ( ! file_exists( $file ) ) {
311
+
312
  // File doesn't exist attempt to create ti
313
  $handle = fopen( $file, 'w' );
314
 
315
  // Check if we were able to open the file
316
  if ( false === $handle ) {
317
+
318
  // We couldn't create the folder, so let's tell the user
319
  if ( is_multisite() ) {
320
  return add_action( 'network_admin_notices', array( $this, 'index_notice' ) );
328
  }
329
  }
330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  /**
332
  * Register plugin menus
333
  *
392
  */
393
  public function admin_head() {
394
  global $wp_version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
396
+ Ai1wm_Template::render( 'main/admin-head', array( 'version' => $wp_version ) );
 
 
 
 
 
 
 
397
  }
398
 
399
  /**
581
  ),
582
  ) );
583
  }
584
+
585
+ /**
586
+ * Register scripts and styles for Updater Controller
587
+ *
588
+ * @return void
589
+ */
590
+ public function register_updater_scripts_and_styles( $hook ) {
591
+ if ( 'plugins.php' !== $hook ) {
592
+ return;
593
+ }
594
+
595
+ do_action( 'ai1mw-register-updater-scripts-and-styles' );
596
+
597
+ wp_enqueue_style(
598
+ 'ai1wm-css-updater',
599
+ Ai1wm_Template::asset_link( 'css/updater.min.css' )
600
+ );
601
+ wp_enqueue_script(
602
+ 'ai1wm-js-updater',
603
+ Ai1wm_Template::asset_link( 'javascript/updater.min.js' ),
604
+ array( 'jquery' )
605
+ );
606
+ wp_localize_script( 'ai1wm-js-updater', 'ai1wm_updater', array(
607
+ 'ajax' => array(
608
+ 'url' => admin_url( 'admin-ajax.php?action=ai1wm_updater' ),
609
+ ),
610
+ ) );
611
+ }
612
  }
lib/controller/class-ai1wm-message-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Message_Controller {
27
 
28
  public static function close_message() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Message_Controller {
27
 
28
  public static function close_message() {
lib/controller/class-ai1wm-report-controller.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Report_Controller {
27
 
28
  public static function report_problem() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Report_Controller {
27
 
28
  public static function report_problem() {
lib/controller/class-ai1wm-updater-controller.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2014 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
+ class Ai1wm_Updater_Controller {
27
+
28
+ public static function plugins_api( $result, $action = null, $args = null ) {
29
+ return Ai1wm_Updater::plugins_api( $result, $action, $args );
30
+ }
31
+
32
+ public static function pre_update_plugins( $transient ) {
33
+ if ( empty( $transient->checked ) ) {
34
+ return $transient;
35
+ }
36
+
37
+ // Check for updates
38
+ Ai1wm_Updater::check_for_updates();
39
+
40
+ return $transient;
41
+ }
42
+
43
+ public static function update_plugins( $transient ) {
44
+ return Ai1wm_Updater::update_plugins( $transient );
45
+ }
46
+
47
+ public static function check_for_updates() {
48
+ return Ai1wm_Updater::check_for_updates();
49
+ }
50
+
51
+ public static function plugin_row_meta( $links, $file ) {
52
+ return Ai1wm_Updater::plugin_row_meta( $links, $file );
53
+ }
54
+
55
+ public static function updater() {
56
+ $extensions = Ai1wm_Updater::get_extensions();
57
+
58
+ // Set uuid
59
+ $uuid = null;
60
+ if ( isset( $_POST['ai1wm-uuid'] ) ) {
61
+ $uuid = trim( $_POST['ai1wm-uuid'] );
62
+ }
63
+
64
+ // Set extension
65
+ $extension = null;
66
+ if ( isset( $_POST['ai1wm-extension'] ) ) {
67
+ $extension = trim( $_POST['ai1wm-extension'] );
68
+ }
69
+
70
+ // Verify whether extension exists
71
+ if ( isset( $extensions[ $extension ] ) ) {
72
+ update_site_option( $extensions[ $extension ]['key'], $uuid );
73
+ }
74
+ }
75
+ }
lib/model/class-ai1wm-backup.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Backup {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Backup {
27
 
28
  /**
lib/model/class-ai1wm-export-abstract.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  abstract class Ai1wm_Export_Abstract {
27
 
28
  protected $args = array();
@@ -115,6 +115,7 @@ abstract class Ai1wm_Export_Abstract {
115
  'plugins' . DIRECTORY_SEPARATOR . AI1WMUE_PLUGIN_BASEDIR,
116
  'plugins' . DIRECTORY_SEPARATOR . AI1WMFE_PLUGIN_BASEDIR,
117
  'plugins' . DIRECTORY_SEPARATOR . AI1WMLE_PLUGIN_BASEDIR,
 
118
  ) );
119
  }
120
 
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  abstract class Ai1wm_Export_Abstract {
27
 
28
  protected $args = array();
115
  'plugins' . DIRECTORY_SEPARATOR . AI1WMUE_PLUGIN_BASEDIR,
116
  'plugins' . DIRECTORY_SEPARATOR . AI1WMFE_PLUGIN_BASEDIR,
117
  'plugins' . DIRECTORY_SEPARATOR . AI1WMLE_PLUGIN_BASEDIR,
118
+ 'plugins' . DIRECTORY_SEPARATOR . AI1WMOE_PLUGIN_BASEDIR,
119
  ) );
120
  }
121
 
lib/model/class-ai1wm-export-file.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Export_File extends Ai1wm_Export_Abstract {
27
 
28
  public function export() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Export_File extends Ai1wm_Export_Abstract {
27
 
28
  public function export() {
lib/model/class-ai1wm-feedback.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Feedback {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Feedback {
27
 
28
  /**
lib/model/class-ai1wm-http.php CHANGED
@@ -80,11 +80,14 @@ class Ai1wm_Http {
80
  // HTTP response
81
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
82
 
 
 
 
83
  // Clear WP notoptions cache
84
  wp_cache_delete( 'notoptions', 'options' );
85
 
86
- // Clear WP options cache
87
- wp_cache_flush();
88
 
89
  // Is valid transport layer?
90
  if ( get_site_option( AI1WM_URL_IP, false, false )
80
  // HTTP response
81
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
82
 
83
+ // Clear WP options cache
84
+ wp_cache_flush();
85
+
86
  // Clear WP notoptions cache
87
  wp_cache_delete( 'notoptions', 'options' );
88
 
89
+ // Set WP notoptions cache
90
+ wp_cache_set( 'notoptions', array(), 'options' );
91
 
92
  // Is valid transport layer?
93
  if ( get_site_option( AI1WM_URL_IP, false, false )
lib/model/class-ai1wm-import-abstract.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  abstract class Ai1wm_Import_Abstract {
27
 
28
  protected $args = array();
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  abstract class Ai1wm_Import_Abstract {
27
 
28
  protected $args = array();
lib/model/class-ai1wm-import-file.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Import_File extends Ai1wm_Import_Abstract {
27
 
28
  public function import() {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Import_File extends Ai1wm_Import_Abstract {
27
 
28
  public function import() {
lib/model/class-ai1wm-logger.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Logger {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Logger {
27
 
28
  /**
lib/model/class-ai1wm-maintenance.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Maintenance {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Maintenance {
27
 
28
  /**
lib/model/class-ai1wm-message.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Message {
27
 
28
  protected $messages = array();
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Message {
27
 
28
  protected $messages = array();
lib/model/class-ai1wm-report.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Report {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Report {
27
 
28
  /**
lib/model/class-ai1wm-status.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Status {
27
 
28
  public static function get( $key = null ) {
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Status {
27
 
28
  public static function get( $key = null ) {
lib/model/class-ai1wm-storage.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Storage {
27
 
28
  protected $storage = null;
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Storage {
27
 
28
  protected $storage = null;
lib/model/class-ai1wm-template.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -23,6 +22,7 @@
23
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
 
26
  class Ai1wm_Template extends Bandar {
27
 
28
  /**
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
22
  * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
23
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
24
  */
25
+
26
  class Ai1wm_Template extends Bandar {
27
 
28
  /**
lib/model/class-ai1wm-updater.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2014 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
+ class Ai1wm_Updater {
27
+
28
+ /**
29
+ * Retrieve plugin installer pages from WordPress Plugins API.
30
+ *
31
+ * @param mixed $result
32
+ * @param string $action
33
+ * @param array|object $args
34
+ * @return mixed
35
+ */
36
+ public static function plugins_api( $result, $action = null, $args = null ) {
37
+ if ( empty( $args->slug ) ) {
38
+ return $result;
39
+ }
40
+
41
+ $extensions = self::get_extensions();
42
+
43
+ // View details page
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 ] ) ) {
51
+ return (object) $details;
52
+ }
53
+ }
54
+
55
+ return $result;
56
+ }
57
+
58
+ /**
59
+ * Update WordPress plugin list page.
60
+ *
61
+ * @param object $transient
62
+ * @return object
63
+ */
64
+ public static function update_plugins( $transient ) {
65
+ $extensions = self::get_extensions();
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(
84
+ 'slug' => $slug,
85
+ 'new_version' => $update['version'],
86
+ 'url' => $update['homepage'],
87
+ 'plugin' => $extension['basename'],
88
+ 'package' => sprintf( '%s/%s?siteurl=%s', $update['download_link'], $key, $url ),
89
+ );
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ return $transient;
96
+ }
97
+
98
+ /**
99
+ * Check for extension updates
100
+ *
101
+ * @return void
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 ( self::get_extensions() as $slug => $extension ) {
109
+ $response = wp_remote_get( $extension['about'], array(
110
+ 'timeout' => 15,
111
+ 'headers' => array( 'Accept' => 'application/json' ),
112
+ ) );
113
+
114
+ // Add updates
115
+ if ( ! is_wp_error( $response ) ) {
116
+ if ( ( $response = json_decode( $response['body'], true ) ) ) {
117
+ // Slug is mandatory
118
+ if ( ! isset( $response['slug'] ) ) {
119
+ return;
120
+ }
121
+
122
+ // Version is mandatory
123
+ if ( ! isset( $response['version'] ) ) {
124
+ return;
125
+ }
126
+
127
+ // Homepage is mandatory
128
+ if ( ! isset( $response['homepage'] ) ) {
129
+ return;
130
+ }
131
+
132
+ // Download link is mandatory
133
+ if ( ! isset( $response['download_link'] ) ) {
134
+ return;
135
+ }
136
+
137
+ $updates[ $slug ] = $response;
138
+ }
139
+ }
140
+ }
141
+
142
+ // Set new updates
143
+ update_site_option( AI1WM_UPDATER, $updates );
144
+ }
145
+
146
+ /**
147
+ * Add "Check for updates" link
148
+ *
149
+ * @param array $links The array having default links for the plugin.
150
+ * @param string $file The name of the plugin file.
151
+ * @return array
152
+ */
153
+ public static function plugin_row_meta( $links, $file ) {
154
+ $modal = 0;
155
+
156
+ // Add link for each extension
157
+ foreach ( self::get_extensions() as $slug => $extension ) {
158
+ $modal++;
159
+
160
+ // Get plugin details
161
+ if ( $file === $extension['basename'] ) {
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(
169
+ 'url' => wp_nonce_url( $url, 'ai1wm_updater_nonce' ),
170
+ ) );
171
+
172
+ } else {
173
+
174
+ // Add modal
175
+ $links[] = Ai1wm_Template::get_content( 'updater/modal', array(
176
+ 'url' => wp_nonce_url( $url, 'ai1wm_updater_nonce' ),
177
+ 'modal' => $modal,
178
+ ) );
179
+
180
+ }
181
+ }
182
+ }
183
+
184
+ return $links;
185
+ }
186
+
187
+ /**
188
+ * Get extensions for update.
189
+ *
190
+ * @return array
191
+ */
192
+ public static function get_extensions() {
193
+ $extensions = array();
194
+
195
+ // Add Dropbox Extension
196
+ if ( defined( 'AI1WMDE_PLUGIN_NAME' ) ) {
197
+ $extensions[ AI1WMDE_PLUGIN_NAME ] = array(
198
+ 'key' => AI1WMDE_PLUGIN_KEY,
199
+ 'about' => AI1WMDE_PLUGIN_ABOUT,
200
+ 'basename' => AI1WMDE_PLUGIN_BASENAME,
201
+ 'version' => AI1WMDE_VERSION,
202
+ );
203
+ }
204
+
205
+ // Add Google Drive Extension
206
+ if ( defined( 'AI1WMGE_PLUGIN_NAME' ) ) {
207
+ $extensions[ AI1WMGE_PLUGIN_NAME ] = array(
208
+ 'key' => AI1WMGE_PLUGIN_KEY,
209
+ 'about' => AI1WMGE_PLUGIN_ABOUT,
210
+ 'basename' => AI1WMGE_PLUGIN_BASENAME,
211
+ 'version' => AI1WMGE_VERSION,
212
+ );
213
+ }
214
+
215
+ // Add Amazon S3 extension
216
+ if ( defined( 'AI1WMSE_PLUGIN_NAME' ) ) {
217
+ $extensions[ AI1WMSE_PLUGIN_NAME ] = array(
218
+ 'key' => AI1WMSE_PLUGIN_KEY,
219
+ 'about' => AI1WMSE_PLUGIN_ABOUT,
220
+ 'basename' => AI1WMSE_PLUGIN_BASENAME,
221
+ 'version' => AI1WMSE_VERSION,
222
+ );
223
+ }
224
+
225
+ // Add Multisite Extension
226
+ if ( defined( 'AI1WMME_PLUGIN_NAME' ) ) {
227
+ $extensions[ AI1WMME_PLUGIN_NAME ] = array(
228
+ 'key' => AI1WMME_PLUGIN_KEY,
229
+ 'about' => AI1WMME_PLUGIN_ABOUT,
230
+ 'basename' => AI1WMME_PLUGIN_BASENAME,
231
+ 'version' => AI1WMME_VERSION,
232
+ );
233
+ }
234
+
235
+ // Add Unlimited Extension
236
+ if ( defined( 'AI1WMUE_PLUGIN_NAME' ) ) {
237
+ $extensions[ AI1WMUE_PLUGIN_NAME ] = array(
238
+ 'key' => AI1WMUE_PLUGIN_KEY,
239
+ 'about' => AI1WMUE_PLUGIN_ABOUT,
240
+ 'basename' => AI1WMUE_PLUGIN_BASENAME,
241
+ 'version' => AI1WMUE_VERSION,
242
+ );
243
+ }
244
+
245
+ // Add FTP Extension
246
+ if ( defined( 'AI1WMFE_PLUGIN_NAME' ) ) {
247
+ $extensions[ AI1WMFE_PLUGIN_NAME ] = array(
248
+ 'key' => AI1WMFE_PLUGIN_KEY,
249
+ 'about' => AI1WMFE_PLUGIN_ABOUT,
250
+ 'basename' => AI1WMFE_PLUGIN_BASENAME,
251
+ 'version' => AI1WMFE_VERSION,
252
+ );
253
+ }
254
+
255
+ // Add URL Extension
256
+ if ( defined( 'AI1WMLE_PLUGIN_NAME' ) ) {
257
+ $extensions[ AI1WMLE_PLUGIN_NAME ] = array(
258
+ 'key' => AI1WMLE_PLUGIN_KEY,
259
+ 'about' => AI1WMLE_PLUGIN_ABOUT,
260
+ 'basename' => AI1WMLE_PLUGIN_BASENAME,
261
+ 'version' => AI1WMLE_VERSION,
262
+ );
263
+ }
264
+
265
+ // Add OneDrive Extension
266
+ if ( defined( 'AI1WMOE_PLUGIN_NAME' ) ) {
267
+ $extensions[ AI1WMOE_PLUGIN_NAME ] = array(
268
+ 'key' => AI1WMOE_PLUGIN_KEY,
269
+ 'about' => AI1WMOE_PLUGIN_ABOUT,
270
+ 'basename' => AI1WMOE_PLUGIN_BASENAME,
271
+ 'version' => AI1WMOE_VERSION,
272
+ );
273
+ }
274
+
275
+ return $extensions;
276
+ }
277
+ }
lib/model/service/class-ai1wm-service-database.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
@@ -251,20 +250,21 @@ class Ai1wm_Service_Database implements Ai1wm_Service_Interface {
251
  public function export() {
252
  global $wpdb;
253
 
254
- $clauses = array();
 
255
 
256
  // Spam comments
257
  if ( isset( $this->args['options']['no-spam-comments'] ) ) {
258
- $clauses[ $wpdb->comments ] = " WHERE comment_approved != 'spam' ";
259
- $clauses[ $wpdb->commentmeta ] = sprintf(
260
  " WHERE comment_id IN ( SELECT comment_ID FROM `%s` WHERE comment_approved != 'spam' ) ",
261
  $wpdb->comments
262
- );
263
  }
264
 
265
  // Post revisions
266
  if ( isset( $this->args['options']['no-revisions'] ) ) {
267
- $clauses[ $wpdb->posts ] = " WHERE post_type != 'revision' ";
268
  }
269
 
270
  // Find and replace
@@ -279,16 +279,12 @@ class Ai1wm_Service_Database implements Ai1wm_Service_Interface {
279
  }
280
  }
281
 
282
- // Get database client
283
- $client = MysqlDumpFactory::makeMysqlDump( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
284
-
285
  // Set database options
286
  $client->setOldTablePrefixes( array( $wpdb->prefix ) )
287
  ->setNewTablePrefixes( array( AI1WM_TABLE_PREFIX ) )
288
  ->setOldReplaceValues( $old_values )
289
  ->setNewReplaceValues( $new_values )
290
  ->setIncludeTablePrefixes( array( $wpdb->prefix ) )
291
- ->setQueryClauses( $clauses )
292
  ->setTablePrefixColumns( $wpdb->options, array( 'option_name' ) )
293
  ->setTablePrefixColumns( $wpdb->usermeta, array( 'meta_key' ) );
294
 
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
250
  public function export() {
251
  global $wpdb;
252
 
253
+ // Get database client
254
+ $client = MysqlDumpFactory::makeMysqlDump( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
255
 
256
  // Spam comments
257
  if ( isset( $this->args['options']['no-spam-comments'] ) ) {
258
+ $client->setTableQueryClauses( $wpdb->comments, " WHERE comment_approved != 'spam' " );
259
+ $client->setTableQueryClauses( $wpdb->commentmeta, sprintf(
260
  " WHERE comment_id IN ( SELECT comment_ID FROM `%s` WHERE comment_approved != 'spam' ) ",
261
  $wpdb->comments
262
+ ) );
263
  }
264
 
265
  // Post revisions
266
  if ( isset( $this->args['options']['no-revisions'] ) ) {
267
+ $client->setTableQueryClauses( $wpdb->posts, " WHERE post_type != 'revision' " );
268
  }
269
 
270
  // Find and replace
279
  }
280
  }
281
 
 
 
 
282
  // Set database options
283
  $client->setOldTablePrefixes( array( $wpdb->prefix ) )
284
  ->setNewTablePrefixes( array( AI1WM_TABLE_PREFIX ) )
285
  ->setOldReplaceValues( $old_values )
286
  ->setNewReplaceValues( $new_values )
287
  ->setIncludeTablePrefixes( array( $wpdb->prefix ) )
 
288
  ->setTablePrefixColumns( $wpdb->options, array( 'option_name' ) )
289
  ->setTablePrefixColumns( $wpdb->usermeta, array( 'meta_key' ) );
290
 
lib/model/service/class-ai1wm-service-interface.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
lib/model/service/class-ai1wm-service-package.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Copyright (C) 2014 ServMask Inc.
5
  *
1
  <?php
 
2
  /**
3
  * Copyright (C) 2014 ServMask Inc.
4
  *
lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpInterface.php CHANGED
@@ -26,6 +26,9 @@
26
 
27
  interface MysqlDumpInterface
28
  {
 
 
 
29
  /**
30
  * Define MySQL credentials for the current connection
31
  *
@@ -98,19 +101,21 @@ interface MysqlDumpInterface
98
  public function getNewReplaceValues();
99
 
100
  /**
101
- * Set query clauses
102
  *
103
- * @param array $clauses List of SQL query clauses
 
104
  * @return MysqlDumpInterface
105
  */
106
- public function setQueryClauses($clauses);
107
 
108
  /**
109
- * Get query clauses
110
  *
 
111
  * @return array
112
  */
113
- public function getQueryClauses();
114
 
115
  /**
116
  * Set table prefix columns
26
 
27
  interface MysqlDumpInterface
28
  {
29
+
30
+ const QUERIES_PER_TRANSACTION = 1000;
31
+
32
  /**
33
  * Define MySQL credentials for the current connection
34
  *
101
  public function getNewReplaceValues();
102
 
103
  /**
104
+ * Set table query clauses
105
  *
106
+ * @param string $table Table name
107
+ * @param array $clauses Table clauses
108
  * @return MysqlDumpInterface
109
  */
110
+ public function setTableQueryClauses($table, $clauses);
111
 
112
  /**
113
+ * Get table query clauses
114
  *
115
+ * @param string $table Table name
116
  * @return array
117
  */
118
+ public function getTableQueryClauses($table);
119
 
120
  /**
121
  * Set table prefix columns
lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpPDO.php CHANGED
@@ -51,7 +51,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
51
 
52
  protected $newReplaceValues = array();
53
 
54
- protected $queryClauses = array();
55
 
56
  protected $tablePrefixColumns = array();
57
 
@@ -174,26 +174,32 @@ class MysqlDumpPDO implements MysqlDumpInterface
174
  }
175
 
176
  /**
177
- * Set query clauses
178
  *
179
- * @param array $clauses List of SQL query clauses
 
180
  * @return MysqlDumpPDO
181
  */
182
- public function setQueryClauses($clauses)
183
  {
184
- $this->queryClauses = $clauses;
185
 
186
  return $this;
187
  }
188
 
189
  /**
190
- * Get query clauses
191
  *
 
192
  * @return array
193
  */
194
- public function getQueryClauses()
195
  {
196
- return $this->queryClauses;
 
 
 
 
197
  }
198
 
199
  /**
@@ -206,7 +212,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
206
  public function setTablePrefixColumns($table, $columns)
207
  {
208
  foreach ($columns as $column) {
209
- $this->tablePrefixColumns[$table][$column] = true;
210
  }
211
 
212
  return $this;
@@ -220,8 +226,8 @@ class MysqlDumpPDO implements MysqlDumpInterface
220
  */
221
  public function getTablePrefixColumns($table)
222
  {
223
- if (isset($this->tablePrefixColumns[$table])) {
224
- return $this->tablePrefixColumns[$table];
225
  }
226
 
227
  return array();
@@ -295,7 +301,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
295
 
296
  // Check table prefixes
297
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
298
- if (strpos($tableName, $prefix) === 0) {
299
  $include = true;
300
  break;
301
  }
@@ -313,7 +319,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
313
 
314
  // Check table prefixes
315
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
316
- if (strpos($tableName, $prefix) === 0) {
317
  $exclude = true;
318
  break;
319
  }
@@ -340,7 +346,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
340
 
341
  // Check table prefixes
342
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
343
- if (strpos($tableName, $prefix) === 0) {
344
  $include = true;
345
  break;
346
  }
@@ -358,7 +364,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
358
 
359
  // Check table prefixes
360
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
361
- if (strpos($tableName, $prefix) === 0) {
362
  $exclude = true;
363
  break;
364
  }
@@ -442,6 +448,11 @@ class MysqlDumpPDO implements MysqlDumpInterface
442
  // Get table structure
443
  $structure = $this->getConnection()->query("SHOW CREATE TABLE `$tableName`");
444
  $table = $structure->fetch(PDO::FETCH_ASSOC);
 
 
 
 
 
445
  if (isset($table['Create Table'])) {
446
 
447
  // Write table drop statement
@@ -468,62 +479,80 @@ class MysqlDumpPDO implements MysqlDumpInterface
468
  throw new Exception('Unable to write database end of statement');
469
  }
470
 
471
- // Close structure cursor
472
- $structure->closeCursor();
473
- } else {
474
- // Close structure cursor
475
- $structure->closeCursor();
476
 
477
- break;
478
- }
 
 
479
 
480
- // Set query
481
- $query = "SELECT * FROM `$tableName` ";
482
 
483
- // Apply additional query clauses
484
- $clauses = $this->getQueryClauses();
485
- if (isset($clauses[$tableName]) && ($queryClause = $clauses[$tableName])) {
486
- $query .= $queryClause;
487
- }
488
 
489
- // Apply additional table prefix columns
490
- $columns = $this->getTablePrefixColumns($tableName);
 
 
 
 
 
 
491
 
492
- // Get results
493
- $result = $this->getConnection()->query($query);
 
 
 
 
494
 
495
- // Generate insert statements
496
- while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
497
- $items = array();
498
- foreach ($row as $key => $value) {
499
- // Replace table prefix columns
500
- if (isset($columns[$key])) {
501
- $value = $this->replaceTablePrefixes($value, true, 0);
502
  }
503
 
504
- // Replace table values
505
- $items[] = is_null($value) ? 'NULL' : $this->getConnection()->quote($this->replaceTableValues($value));
506
- }
 
 
 
 
 
 
 
507
 
508
- // Set table values
509
- $tableValues = implode(',', $items);
510
 
511
- // Set insert statement
512
- $tableInsert = "INSERT INTO `$newTableName` VALUES ($tableValues);\n";
 
 
 
513
 
514
- // Write insert statement
515
- if (fwrite($fileHandler, $tableInsert) === false) {
516
- throw new Exception('Unable to write database insert statement');
517
  }
518
- }
519
 
520
- // Write end of statements
521
- if (fwrite($fileHandler, "\n") === false) {
522
- throw new Exception('Unable to write database end of statement');
523
- }
 
 
524
 
525
- // Close result cursor
526
- $result->closeCursor();
 
 
 
 
 
 
527
  }
528
 
529
  // Close file handler
@@ -719,7 +748,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
719
  // Replace first occurance at a specified position
720
  if ($position !== false) {
721
  for ($i = 0; $i < count($search); $i++) {
722
- $current = strpos($input, $search[$i]);
723
  if ($current === $position) {
724
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
725
  }
@@ -730,7 +759,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
730
 
731
  // Replace first occurance at any position
732
  for ($i = 0; $i < count($search); $i++) {
733
- $current = strpos($input, $search[$i]);
734
  if ($current !== $position) {
735
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
736
  }
@@ -740,7 +769,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
740
  }
741
 
742
  // Replace all occurrences
743
- return str_replace($search, $replace, $input);
744
  }
745
 
746
  /**
@@ -761,7 +790,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
761
 
762
  // Prepare replace values
763
  for ($i = 0; $i < count($old); $i++) {
764
- if (strpos($input, $old[$i]) !== false) {
765
  $oldValues[] = $old[$i];
766
  $newValues[] = $new[$i];
767
  }
@@ -826,7 +855,7 @@ class MysqlDumpPDO implements MysqlDumpInterface
826
  */
827
  protected function replaceTableCollation($input)
828
  {
829
- return str_replace('utf8mb4', 'utf8', $input);
830
  }
831
 
832
  /**
51
 
52
  protected $newReplaceValues = array();
53
 
54
+ protected $tableQueryClauses = array();
55
 
56
  protected $tablePrefixColumns = array();
57
 
174
  }
175
 
176
  /**
177
+ * Set table query clauses
178
  *
179
+ * @param string $table Table name
180
+ * @param array $clauses Table clauses
181
  * @return MysqlDumpPDO
182
  */
183
+ public function setTableQueryClauses($table, $clauses)
184
  {
185
+ $this->tableQueryClauses[strtolower($table)] = $clauses;
186
 
187
  return $this;
188
  }
189
 
190
  /**
191
+ * Get table query clauses
192
  *
193
+ * @param string $table Table name
194
  * @return array
195
  */
196
+ public function getTableQueryClauses($table)
197
  {
198
+ if (isset($this->tableQueryClauses[strtolower($table)])) {
199
+ return $this->tableQueryClauses[strtolower($table)];
200
+ }
201
+
202
+ return array();
203
  }
204
 
205
  /**
212
  public function setTablePrefixColumns($table, $columns)
213
  {
214
  foreach ($columns as $column) {
215
+ $this->tablePrefixColumns[strtolower($table)][strtolower($column)] = true;
216
  }
217
 
218
  return $this;
226
  */
227
  public function getTablePrefixColumns($table)
228
  {
229
+ if (isset($this->tablePrefixColumns[strtolower($table)])) {
230
+ return $this->tablePrefixColumns[strtolower($table)];
231
  }
232
 
233
  return array();
301
 
302
  // Check table prefixes
303
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
304
+ if (stripos($tableName, $prefix) === 0) {
305
  $include = true;
306
  break;
307
  }
319
 
320
  // Check table prefixes
321
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
322
+ if (stripos($tableName, $prefix) === 0) {
323
  $exclude = true;
324
  break;
325
  }
346
 
347
  // Check table prefixes
348
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
349
+ if (stripos($tableName, $prefix) === 0) {
350
  $include = true;
351
  break;
352
  }
364
 
365
  // Check table prefixes
366
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
367
+ if (stripos($tableName, $prefix) === 0) {
368
  $exclude = true;
369
  break;
370
  }
448
  // Get table structure
449
  $structure = $this->getConnection()->query("SHOW CREATE TABLE `$tableName`");
450
  $table = $structure->fetch(PDO::FETCH_ASSOC);
451
+
452
+ // Close structure cursor
453
+ $structure->closeCursor();
454
+
455
+ // Get create table
456
  if (isset($table['Create Table'])) {
457
 
458
  // Write table drop statement
479
  throw new Exception('Unable to write database end of statement');
480
  }
481
 
482
+ // Set query
483
+ $query = "SELECT * FROM `$tableName` ";
 
 
 
484
 
485
+ // Apply additional table query clauses
486
+ if (($queryClauses = $this->getTableQueryClauses($tableName))) {
487
+ $query .= $queryClauses;
488
+ }
489
 
490
+ // Apply additional table prefix columns
491
+ $columns = $this->getTablePrefixColumns($tableName);
492
 
493
+ // Get results
494
+ $result = $this->getConnection()->query($query);
495
+
496
+ $processedRows = 0;
 
497
 
498
+ // Generate insert statements
499
+ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
500
+ if ($processedRows === 0) {
501
+ // Write start transaction
502
+ if (fwrite($fileHandler, "START TRANSACTION;\n") === false) {
503
+ throw new Exception('Unable to write database start transaction');
504
+ }
505
+ }
506
 
507
+ $items = array();
508
+ foreach ($row as $key => $value) {
509
+ // Replace table prefix columns
510
+ if (isset($columns[strtolower($key)])) {
511
+ $value = $this->replaceTablePrefixes($value, true, 0);
512
+ }
513
 
514
+ // Replace table values
515
+ $items[] = is_null($value) ? 'NULL' : $this->getConnection()->quote($this->replaceTableValues($value));
 
 
 
 
 
516
  }
517
 
518
+ // Set table values
519
+ $tableValues = implode(',', $items);
520
+
521
+ // Set insert statement
522
+ $tableInsert = "INSERT INTO `$newTableName` VALUES ($tableValues);\n";
523
+
524
+ // Write insert statement
525
+ if (fwrite($fileHandler, $tableInsert) === false) {
526
+ throw new Exception('Unable to write database insert statement');
527
+ }
528
 
529
+ $processedRows++;
 
530
 
531
+ // Write end of transaction
532
+ if ($processedRows === MysqlDumpInterface::QUERIES_PER_TRANSACTION) {
533
+ if (fwrite($fileHandler, "COMMIT;\n") === false) {
534
+ throw new Exception('Unable to write database end of transaction');
535
+ }
536
 
537
+ $processedRows = 0;
538
+ }
 
539
  }
 
540
 
541
+ // Write end of transaction
542
+ if ($processedRows !== 0) {
543
+ if (fwrite($fileHandler, "COMMIT;\n") === false) {
544
+ throw new Exception('Unable to write database end of transaction');
545
+ }
546
+ }
547
 
548
+ // Write end of statements
549
+ if (fwrite($fileHandler, "\n") === false) {
550
+ throw new Exception('Unable to write database end of statement');
551
+ }
552
+
553
+ // Close result cursor
554
+ $result->closeCursor();
555
+ }
556
  }
557
 
558
  // Close file handler
748
  // Replace first occurance at a specified position
749
  if ($position !== false) {
750
  for ($i = 0; $i < count($search); $i++) {
751
+ $current = stripos($input, $search[$i]);
752
  if ($current === $position) {
753
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
754
  }
759
 
760
  // Replace first occurance at any position
761
  for ($i = 0; $i < count($search); $i++) {
762
+ $current = stripos($input, $search[$i]);
763
  if ($current !== $position) {
764
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
765
  }
769
  }
770
 
771
  // Replace all occurrences
772
+ return str_ireplace($search, $replace, $input);
773
  }
774
 
775
  /**
790
 
791
  // Prepare replace values
792
  for ($i = 0; $i < count($old); $i++) {
793
+ if (stripos($input, $old[$i]) !== false) {
794
  $oldValues[] = $old[$i];
795
  $newValues[] = $new[$i];
796
  }
855
  */
856
  protected function replaceTableCollation($input)
857
  {
858
+ return str_ireplace('utf8mb4', 'utf8', $input);
859
  }
860
 
861
  /**
lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpSQL.php CHANGED
@@ -47,7 +47,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
47
 
48
  protected $newReplaceValues = array();
49
 
50
- protected $queryClauses = array();
51
 
52
  protected $tablePrefixColumns = array();
53
 
@@ -166,26 +166,31 @@ class MysqlDumpSQL implements MysqlDumpInterface
166
  }
167
 
168
  /**
169
- * Set query clauses
170
  *
171
- * @param array $clauses List of SQL query clauses
 
172
  * @return MysqlDumpSQL
173
  */
174
- public function setQueryClauses($clauses)
175
  {
176
- $this->queryClauses = $clauses;
177
 
178
  return $this;
179
  }
180
-
181
  /**
182
- * Get query clauses
183
  *
 
184
  * @return array
185
  */
186
- public function getQueryClauses()
187
  {
188
- return $this->queryClauses;
 
 
 
 
189
  }
190
 
191
  /**
@@ -198,7 +203,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
198
  public function setTablePrefixColumns($table, $columns)
199
  {
200
  foreach ($columns as $column) {
201
- $this->tablePrefixColumns[$table][$column] = true;
202
  }
203
 
204
  return $this;
@@ -212,8 +217,8 @@ class MysqlDumpSQL implements MysqlDumpInterface
212
  */
213
  public function getTablePrefixColumns($table)
214
  {
215
- if (isset($this->tablePrefixColumns[$table])) {
216
- return $this->tablePrefixColumns[$table];
217
  }
218
 
219
  return array();
@@ -290,7 +295,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
290
 
291
  // Check table prefixes
292
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
293
- if (strpos($tableName, $prefix) === 0) {
294
  $include = true;
295
  break;
296
  }
@@ -308,7 +313,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
308
 
309
  // Check table prefixes
310
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
311
- if (strpos($tableName, $prefix) === 0) {
312
  $exclude = true;
313
  break;
314
  }
@@ -335,7 +340,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
335
 
336
  // Check table prefixes
337
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
338
- if (strpos($tableName, $prefix) === 0) {
339
  $include = true;
340
  break;
341
  }
@@ -353,7 +358,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
353
 
354
  // Check table prefixes
355
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
356
- if (strpos($tableName, $prefix) === 0) {
357
  $exclude = true;
358
  break;
359
  }
@@ -438,6 +443,11 @@ class MysqlDumpSQL implements MysqlDumpInterface
438
  // Get table structure
439
  $structure = mysql_unbuffered_query("SHOW CREATE TABLE `$tableName`", $this->getConnection());
440
  $table = mysql_fetch_assoc($structure);
 
 
 
 
 
441
  if (isset($table['Create Table'])) {
442
 
443
  // Write table drop statement
@@ -464,62 +474,80 @@ class MysqlDumpSQL implements MysqlDumpInterface
464
  throw new Exception('Unable to write database end of statement');
465
  }
466
 
467
- // Close structure cursor
468
- mysql_free_result($structure);
469
- } else {
470
- // Close structure cursor
471
- mysql_free_result($structure);
472
 
473
- break;
474
- }
 
 
475
 
476
- // Set query
477
- $query = "SELECT * FROM `$tableName` ";
478
 
479
- // Apply additional query clauses
480
- $clauses = $this->getQueryClauses();
481
- if (isset($clauses[$tableName]) && ($queryClause = $clauses[$tableName])) {
482
- $query .= $queryClause;
483
- }
484
 
485
- // Apply additional table prefix columns
486
- $columns = $this->getTablePrefixColumns($tableName);
487
 
488
- // Get results
489
- $result = mysql_unbuffered_query($query, $this->getConnection());
 
 
 
 
 
 
490
 
491
- // Generate insert statements
492
- while ($row = mysql_fetch_assoc($result)) {
493
- $items = array();
494
- foreach ($row as $key => $value) {
495
- // Replace table prefix columns
496
- if (isset($columns[$key])) {
497
- $value = $this->replaceTablePrefixes($value, true, 0);
 
 
498
  }
499
 
500
- // Replace table values
501
- $items[] = is_null($value) ? 'NULL' : "'" . mysql_real_escape_string($this->replaceTableValues($value), $this->getConnection()) . "'";
502
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
 
504
- // Set table values
505
- $tableValues = implode(',', $items);
 
506
 
507
- // Set insert statement
508
- $tableInsert = "INSERT INTO `$newTableName` VALUES ($tableValues);\n";
 
 
 
 
509
 
510
- // Write insert statement
511
- if (fwrite($fileHandler, $tableInsert) === false) {
512
- throw new Exception('Unable to write database insert statement');
513
  }
514
- }
515
 
516
- // Write end of statements
517
- if (fwrite($fileHandler, "\n") === false) {
518
- throw new Exception('Unable to write database end of statement');
519
  }
520
-
521
- // Close result cursor
522
- mysql_free_result($result);
523
  }
524
 
525
  // Close file handler
@@ -716,7 +744,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
716
  // Replace first occurance at a specified position
717
  if ($position !== false) {
718
  for ($i = 0; $i < count($search); $i++) {
719
- $current = strpos($input, $search[$i]);
720
  if ($current === $position) {
721
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
722
  }
@@ -727,7 +755,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
727
 
728
  // Replace first occurance at any position
729
  for ($i = 0; $i < count($search); $i++) {
730
- $current = strpos($input, $search[$i]);
731
  if ($current !== $position) {
732
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
733
  }
@@ -737,7 +765,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
737
  }
738
 
739
  // Replace all occurrences
740
- return str_replace($search, $replace, $input);
741
  }
742
 
743
  /**
@@ -758,7 +786,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
758
 
759
  // Prepare replace values
760
  for ($i = 0; $i < count($old); $i++) {
761
- if (strpos($input, $old[$i]) !== false) {
762
  $oldValues[] = $old[$i];
763
  $newValues[] = $new[$i];
764
  }
@@ -823,7 +851,7 @@ class MysqlDumpSQL implements MysqlDumpInterface
823
  */
824
  protected function replaceTableCollation($input)
825
  {
826
- return str_replace('utf8mb4', 'utf8', $input);
827
  }
828
 
829
  /**
47
 
48
  protected $newReplaceValues = array();
49
 
50
+ protected $tableQueryClauses = array();
51
 
52
  protected $tablePrefixColumns = array();
53
 
166
  }
167
 
168
  /**
169
+ * Set table query clauses
170
  *
171
+ * @param string $table Table name
172
+ * @param array $clauses Table clauses
173
  * @return MysqlDumpSQL
174
  */
175
+ public function setTableQueryClauses($table, $clauses)
176
  {
177
+ $this->tableQueryClauses[strtolower($table)] = $clauses;
178
 
179
  return $this;
180
  }
 
181
  /**
182
+ * Get table query clauses
183
  *
184
+ * @param string $table Table name
185
  * @return array
186
  */
187
+ public function getTableQueryClauses($table)
188
  {
189
+ if (isset($this->tableQueryClauses[strtolower($table)])) {
190
+ return $this->tableQueryClauses[strtolower($table)];
191
+ }
192
+
193
+ return array();
194
  }
195
 
196
  /**
203
  public function setTablePrefixColumns($table, $columns)
204
  {
205
  foreach ($columns as $column) {
206
+ $this->tablePrefixColumns[strtolower($table)][strtolower($column)] = true;
207
  }
208
 
209
  return $this;
217
  */
218
  public function getTablePrefixColumns($table)
219
  {
220
+ if (isset($this->tablePrefixColumns[strtolower($table)])) {
221
+ return $this->tablePrefixColumns[strtolower($table)];
222
  }
223
 
224
  return array();
295
 
296
  // Check table prefixes
297
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
298
+ if (stripos($tableName, $prefix) === 0) {
299
  $include = true;
300
  break;
301
  }
313
 
314
  // Check table prefixes
315
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
316
+ if (stripos($tableName, $prefix) === 0) {
317
  $exclude = true;
318
  break;
319
  }
340
 
341
  // Check table prefixes
342
  foreach ($this->getIncludeTablePrefixes() as $prefix) {
343
+ if (stripos($tableName, $prefix) === 0) {
344
  $include = true;
345
  break;
346
  }
358
 
359
  // Check table prefixes
360
  foreach ($this->getExcludeTablePrefixes() as $prefix) {
361
+ if (stripos($tableName, $prefix) === 0) {
362
  $exclude = true;
363
  break;
364
  }
443
  // Get table structure
444
  $structure = mysql_unbuffered_query("SHOW CREATE TABLE `$tableName`", $this->getConnection());
445
  $table = mysql_fetch_assoc($structure);
446
+
447
+ // Close structure cursor
448
+ mysql_free_result($structure);
449
+
450
+ // Get create table
451
  if (isset($table['Create Table'])) {
452
 
453
  // Write table drop statement
474
  throw new Exception('Unable to write database end of statement');
475
  }
476
 
477
+ // Set query
478
+ $query = "SELECT * FROM `$tableName` ";
 
 
 
479
 
480
+ // Apply additional table query clauses
481
+ if (($queryClauses = $this->getTableQueryClauses($tableName))) {
482
+ $query .= $queryClauses;
483
+ }
484
 
485
+ // Apply additional table prefix columns
486
+ $columns = $this->getTablePrefixColumns($tableName);
487
 
488
+ // Get results
489
+ $result = mysql_unbuffered_query($query, $this->getConnection());
 
 
 
490
 
491
+ $processedRows = 0;
 
492
 
493
+ // Generate insert statements
494
+ while ($row = mysql_fetch_assoc($result)) {
495
+ if ($processedRows === 0) {
496
+ // Write start transaction
497
+ if (fwrite($fileHandler, "START TRANSACTION;\n") === false) {
498
+ throw new Exception('Unable to write database start transaction');
499
+ }
500
+ }
501
 
502
+ $items = array();
503
+ foreach ($row as $key => $value) {
504
+ // Replace table prefix columns
505
+ if (isset($columns[strtolower($key)])) {
506
+ $value = $this->replaceTablePrefixes($value, true, 0);
507
+ }
508
+
509
+ // Replace table values
510
+ $items[] = is_null($value) ? 'NULL' : "'" . mysql_real_escape_string($this->replaceTableValues($value), $this->getConnection()) . "'";
511
  }
512
 
513
+ // Set table values
514
+ $tableValues = implode(',', $items);
515
+
516
+ // Set insert statement
517
+ $tableInsert = "INSERT INTO `$newTableName` VALUES ($tableValues);\n";
518
+
519
+ // Write insert statement
520
+ if (fwrite($fileHandler, $tableInsert) === false) {
521
+ throw new Exception('Unable to write database insert statement');
522
+ }
523
+
524
+ $processedRows++;
525
+
526
+ // Write end of transaction
527
+ if ($processedRows === MysqlDumpInterface::QUERIES_PER_TRANSACTION) {
528
+ if (fwrite($fileHandler, "COMMIT;\n") === false) {
529
+ throw new Exception('Unable to write database end of transaction');
530
+ }
531
 
532
+ $processedRows = 0;
533
+ }
534
+ }
535
 
536
+ // Write end of transaction
537
+ if ($processedRows !== 0) {
538
+ if (fwrite($fileHandler, "COMMIT;\n") === false) {
539
+ throw new Exception('Unable to write database end of transaction');
540
+ }
541
+ }
542
 
543
+ // Write end of statements
544
+ if (fwrite($fileHandler, "\n") === false) {
545
+ throw new Exception('Unable to write database end of statement');
546
  }
 
547
 
548
+ // Close result cursor
549
+ mysql_free_result($result);
 
550
  }
 
 
 
551
  }
552
 
553
  // Close file handler
744
  // Replace first occurance at a specified position
745
  if ($position !== false) {
746
  for ($i = 0; $i < count($search); $i++) {
747
+ $current = stripos($input, $search[$i]);
748
  if ($current === $position) {
749
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
750
  }
755
 
756
  // Replace first occurance at any position
757
  for ($i = 0; $i < count($search); $i++) {
758
+ $current = stripos($input, $search[$i]);
759
  if ($current !== $position) {
760
  $input = substr_replace($input, $replace[$i], $current, strlen($search[$i]));
761
  }
765
  }
766
 
767
  // Replace all occurrences
768
+ return str_ireplace($search, $replace, $input);
769
  }
770
 
771
  /**
786
 
787
  // Prepare replace values
788
  for ($i = 0; $i < count($old); $i++) {
789
+ if (stripos($input, $old[$i]) !== false) {
790
  $oldValues[] = $old[$i];
791
  $newValues[] = $new[$i];
792
  }
851
  */
852
  protected function replaceTableCollation($input)
853
  {
854
+ return str_ireplace('utf8mb4', 'utf8', $input);
855
  }
856
 
857
  /**
lib/vendor/mysqldump-factory/mysqldump-factory/lib/MysqlDumpUtility.php CHANGED
@@ -37,7 +37,7 @@ class MysqlDumpUtility
37
  */
38
  public static function replaceValues($from = array(), $to = array(), $data = '')
39
  {
40
- return str_replace($from, $to, $data);
41
  }
42
 
43
  /**
@@ -77,7 +77,7 @@ class MysqlDumpUtility
77
  unset($tmp);
78
  } else {
79
  if (is_string($data)) {
80
- $data = str_replace($from, $to, $data);
81
  }
82
  }
83
 
@@ -99,7 +99,7 @@ class MysqlDumpUtility
99
  * @return string
100
  */
101
  public static function unescapeMysql($data) {
102
- return str_replace(
103
  array('\\\\', '\\0', "\\n", "\\r", '\Z', "\'", '\"'),
104
  array('\\', '\0', "\n", "\r", "\x1a", "'", '"'),
105
  $data
@@ -112,6 +112,6 @@ class MysqlDumpUtility
112
  * @return string
113
  */
114
  public static function unescapeQuotes($data) {
115
- return str_replace('\"', '"', $data);
116
  }
117
  }
37
  */
38
  public static function replaceValues($from = array(), $to = array(), $data = '')
39
  {
40
+ return str_ireplace($from, $to, $data);
41
  }
42
 
43
  /**
77
  unset($tmp);
78
  } else {
79
  if (is_string($data)) {
80
+ $data = str_ireplace($from, $to, $data);
81
  }
82
  }
83
 
99
  * @return string
100
  */
101
  public static function unescapeMysql($data) {
102
+ return str_ireplace(
103
  array('\\\\', '\\0', "\\n", "\\r", '\Z', "\'", '\"'),
104
  array('\\', '\0', "\n", "\r", "\x1a", "'", '"'),
105
  $data
112
  * @return string
113
  */
114
  public static function unescapeQuotes($data) {
115
+ return str_ireplace('\"', '"', $data);
116
  }
117
  }
lib/vendor/servmask/archiver/class-ai1wm-archiver.php CHANGED
@@ -30,7 +30,7 @@ abstract class Ai1wm_Archiver {
30
  *
31
  * Field Name Offset Length Contents
32
  * name 0 255 filename (no path, no slash)
33
- * size 255 14 Size of file contents
34
  * mtime 269 12 last modification time
35
  * prefix 281 4096 path name, no trailing slashes
36
  *
@@ -144,7 +144,7 @@ abstract class Ai1wm_Archiver {
144
  // check if we have a handle
145
  if ( false === $file_handle ) {
146
  // we couldn't open the file
147
- throw new Ai1wm_Not_Accesible_Exception( sprintf( __( 'Unable to open %s' . AI1WM_PLUGIN_NAME ), $file ) );
148
  }
149
 
150
  return $file_handle;
30
  *
31
  * Field Name Offset Length Contents
32
  * name 0 255 filename (no path, no slash)
33
+ * size 255 14 size of file contents
34
  * mtime 269 12 last modification time
35
  * prefix 281 4096 path name, no trailing slashes
36
  *
144
  // check if we have a handle
145
  if ( false === $file_handle ) {
146
  // we couldn't open the file
147
+ throw new Ai1wm_Not_Accesible_Exception( sprintf( __( 'Unable to open %s', AI1WM_PLUGIN_NAME ), $file ) );
148
  }
149
 
150
  return $file_handle;
lib/vendor/servmask/archiver/class-ai1wm-compressor.php CHANGED
@@ -38,10 +38,10 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
38
  /**
39
  * Add a file to the archive
40
  *
41
- * @param string $file File to Add to the archive
42
- * @param string $new_filename Write the file with a different name
43
- * @param int $offset File offset
44
- * @param int $timeout Process timeout
45
  *
46
  * @throws \Ai1wm_Not_Accesible_Exception
47
  * @throws \Ai1wm_Not_Readable_Exception
38
  /**
39
  * Add a file to the archive
40
  *
41
+ * @param string $file File to Add to the archive
42
+ * @param string $new_filename Write the file with a different name
43
+ * @param int $offset File offset
44
+ * @param int $timeout Process timeout
45
  *
46
  * @throws \Ai1wm_Not_Accesible_Exception
47
  * @throws \Ai1wm_Not_Readable_Exception
lib/vendor/servmask/archiver/class-ai1wm-extractor.php CHANGED
@@ -24,6 +24,7 @@
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
26
  class Ai1wm_Extractor extends Ai1wm_Archiver {
 
27
  /**
28
  * Overloaded constructor that opens the passed file for reading
29
  *
24
  * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
25
  */
26
  class Ai1wm_Extractor extends Ai1wm_Archiver {
27
+
28
  /**
29
  * Overloaded constructor that opens the passed file for reading
30
  *
lib/view/assets/css/updater.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @charset "UTF-8";.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block}.ai1wm-button-group.ai1wm-button-export{width:147px}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:150px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import{width:158px}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:180px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{padding:6px 25px 1px;height:22px}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:6px 25px 1px 26px;height:22px;line-height:22px;text-decoration:none;color:#27ae60;text-align:left}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{-webkit-transform:translate(11px,-1px);transform:translate(11px,-1px);position:relative;display:inline-block;width:12px;height:10px}.ai1wm-line{display:inline-block;width:100%;height:2px;margin:auto;background:#27ae60;position:absolute;transition:all .2s ease-in-out}.ai1wm-line-first{top:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third,.ai1wm-line-second{top:50%}.ai1wm-line-third{top:100%}.ai1wm-button-gray{border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:none;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-green{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:none;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-green-small{border:2px solid #6eb649;background-color:transparent;color:#6eb649;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:none;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue{border:2px solid #00aff0;background-color:transparent;color:#00aff0;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:none;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;background-color:transparent;color:#e74c3c;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:none;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-alone{border-radius:50px!important;padding:5px 8px!important}.ai1wm-button-blue[disabled="disabled"],.ai1wm-button-green[disabled="disabled"],.ai1wm-button-red[disabled="disabled"],.ai1wm-button-green-small[disabled="disabled"]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled="disabled"]:hover{color:#00aff0}.ai1wm-button-red[disabled="disabled"]:hover{color:#e74c3c}.ai1wm-button-green[disabled="disabled"]:hover{color:#27ae60}.ai1wm-button-blue[disabled="disabled"]:hover,.ai1wm-button-green[disabled="disabled"]:hover,.ai1wm-button-red[disabled="disabled"]:hover,.ai1wm-button-green-small[disabled="disabled"]:hover{background:0 0}.ai1wm-button-gray i,.ai1wm-button-green i,.ai1wm-button-blue i,.ai1wm-button-red i{margin-left:-.5em;margin-right:.2em}.ai1wm-message-close-button{position:absolute;right:10px;top:6px;text-decoration:none;font-size:10px}input[type="radio"].ai1wm-flat-radio-button{display:none}input[type="radio"].ai1wm-flat-radio-button+a i,input[type="radio"].ai1wm-flat-radio-button+label i{vertical-align:middle;float:left;width:25px;height:25px;border-radius:50%;background:0 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type="radio"].ai1wm-flat-radio-button:checked+a i,input[type="radio"].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-icon-update{font-size:13px;padding:0;margin:0;font-weight:400}.ai1wm-icon-update:before{color:#d54e21;content:'\f463';display:inline-block;font:20px/1 'dashicons';speak:none;padding:0;margin:0;vertical-align:top}.ai1wm-modal-dialog{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.7);z-index:99999;opacity:0;transition:opacity 400ms ease-in;pointer-events:none}.ai1wm-modal-dialog:target{opacity:1;pointer-events:auto}.ai1wm-modal-dialog .ai1wm-modal-container{position:fixed;top:50%;left:50%;z-index:100002;width:480px;height:auto;padding:6px 16px 10px;-webkit-transform:translate(-240px,-94px);transform:translate(-240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-error{color:red}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-buttons{text-align:left}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-id{width:100%;padding:6px}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-help-link{font-weight:700}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-discard{margin-left:1em}
lib/view/assets/javascript/updater.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function t(i,a,e){function r(o,u){if(!a[o]){if(!i[o]){var s="function"==typeof require&&require;if(!u&&s)return s(o,!0);if(n)return n(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=a[o]={exports:{}};i[o][0].call(c.exports,function(t){var a=i[o][1][t];return r(a?a:t)},c,c.exports,t,i,a,e)}return a[o].exports}for(var n="function"==typeof require&&require,o=0;o<e.length;o++)r(e[o]);return r}({1:[function(){jQuery(document).ready(function(t){"use strict";t(".ai1wm-purchase-add").click(function(i){var a=this;i.preventDefault(),t(this).attr("disabled",!0);var e=t(this).closest(".ai1wm-modal-dialog"),r=e.find(".ai1wm-modal-error"),n=e.attr("id").split("-").pop(),o=e.find(".ai1wm-purchase-id").val(),u=e.find(".ai1wm-update-link").val();t.getJSON("https://servmask.com/purchase/"+o+"/check",function(i){t.post(ai1wm_updater.ajax.url,{"ai1wm-uuid":i.uuid,"ai1wm-extension":i.extension},function(){window.location.hash="",t("#ai1wm-update-section-"+n).html('<a href="'+u+'">Check for updates</a>'),t(a).attr("disabled",!1)})}).fail(function(){t(a).attr("disabled",!1),r.html('Your purchase ID is invalid, please <a href="mailto:support@servmask.com">contact us</a>')})}),t(".ai1wm-purchase-discard").click(function(t){window.location.hash="",t.preventDefault()})})},{}]},{},[1]);
lib/view/main/admin-head.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css" media="all">
2
+ @font-face {
3
+ font-family: 'servmask';
4
+ src: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.eot?v=<?php echo AI1WM_VERSION; ?>');
5
+ src: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.eot?v=<?php echo AI1WM_VERSION; ?>#iefix') format('embedded-opentype'),
6
+ url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.woff?v=<?php echo AI1WM_VERSION; ?>') format('woff'),
7
+ url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.ttf?v=<?php echo AI1WM_VERSION; ?>') format('truetype'),
8
+ url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/font/servmask.svg?v=<?php echo AI1WM_VERSION; ?>#servmask') format('svg');
9
+ font-weight: normal;
10
+ font-style: normal;
11
+ }
12
+
13
+ [class^="ai1wm-icon-"], [class*=" ai1wm-icon-"] {
14
+ font-family: 'servmask';
15
+ speak: none;
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ font-variant: normal;
19
+ text-transform: none;
20
+ line-height: 1;
21
+
22
+ /* Better Font Rendering =========== */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ .ai1wm-icon-notification:before {
28
+ content: "\e619";
29
+ }
30
+
31
+ .ai1wm-label {
32
+ border: 1px solid #5cb85c;
33
+ background-color: transparent;
34
+ color: #5cb85c;
35
+ cursor: pointer;
36
+ text-transform: uppercase;
37
+ font-weight: 600;
38
+ outline: none;
39
+ transition: background-color 0.2s ease-out;
40
+ padding: .2em .6em;
41
+ font-size: 0.8em;
42
+ border-radius: 5px;
43
+ text-decoration: none !important;
44
+ }
45
+
46
+ .ai1wm-label:hover {
47
+ background-color: #5cb85c;
48
+ color: #fff;
49
+ }
50
+
51
+ <?php if ( version_compare( $version, '3.8', '<' ) ): ?>
52
+ .toplevel_page_site-migration-export > div.wp-menu-image {
53
+ background: none !important;
54
+ }
55
+
56
+ .toplevel_page_site-migration-export > div.wp-menu-image:before {
57
+ line-height: 27px !important;
58
+ content: '';
59
+ background: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/img/logo.svg') no-repeat center center;
60
+ speak: none !important;
61
+ font-style: normal !important;
62
+ font-weight: normal !important;
63
+ font-variant: normal !important;
64
+ text-transform: none !important;
65
+ margin-left: 7px;
66
+ /* Better Font Rendering =========== */
67
+ -webkit-font-smoothing: antialiased !important;
68
+ -moz-osx-font-smoothing: grayscale !important;
69
+ }
70
+
71
+ <?php else: ?>
72
+ .toplevel_page_site-migration-export > div.wp-menu-image:before {
73
+ position: relative;
74
+ display: inline-block;
75
+ content: '';
76
+ background: url('<?php echo esc_url( AI1WM_URL ); ?>/lib/view/assets/img/logo.svg') no-repeat center center;
77
+ speak: none !important;
78
+ font-style: normal !important;
79
+ font-weight: normal !important;
80
+ font-variant: normal !important;
81
+ text-transform: none !important;
82
+ line-height: 1 !important;
83
+ /* Better Font Rendering =========== */
84
+ -webkit-font-smoothing: antialiased !important;
85
+ -moz-osx-font-smoothing: grayscale !important;
86
+ }
87
+
88
+ .wp-menu-open.toplevel_page_site-migration-export,
89
+ .wp-menu-open.toplevel_page_site-migration-export > a {
90
+ background-color: #111 !important;
91
+ }
92
+
93
+ <?php endif; ?>
94
+ </style>
lib/view/main/backups-notice.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="error">
2
+ <p>
3
+ <?php
4
+ printf(
5
+ __(
6
+ 'All in One WP Migration is not able to create <strong>%s</strong> folder. ' .
7
+ 'You will need to create this folder and grant it read/write/execute permissions (0777) ' .
8
+ 'for the All in One WP Migration plugin to function properly.',
9
+ AI1WM_PLUGIN_NAME
10
+ ),
11
+ AI1WM_BACKUPS_PATH
12
+ )
13
+ ?>
14
+ </p>
15
+ </div>
lib/view/main/get-support.php ADDED
@@ -0,0 +1 @@
 
1
+ <a href="https://servmask.com/help" target="_blank"><?php _e( 'Get Support', AI1WM_PLUGIN_NAME ); ?></a>
lib/view/main/index-notice.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="error">
2
+ <p>
3
+ <?php
4
+ printf(
5
+ __(
6
+ 'All in One WP Migration is not able to create <strong>%s</strong> file. ' .
7
+ 'Try to change permissions of the parent folder or send us an email at ' .
8
+ '<a href="mailto:support@servmask.com">support@servmask.com</a> for assistance.',
9
+ AI1WM_PLUGIN_NAME
10
+ ),
11
+ AI1WM_DIRECTORY_INDEX
12
+ )
13
+ ?>
14
+ </p>
15
+ </div>
lib/view/main/multisite-notice.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="error">
2
+ <p>
3
+ <?php
4
+ _e(
5
+ 'WordPress Multisite is supported via our All in One WP Migration Multisite Extension. ' .
6
+ 'You can get a copy of it here',
7
+ AI1WM_PLUGIN_NAME
8
+ );
9
+ ?>
10
+ <a href="https://servmask.com/products/multisite-extension" target="_blank" class="ai1wm-label">
11
+ <i class="ai1wm-icon-notification"></i>
12
+ <?php _e( 'Get multisite', AI1WM_PLUGIN_NAME ); ?>
13
+ </a>
14
+ </p>
15
+ </div>
lib/view/main/storage-notice.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="error">
2
+ <p>
3
+ <?php
4
+ printf(
5
+ __(
6
+ 'All in One WP Migration is not able to create <strong>%s</strong> folder. ' .
7
+ 'You will need to create this folder and grant it read/write/execute permissions (0777) ' .
8
+ 'for the All in One WP Migration plugin to function properly.',
9
+ AI1WM_PLUGIN_NAME
10
+ ),
11
+ AI1WM_STORAGE_PATH
12
+ )
13
+ ?>
14
+ </p>
15
+ </div>
lib/view/updater/check.php ADDED
@@ -0,0 +1 @@
 
1
+ <a href="<?php echo $url; ?>"><?php _e( 'Check for updates', AI1WM_PLUGIN_NAME ); ?></a>
lib/view/updater/modal.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="ai1wm-modal-dialog-<?php echo $modal; ?>" class="ai1wm-modal-dialog">
2
+ <div class="ai1wm-modal-container">
3
+ <h2><?php _e( 'Enter your Purchase ID', AI1WM_PLUGIN_NAME ); ?></h2>
4
+ <p><?php _e( 'To update your plugin/extension to the latest version, please fill your Purchase ID below.', AI1WM_PLUGIN_NAME ); ?></p>
5
+ <p class="ai1wm-modal-error"></p>
6
+ <p>
7
+ <input type="text" class="ai1wm-purchase-id" placeholder="<?php _e( 'Purchase ID', AI1WM_PLUGIN_NAME ); ?>" />
8
+ <input type="hidden" class="ai1wm-update-link" value="<?php echo $url; ?>" />
9
+ </p>
10
+ <p>
11
+ <?php _e( "Don't have a Purchase ID? You can find your Purchase ID", AI1WM_PLUGIN_NAME ); ?>
12
+ <a href="https://servmask.com/lost-purchase" target="_blank" class="ai1wm-help-link"><?php _e( 'here', AI1WM_PLUGIN_NAME ); ?></a>
13
+ </p>
14
+ <p class="ai1wm-modal-buttons submitbox">
15
+ <button type="button" class="ai1wm-purchase-add ai1wm-button-green">
16
+ <?php _e( 'Save', AI1WM_PLUGIN_NAME ); ?>
17
+ </button>
18
+ <a href="#" class="submitdelete ai1wm-purchase-discard"><?php _e( 'Discard', AI1WM_PLUGIN_NAME ); ?></a>
19
+ </p>
20
+ </div>
21
+ </div>
22
+
23
+ <span id="ai1wm-update-section-<?php echo $modal; ?>">
24
+ <span class="ai1wm-icon-update"></span>
25
+ <?php _e( 'There is an update available. To update, you must enter your', AI1WM_PLUGIN_NAME ); ?>
26
+ <a href="#ai1wm-modal-dialog-<?php echo $modal; ?>"><?php _e( 'Purchase ID', AI1WM_PLUGIN_NAME ); ?></a>.
27
+ </span>
loader.php CHANGED
@@ -136,6 +136,10 @@ require_once AI1WM_CONTROLLER_PATH .
136
  DIRECTORY_SEPARATOR .
137
  'class-ai1wm-report-controller.php';
138
 
 
 
 
 
139
  require_once AI1WM_CONTROLLER_PATH .
140
  DIRECTORY_SEPARATOR .
141
  'class-ai1wm-message-controller.php';
@@ -184,6 +188,10 @@ require_once AI1WM_MODEL_PATH .
184
  DIRECTORY_SEPARATOR .
185
  'class-ai1wm-logger.php';
186
 
 
 
 
 
187
  require_once AI1WM_MODEL_PATH .
188
  DIRECTORY_SEPARATOR .
189
  'class-ai1wm-maintenance.php';
136
  DIRECTORY_SEPARATOR .
137
  'class-ai1wm-report-controller.php';
138
 
139
+ require_once AI1WM_CONTROLLER_PATH .
140
+ DIRECTORY_SEPARATOR .
141
+ 'class-ai1wm-updater-controller.php';
142
+
143
  require_once AI1WM_CONTROLLER_PATH .
144
  DIRECTORY_SEPARATOR .
145
  'class-ai1wm-message-controller.php';
188
  DIRECTORY_SEPARATOR .
189
  'class-ai1wm-logger.php';
190
 
191
+ require_once AI1WM_MODEL_PATH .
192
+ DIRECTORY_SEPARATOR .
193
+ 'class-ai1wm-updater.php';
194
+
195
  require_once AI1WM_MODEL_PATH .
196
  DIRECTORY_SEPARATOR .
197
  'class-ai1wm-maintenance.php';
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: yani.iliev, bangelov, pimjitsawang
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.4
6
- Stable tag: 4.18
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,9 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
75
  3. Plugin Menu
76
 
77
  == Changelog ==
 
 
 
78
  = 4.18 =
79
  * Fixed an issue with large media files
80
  * Fixed an issue with status file being cached
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.4
6
+ Stable tag: 4.19
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
+ = 4.19 =
79
+ * Fixed an issue with options cache
80
+
81
  = 4.18 =
82
  * Fixed an issue with large media files
83
  * Fixed an issue with status file being cached