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
}
46