All-in-One WP Migration - Version 4.18

Version Description

  • Fixed an issue with large media files
  • Fixed an issue with status file being cached
Download this release

Release Info

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

Code changes from version 4.17 to 4.18

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.17
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.18
9
* Text Domain: all-in-one-wp-migration
10
* Domain Path: /languages
11
* Network: True
constants.php CHANGED
@@ -38,7 +38,7 @@ if ( function_exists( 'gethostname' ) && in_array( gethostname(), $local ) ) {
38
// ==================
39
// = Plugin Version =
40
// ==================
41
- define( 'AI1WM_VERSION', '4.17' );
42
43
// ===============
44
// = Plugin Name =
@@ -190,6 +190,11 @@ define( 'AI1WM_AUTH_USER', 'ai1wm_auth_user' );
190
// =================
191
define( 'AI1WM_AUTH_PASSWORD', 'ai1wm_auth_password' );
192
193
// ================
194
// = Messages Key =
195
// ================
38
// ==================
39
// = Plugin Version =
40
// ==================
41
+ define( 'AI1WM_VERSION', '4.18' );
42
43
// ===============
44
// = Plugin Name =
190
// =================
191
define( 'AI1WM_AUTH_PASSWORD', 'ai1wm_auth_password' );
192
193
+ // ==================
194
+ // = Active Plugins =
195
+ // ==================
196
+ define( 'AI1WM_ACTIVE_PLUGINS', 'active_plugins' );
197
+
198
// ================
199
// = Messages Key =
200
// ================
functions.php CHANGED
@@ -42,3 +42,53 @@ function ai1wm_urlencode( $value ) {
42
function ai1wm_urldecode( $value ) {
43
return is_array( $value ) ? array_map( 'ai1wm_urldecode', $value ) : urldecode( stripslashes( $value ) );
44
}
42
function ai1wm_urldecode( $value ) {
43
return is_array( $value ) ? array_map( 'ai1wm_urldecode', $value ) : urldecode( stripslashes( $value ) );
44
}
45
+
46
+ /**
47
+ * Get active plugins
48
+ *
49
+ * @param array $plugins List of plugins
50
+ * @return array
51
+ */
52
+ function ai1wm_active_plugins( $plugins = array() ) {
53
+ // WP Migration Plugin
54
+ if ( defined( 'AI1WM_PLUGIN_BASENAME' ) ) {
55
+ $plugins[] = AI1WM_PLUGIN_BASENAME;
56
+ }
57
+
58
+ // Dropbox Extension
59
+ if ( defined( 'AI1WMDE_PLUGIN_BASENAME' ) ) {
60
+ $plugins[] = AI1WMDE_PLUGIN_BASENAME;
61
+ }
62
+
63
+ // Google Drive Extension
64
+ if ( defined( 'AI1WMGE_PLUGIN_BASENAME' ) ) {
65
+ $plugins[] = AI1WMGE_PLUGIN_BASENAME;
66
+ }
67
+
68
+ // Amazon S3 Extension
69
+ if ( defined( 'AI1WMSE_PLUGIN_BASENAME' ) ) {
70
+ $plugins[] = AI1WMSE_PLUGIN_BASENAME;
71
+ }
72
+
73
+ // Multisite Extension
74
+ if ( defined( 'AI1WMME_PLUGIN_BASENAME' ) ) {
75
+ $plugins[] = AI1WMME_PLUGIN_BASENAME;
76
+ }
77
+
78
+ // Unlimited Extension
79
+ if ( defined( 'AI1WMUE_PLUGIN_BASENAME' ) ) {
80
+ $plugins[] = AI1WMUE_PLUGIN_BASENAME;
81
+ }
82
+
83
+ // FTP Extension
84
+ if ( defined( 'AI1WMFE_PLUGIN_BASENAME' ) ) {
85
+ $plugins[] = AI1WMFE_PLUGIN_BASENAME;
86
+ }
87
+
88
+ // URL Extension
89
+ if ( defined( 'AI1WMLE_PLUGIN_BASENAME' ) ) {
90
+ $plugins[] = AI1WMLE_PLUGIN_BASENAME;
91
+ }
92
+
93
+ return $plugins;
94
+ }
lib/controller/class-ai1wm-export-controller.php CHANGED
@@ -38,6 +38,10 @@ class Ai1wm_Export_Controller {
38
}
39
40
public static function export( $args = array() ) {
41
try {
42
43
// Set arguments
38
}
39
40
public static function export( $args = array() ) {
41
+
42
+ // Set error handler
43
+ @set_error_handler( 'Ai1wm_Log::error_handler' );
44
+
45
try {
46
47
// Set arguments
lib/controller/class-ai1wm-import-controller.php CHANGED
@@ -29,6 +29,10 @@ class Ai1wm_Import_Controller {
29
}
30
31
public static function import( $args = array() ) {
32
try {
33
34
// Set arguments
29
}
30
31
public static function import( $args = array() ) {
32
+
33
+ // Set error handler
34
+ @set_error_handler( 'Ai1wm_Log::error_handler' );
35
+
36
try {
37
38
// Set arguments
lib/controller/class-ai1wm-main-controller.php CHANGED
@@ -31,14 +31,7 @@ class Ai1wm_Main_Controller {
31
* @return Ai1wm_Main_Controller
32
*/
33
public function __construct() {
34
- // Start by setting error and exception handlers
35
- @set_error_handler( 'Ai1wm_Log::error_handler' );
36
-
37
- register_activation_hook(
38
- AI1WM_PLUGIN_BASENAME,
39
- array( $this, 'activation_hook' )
40
- );
41
-
42
43
// Activate hooks
44
$this->activate_actions()
@@ -575,7 +568,8 @@ class Ai1wm_Main_Controller {
575
'url' => wp_make_link_relative( admin_url( 'admin-ajax.php?action=ai1wm_export' ) ),
576
),
577
'status' => array(
578
- 'url' => wp_make_link_relative( AI1WM_STORAGE_URL ),
579
),
580
'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
581
) );
@@ -685,7 +679,8 @@ class Ai1wm_Main_Controller {
685
'url' => wp_make_link_relative( admin_url( 'admin-ajax.php?action=ai1wm_import' ) ),
686
),
687
'status' => array(
688
- 'url' => wp_make_link_relative( AI1WM_STORAGE_URL ),
689
),
690
'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
691
'oversize' => sprintf(
31
* @return Ai1wm_Main_Controller
32
*/
33
public function __construct() {
34
+ register_activation_hook( AI1WM_PLUGIN_BASENAME, array( $this, 'activation_hook' ) );
35
36
// Activate hooks
37
$this->activate_actions()
568
'url' => wp_make_link_relative( admin_url( 'admin-ajax.php?action=ai1wm_export' ) ),
569
),
570
'status' => array(
571
+ 'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
572
+ 'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
573
),
574
'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
575
) );
679
'url' => wp_make_link_relative( admin_url( 'admin-ajax.php?action=ai1wm_import' ) ),
680
),
681
'status' => array(
682
+ 'php' => wp_make_link_relative( plugins_url( 'status.php', AI1WM_PLUGIN_BASENAME ) ),
683
+ 'js' => wp_make_link_relative( plugins_url( 'storage/status.js', AI1WM_PLUGIN_BASENAME ) ),
684
),
685
'secret_key' => get_site_option( AI1WM_SECRET_KEY, false, false ),
686
'oversize' => sprintf(
lib/controller/class-ai1wm-resolve-controller.php CHANGED
@@ -27,6 +27,9 @@ class Ai1wm_Resolve_Controller {
27
28
public static function resolve( $args = array() ) {
29
30
// Set arguments
31
if ( empty( $args ) ) {
32
$args = ai1wm_urldecode( $_REQUEST );
27
28
public static function resolve( $args = array() ) {
29
30
+ // Set error handler
31
+ @set_error_handler( 'Ai1wm_Log::error_handler' );
32
+
33
// Set arguments
34
if ( empty( $args ) ) {
35
$args = ai1wm_urldecode( $_REQUEST );
lib/model/class-ai1wm-export-abstract.php CHANGED
@@ -46,10 +46,8 @@ abstract class Ai1wm_Export_Abstract {
46
public function start() {
47
// Set default progress
48
Ai1wm_Status::set( array(
49
- 'total' => 0,
50
- 'processed' => 0,
51
- 'type' => 'info',
52
- 'message' => __( 'Creating an empty archive...', AI1WM_PLUGIN_NAME )
53
) );
54
55
// Get package file
@@ -65,6 +63,7 @@ abstract class Ai1wm_Export_Abstract {
65
66
// Set progress
67
Ai1wm_Status::set( array(
68
'message' => __( 'Done creating an empty archive.', AI1WM_PLUGIN_NAME )
69
) );
70
@@ -80,6 +79,7 @@ abstract class Ai1wm_Export_Abstract {
80
public function enumerate() {
81
// Set progress
82
Ai1wm_Status::set( array(
83
'message' => __( 'Retrieving a list of all WordPress files...', AI1WM_PLUGIN_NAME )
84
) );
85
@@ -144,11 +144,15 @@ abstract class Ai1wm_Export_Abstract {
144
}
145
}
146
147
fclose( $filemap );
148
149
// Set progress
150
Ai1wm_Status::set( array(
151
- 'total' => $total,
152
'message' => __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME )
153
) );
154
@@ -162,17 +166,44 @@ abstract class Ai1wm_Export_Abstract {
162
* @return void
163
*/
164
public function content() {
165
- // Total and processed files
166
- $total = (int) Ai1wm_Status::get( 'total' );
167
- $processed = (int) Ai1wm_Status::get( 'processed' );
168
169
// What percent of files have we processed?
170
- $progress = @(int) ( ( $processed / $total ) * 100 );
171
172
// Set progress
173
- Ai1wm_Status::set( array(
174
- 'message' => sprintf( __( 'Archiving %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total, $progress )
175
- ) );
176
177
// Get map file
178
$filemap = fopen( $this->storage()->filemap(), 'r' );
@@ -184,24 +215,59 @@ abstract class Ai1wm_Export_Abstract {
184
$completed = true;
185
186
// Set file map pointer at the current index
187
- if ( fseek( $filemap, $this->pointer() ) !== -1 ) {
188
// Get archive
189
$archive = new Ai1wm_Compressor( $this->storage()->archive() );
190
191
while ( $path = trim( fgets( $filemap ) ) ) {
192
try {
193
// Add file to archive
194
- $archive->add_file( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path, $path );
195
} catch ( Exception $e ) {
196
// Skip bad file permissions
197
}
198
199
$processed++;
200
201
- // time elapsed
202
- $time = microtime( true ) - $start;
203
-
204
- if ( $time > 3 ) {
205
// More than 3 seconds have passed, break and do another request
206
$completed = false;
207
break;
@@ -211,17 +277,20 @@ abstract class Ai1wm_Export_Abstract {
211
$archive->close();
212
}
213
214
- // Set new file map pointer
215
- $this->pointer( ftell( $filemap ) );
216
217
- fclose( $filemap );
218
219
- // Set progress
220
- Ai1wm_Status::set( array( 'processed' => $processed ) );
221
222
// Redirect
223
if ( $completed ) {
224
- // Redirect
225
$this->route_to( 'database' );
226
} else {
227
$this->route_to( 'content' );
@@ -244,7 +313,10 @@ abstract class Ai1wm_Export_Abstract {
244
}
245
246
// Set progress
247
- Ai1wm_Status::set( array( 'message' => __( 'Exporting database...', AI1WM_PLUGIN_NAME ) ) );
248
249
// Get databsae file
250
$service = new Ai1wm_Service_Database( $this->args );
@@ -258,7 +330,10 @@ abstract class Ai1wm_Export_Abstract {
258
$archive->close();
259
260
// Set progress
261
- Ai1wm_Status::set( array( 'message' => __( 'Done exporting database.', AI1WM_PLUGIN_NAME ) ) );
262
263
// Disable maintenance mode
264
Ai1wm_Maintenance::disable();
@@ -311,22 +386,6 @@ abstract class Ai1wm_Export_Abstract {
311
return $this->storage;
312
}
313
314
- /**
315
- * Get filemap pointer or set new one
316
- *
317
- * @param int $pointer Set new file pointer
318
- * @return int
319
- */
320
- protected function pointer( $pointer = null ) {
321
- if ( ! isset( $this->args['pointer'] ) ) {
322
- $this->args['pointer'] = 0;
323
- } else if ( ! is_null( $pointer ) ) {
324
- $this->args['pointer'] = $pointer;
325
- }
326
-
327
- return (int) $this->args['pointer'];
328
- }
329
-
330
/**
331
* Get file name
332
*
46
public function start() {
47
// Set default progress
48
Ai1wm_Status::set( array(
49
+ 'type' => 'info',
50
+ 'message' => __( 'Creating an empty archive...', AI1WM_PLUGIN_NAME )
51
) );
52
53
// Get package file
63
64
// Set progress
65
Ai1wm_Status::set( array(
66
+ 'type' => 'info',
67
'message' => __( 'Done creating an empty archive.', AI1WM_PLUGIN_NAME )
68
) );
69
79
public function enumerate() {
80
// Set progress
81
Ai1wm_Status::set( array(
82
+ 'type' => 'info',
83
'message' => __( 'Retrieving a list of all WordPress files...', AI1WM_PLUGIN_NAME )
84
) );
85
144
}
145
}
146
147
+ // Close handler
148
fclose( $filemap );
149
150
+ // Set total files
151
+ $this->args['total'] = $total;
152
+
153
// Set progress
154
Ai1wm_Status::set( array(
155
+ 'type' => 'info',
156
'message' => __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME )
157
) );
158
166
* @return void
167
*/
168
public function content() {
169
+ // Set content offset
170
+ if ( isset( $this->args['content_offset'] ) ) {
171
+ $content_offset = $this->args['content_offset'];
172
+ } else {
173
+ $content_offset = 0;
174
+ }
175
+
176
+ // Set filemap offset
177
+ if ( isset( $this->args['filemap_offset'] ) ) {
178
+ $filemap_offset = $this->args['filemap_offset'];
179
+ } else {
180
+ $filemap_offset = 0;
181
+ }
182
+
183
+ // Set total files
184
+ if ( isset( $this->args['total'] ) ) {
185
+ $total = $this->args['total'];
186
+ } else {
187
+ $total = 1;
188
+ }
189
+
190
+ // Set processed files
191
+ if ( isset( $this->args['processed'] ) ) {
192
+ $processed = $this->args['processed'];
193
+ } else {
194
+ $processed = 0;
195
+ }
196
197
// What percent of files have we processed?
198
+ $progress = (int) ( ( $processed / $total ) * 100 );
199
200
// Set progress
201
+ if ( empty( $content_offset ) ) {
202
+ Ai1wm_Status::set( array(
203
+ 'type' => 'info',
204
+ 'message' => sprintf( __( 'Archiving %d files...<br />%.2f%% complete', AI1WM_PLUGIN_NAME ), $total, $progress )
205
+ ) );
206
+ }
207
208
// Get map file
209
$filemap = fopen( $this->storage()->filemap(), 'r' );
215
$completed = true;
216
217
// Set file map pointer at the current index
218
+ if ( fseek( $filemap, $filemap_offset ) !== -1 ) {
219
+
220
// Get archive
221
$archive = new Ai1wm_Compressor( $this->storage()->archive() );
222
223
while ( $path = trim( fgets( $filemap ) ) ) {
224
try {
225
+
226
+ // Set absolute path
227
+ $abs_path = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $path;
228
+
229
// Add file to archive
230
+ if ( ( $content_offset = $archive->add_file( $abs_path, $path, $content_offset, 3 ) ) ) {
231
+
232
+ // Set progress
233
+ if ( ( $sub_progress = ( $content_offset / $archive->get_current_filesize() ) ) < 1 ) {
234
+ $progress += $sub_progress;
235
+ }
236
+
237
+ // Set progress
238
+ Ai1wm_Status::set( array(
239
+ 'type' => 'info',
240
+ 'message' => sprintf( __( 'Archiving %d files...<br />%.2f%% complete', AI1WM_PLUGIN_NAME ), $total, $progress )
241
+ ) );
242
+
243
+ // Set content offset
244
+ $this->args['content_offset'] = $content_offset;
245
+
246
+ // Set filemap offset
247
+ $this->args['filemap_offset'] = $filemap_offset;
248
+
249
+ // Close the filemap file
250
+ fclose( $filemap );
251
+
252
+ // Redirect
253
+ return $this->route_to( 'content' );
254
+
255
+ }
256
+
257
+ // Set content offset
258
+ $content_offset = 0;
259
+
260
+ // Set filemap offset
261
+ $filemap_offset = ftell( $filemap );
262
+
263
} catch ( Exception $e ) {
264
// Skip bad file permissions
265
}
266
267
$processed++;
268
269
+ // Time elapsed
270
+ if ( ( microtime( true ) - $start ) > 3 ) {
271
// More than 3 seconds have passed, break and do another request
272
$completed = false;
273
break;
277
$archive->close();
278
}
279
280
+ // Set content offset
281
+ $this->args['content_offset'] = $content_offset;
282
283
+ // Set filemap offset
284
+ $this->args['filemap_offset'] = $filemap_offset;
285
286
+ // Set processed files
287
+ $this->args['processed'] = $processed;
288
+
289
+ // Close the filemap file
290
+ fclose( $filemap );
291
292
// Redirect
293
if ( $completed ) {
294
$this->route_to( 'database' );
295
} else {
296
$this->route_to( 'content' );
313
}
314
315
// Set progress
316
+ Ai1wm_Status::set( array(
317
+ 'type' => 'info',
318
+ 'message' => __( 'Exporting database...', AI1WM_PLUGIN_NAME )
319
+ ) );
320
321
// Get databsae file
322
$service = new Ai1wm_Service_Database( $this->args );
330
$archive->close();
331
332
// Set progress
333
+ Ai1wm_Status::set( array(
334
+ 'type' => 'info',
335
+ 'message' => __( 'Done exporting database.', AI1WM_PLUGIN_NAME )
336
+ ) );
337
338
// Disable maintenance mode
339
Ai1wm_Maintenance::disable();
386
return $this->storage;
387
}
388
389
/**
390
* Get file name
391
*
lib/model/class-ai1wm-export-file.php CHANGED
@@ -27,7 +27,10 @@ class Ai1wm_Export_File extends Ai1wm_Export_Abstract {
27
28
public function export() {
29
// Set progress
30
- Ai1wm_Status::set( array( 'message' => __( 'Renaming exported file...', AI1WM_PLUGIN_NAME ) ) );
31
32
// Close achive file
33
$archive = new Ai1wm_Compressor( $this->storage()->archive() );
@@ -37,27 +40,23 @@ class Ai1wm_Export_File extends Ai1wm_Export_Abstract {
37
38
// Rename archive file
39
if ( rename( $this->storage()->archive(), $this->storage()->backup() ) ) {
40
-
41
// Set progress
42
- Ai1wm_Status::set(
43
- array(
44
- 'type' => 'download',
45
- 'message' => sprintf(
46
- __(
47
- '<a href="%s/%s" class="ai1wm-button-green ai1wm-emphasize">' .
48
- '<span>Download %s</span>' .
49
- '<em>Size: %s</em>' .
50
- '</a>',
51
- AI1WM_PLUGIN_NAME
52
- ),
53
- AI1WM_BACKUPS_URL,
54
- basename( $this->storage()->backup() ),
55
- parse_url( home_url(), PHP_URL_HOST ),
56
- size_format( filesize( $this->storage()->backup() ) )
57
- )
58
- ),
59
- $this->storage()->status() // status.js file
60
- );
61
}
62
}
63
}
27
28
public function export() {
29
// Set progress
30
+ Ai1wm_Status::set( array(
31
+ 'type' => 'info',
32
+ 'message' => __( 'Renaming exported file...', AI1WM_PLUGIN_NAME )
33
+ ) );
34
35
// Close achive file
36
$archive = new Ai1wm_Compressor( $this->storage()->archive() );
40
41
// Rename archive file
42
if ( rename( $this->storage()->archive(), $this->storage()->backup() ) ) {
43
// Set progress
44
+ Ai1wm_Status::set( array(
45
+ 'type' => 'download',
46
+ 'message' => sprintf(
47
+ __(
48
+ '<a href="%s/%s" class="ai1wm-button-green ai1wm-emphasize">' .
49
+ '<span>Download %s</span>' .
50
+ '<em>Size: %s</em>' .
51
+ '</a>',
52
+ AI1WM_PLUGIN_NAME
53
+ ),
54
+ AI1WM_BACKUPS_URL,
55
+ basename( $this->storage()->backup() ),
56
+ parse_url( home_url(), PHP_URL_HOST ),
57
+ size_format( filesize( $this->storage()->backup() ) )
58
+ )
59
+ ) );
60
}
61
}
62
}
lib/model/class-ai1wm-http.php CHANGED
@@ -138,13 +138,14 @@ class Ai1wm_Http {
138
139
// HTTP request
140
remove_all_filters( 'http_request_args' );
141
- wp_remote_get(
142
- add_query_arg( ai1wm_urlencode( $params ), $url ),
143
array(
144
'timeout' => apply_filters( 'ai1wm_http_timeout', 5 ),
145
'blocking' => false,
146
'sslverify' => false,
147
'headers' => $headers,
148
)
149
);
150
}
138
139
// HTTP request
140
remove_all_filters( 'http_request_args' );
141
+ wp_remote_post(
142
+ $url,
143
array(
144
'timeout' => apply_filters( 'ai1wm_http_timeout', 5 ),
145
'blocking' => false,
146
'sslverify' => false,
147
'headers' => $headers,
148
+ 'body' => $params,
149
)
150
);
151
}
lib/model/class-ai1wm-import-abstract.php CHANGED
@@ -46,10 +46,8 @@ abstract class Ai1wm_Import_Abstract {
46
public function start() {
47
// Set default progress
48
Ai1wm_Status::set( array(
49
- 'total' => 0,
50
- 'processed' => 0,
51
- 'type' => 'info',
52
- 'message' => __( 'Unpacking archive...', AI1WM_PLUGIN_NAME ),
53
) );
54
55
// Open the archive file for reading
@@ -151,18 +149,17 @@ abstract class Ai1wm_Import_Abstract {
151
// Open the archive file for reading
152
$archive = new Ai1wm_Extractor( $this->storage()->archive() );
153
154
- // Unpack package.json and database.sql files
155
$total = $archive->get_number_of_files();
156
157
- // Substract database.sql and package.json
158
- $total -= 2;
159
-
160
- // close the archive file
161
$archive->close();
162
163
// Set progress
164
Ai1wm_Status::set( array(
165
- 'total' => $total,
166
'type' => 'info',
167
'message' => __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME ),
168
) );
@@ -190,16 +187,44 @@ abstract class Ai1wm_Import_Abstract {
190
* @return void
191
*/
192
public function content() {
193
- // Total and processed files
194
- $total = Ai1wm_Status::get( 'total' );
195
- $processed = Ai1wm_Status::get( 'processed' );
196
- $progress = (int) ( ( $processed / $total ) * 100 ) or $progress = 4;
197
198
// Set progress
199
- Ai1wm_Status::set( array(
200
- 'type' => 'info',
201
- 'message' => sprintf( __( 'Restoring %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total, $progress ),
202
- ) );
203
204
// Start time
205
$start = microtime( true );
@@ -211,15 +236,45 @@ abstract class Ai1wm_Import_Abstract {
211
$archive = new Ai1wm_Extractor( $this->storage()->archive() );
212
213
// Set the file pointer to the one that we have saved
214
- $archive->set_file_pointer( null, $this->pointer() );
215
216
while ( $archive->has_not_reached_eof() ) {
217
try {
218
- // Extract a file from archive to wp_content_dir
219
- $archive->extract_one_file_to( WP_CONTENT_DIR, array(
220
- AI1WM_PACKAGE_NAME,
221
- AI1WM_DATABASE_NAME,
222
- ) );
223
} catch ( Exception $e ) {
224
// Skip bad file permissions
225
}
@@ -227,26 +282,26 @@ abstract class Ai1wm_Import_Abstract {
227
// Increment processed files counter
228
$processed++;
229
230
- // We are only extracting files for 5 seconds at a time
231
- $time = microtime( true ) - $start;
232
- if ( $time > 5 ) {
233
- // More than 5 seconds have passed, break and do another request
234
$completed = false;
235
break;
236
}
237
}
238
239
- // Set new file map pointer
240
- $this->pointer( $archive->get_file_pointer() );
241
242
// Close the archive file
243
$archive->close();
244
245
- // Set progress
246
- Ai1wm_Status::set( array(
247
- 'processed' => $processed,
248
- ) );
249
-
250
// Redirect
251
if ( $completed ) {
252
$this->route_to( 'database' );
@@ -268,6 +323,7 @@ abstract class Ai1wm_Import_Abstract {
268
269
// Display progress
270
Ai1wm_Status::set( array(
271
'message' => __( 'Restoring database...', AI1WM_PLUGIN_NAME ),
272
) );
273
@@ -359,22 +415,6 @@ abstract class Ai1wm_Import_Abstract {
359
return $this->storage;
360
}
361
362
- /**
363
- * Get filemap pointer or set new one
364
- *
365
- * @param int $pointer Set new file pointer
366
- * @return int
367
- */
368
- protected function pointer( $pointer = null ) {
369
- if ( ! isset( $this->args['pointer'] ) ) {
370
- $this->args['pointer'] = 0;
371
- } else if ( ! is_null( $pointer ) ) {
372
- $this->args['pointer'] = $pointer;
373
- }
374
-
375
- return (int) $this->args['pointer'];
376
- }
377
-
378
/**
379
* Route to method
380
*
46
public function start() {
47
// Set default progress
48
Ai1wm_Status::set( array(
49
+ 'type' => 'info',
50
+ 'message' => __( 'Unpacking archive...', AI1WM_PLUGIN_NAME ),
51
) );
52
53
// Open the archive file for reading
149
// Open the archive file for reading
150
$archive = new Ai1wm_Extractor( $this->storage()->archive() );
151
152
+ // Get number of files
153
$total = $archive->get_number_of_files();
154
155
+ // Close the archive file
156
$archive->close();
157
158
+ // Set total
159
+ $this->args['total'] = $total;
160
+
161
// Set progress
162
Ai1wm_Status::set( array(
163
'type' => 'info',
164
'message' => __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME ),
165
) );
187
* @return void
188
*/
189
public function content() {
190
+ // Set content offset
191
+ if ( isset( $this->args['content_offset'] ) ) {
192
+ $content_offset = $this->args['content_offset'];
193
+ } else {
194
+ $content_offset = 0;
195
+ }
196
+
197
+ // Set archive offset
198
+ if ( isset( $this->args['archive_offset']) ) {
199
+ $archive_offset = $this->args['archive_offset'];
200
+ } else {
201
+ $archive_offset = 0;
202
+ }
203
+
204
+ // Set total files
205
+ if ( isset( $this->args['total'] ) ) {
206
+ $total = $this->args['total'];
207
+ } else {
208
+ $total = 1;
209
+ }
210
+
211
+ // Set processed files
212
+ if ( isset( $this->args['processed'] ) ) {
213
+ $processed = $this->args['processed'];
214
+ } else {
215
+ $processed = 0;
216
+ }
217
+
218
+ // What percent of files have we processed?
219
+ $progress = (int) ( ( $processed / $total ) * 100 );
220
221
// Set progress
222
+ if ( empty( $content_offset ) ) {
223
+ Ai1wm_Status::set( array(
224
+ 'type' => 'info',
225
+ 'message' => sprintf( __( 'Restoring %d files...<br />%.2f%% complete', AI1WM_PLUGIN_NAME ), $total, $progress ),
226
+ ) );
227
+ }
228
229
// Start time
230
$start = microtime( true );
236
$archive = new Ai1wm_Extractor( $this->storage()->archive() );
237
238
// Set the file pointer to the one that we have saved
239
+ $archive->set_file_pointer( null, $archive_offset );
240
241
while ( $archive->has_not_reached_eof() ) {
242
try {
243
+
244
+ // Extract a file from archive to WP_CONTENT_DIR
245
+ if ( ( $content_offset = $archive->extract_one_file_to( WP_CONTENT_DIR, array( AI1WM_PACKAGE_NAME, AI1WM_DATABASE_NAME ), $content_offset, 3 ) ) ) {
246
+
247
+ // Set progress
248
+ if ( ( $sub_progress = ( $content_offset / $archive->get_current_filesize() ) ) < 1 ) {
249
+ $progress += $sub_progress;
250
+ }
251
+
252
+ // Set progress
253
+ Ai1wm_Status::set( array(
254
+ 'type' => 'info',
255
+ 'message' => sprintf( __( 'Restoring %d files...<br />%.2f%% complete', AI1WM_PLUGIN_NAME ), $total, $progress ),
256
+ ) );
257
+
258
+ // Set content offset
259
+ $this->args['content_offset'] = $content_offset;
260
+
261
+ // Set archive offset
262
+ $this->args['archive_offset'] = $archive_offset;
263
+
264
+ // Close the archive file
265
+ $archive->close();
266
+
267
+ // Redirect
268
+ return $this->route_to( 'content' );
269
+
270
+ }
271
+
272
+ // Set content offset
273
+ $content_offset = 0;
274
+
275
+ // Set archive offset
276
+ $archive_offset = $archive->get_file_pointer();
277
+
278
} catch ( Exception $e ) {
279
// Skip bad file permissions
280
}
282
// Increment processed files counter
283
$processed++;
284
285
+ // Time elapsed
286
+ if ( ( microtime( true ) - $start ) > 3 ) {
287
+ // More than 3 seconds have passed, break and do another request
288
$completed = false;
289
break;
290
}
291
}
292
293
+ // Set content offset
294
+ $this->args['content_offset'] = $content_offset;
295
+
296
+ // Set archive offset
297
+ $this->args['archive_offset'] = $archive_offset;
298
+
299
+ // Set processed files
300
+ $this->args['processed'] = $processed;
301
302
// Close the archive file
303
$archive->close();
304
305
// Redirect
306
if ( $completed ) {
307
$this->route_to( 'database' );
323
324
// Display progress
325
Ai1wm_Status::set( array(
326
+ 'type' => 'info',
327
'message' => __( 'Restoring database...', AI1WM_PLUGIN_NAME ),
328
) );
329
415
return $this->storage;
416
}
417
418
/**
419
* Route to method
420
*
lib/model/class-ai1wm-log.php CHANGED
@@ -92,23 +92,19 @@ class Ai1wm_Log {
92
* @return void
93
*/
94
public static function error_handler( $errno, $errstr, $errfile, $errline ) {
95
- // Only log errors and warnings
96
- if ( in_array( $errno, array( E_ERROR, E_WARNING ) ) ) {
97
- // Build message array
98
- $message = array();
99
-
100
- // Add an empty line
101
- $message[] = '';
102
- $message[] = 'Number: ' . $errno;
103
- $message[] = 'Message: ' . $errstr;
104
- $message[] = 'File: ' . $errfile;
105
- $message[] = 'Line: ' . $errline;
106
- $message[] = '--------------------------------------------';
107
-
108
- $message = implode( PHP_EOL, $message );
109
-
110
- self::write( $message, 'ERROR_HANDLER' );
111
- }
112
}
113
114
/**
92
* @return void
93
*/
94
public static function error_handler( $errno, $errstr, $errfile, $errline ) {
95
+ $message = array();
96
+
97
+ // Add an empty line
98
+ $message[] = '';
99
+ $message[] = 'Number: ' . $errno;
100
+ $message[] = 'Message: ' . $errstr;
101
+ $message[] = 'File: ' . $errfile;
102
+ $message[] = 'Line: ' . $errline;
103
+ $message[] = '--------------------------------------------';
104
+
105
+ $message = implode( PHP_EOL, $message );
106
+
107
+ self::write( $message, 'ERROR_HANDLER' );
108
}
109
110
/**
lib/model/service/class-ai1wm-service-database.php CHANGED
@@ -150,20 +150,23 @@ class Ai1wm_Service_Database implements Ai1wm_Service_Interface {
150
$user = array();
151
}
152
153
- // Get HTTP user
154
- $auth_user = get_site_option( AI1WM_AUTH_USER, false, false );
155
156
- // Get HTTP password
157
- $auth_password = get_site_option( AI1WM_AUTH_PASSWORD, false, false );
158
159
// Get secret key
160
$secret_key = get_site_option( AI1WM_SECRET_KEY, false, false );
161
162
- // Get URL IP
163
- $url_ip = get_site_option( AI1WM_URL_IP, false, false );
164
165
- // Get URL transport
166
- $url_transport = get_site_option( AI1WM_URL_TRANSPORT, false, false );
167
168
// Get database client
169
$client = MysqlDumpFactory::makeMysqlDump( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
@@ -188,44 +191,11 @@ class Ai1wm_Service_Database implements Ai1wm_Service_Interface {
188
// Clear WP options cache
189
wp_cache_flush();
190
191
- // WP Migration
192
- if ( is_plugin_active( AI1WM_PLUGIN_BASENAME ) ) {
193
- activate_plugin( AI1WM_PLUGIN_BASENAME );
194
- }
195
-
196
- // Dropbox Extension
197
- if ( is_plugin_active( AI1WMDE_PLUGIN_BASENAME ) ) {
198
- activate_plugin( AI1WMDE_PLUGIN_BASENAME );
199
- }
200
-
201
- // Google Drive Extension
202
- if ( is_plugin_active( AI1WMGE_PLUGIN_BASENAME ) ) {
203
- activate_plugin( AI1WMGE_PLUGIN_BASENAME );
204
- }
205
-
206
- // Amazon S3 Extension
207
- if ( is_plugin_active( AI1WMSE_PLUGIN_BASENAME ) ) {
208
- activate_plugin( AI1WMSE_PLUGIN_BASENAME );
209
- }
210
-
211
- // Multisite Extension
212
- if ( is_plugin_active( AI1WMME_PLUGIN_BASENAME ) ) {
213
- activate_plugin( AI1WMME_PLUGIN_BASENAME );
214
- }
215
-
216
- // Unlimited Extension
217
- if ( is_plugin_active( AI1WMUE_PLUGIN_BASENAME ) ) {
218
- activate_plugin( AI1WMUE_PLUGIN_BASENAME );
219
- }
220
-
221
- // FTP Extension
222
- if ( is_plugin_active( AI1WMFE_PLUGIN_BASENAME ) ) {
223
- activate_plugin( AI1WMFE_PLUGIN_BASENAME );
224
- }
225
-
226
- // URL Extension
227
- if ( is_plugin_active( AI1WMLE_PLUGIN_BASENAME ) ) {
228
- activate_plugin( AI1WMLE_PLUGIN_BASENAME );
229
}
230
231
// Set new user identity
@@ -257,20 +227,20 @@ class Ai1wm_Service_Database implements Ai1wm_Service_Interface {
257
}
258
}
259
260
- // Set the new HTTP user
261
- update_site_option( AI1WM_AUTH_USER, $auth_user );
262
263
- // Set the new HTTP password
264
- update_site_option( AI1WM_AUTH_PASSWORD, $auth_password );
265
266
// Set the new secret key value
267
update_site_option( AI1WM_SECRET_KEY, $secret_key );
268
269
- // Set the new URL IP
270
- update_site_option( AI1WM_URL_IP, $url_ip );
271
272
- // Set the new URL transport
273
- update_site_option( AI1WM_URL_TRANSPORT, $url_transport );
274
}
275
276
/**
150
$user = array();
151
}
152
153
+ // Get URL IP
154
+ $url_ip = get_site_option( AI1WM_URL_IP, false, false );
155
156
+ // Get URL transport
157
+ $url_transport = get_site_option( AI1WM_URL_TRANSPORT, false, false );
158
159
// Get secret key
160
$secret_key = get_site_option( AI1WM_SECRET_KEY, false, false );
161
162
+ // Get HTTP user
163
+ $auth_user = get_site_option( AI1WM_AUTH_USER, false, false );
164
165
+ // Get HTTP password
166
+ $auth_password = get_site_option( AI1WM_AUTH_PASSWORD, false, false );
167
+
168
+ // Get active plugins
169
+ $active_plugins = get_site_option( AI1WM_ACTIVE_PLUGINS, array(), false );
170
171
// Get database client
172
$client = MysqlDumpFactory::makeMysqlDump( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
191
// Clear WP options cache
192
wp_cache_flush();
193
194
+ // Activate plugins
195
+ foreach ( $active_plugins as $plugin ) {
196
+ if ( in_array( $plugin, ai1wm_active_plugins() ) ) {
197
+ activate_plugin( $plugin );
198
+ }
199
}
200
201
// Set new user identity
227
}
228
}
229
230
+ // Set the new URL IP
231
+ update_site_option( AI1WM_URL_IP, $url_ip );
232
233
+ // Set the new URL transport
234
+ update_site_option( AI1WM_URL_TRANSPORT, $url_transport );
235
236
// Set the new secret key value
237
update_site_option( AI1WM_SECRET_KEY, $secret_key );
238
239
+ // Set the new HTTP user
240
+ update_site_option( AI1WM_AUTH_USER, $auth_user );
241
242
+ // Set the new HTTP password
243
+ update_site_option( AI1WM_AUTH_PASSWORD, $auth_password );
244
}
245
246
/**
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 length of file contents
34
* mtime 269 12 last modification time
35
* prefix 281 4096 path name, no trailing slashes
36
*
@@ -38,7 +38,7 @@ abstract class Ai1wm_Archiver {
38
*/
39
protected $block_format = array(
40
'a255', // filename
41
- 'a14', // length of file contents
42
'a12', // last time modified
43
'a4096' // path
44
);
@@ -57,6 +57,13 @@ abstract class Ai1wm_Archiver {
57
*/
58
protected $file_handle = null;
59
60
/**
61
* End Of File block string
62
*
@@ -147,8 +154,8 @@ abstract class Ai1wm_Archiver {
147
* Write data to a handle and check if the data has been written
148
*
149
* @param resource $handle File handle
150
- * @param string $data Data to be written - binary
151
- * @param string $file Filename that the file handle belongs to
152
*
153
* @throws \Ai1wm_Not_Writable_Exception
154
*/
@@ -163,8 +170,8 @@ abstract class Ai1wm_Archiver {
163
* Read data from a handle
164
*
165
* @param resource $handle File handle
166
- * @param int size Length of data to be read in bytes
167
- * @param string $file Filename that the file handle belongs to
168
*
169
* @return string Content that was read
170
* @throws \Ai1wm_Not_Readable_Exception
@@ -178,7 +185,6 @@ abstract class Ai1wm_Archiver {
178
return $result;
179
}
180
181
-
182
/**
183
* Appends end of file block to the archive
184
*
@@ -188,6 +194,15 @@ abstract class Ai1wm_Archiver {
188
$this->write_to_handle( $this->file_handle, $this->eof, $this->filename );
189
}
190
191
/**
192
* Closes the archive file
193
*
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
*
38
*/
39
protected $block_format = array(
40
'a255', // filename
41
+ 'a14', // size of file contents
42
'a12', // last time modified
43
'a4096' // path
44
);
57
*/
58
protected $file_handle = null;
59
60
+ /**
61
+ * Current file size
62
+ *
63
+ * @type int
64
+ */
65
+ protected $current_filesize = null;
66
+
67
/**
68
* End Of File block string
69
*
154
* Write data to a handle and check if the data has been written
155
*
156
* @param resource $handle File handle
157
+ * @param string $data Data to be written - binary
158
+ * @param string $file Filename that the file handle belongs to
159
*
160
* @throws \Ai1wm_Not_Writable_Exception
161
*/
170
* Read data from a handle
171
*
172
* @param resource $handle File handle
173
+ * @param int $size Size of data to be read in bytes
174
+ * @param string $file Filename that the file handle belongs to
175
*
176
* @return string Content that was read
177
* @throws \Ai1wm_Not_Readable_Exception
185
return $result;
186
}
187
188
/**
189
* Appends end of file block to the archive
190
*
194
$this->write_to_handle( $this->file_handle, $this->eof, $this->filename );
195
}
196
197
+ /**
198
+ * Get current file size
199
+ *
200
+ * return int
201
+ */
202
+ public function get_current_filesize() {
203
+ return $this->current_filesize;
204
+ }
205
+
206
/**
207
* Closes the archive file
208
*
lib/vendor/servmask/archiver/class-ai1wm-compressor.php CHANGED
@@ -38,33 +38,56 @@ 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
*
44
* @throws \Ai1wm_Not_Accesible_Exception
45
* @throws \Ai1wm_Not_Readable_Exception
46
* @throws \Ai1wm_Not_Writable_Exception
47
*/
48
- public function add_file( $file, $new_filename = '' ) {
49
// open the file for reading in binary mode
50
$handle = $this->open_file_for_reading( $file );
51
52
// get file block header of the file we are trying to archive
53
$block = $this->get_file_block( $file, $new_filename );
54
55
- // write file block header to our archive file
56
- $this->write_to_handle( $this->file_handle, $block, $this->filename );
57
58
// read the file in 512KB chunks
59
while ( false === feof( $handle ) ) {
60
$content = $this->read_from_handle( $handle, 512000, $file );
61
// write file contents
62
- $this->write_to_handle(
63
- $this->file_handle,
64
- $content,
65
- $this->filename
66
- );
67
}
68
// close the handle
69
fclose( $handle );
70
}
@@ -72,7 +95,7 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
72
/**
73
* Generate binary block header for a file
74
*
75
- * @param string $file Filename to generate block header for
76
* @param string $new_filename Write the file with a different name
77
*
78
* @return string
@@ -95,19 +118,24 @@ class Ai1wm_Compressor extends Ai1wm_Archiver {
95
}
96
97
// filename of the file we are accessing
98
- $name = $pathinfo['basename'];
99
- // content length in bytes of the file
100
- $length = $stat['7'];
101
// last time the file was modified
102
- $date = $stat['9'];
103
104
// replace DIRECTORY_SEPARATOR with / in path, we want to always have /
105
- $path = str_replace( DIRECTORY_SEPARATOR, "/", $pathinfo['dirname'] );
106
107
// concatenate block format parts
108
- $format = implode( "", $this->block_format );
109
110
// pack file data into binary string
111
- return pack( $format, $name, $length, $date, $path );
112
}
113
}
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
48
* @throws \Ai1wm_Not_Writable_Exception
49
*/
50
+ public function add_file( $file, $new_filename = '', $offset = 0, $timeout = 0 ) {
51
// open the file for reading in binary mode
52
$handle = $this->open_file_for_reading( $file );
53
54
// get file block header of the file we are trying to archive
55
$block = $this->get_file_block( $file, $new_filename );
56
57
+ // set file offset or set file header
58
+ if ( $offset ) {
59
+ // set file offset
60
+ fseek( $handle, $offset, SEEK_SET );
61
+ } else {
62
+ // write file block header to our archive file
63
+ $this->write_to_handle( $this->file_handle, $block, $this->filename );
64
+ }
65
+
66
+ // start time
67
+ $start = microtime( true );
68
69
// read the file in 512KB chunks
70
while ( false === feof( $handle ) ) {
71
$content = $this->read_from_handle( $handle, 512000, $file );
72
+
73
// write file contents
74
+ $this->write_to_handle( $this->file_handle, $content, $this->filename );
75
+
76
+ // time elapsed
77
+ if ( $timeout ) {
78
+ if ( ( microtime( true ) - $start ) > $timeout ) {
79
+ // set file offset
80
+ $offset = ftell( $handle );
81
+
82
+ // close the handle
83
+ fclose( $handle );
84
+
85
+ // get file offset
86
+ return $offset;
87
+ }
88
+ }
89
}
90
+
91
// close the handle
92
fclose( $handle );
93
}
95
/**
96
* Generate binary block header for a file
97
*
98
+ * @param string $file Filename to generate block header for
99
* @param string $new_filename Write the file with a different name
100
*
101
* @return string
118
}
119
120
// filename of the file we are accessing
121
+ $name = $pathinfo['basename'];
122
+
123
+ // size in bytes of the file
124
+ $size = $stat['7'];
125
+
126
// last time the file was modified
127
+ $date = $stat['9'];
128
+
129
+ // current file size
130
+ $this->current_filesize = $size;
131
132
// replace DIRECTORY_SEPARATOR with / in path, we want to always have /
133
+ $path = str_replace( DIRECTORY_SEPARATOR, '/', $pathinfo['dirname'] );
134
135
// concatenate block format parts
136
+ $format = implode( '', $this->block_format );
137
138
// pack file data into binary string
139
+ return pack( $format, $name, $size, $date, $path );
140
}
141
}
lib/vendor/servmask/archiver/class-ai1wm-extractor.php CHANGED
@@ -74,7 +74,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
74
return $files_found;
75
}
76
77
- public function extract_one_file_to( $location, $exclude = array() ) {
78
if ( false === file_exists( $location ) ) {
79
throw new Ai1wm_Not_Readable_Exception( sprintf( __( '%s doesn\'t exist', AI1WM_PLUGIN_NAME ), $location ) );
80
}
@@ -117,11 +117,13 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
117
}
118
119
try {
120
- $this->extract_to( $path . DIRECTORY_SEPARATOR . $data['filename'], $data );
121
} catch ( Exception $e ) {
122
// we don't have file permissions, skip file content
123
$this->set_file_pointer( $this->file_handle, $data['size'], $this->filename );
124
- return;
125
}
126
}
127
@@ -131,7 +133,7 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
131
* @param string $location Location where to extract files
132
* @param array $files Files to extract
133
*/
134
- public function extract_by_files_array( $location, $files = array() ) {
135
if ( false === file_exists( $location ) ) {
136
throw new Ai1wm_Not_Readable_Exception( sprintf( __( '%s doesn\'t exist', AI1WM_PLUGIN_NAME ), $location ) );
137
}
@@ -163,7 +165,9 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
163
if ( in_array( $filename, $files ) ) {
164
try {
165
// we have a match, let's extract the file and remove it from the array
166
- $this->extract_to( $location . DIRECTORY_SEPARATOR . $data['filename'], $data );
167
} catch ( Exception $e ) {
168
// we don't have file permissions, skip file content
169
$this->set_file_pointer( $this->file_handle, $data['size'], $this->filename );
@@ -207,28 +211,53 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
207
}
208
}
209
210
- private function extract_to( $file, $data, $overwrite = true ) {
211
- // local file handle
212
- $handle = null;
213
-
214
// should the extract overwrite the file if it exists?
215
- if ( $overwrite ) {
216
- $handle = $this->open_file_for_overwriting( $file );
217
- } else {
218
$handle = $this->open_file_for_writing( $file );
219
}
220
221
// is the filesize more than 0 bytes?
222
while ( $data['size'] > 0 ) {
223
// read the file in chunks of 512KB
224
- $length = $data['size'] > 512000 ? 512000 : $data['size'];
225
// read the file in chunks of 512KB from archiver
226
- $content = $this->read_from_handle( $this->file_handle, $length, $this->filename );
227
// remote the amount of bytes we read
228
- $data['size'] -= $length;
229
230
// write file contents
231
$this->write_to_handle( $handle, $content, $file );
232
}
233
234
// close the handle
@@ -266,6 +295,9 @@ class Ai1wm_Extractor extends Ai1wm_Archiver {
266
$data['mtime'] = trim( $data['mtime'] );
267
$data['path'] = trim( $data['path'] );
268
269
return $data;
270
}
271
74
return $files_found;
75
}
76
77
+ public function extract_one_file_to( $location, $exclude = array(), $offset = 0, $timeout = 0 ) {
78
if ( false === file_exists( $location ) ) {
79
throw new Ai1wm_Not_Readable_Exception( sprintf( __( '%s doesn\'t exist', AI1WM_PLUGIN_NAME ), $location ) );
80
}
117
}
118
119
try {
120
+ // we have a match, let's extract the file
121
+ if ( ( $offset = $this->extract_to( $path . DIRECTORY_SEPARATOR . $data['filename'], $data, $offset, $timeout ) ) ) {
122
+ return $offset;
123
+ }
124
} catch ( Exception $e ) {
125
// we don't have file permissions, skip file content
126
$this->set_file_pointer( $this->file_handle, $data['size'], $this->filename );
127
}
128
}
129
133
* @param string $location Location where to extract files
134
* @param array $files Files to extract
135
*/
136
+ public function extract_by_files_array( $location, $files = array(), $offset = 0, $timeout = 0 ) {
137
if ( false === file_exists( $location ) ) {
138
throw new Ai1wm_Not_Readable_Exception( sprintf( __( '%s doesn\'t exist', AI1WM_PLUGIN_NAME ), $location ) );
139
}
165
if ( in_array( $filename, $files ) ) {
166
try {
167
// we have a match, let's extract the file and remove it from the array
168
+ if ( ( $offset = $this->extract_to( $location . DIRECTORY_SEPARATOR . $data['filename'], $data, $offset, $timeout ) ) ) {
169
+ return $offset;
170
+ }
171
} catch ( Exception $e ) {
172
// we don't have file permissions, skip file content
173
$this->set_file_pointer( $this->file_handle, $data['size'], $this->filename );
211
}
212
}
213
214
+ private function extract_to( $file, $data, $offset = 0, $timeout = 0 ) {
215
// should the extract overwrite the file if it exists?
216
+ if ( $offset ) {
217
$handle = $this->open_file_for_writing( $file );
218
+ } else {
219
+ $handle = $this->open_file_for_overwriting( $file );
220
}
221
222
+ // get data file pointer
223
+ $data_file_pointer = $this->get_file_pointer();
224
+
225
+ // set data file pointer
226
+ $this->set_file_pointer( $this->file_handle, $offset, $this->filename );
227
+
228
+ // set file size
229
+ $data['size'] -= $offset;
230
+
231
+ // start time
232
+ $start = microtime( true );
233
+
234
// is the filesize more than 0 bytes?
235
while ( $data['size'] > 0 ) {
236
// read the file in chunks of 512KB
237
+ $chunk_size = $data['size'] > 512000 ? 512000 : $data['size'];
238
+
239
// read the file in chunks of 512KB from archiver
240
+ $content = $this->read_from_handle( $this->file_handle, $chunk_size, $this->filename );
241
+
242
// remote the amount of bytes we read
243
+ $data['size'] -= $chunk_size;
244
245
// write file contents
246
$this->write_to_handle( $handle, $content, $file );
247
+
248
+ // time elapsed
249
+ if ( $timeout ) {
250
+ if ( ( microtime( true ) - $start ) > $timeout ) {
251
+ // set file offset
252
+ $offset = $this->get_file_pointer() - $data_file_pointer;
253
+
254
+ // close the handle
255
+ fclose( $handle );
256
+
257
+ // get file offset
258
+ return $offset;
259
+ }
260
+ }
261
}
262
263
// close the handle
295
$data['mtime'] = trim( $data['mtime'] );
296
$data['path'] = trim( $data['path'] );
297
298
+ // current file size
299
+ $this->current_filesize = $data['size'];
300
+
301
return $data;
302
}
303
lib/view/assets/css/backup.min.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.ai1wm-divider{-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;border:none;height:0;background-color:transparent;font-size:14px;font-weight:700;text-align:center;text-transform:uppercase;color:rgba(0,0,0,.8);position:relative;top:0%;left:0%;margin:1rem 2.5rem;height:auto;padding:0;line-height:1}.ai1wm-divider:before,.ai1wm-divider:after{position:absolute;content:" ";z-index:3;width:50%;top:50%;height:0%;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(255,255,255,.8)}.ai1wm-divider:before{left:0%;margin-left:-2.5rem}.ai1wm-divider:after{left:auto;right:0%;margin-right:-2.5rem}@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}100%{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}100%{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@-webkit-keyframes ai1wm-emphasize{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-emphasize{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}[class^="ai1wm-icon-"],[class*=" ai1wm-icon-"]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-chevron-down{display:inline-block;position:relative;-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg);margin-left:.5em!important}.ai1wm-icon-chevron-down:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-alone{margin:0!important}@media (min-width:855px){.ai1wm-row{margin-right:399px}.ai1wm-row:before,.ai1wm-row:after{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message,.ai1wm-right .ai1wm-http-authentication{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{margin:0;padding:0;float:left;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-left:10px!important}.ai1wm-row,.ai1wm-right{margin-right:0!important}.ai1wm-right{float:left!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 20px 0 2px}.ai1wm-container:before,.ai1wm-container:after{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 #fff;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-replace-row .ai1wm-field-inline{float:left;width:100%}.ai1wm-replace-row .ai1wm-field-inline input{width:100%;font-weight:400;font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type="text"],.ai1wm-field textarea{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#EFEFEF;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#F2F8F0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#F1D7D7;color:#A95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#D95C5C;border:2px solid #D95C5C;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#D95C5C}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-left:4px solid #ffba00}.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-clear{*zoom:1;clear:both}.ai1wm-clear:before,.ai1wm-clear:after{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-list-expanded{display:block!important}.ai1wm-field-inline input{border-radius:5px}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:right}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;right:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #D6D6D6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-feedback-cancel:active{float:right;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-feedback-types>li>a{height:29px;outline:none;color:#333;text-deciration:none}.ai1wm-feedback-types>li>a>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url("../img/logo.svg") no-repeat center center}.ai1wm-hide{display:none}#ai1wm-backup-progress{background-color:#dfdfdf;height:20px;width:350px;border-radius:15px}#ai1wm-backup-progress-bar{background-color:#00aff0;height:20px;line-height:20px;border-radius:15px;color:#fff;width:0;text-align:center}.ai1wm-backups{width:100%;margin:20px 0 0;padding:0;border-collapse:collapse}.ai1wm-backups .ai1wm-column-name{text-align:left}.ai1wm-backups .ai1wm-column-date,.ai1wm-backups .ai1wm-column-size{text-align:center}.ai1wm-backups .ai1wm-column-actions{text-align:right}.ai1wm-backups thead th{padding:4px 6px;text-align:left;font-size:1.2em}.ai1wm-backups tbody tr:first-child{border-top:1px solid #ccc}.ai1wm-backups tbody tr{border-bottom:1px solid #ccc}.ai1wm-backups tbody tr:hover{background:rgba(0,0,0,.1)}.ai1wm-backups tbody td{padding:4px 6px;box-sizing:border-box;line-height:36px}.ai1wm-backups tbody td span{font-weight:700}.ai1wm-backups tbody td.ai1wm-backup-actions{text-align:right;width:250px}.ai1wm-backups tbody td.ai1wm-backup-actions a{margin-left:4px}.ai1wm-backups tbody td.ai1wm-backup-actions span{transition:width 2s cubic-bezier(.19,1,.22,1);display:inline-block;width:0;text-align:center;visibility:hidden}.ai1wm-backups tbody td.ai1wm-backup-actions .ai1wm-button-on span{width:80px;visibility:visible}
1
+ @charset "UTF-8";.ai1wm-divider{-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;border:none;height:0;background-color:transparent;font-size:14px;font-weight:700;text-align:center;text-transform:uppercase;color:rgba(0,0,0,.8);position:relative;top:0%;left:0%;margin:1rem 2.5rem;height:auto;padding:0;line-height:1}.ai1wm-divider:before,.ai1wm-divider:after{position:absolute;content:" ";z-index:3;width:50%;top:50%;height:0%;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(255,255,255,.8)}.ai1wm-divider:before{left:0%;margin-left:-2.5rem}.ai1wm-divider:after{left:auto;right:0%;margin-right:-2.5rem}@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}100%{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}100%{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@-webkit-keyframes ai1wm-emphasize{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-emphasize{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}[class^="ai1wm-icon-"],[class*=" ai1wm-icon-"]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-chevron-down{display:inline-block;position:relative;-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg);margin-left:.5em!important}.ai1wm-icon-chevron-down:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-alone{margin:0!important}@media (min-width:855px){.ai1wm-row{margin-right:399px}.ai1wm-row:before,.ai1wm-row:after{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message,.ai1wm-right .ai1wm-http-authentication{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{margin:0;padding:0;float:left;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-left:10px!important}.ai1wm-row,.ai1wm-right{margin-right:0!important}.ai1wm-right{float:left!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 20px 0 2px}.ai1wm-container:before,.ai1wm-container:after{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 #fff;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-replace-row .ai1wm-field-inline{float:left;width:100%}.ai1wm-replace-row .ai1wm-field-inline input{width:100%;font-weight:400;font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type="text"],.ai1wm-field textarea{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#EFEFEF;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#F2F8F0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#F1D7D7;color:#A95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#D95C5C;border:2px solid #D95C5C;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#D95C5C}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-left:4px solid #ffba00}.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-clear{*zoom:1;clear:both}.ai1wm-clear:before,.ai1wm-clear:after{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-list-expanded{display:block!important}.ai1wm-field-inline input{border-radius:5px}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:right}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;right:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #D6D6D6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-feedback-cancel:active{float:right;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-feedback-types>li>a{height:29px;outline:none;color:#333;text-deciration:none}.ai1wm-feedback-types>li>a>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url("../img/logo.svg") no-repeat center center}.ai1wm-hide{display:none}#ai1wm-backup-progress{background-color:#dfdfdf;height:20px;width:350px;border-radius:15px}#ai1wm-backup-progress-bar{background-color:#00aff0;height:20px;line-height:20px;border-radius:15px;color:#fff;width:0;text-align:center}.ai1wm-backups{width:100%;margin:20px 0 0;padding:0;border-collapse:collapse}.ai1wm-backups .ai1wm-column-name{text-align:left}.ai1wm-backups .ai1wm-column-date,.ai1wm-backups .ai1wm-column-size{text-align:center}.ai1wm-backups .ai1wm-column-actions{text-align:right}.ai1wm-backups thead th{padding:4px 6px;text-align:left;font-size:1.2em}.ai1wm-backups tbody tr:first-child{border-top:1px solid #ccc}.ai1wm-backups tbody tr{border-bottom:1px solid #ccc}.ai1wm-backups tbody tr:hover{background:rgba(0,0,0,.1)}.ai1wm-backups tbody td{padding:4px 6px;box-sizing:border-box;line-height:36px}.ai1wm-backups tbody td span{font-weight:700}.ai1wm-backups tbody td.ai1wm-backup-actions{text-align:right;width:250px}.ai1wm-backups tbody td.ai1wm-backup-actions a{margin-left:4px}.ai1wm-backups tbody td.ai1wm-backup-actions span{transition:width 2s cubic-bezier(.19,1,.22,1);display:inline-block;width:0;text-align:center;visibility:hidden}.ai1wm-backups tbody td.ai1wm-backup-actions .ai1wm-button-on span{width:80px;visibility:visible}.ai1wm-authentication{margin:10px 0}.ai1wm-authentication .ai1wm-authentication-info{font-size:.7rem;line-height:1rem;margin:4px 0 8px}
lib/view/assets/javascript/export.min.js CHANGED
@@ -1 +1 @@
1
- !function e(t,a,i){function s(o,n){if(!a[o]){if(!t[o]){var c="function"==typeof require&&require;if(!n&&c)return c(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var m=a[o]={exports:{}};t[o][0].call(m.exports,function(e){var a=t[o][1][e];return s(a?a:e)},m,m.exports,e,t,a,i)}return a[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e){var t=(e("./jquery/query"),e("./jquery/find_replace"),e("./jquery/message_close"),e("./servmask/report"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/export_controller"));jQuery(document).ready(function(e){"use strict";e("#ai1wm-export-file").click(function(e){e.preventDefault();var a=new t("file");a.start()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-message-close-button").ai1wm_message_close(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()})},{"./jquery/find_replace":2,"./jquery/message_close":3,"./jquery/query":4,"./servmask/export_controller":6,"./servmask/feedback":8,"./servmask/maintenance":9,"./servmask/report":10}],2:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],3:[function(){!function(e){e.fn.ai1wm_message_close=function(){return e(this).click(function(t){var a=ai1wm_message.ajax.url,i=e(this),s=i.attr("data-key");e.ajax({type:"POST",url:a,data:{key:s},success:function(e){var t=e.errors;0===t.length&&i.closest(".ai1wm-message").remove()},dataType:"json"}),t.preventDefault()}),this}}(jQuery)},{}],4:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),s=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";s.text(t)}),this}}(jQuery)},{}],5:[function(e,t){var a=jQuery,i=function(e){this._stop=!1,this._provider=e,this._storage=this.random(12)};i.prototype.start=function(e){var t=this,i=new jQuery.Deferred,s=e.concat("&",a.param({method:"start",secret_key:ai1wm_export.secret_key,provider:t._provider,storage:t._storage}));return a.post(ai1wm_export.ajax.url,s).done(function(){t.getStatus().progress(function(e){i.notify(e)}).done(function(){i.resolve()}).fail(function(e){i.reject(e)})}).fail(function(){i.reject({message:"Unable to start the export. Refresh the page and try again"})}),i.promise()},i.prototype.getStatus=function(e,t){var i=this;return e=e||new jQuery.Deferred,t=t||0,i._stop?e.resolve():(a.ajax({cache:!1,url:ai1wm_export.status.url+"/status.js",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":case"download":e.resolve(),a.post(ai1wm_export.ajax.url,{method:"clean",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage});break;default:setTimeout(function(){i.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.getStatus(e,t))}),e.promise())},i.prototype.stop=function(e,t){var e=new jQuery.Deferred,i=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the export... Retry "+t}):(e.notify({message:"Please wait, stopping the export..."}),i._stop=!0),a.post(ai1wm_export.ajax.url,{method:"stop",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.stop(e,t))}),e.promise()},i.prototype.random=function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},t.exports=i},{}],6:[function(e,t){(function(a){var i=e("./export_modal"),s=e("./export"),r=jQuery,o=function(e){this._export=new s(e),this._modal=new i};o.prototype.start=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),e.stop()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()}),this._modal.show(),e._modal._loader.show(),e._modal._stop.show();var t=r("#ai1wm-export-form").serialize();e.display({type:"info",message:"Preparing to export..."}),this._export.start(t).progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})},o.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"download":t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show()}},o.prototype.stop=function(){var e=this;this._export.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e)})},t.exports=o,a.window.Ai1wmExportController=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export":5,"./export_modal":7}],7:[function(e,t){var a=jQuery,i=function(){this._overlay=a('<div class="ai1wm-overlay"></div>'),this._modal=a('<div class="ai1wm-modal-container"></div>'),this._section=a("<section></section>"),this._header=a("<h1></h1>"),this._message=a("<p></p>").hide(),this._action=a("<div></div>"),this._title=a("<span></span>").hide(),this._loader=a('<span class="ai1wm-loader"></span>').hide(),this._warning=a('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=a('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=a('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=a('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').hide(),this._close=a('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=a('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),a("body").append(this._overlay).append(this._modal)};i.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},i.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},i.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},i.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._close.hide(),this._confirm.hide(),this},t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,a=e(".ai1wm-feedback-type:checked").val(),i=e(".ai1wm-feedback-email").val(),s=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:a,email:i,message:s,terms:+r},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(s)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var a=ai1wm_maintenance.ajax.url,i=e(this);e.ajax({type:"POST",url:a,success:function(){i.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,a=e(".ai1wm-report-email").val(),i=e(".ai1wm-report-message").val(),s=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:a,message:i,terms:+s},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(s),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
1
+ !function e(t,a,i){function s(o,n){if(!a[o]){if(!t[o]){var c="function"==typeof require&&require;if(!n&&c)return c(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var m=a[o]={exports:{}};t[o][0].call(m.exports,function(e){var a=t[o][1][e];return s(a?a:e)},m,m.exports,e,t,a,i)}return a[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e){var t=(e("./jquery/query"),e("./jquery/find_replace"),e("./jquery/message_close"),e("./servmask/report"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/export_controller"));jQuery(document).ready(function(e){"use strict";e("#ai1wm-export-file").click(function(e){e.preventDefault();var a=new t("file");a.start()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-message-close-button").ai1wm_message_close(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()})},{"./jquery/find_replace":2,"./jquery/message_close":3,"./jquery/query":4,"./servmask/export_controller":6,"./servmask/feedback":8,"./servmask/maintenance":9,"./servmask/report":10}],2:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],3:[function(){!function(e){e.fn.ai1wm_message_close=function(){return e(this).click(function(t){var a=ai1wm_message.ajax.url,i=e(this),s=i.attr("data-key");e.ajax({type:"POST",url:a,data:{key:s},success:function(e){var t=e.errors;0===t.length&&i.closest(".ai1wm-message").remove()},dataType:"json"}),t.preventDefault()}),this}}(jQuery)},{}],4:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),s=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";s.text(t)}),this}}(jQuery)},{}],5:[function(e,t){var a=jQuery,i=function(e){this._stop=!1,this._provider=e,this._storage=this.random(12)};i.prototype.start=function(e){var t=this,i=new jQuery.Deferred,s=e.concat("&",a.param({method:"start",secret_key:ai1wm_export.secret_key,provider:t._provider,storage:t._storage}));return a.post(ai1wm_export.ajax.url,s).done(function(){t.getStatus(ai1wm_export.status.php).progress(function(e){i.notify(e)}).done(function(){i.resolve()}).fail(function(e){i.reject(e)})}).fail(function(){i.reject({message:"Unable to start the export. Refresh the page and try again"})}),i.promise()},i.prototype.getStatus=function(e,t,i){var s=this;return t=t||new jQuery.Deferred,i=i||0,s._stop?t.resolve():(a.ajax({cache:!1,url:e,dataType:"json"}).done(function(i){if(i)switch(t.notify(i),i.type){case"finish":case"download":t.resolve(),a.post(ai1wm_export.ajax.url,{method:"clean",secret_key:ai1wm_export.secret_key,provider:s._provider,storage:s._storage});break;default:setTimeout(function(){s.getStatus(e,t)},3e3)}}).fail(function(){i++,i>=6?t.reject({message:"Unable to retrieve status of the export. Is your server running?"}):i>=3?s.getStatus(ai1wm_export.status.js,t,i):s.getStatus(ai1wm_export.status.php,t,i)}),t.promise())},i.prototype.stop=function(e,t){var e=new jQuery.Deferred,i=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the export... Retry "+t}):(e.notify({message:"Please wait, stopping the export..."}),i._stop=!0),a.post(ai1wm_export.ajax.url,{method:"stop",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage}).done(function(){e.resolve()}).fail(function(){t++,t>=3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):i.stop(e,t)}),e.promise()},i.prototype.random=function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},t.exports=i},{}],6:[function(e,t){(function(a){var i=e("./export_modal"),s=e("./export"),r=jQuery,o=function(e){this._export=new s(e),this._modal=new i};o.prototype.start=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),e.stop()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()}),this._modal.show(),e._modal._loader.show(),e._modal._stop.show();var t=r("#ai1wm-export-form").serialize();e.display({type:"info",message:"Preparing to export..."}),this._export.start(t).progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})},o.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"download":t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show()}},o.prototype.stop=function(){var e=this;this._export.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e)})},t.exports=o,a.window.Ai1wmExportController=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export":5,"./export_modal":7}],7:[function(e,t){var a=jQuery,i=function(){this._overlay=a('<div class="ai1wm-overlay"></div>'),this._modal=a('<div class="ai1wm-modal-container"></div>'),this._section=a("<section></section>"),this._header=a("<h1></h1>"),this._message=a("<p></p>").hide(),this._action=a("<div></div>"),this._title=a("<span></span>").hide(),this._loader=a('<span class="ai1wm-loader"></span>').hide(),this._warning=a('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=a('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=a('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=a('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').hide(),this._close=a('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=a('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),a("body").append(this._overlay).append(this._modal)};i.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},i.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},i.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},i.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._close.hide(),this._confirm.hide(),this},t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,a=e(".ai1wm-feedback-type:checked").val(),i=e(".ai1wm-feedback-email").val(),s=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:a,email:i,message:s,terms:+r},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(s)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var a=ai1wm_maintenance.ajax.url,i=e(this);e.ajax({type:"POST",url:a,success:function(){i.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,a=e(".ai1wm-report-email").val(),i=e(".ai1wm-report-message").val(),s=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:a,message:i,terms:+s},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(s),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
lib/view/assets/javascript/import.min.js CHANGED
@@ -1 +1 @@
1
- !function e(t,i,a){function o(s,n){if(!i[s]){if(!t[s]){var d="function"==typeof require&&require;if(!n&&d)return d(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+s+"'")}var p=i[s]={exports:{}};t[s][0].call(p.exports,function(e){var i=t[s][1][e];return o(i?i:e)},p,p.exports,e,t,i,a)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<a.length;s++)o(a[s]);return o}({1:[function(e){var t=(e("./servmask/report.js"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/import_controller"));jQuery(document).ready(function(e){"use strict";var i=function(e){for(var t=window.location.search.substring(1),i=t.split("&"),a=0;a<i.length;a++){var o=i[a].split("=");if(o[0]==e)return o[1]}},a=new t("file");a.init(),a.upload(),i("restore-file")&&a.restore(i("restore-file")),e(".ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})})},{"./servmask/feedback":3,"./servmask/import_controller":6,"./servmask/maintenance":9,"./servmask/report.js":10}],2:[function(e,t){var i=jQuery,a=function(e){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._modal_section=i("<section></section>"),this._modal_content=i('<p style="text-align: left; line-height: 1.5em;">'+e+"</p>"),this._modal_close=i('<button class="ai1wm-button-red">Close</button>'),this._modal_section.append(this._modal_content),this._modal.append(this._modal_section).append(this._modal_close),console.log(this._modal),i("body").append(this._overlay).append(this._modal),this._modal_close.on("click",function(){this.remove()}.bind(this)),this.show()};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},t.exports=a},{}],3:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var i=e("#ai1wm-feedback-type-1");i.is(":checked")?(i.attr("checked",!1),t.preventDefault()):i.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,i=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),o=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:i,email:a,message:o,terms:+r},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],4:[function(e,t){var i=jQuery,a=function(){this.FILES_ADDED=1,this.BEFORE_UPLOAD=2,this.UPLOAD_PROGRESS=3,this.CHUNK_UPLOADED=4,this.UPLOAD_FINISHED=5,this.UPLOAD_ERROR=6,this.OVERSIZED_FILE=7,this.INVALID_EXTENSION=8,this._dfd=new i.Deferred,this._chunkUploaded=!1,this._storage=null,this.addFileFilters(),this._uploader=new plupload.Uploader(ai1wm_uploader),this._uploader.bind("Init",this._onInit),this._uploader.init(),this._uploader.bind("FilesAdded",this._onFilesAdded.bind(this)),this._uploader.bind("BeforeUpload",this._onBeforeUpload.bind(this)),this._uploader.bind("UploadProgress",this._onUploadProgress.bind(this)),this._uploader.bind("ChunkUploaded",this._onChunkUploaded.bind(this)),this._uploader.bind("FileUploaded",this._onFileUploaded.bind(this)),this._uploader.bind("Error",this._onError.bind(this))};a.prototype.addFileFilters=function(){var e=this;plupload.addFileFilter("ai1wm_archive_size",function(t,i,a){t=parseInt(t,10),i.size=i.hasOwnProperty("size")?parseInt(i.size,10):0,0===t||i.size<=t?a(!0):(this.trigger("Error",{code:e.OVERSIZED_FILE,message:ai1wm_import.oversize}),a(!1))}),plupload.addFileFilter("ai1wm_archive_extension",function(t,a,o){var r=a.name.substr((~-a.name.lastIndexOf(".")>>>0)+2);i.inArray(r,t)>-1?o(!0):(this.trigger("Error",{code:e.INVALID_EXTENSION,message:ai1wm_import.invalid_extension}),o(!1))})},a.prototype.watch=function(){return this._dfd.promise()},a.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},a.prototype._onInit=function(e){var t=i("#ai1wm-plupload-upload-ui");e.features.dragdrop&&!i(document.body).hasClass("mobile")?i("#ai1wm-drag-drop-area").bind("dragover.wp-uploader",function(){t.addClass("ai1wm-drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){t.removeClass("ai1wm-drag-over")}):i("#ai1wm-drag-drop-area").unbind(".wp-uploader"),"html4"==e.runtime&&i(".upload-flash-bypass").hide()},a.prototype._onFilesAdded=function(e,t){this._storage=this.random(12),this._uploader.settings.multipart_params.storage=this._storage,this._dfd.notify({state:this.FILES_ADDED,up:e,files:t})},a.prototype._onBeforeUpload=function(e,t){this._dfd.notify({state:this.BEFORE_UPLOAD,up:e,files:t})},a.prototype._onUploadProgress=function(e,t){this._dfd.notify({state:this.UPLOAD_PROGRESS,up:e,files:t})},a.prototype._onChunkUploaded=function(){this._dfd.notify({state:this.CHUNK_UPLOADED})},a.prototype._onFileUploaded=function(e,t){this._dfd.notify({state:this.UPLOAD_FINISHED,up:e,files:t})},a.prototype._onError=function(e,t){this._dfd.notify({state:this.UPLOAD_ERROR,up:e,error:t})},t.exports=a},{}],5:[function(e,t){var i=jQuery,a=function(e){this._stop=!1,this._archive=null,this._storage=null,this._provider=e};a.prototype.start=function(){var e=this,t=new jQuery.Deferred;return i.post(ai1wm_import.ajax.url,{method:"start",secret_key:ai1wm_import.secret_key,provider:e._provider,storage:e._storage,archive:e._archive}).done(function(){e.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},a.prototype.getStatus=function(e,t){var a=this;return e=e||new jQuery.Deferred,t=t||0,a._stop?e.resolve():(i.ajax({cache:!1,url:ai1wm_import.status.url+"/status.js",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":e.resolve(),i.post(ai1wm_import.ajax.url,{method:"clean",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage});break;case"confirm":e.resolve();break;default:setTimeout(function(){a.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.getStatus(e,t))}),e.promise())},a.prototype.stop=function(e,t){var e=new jQuery.Deferred,a=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the import... Retry "+t}):(e.notify({message:"Please wait, stopping the import..."}),a._stop=!0),i.post(ai1wm_import.ajax.url,{method:"stop",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.stop(e,t))}),e.promise()},a.prototype.confirm=function(){var e=new jQuery.Deferred,t=this;return i.post(ai1wm_import.ajax.url,{method:"enumerate",secret_key:ai1wm_import.secret_key,provider:t._provider,storage:t._storage,archive:t._archive}).done(function(){t.getStatus().progress(function(t){e.notify(t)}).done(function(){e.resolve()}).fail(function(t){e.reject(t)})}).fail(function(){e.reject({message:"Unable to start the import. Refresh the page and try again"})}),e.promise()},a.prototype.download=function(e){var t=new jQuery.Deferred,a=this;return i.post(ai1wm_import.ajax.url,i.extend({method:"import",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage,archive:a._archive},e)).done(function(){a.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},t.exports=a},{}],6:[function(e,t){(function(i){var a=e("./import_modal"),o=e("./file_uploader"),r=e("./import"),s=e("./info"),n=e("./dialog"),d=jQuery,p=function(e){this._import=new r(e),this._modal=new a};p.prototype.init=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.stop()}),this._modal._confirm.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.confirm()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()})},p.prototype.stop=function(){var e=this;this._import.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e.message)})},p.prototype.confirm=function(){var e=this;this._import.confirm().progress(function(t){e.display(t)}).fail(function(e){alert(e.message)})},p.prototype.download=function(e){var t=this;t.display({type:"info",message:"Preparing to import..."}),this._import.download(e).progress(function(e){t.display(e)}).fail(function(e){alert(e.message)})},p.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"confirm":t._modal._warning.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._confirm.show();break;case"progress":t._modal._progressBar.show(),t._modal._progressBarPercent.text(e.percent+"%"),t._modal._progressBarMeter.width(e.meter+"%"),t._modal._stop.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show(),t._modal._stop.attr("disabled","disabled")}},p.prototype.upload=function(){var e=this;this._uploadFinished=!1,this._uploadProgress=0,this._fileUploader=new o,this._fileUploader.watch().progress(function(t){e._handleUploadState(t)}).done(function(){e.display({type:"info",message:"Preparing to import..."}),e._import.start().progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})}).fail(function(e){alert(e.message)})},p.prototype.restore=function(e){var t=this;this._import._archive=e,this._import._storage=this.random(12),t.display({type:"info",message:"Preparing to import..."}),this._import.start().progress(function(e){t.display(e)}).done(function(){}).fail(function(e){alert(e.message)})},p.prototype._handleUploadState=function(e){var t=this;switch(e.state){case t._fileUploader.FILES_ADDED:t.display({type:"progress",percent:1,meter:7}),t._fileUploader._uploader.refresh(),t._fileUploader._uploader.start();break;case t._fileUploader.BEFORE_UPLOAD:break;case t._fileUploader.UPLOAD_PROGRESS:if(e.files.size>e.up.settings.chunk_size&&t._fileUploader._chunkUploaded){var i=e.files.percent>7?e.files.percent:7;t.display({type:"progress",percent:i,meter:i})}else t._uploadFinished?(t._uploadProgress++,2==t._uploadProgress&&t.display({type:"progress",percent:100,meter:100})):t.display({type:"progress",percent:1,meter:7});break;case t._fileUploader.CHUNK_UPLOADED:t._fileUploader._chunkUploaded===!1&&(t._fileUploader._uploader.settings.max_retries=100),t._fileUploader._chunkUploaded=!0;break;case t._fileUploader.UPLOAD_FINISHED:t._uploadFinished=!0,t._import._archive=e.files.target_name,t._import._storage=this._fileUploader._storage,t._fileUploader._dfd.resolve();break;case t._fileUploader.UPLOAD_ERROR:switch(e.error.code){case t._fileUploader.OVERSIZED_FILE:new n(e.error.message);break;case t._fileUploader.INVALID_EXTENSION:new n(e.error.message);break;default:if(t._fileUploader._chunkUploaded)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;if(t._uploadProgress=0,t._uploadFinished=!1,e.up.settings.chunk_size/=2,e.up.settings.chunk_size<102400)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;new s("Trying new chunk size: "+(e.up.settings.chunk_size/1048576).toFixed(2)+"MB"),e.up.files[0].status=plupload.QUEUED,e.up.files[0].loaded=0,e.up.refresh(),e.up.start()}break;default:alert("Unknown state: "+state)}},p.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},t.exports=p,i.window.Ai1wmImportController=p}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dialog":2,"./file_uploader":4,"./import":5,"./import_modal":7,"./info":8}],7:[function(e,t){var i=jQuery,a=function(){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._section=i("<section></section>"),this._header=i("<h1></h1>"),this._message=i("<p></p>").hide(),this._action=i("<div></div>"),this._title=i("<span></span>").hide(),this._loader=i('<span class="ai1wm-loader"></span>').hide(),this._warning=i('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=i('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=i('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=i('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=i('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').hide(),this._close=i('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=i('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),i("body").append(this._overlay).append(this._modal)};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},a.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._stop.removeAttr("disabled"),this._close.hide(),this._confirm.hide(),this},t.exports=a},{}],8:[function(e,t){var i=jQuery,a=function(e){var t=i('<div class="ai1wm-growl-info">'+e+"</div>");t.hide(),i("body").append(t),t.show("normal",function(){setTimeout(function(){t.hide(),t.remove()},3e3)})};t.exports=a},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var i=ai1wm_maintenance.ajax.url,a=e(this);e.ajax({type:"POST",url:i,success:function(){a.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,i=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),o=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:i,message:a,terms:+o},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
1
+ !function e(t,i,a){function o(s,n){if(!i[s]){if(!t[s]){var d="function"==typeof require&&require;if(!n&&d)return d(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+s+"'")}var p=i[s]={exports:{}};t[s][0].call(p.exports,function(e){var i=t[s][1][e];return o(i?i:e)},p,p.exports,e,t,i,a)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<a.length;s++)o(a[s]);return o}({1:[function(e){var t=(e("./servmask/report.js"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/import_controller"));jQuery(document).ready(function(e){"use strict";var i=function(e){for(var t=window.location.search.substring(1),i=t.split("&"),a=0;a<i.length;a++){var o=i[a].split("=");if(o[0]==e)return o[1]}},a=new t("file");a.init(),a.upload(),i("restore-file")&&a.restore(i("restore-file")),e(".ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})})},{"./servmask/feedback":3,"./servmask/import_controller":6,"./servmask/maintenance":9,"./servmask/report.js":10}],2:[function(e,t){var i=jQuery,a=function(e){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._modal_section=i("<section></section>"),this._modal_content=i('<p style="text-align: left; line-height: 1.5em;">'+e+"</p>"),this._modal_close=i('<button class="ai1wm-button-red">Close</button>'),this._modal_section.append(this._modal_content),this._modal.append(this._modal_section).append(this._modal_close),console.log(this._modal),i("body").append(this._overlay).append(this._modal),this._modal_close.on("click",function(){this.remove()}.bind(this)),this.show()};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},t.exports=a},{}],3:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var i=e("#ai1wm-feedback-type-1");i.is(":checked")?(i.attr("checked",!1),t.preventDefault()):i.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,i=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),o=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:i,email:a,message:o,terms:+r},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],4:[function(e,t){var i=jQuery,a=function(){this.FILES_ADDED=1,this.BEFORE_UPLOAD=2,this.UPLOAD_PROGRESS=3,this.CHUNK_UPLOADED=4,this.UPLOAD_FINISHED=5,this.UPLOAD_ERROR=6,this.OVERSIZED_FILE=7,this.INVALID_EXTENSION=8,this._dfd=new i.Deferred,this._chunkUploaded=!1,this._storage=null,this.addFileFilters(),this._uploader=new plupload.Uploader(ai1wm_uploader),this._uploader.bind("Init",this._onInit),this._uploader.init(),this._uploader.bind("FilesAdded",this._onFilesAdded.bind(this)),this._uploader.bind("BeforeUpload",this._onBeforeUpload.bind(this)),this._uploader.bind("UploadProgress",this._onUploadProgress.bind(this)),this._uploader.bind("ChunkUploaded",this._onChunkUploaded.bind(this)),this._uploader.bind("FileUploaded",this._onFileUploaded.bind(this)),this._uploader.bind("Error",this._onError.bind(this))};a.prototype.addFileFilters=function(){var e=this;plupload.addFileFilter("ai1wm_archive_size",function(t,i,a){t=parseInt(t,10),i.size=i.hasOwnProperty("size")?parseInt(i.size,10):0,0===t||i.size<=t?a(!0):(this.trigger("Error",{code:e.OVERSIZED_FILE,message:ai1wm_import.oversize}),a(!1))}),plupload.addFileFilter("ai1wm_archive_extension",function(t,a,o){var r=a.name.substr((~-a.name.lastIndexOf(".")>>>0)+2);i.inArray(r,t)>-1?o(!0):(this.trigger("Error",{code:e.INVALID_EXTENSION,message:ai1wm_import.invalid_extension}),o(!1))})},a.prototype.watch=function(){return this._dfd.promise()},a.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},a.prototype._onInit=function(e){var t=i("#ai1wm-plupload-upload-ui");e.features.dragdrop&&!i(document.body).hasClass("mobile")?i("#ai1wm-drag-drop-area").bind("dragover.wp-uploader",function(){t.addClass("ai1wm-drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){t.removeClass("ai1wm-drag-over")}):i("#ai1wm-drag-drop-area").unbind(".wp-uploader"),"html4"==e.runtime&&i(".upload-flash-bypass").hide()},a.prototype._onFilesAdded=function(e,t){this._storage=this.random(12),this._uploader.settings.multipart_params.storage=this._storage,this._dfd.notify({state:this.FILES_ADDED,up:e,files:t})},a.prototype._onBeforeUpload=function(e,t){this._dfd.notify({state:this.BEFORE_UPLOAD,up:e,files:t})},a.prototype._onUploadProgress=function(e,t){this._dfd.notify({state:this.UPLOAD_PROGRESS,up:e,files:t})},a.prototype._onChunkUploaded=function(){this._dfd.notify({state:this.CHUNK_UPLOADED})},a.prototype._onFileUploaded=function(e,t){this._dfd.notify({state:this.UPLOAD_FINISHED,up:e,files:t})},a.prototype._onError=function(e,t){this._dfd.notify({state:this.UPLOAD_ERROR,up:e,error:t})},t.exports=a},{}],5:[function(e,t){var i=jQuery,a=function(e){this._stop=!1,this._archive=null,this._storage=null,this._provider=e};a.prototype.start=function(){var e=this,t=new jQuery.Deferred;return i.post(ai1wm_import.ajax.url,{method:"start",secret_key:ai1wm_import.secret_key,provider:e._provider,storage:e._storage,archive:e._archive}).done(function(){e.getStatus(ai1wm_import.status.php).progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},a.prototype.getStatus=function(e,t,a){var o=this;return t=t||new jQuery.Deferred,a=a||0,o._stop?t.resolve():(i.ajax({cache:!1,url:e,dataType:"json"}).done(function(a){if(a)switch(t.notify(a),a.type){case"finish":t.resolve(),i.post(ai1wm_import.ajax.url,{method:"clean",secret_key:ai1wm_import.secret_key,provider:o._provider,storage:o._storage});break;case"confirm":t.resolve();break;default:setTimeout(function(){o.getStatus(e,t)},3e3)}}).fail(function(){a++,a>=6?t.reject({message:"Unable to retrieve status of the import. Is your server running?"}):a>=3?o.getStatus(ai1wm_import.status.js,t,a):o.getStatus(ai1wm_import.status.php,t,a)}),t.promise())},a.prototype.stop=function(e,t){var e=new jQuery.Deferred,a=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the import... Retry "+t}):(e.notify({message:"Please wait, stopping the import..."}),a._stop=!0),i.post(ai1wm_import.ajax.url,{method:"stop",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage}).done(function(){e.resolve()}).fail(function(){t++,t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):a.stop(e,t)}),e.promise()},a.prototype.confirm=function(){var e=new jQuery.Deferred,t=this;return i.post(ai1wm_import.ajax.url,{method:"enumerate",secret_key:ai1wm_import.secret_key,provider:t._provider,storage:t._storage,archive:t._archive}).done(function(){t.getStatus(ai1wm_import.status.php).progress(function(t){e.notify(t)}).done(function(){e.resolve()}).fail(function(t){e.reject(t)})}).fail(function(){e.reject({message:"Unable to start the import. Refresh the page and try again"})}),e.promise()},a.prototype.download=function(e){var t=new jQuery.Deferred,a=this;return i.post(ai1wm_import.ajax.url,i.extend({method:"import",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage,archive:a._archive},e)).done(function(){a.getStatus(ai1wm_import.status.php).progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},t.exports=a},{}],6:[function(e,t){(function(i){var a=e("./import_modal"),o=e("./file_uploader"),r=e("./import"),s=e("./info"),n=e("./dialog"),d=jQuery,p=function(e){this._import=new r(e),this._modal=new a};p.prototype.init=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.stop()}),this._modal._confirm.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.confirm()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()})},p.prototype.stop=function(){var e=this;this._import.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e.message)})},p.prototype.confirm=function(){var e=this;this._import.confirm().progress(function(t){e.display(t)}).fail(function(e){alert(e.message)})},p.prototype.download=function(e){var t=this;t.display({type:"info",message:"Preparing to import..."}),this._import.download(e).progress(function(e){t.display(e)}).fail(function(e){alert(e.message)})},p.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"confirm":t._modal._warning.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._confirm.show();break;case"progress":t._modal._progressBar.show(),t._modal._progressBarPercent.text(e.percent+"%"),t._modal._progressBarMeter.width(e.meter+"%"),t._modal._stop.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show(),t._modal._stop.attr("disabled","disabled")}},p.prototype.upload=function(){var e=this;this._uploadFinished=!1,this._uploadProgress=0,this._fileUploader=new o,this._fileUploader.watch().progress(function(t){e._handleUploadState(t)}).done(function(){e.display({type:"info",message:"Preparing to import..."}),e._import.start().progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})}).fail(function(e){alert(e.message)})},p.prototype.restore=function(e){var t=this;this._import._archive=e,this._import._storage=this.random(12),t.display({type:"info",message:"Preparing to import..."}),this._import.start().progress(function(e){t.display(e)}).done(function(){}).fail(function(e){alert(e.message)})},p.prototype._handleUploadState=function(e){var t=this;switch(e.state){case t._fileUploader.FILES_ADDED:t.display({type:"progress",percent:1,meter:7}),t._fileUploader._uploader.refresh(),t._fileUploader._uploader.start();break;case t._fileUploader.BEFORE_UPLOAD:break;case t._fileUploader.UPLOAD_PROGRESS:if(e.files.size>e.up.settings.chunk_size&&t._fileUploader._chunkUploaded){var i=e.files.percent>7?e.files.percent:7;t.display({type:"progress",percent:i,meter:i})}else t._uploadFinished?(t._uploadProgress++,2==t._uploadProgress&&t.display({type:"progress",percent:100,meter:100})):t.display({type:"progress",percent:1,meter:7});break;case t._fileUploader.CHUNK_UPLOADED:t._fileUploader._chunkUploaded===!1&&(t._fileUploader._uploader.settings.max_retries=100),t._fileUploader._chunkUploaded=!0;break;case t._fileUploader.UPLOAD_FINISHED:t._uploadFinished=!0,t._import._archive=e.files.target_name,t._import._storage=this._fileUploader._storage,t._fileUploader._dfd.resolve();break;case t._fileUploader.UPLOAD_ERROR:switch(e.error.code){case t._fileUploader.OVERSIZED_FILE:new n(e.error.message);break;case t._fileUploader.INVALID_EXTENSION:new n(e.error.message);break;default:if(t._fileUploader._chunkUploaded)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;if(t._uploadProgress=0,t._uploadFinished=!1,e.up.settings.chunk_size/=2,e.up.settings.chunk_size<102400)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;new s("Trying new chunk size: "+(e.up.settings.chunk_size/1048576).toFixed(2)+"MB"),e.up.files[0].status=plupload.QUEUED,e.up.files[0].loaded=0,e.up.refresh(),e.up.start()}break;default:alert("Unknown state: "+state)}},p.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},t.exports=p,i.window.Ai1wmImportController=p}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dialog":2,"./file_uploader":4,"./import":5,"./import_modal":7,"./info":8}],7:[function(e,t){var i=jQuery,a=function(){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._section=i("<section></section>"),this._header=i("<h1></h1>"),this._message=i("<p></p>").hide(),this._action=i("<div></div>"),this._title=i("<span></span>").hide(),this._loader=i('<span class="ai1wm-loader"></span>').hide(),this._warning=i('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=i('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=i('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=i('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=i('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').hide(),this._close=i('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=i('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),i("body").append(this._overlay).append(this._modal)};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},a.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._stop.removeAttr("disabled"),this._close.hide(),this._confirm.hide(),this},t.exports=a},{}],8:[function(e,t){var i=jQuery,a=function(e){var t=i('<div class="ai1wm-growl-info">'+e+"</div>");t.hide(),i("body").append(t),t.show("normal",function(){setTimeout(function(){t.hide(),t.remove()},3e3)})};t.exports=a},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var i=ai1wm_maintenance.ajax.url,a=e(this);e.ajax({type:"POST",url:i,success:function(){a.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,i=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),o=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:i,message:a,terms:+o},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
lib/view/backup/index.php CHANGED
@@ -133,9 +133,7 @@
133
134
<?php include AI1WM_TEMPLATES_PATH . '/common/leave-feedback.php'; ?>
135
136
- <?php if ( isset( $_SERVER['AUTH_TYPE'] ) ) : ?>
137
- <?php include AI1WM_TEMPLATES_PATH . '/common/http-authentication.php'; ?>
138
- <?php endif; ?>
139
140
</div>
141
</div>
133
134
<?php include AI1WM_TEMPLATES_PATH . '/common/leave-feedback.php'; ?>
135
136
+ <?php include AI1WM_TEMPLATES_PATH . '/common/http-authentication.php'; ?>
137
138
</div>
139
</div>
lib/view/common/http-authentication.php CHANGED
@@ -1,20 +1,24 @@
1
<h2><?php _e( 'HTTP Basic Authentication', AI1WM_PLUGIN_NAME ); ?></h2>
2
3
- <form method="POST" action="">
4
- <div class="ai1wm-field">
5
- <label for="ai1wm-username"><?php _e( 'Username', AI1WM_PLUGIN_NAME ); ?></label>
6
- <input type="text" placeholder="<?php _e( 'Enter Username', AI1WM_PLUGIN_NAME ); ?>" id="ai1wm-username" name="ai1wm-username" class="ai1wm-http-authentication" value="<?php echo $username; ?>" />
7
- </div>
8
9
- <div class="ai1wm-field">
10
- <label for="ai1wm-password"><?php _e( 'Password', AI1WM_PLUGIN_NAME ); ?></label>
11
- <input type="password" placeholder="<?php _e( 'Enter Password', AI1WM_PLUGIN_NAME ); ?>" id="ai1wm-password" name="ai1wm-password" class="ai1wm-http-authentication" value="<?php echo $password; ?>" />
12
- </div>
13
14
- <div class="ai1wm-field">
15
- <button type="submit" class="ai1wm-button-blue">
16
- <i class="ai1wm-icon-save"></i>
17
- <?php _e( 'Update', AI1WM_PLUGIN_NAME ); ?>
18
- </button>
19
- </div>
20
- </form>
1
<h2><?php _e( 'HTTP Basic Authentication', AI1WM_PLUGIN_NAME ); ?></h2>
2
3
+ <div class="ai1wm-authentication">
4
+ <form method="POST" action="">
5
+ <div class="ai1wm-field">
6
+ <label for="ai1wm-username"><?php _e( 'Username', AI1WM_PLUGIN_NAME ); ?></label>
7
+ <input type="text" autocomplete="off" placeholder="<?php _e( 'Enter Username', AI1WM_PLUGIN_NAME ); ?>" id="ai1wm-username" name="ai1wm-username" class="ai1wm-http-authentication" value="<?php echo $username; ?>" />
8
+ </div>
9
10
+ <div class="ai1wm-field">
11
+ <label for="ai1wm-password"><?php _e( 'Password', AI1WM_PLUGIN_NAME ); ?></label>
12
+ <input type="password" autocomplete="off" placeholder="<?php _e( 'Enter Password', AI1WM_PLUGIN_NAME ); ?>" id="ai1wm-password" name="ai1wm-password" class="ai1wm-http-authentication" value="<?php echo $password; ?>" />
13
+ </div>
14
15
+ <p class="ai1wm-authentication-info"><?php _e( 'Populate the above fields if current site is password protected with <strong>.htaccess</strong> or any other HTTP Basic Authentication mechanism.', AI1WM_PLUGIN_NAME ); ?></p>
16
+
17
+ <div class="ai1wm-field">
18
+ <button type="submit" class="ai1wm-button-blue">
19
+ <i class="ai1wm-icon-save"></i>
20
+ <?php _e( 'Update', AI1WM_PLUGIN_NAME ); ?>
21
+ </button>
22
+ </div>
23
+ </form>
24
+ </div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: yani.iliev, bangelov, pimjitsawang
3
Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
Requires at least: 3.3
5
Tested up to: 4.4
6
- Stable tag: 4.17
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.
@@ -28,8 +28,23 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
28
= Support for MySQL, PDO, MySQLi =
29
* No matter what php mysql driver your webserver ships with, we support it.
30
31
- = Support WordPress v3.3 up to v4.4 =
32
- * We tested every WordPress version from `3.3` up to `4.4`.
33
34
= Migrate WordPress to most popular cloud services using our completely new extensions =
35
* [Unlimited](https://servmask.com/products/unlimited-extension)
@@ -60,6 +75,10 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
60
3. Plugin Menu
61
62
== Changelog ==
63
= 4.17 =
64
* Set "Tested up to" WordPress 4.4
65
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.
28
= Support for MySQL, PDO, MySQLi =
29
* No matter what php mysql driver your webserver ships with, we support it.
30
31
+ = Support WordPress v3.3 up to v4.x =
32
+ * We tested every WordPress version from `3.3` up to `4.x`.
33
+
34
+ = Supported hosting providers =
35
+ * Bluehost
36
+ * InMotion
37
+ * Web Hosting Hub
38
+ * Siteground
39
+ * Pagely
40
+ * Dreamhost
41
+ * Justhost
42
+ * GoDaddy
43
+ * WP Engine
44
+ * Site5
45
+ * 1&1
46
+ * Pantheon
47
+ * [See the full list of supported providers here](https://help.servmask.com/knowledgebase/supported-hosting-providers/)
48
49
= Migrate WordPress to most popular cloud services using our completely new extensions =
50
* [Unlimited](https://servmask.com/products/unlimited-extension)
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
81
+
82
= 4.17 =
83
* Set "Tested up to" WordPress 4.4
84
status.php ADDED
@@ -0,0 +1,4 @@
1
+ <?php
2
+
3
+ @header( 'Content-Type: application/json' );
4
+ @readfile( 'storage' . DIRECTORY_SEPARATOR . 'status.js' );