Astra Starter Sites - Version 1.3.19

Version Description

Download this release

Release Info

Developer Nikschavan
Plugin Icon Astra Starter Sites
Version 1.3.19
Comparing to
See all releases

Code changes from version 1.3.18 to 1.3.19

Files changed (35) hide show
  1. astra-sites.php +54 -54
  2. inc/assets/css/admin.css +790 -790
  3. inc/assets/css/install-theme.css +20 -20
  4. inc/assets/js/admin-page.js +1840 -1840
  5. inc/assets/js/astra-sites-api.js +59 -59
  6. inc/assets/js/eventsource.js +673 -673
  7. inc/assets/js/eventsource.min.js +5 -5
  8. inc/assets/js/fetch.umd.js +531 -531
  9. inc/assets/js/install-theme.js +127 -127
  10. inc/assets/js/render-grid.js +712 -705
  11. inc/classes/class-astra-sites-importer.php +605 -605
  12. inc/classes/class-astra-sites-page.php +434 -434
  13. inc/classes/class-astra-sites-white-label.php +239 -239
  14. inc/classes/class-astra-sites.php +628 -628
  15. inc/classes/compatibility/class-astra-sites-compatibility.php +69 -69
  16. inc/importers/batch-processing/class-astra-sites-batch-processing-beaver-builder.php +261 -261
  17. inc/importers/batch-processing/class-astra-sites-batch-processing-brizy.php +125 -125
  18. inc/importers/batch-processing/class-astra-sites-batch-processing-elementor.php +109 -109
  19. inc/importers/batch-processing/class-astra-sites-batch-processing-gutenberg.php +167 -167
  20. inc/importers/batch-processing/class-astra-sites-batch-processing.php +227 -227
  21. inc/importers/batch-processing/helpers/class-astra-sites-image-importer.php +263 -263
  22. inc/importers/batch-processing/helpers/class-wp-async-request.php +164 -164
  23. inc/importers/batch-processing/helpers/class-wp-background-process.php +513 -513
  24. inc/importers/class-astra-site-options-import.php +309 -309
  25. inc/importers/class-astra-sites-helper.php +311 -311
  26. inc/importers/class-widgets-importer.php +278 -278
  27. inc/importers/wxr-importer/class-astra-wxr-importer.php +446 -446
  28. inc/importers/wxr-importer/class-logger.php +139 -139
  29. inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php +43 -43
  30. inc/importers/wxr-importer/class-wxr-import-info.php +20 -20
  31. inc/importers/wxr-importer/class-wxr-importer.php +2300 -2300
  32. inc/includes/admin-page.php +437 -437
  33. inc/lib/astra-notices/notices.js +93 -93
  34. languages/astra-sites.pot +828 -828
  35. readme.txt +360 -357
astra-sites.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
- /**
3
- * Plugin Name: Astra Starter Sites
4
- * Plugin URI: http://www.wpastra.com/pro/
5
- * Description: Import free sites build with Astra theme.
6
- * Version: 1.3.18
7
- * Author: Brainstorm Force
8
- * Author URI: http://www.brainstormforce.com
9
- * Text Domain: astra-sites
10
- *
11
- * @package Astra Sites
12
- */
13
-
14
- /**
15
- * Set constants.
16
- */
17
- if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
- define( 'ASTRA_SITES_NAME', __( 'Astra Sites', 'astra-sites' ) );
19
- }
20
-
21
- if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
- define( 'ASTRA_SITES_VER', '1.3.18' );
23
- }
24
-
25
- if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
26
- define( 'ASTRA_SITES_FILE', __FILE__ );
27
- }
28
-
29
- if ( ! defined( 'ASTRA_SITES_BASE' ) ) {
30
- define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
31
- }
32
-
33
- if ( ! defined( 'ASTRA_SITES_DIR' ) ) {
34
- define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
35
- }
36
-
37
- if ( ! defined( 'ASTRA_SITES_URI' ) ) {
38
- define( 'ASTRA_SITES_URI', plugins_url( '/', ASTRA_SITES_FILE ) );
39
- }
40
-
41
- if ( ! function_exists( 'astra_sites_setup' ) ) :
42
-
43
- /**
44
- * Astra Sites Setup
45
- *
46
- * @since 1.0.5
47
- */
48
- function astra_sites_setup() {
49
- require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites.php';
50
- }
51
-
52
- add_action( 'plugins_loaded', 'astra_sites_setup' );
53
-
54
- endif;
1
+ <?php
2
+ /**
3
+ * Plugin Name: Astra Starter Sites
4
+ * Plugin URI: http://www.wpastra.com/pro/
5
+ * Description: Import free sites build with Astra theme.
6
+ * Version: 1.3.19
7
+ * Author: Brainstorm Force
8
+ * Author URI: http://www.brainstormforce.com
9
+ * Text Domain: astra-sites
10
+ *
11
+ * @package Astra Sites
12
+ */
13
+
14
+ /**
15
+ * Set constants.
16
+ */
17
+ if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
+ define( 'ASTRA_SITES_NAME', __( 'Astra Sites', 'astra-sites' ) );
19
+ }
20
+
21
+ if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
+ define( 'ASTRA_SITES_VER', '1.3.19' );
23
+ }
24
+
25
+ if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
26
+ define( 'ASTRA_SITES_FILE', __FILE__ );
27
+ }
28
+
29
+ if ( ! defined( 'ASTRA_SITES_BASE' ) ) {
30
+ define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
31
+ }
32
+
33
+ if ( ! defined( 'ASTRA_SITES_DIR' ) ) {
34
+ define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
35
+ }
36
+
37
+ if ( ! defined( 'ASTRA_SITES_URI' ) ) {
38
+ define( 'ASTRA_SITES_URI', plugins_url( '/', ASTRA_SITES_FILE ) );
39
+ }
40
+
41
+ if ( ! function_exists( 'astra_sites_setup' ) ) :
42
+
43
+ /**
44
+ * Astra Sites Setup
45
+ *
46
+ * @since 1.0.5
47
+ */
48
+ function astra_sites_setup() {
49
+ require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites.php';
50
+ }
51
+
52
+ add_action( 'plugins_loaded', 'astra_sites_setup' );
53
+
54
+ endif;
inc/assets/css/admin.css CHANGED
@@ -1,791 +1,791 @@
1
- .wrap .status,
2
- .wrap .site-type {
3
- position: absolute;
4
- z-index: 1;
5
- color: #fff;
6
- padding: 0.5em 1em;
7
- top: -0.5em;
8
- text-transform: uppercase;
9
- }
10
- .wrap .status,
11
- .wrap .site-type.premium {
12
- background: #0073aa;
13
- }
14
- .wrap .status {
15
- left: -0.5em;
16
- }
17
- .wrap .site-type.premium {
18
- right: -0.5em;
19
- }
20
-
21
- .wrap .status.publish,
22
- .wrap .site-type.free {
23
- display: none;
24
- }
25
-
26
- .install-theme-info .site-type {
27
- display: none;
28
- }
29
-
30
- .theme {
31
- position: relative;
32
- }
33
- .wrap .astra-sites-preview .site-type.premium {
34
- display: block;
35
- display: none;
36
- position: relative;
37
- margin: 0.5em 0em 1em 0em;
38
- top: 0;
39
- left: 0;
40
- text-align: center;
41
- }
42
-
43
- .theme-details-read-more.open {
44
- margin: 0.5em 0 0 0;
45
- }
46
-
47
- .astra-sites-preview .theme-screenshot {
48
- width: 100%;
49
- }
50
-
51
- .install-theme-info .site-type.premium {
52
- display: none;
53
- }
54
-
55
- /**
56
- * Required Plugins
57
- */
58
- .required-plugins.loading {
59
- text-align: center;
60
- }
61
- .required-plugins button {
62
- float: right;
63
- }
64
- .required-plugins .plugin-card {
65
- float: none;
66
- width: 100%;
67
- border: none;
68
- margin: 0 0 0.8em 0;
69
- display: flex;
70
- justify-content: space-between;
71
- align-items: center;
72
- transition: background ease 0.8s;
73
- }
74
- .required-plugins .plugin-card.plugin-card-update-failed {
75
- flex-wrap: wrap;
76
- }
77
- .required-plugins .spinner {
78
- float: none;
79
- margin: 0;
80
- }
81
-
82
- .expanded .wp-full-overlay-footer {
83
- height: 111px;
84
- }
85
-
86
- .wp-full-overlay-footer .view-site,
87
- .wp-full-overlay-footer .go-pro,
88
- .wp-full-overlay-footer .astra-demo-import {
89
- width: 100%;
90
- text-align: center;
91
- }
92
-
93
- .wp-core-ui .wp-full-overlay-footer .button.button-hero,
94
- .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
95
- padding: 0 10px 1px;
96
- }
97
-
98
- .wp-full-overlay-footer .installing:before {
99
- vertical-align: text-bottom;
100
- }
101
-
102
- .astra-sites-advanced-options-wrap h4 {
103
- margin: 1em 0 0.5em 0;
104
- padding: 0.5em 0;
105
- transition: all ease 0.3s;
106
- }
107
-
108
- /**
109
- * Read more link
110
- */
111
- .wp-core-ui .theme-details-read-more:focus,
112
- .wp-core-ui .theme-details-read-more:hover {
113
- outline: none;
114
- box-shadow: none;
115
- }
116
- .wp-core-ui .theme-details-read-more {
117
- margin: 10px 0;
118
- display: none;
119
- text-decoration: none;
120
- }
121
-
122
- /**
123
- * Go pro.
124
- */
125
- .wp-core-ui .go-pro.button[disabled] {
126
- background-color: #fcb92c !important;
127
- color: white !important;
128
- box-shadow: 1px 0 #eab23a !important;
129
- text-shadow: 1px 0 #6b4e13 !important;
130
- border-color: #e2a932 !important;
131
- cursor: pointer;
132
- }
133
- .wp-core-ui .view-site .dashicons,
134
- .wp-core-ui .go-pro .dashicons {
135
- font-size: 1rem;
136
- vertical-align: middle;
137
- }
138
-
139
- /**
140
- * Errors
141
- */
142
- .plugin-card-update-failed .notice {
143
- margin-top: 1.5em;
144
- }
145
-
146
- .no-themes {
147
- margin-top: 40px;
148
- }
149
-
150
- .no-themes p {
151
- font-size: 15px;
152
- }
153
-
154
- .no-themes .left-margin {
155
- margin-left: 30px;
156
- }
157
-
158
- /**
159
- *
160
- */
161
- .astra-sites-preview .wp-full-overlay-sidebar-content {
162
- bottom: 100px;
163
- }
164
-
165
- .footer-import-button-wrap {
166
- padding: 10px 20px;
167
- }
168
-
169
- .footer-import-button-wrap .button {
170
- margin: 0;
171
- }
172
-
173
- .astra-sites-preview.expanded .wp-full-overlay-footer {
174
- left: initial;
175
- }
176
-
177
- /**
178
- * Menu Page
179
- */
180
- .astra-sites-title {
181
- float: left;
182
- font-size: 23px;
183
- font-weight: 400;
184
- margin: 0 0 6px 0px;
185
- padding: 0;
186
- line-height: 29px;
187
- }
188
-
189
- #astra-sites-menu-page {
190
- margin-top: 10px;
191
- }
192
-
193
- /**
194
- * API Error
195
- */
196
- .astra-api-error {
197
- margin: 0 0 0.5em 0;
198
- }
199
-
200
- /**
201
- * Grid
202
- */
203
- .wp-filter .search-form {
204
- margin-left: 1em;
205
- }
206
- .wp-filter .search-form input[type="search"] {
207
- width: 200px;
208
- font-size: 13px;
209
- padding: 5px 10px;
210
- }
211
- .section-left {
212
- display: inline-block;
213
- }
214
- .section-right {
215
- float: right;
216
- }
217
- .filter-count {
218
- min-width: 3em;
219
- }
220
- .astra-site-preview-on {
221
- overflow: hidden;
222
- }
223
-
224
- .appearance_page_astra-sites .notice {
225
- margin-left: 0;
226
- width: auto;
227
- float: none;
228
- margin-right: 220px;
229
- }
230
-
231
- .filters-wrap {
232
- display: inline-block;
233
- }
234
- .spinner-wrap {
235
- text-align: center;
236
- }
237
- .spinner-wrap .spinner {
238
- float: none;
239
- }
240
- .hide-me {
241
- display: none !important;
242
- }
243
- #astra-sites-admin {
244
- height: 100vh;
245
- }
246
- .install-theme-info > .notice {
247
- margin: 5px 0 10px 0;
248
- }
249
-
250
- .astra-sites-suggestions:before {
251
- border: 5px dashed #ccc;
252
- position: absolute;
253
- left: 0;
254
- right: 0;
255
- top: 0;
256
- bottom: 0px;
257
- }
258
-
259
- .astra-sites-suggestions {
260
- min-height: 280px;
261
- border: none !important;
262
- }
263
-
264
- .astra-sites-suggestions a {
265
- border: none;
266
- outline: none;
267
- }
268
-
269
- .astra-sites-suggestions .inner {
270
- border: 6px solid #24282e !important;
271
- padding: 27% 10% 50% 10%;
272
- text-align: center;
273
- position: absolute;
274
- left: 0;
275
- right: 0;
276
- top: 0;
277
- background: #33383d;
278
- bottom: 0;
279
- color: #eee;
280
- cursor: auto;
281
- }
282
-
283
- .astra-sites-suggestions .inner a {
284
- color: #00b9eb;
285
- }
286
-
287
- .astra-sites-suggestions p {
288
- font-size: 1rem;
289
- margin: 0;
290
- }
291
-
292
- .astra-notice {
293
- margin: 2em 2em 0em 0em;
294
- }
295
-
296
- .no-themes .description {
297
- display: block;
298
- }
299
-
300
- /**
301
- * Responsive Button UI
302
- */
303
- .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
304
- .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
305
- color: #0073aa;
306
- }
307
- .astra-sites-preview .wp-full-overlay-footer .devices button:before {
308
- color: #c1c1c1;
309
- }
310
- .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
311
- background-color: transparent;
312
- }
313
- .astra-sites-preview .wp-full-overlay-footer .devices button {
314
- border: none;
315
- }
316
- .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
317
- .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
318
- border-bottom-color: transparent;
319
- background-color: transparent;
320
- }
321
- .not-click-able {
322
- pointer-events: none !important;
323
- }
324
- body.page-builder-selected .select-page-builder,
325
- body.loading-content .select-page-builder {
326
- display: none;
327
- }
328
- .select-page-builder .up-arrow {
329
- -webkit-transform: rotate(90deg);
330
- -moz-transform: rotate(90deg);
331
- -ms-transform: rotate(90deg);
332
- transform: rotate(90deg);
333
- display: inline-block;
334
- font-size: 1.5em;
335
- color: #797979;
336
- vertical-align: middle;
337
- margin-right: 10px;
338
- -webkit-transition: all linear 0.6s;
339
- -moz-transition: all linear 0.6s;
340
- -ms-transition: all linear 0.6s;
341
- transition: all linear 0.6s;
342
- -webkit-animation-duration: 1s;
343
- animation-duration: 1s;
344
- -webkit-animation-fill-mode: both;
345
- animation-fill-mode: both;
346
- -webkit-animation-timing-function: ease-in-out;
347
- animation-timing-function: ease-in-out;
348
- animation-iteration-count: infinite;
349
- -webkit-animation-iteration-count: infinite;
350
- animation-name: bounce;
351
- -moz-animation-name: bounce;
352
- }
353
- .select-page-builder {
354
- margin-left: 6em;
355
- }
356
-
357
- .select-page-builder img {
358
- max-width: 100%;
359
- }
360
-
361
- .select-page-builder .note-wrap {
362
- position: absolute;
363
- padding: 40px 0;
364
- margin-left: 170px;
365
- right: 0;
366
- left: 0;
367
- }
368
-
369
- .select-page-builder h3 {
370
- margin: 0;
371
- font-size: 2em;
372
- }
373
- .select-page-builder {
374
- margin: -20px 0 0 -5px;
375
- position: absolute;
376
- }
377
- .select-page-builder .note {
378
- margin-left: 1.5em;
379
- }
380
-
381
- @keyframes bounce {
382
- 0%,
383
- 100%,
384
- 20%,
385
- 50%,
386
- 80% {
387
- -webkit-transform: translateY(-0px) rotate(90deg);
388
- -moz-transform: translateY(-0px) rotate(90deg);
389
- -ms-transform: translateY(-0px) rotate(90deg);
390
- transform: translateY(-0px) rotate(90deg);
391
- }
392
- 40% {
393
- -webkit-transform: translateY(-2px) rotate(90deg);
394
- -moz-transform: translateY(-2px) rotate(90deg);
395
- -ms-transform: translateY(-2px) rotate(90deg);
396
- transform: translateY(-2px) rotate(90deg);
397
- }
398
- 60% {
399
- -webkit-transform: translateY(-1px) rotate(90deg);
400
- -moz-transform: translateY(-1px) rotate(90deg);
401
- -ms-transform: translateY(-1px) rotate(90deg);
402
- transform: translateY(-1px) rotate(90deg);
403
- }
404
- }
405
-
406
- /**
407
- * Processing Animation
408
- */
409
- .astra-demo-import.disabled {
410
- pointer-events: none;
411
- }
412
- .astra-demo-import.button.updating-message:before,
413
- .astra-demo-import.button.installing:before {
414
- -webkit-animation: cssAnimation .72s ease infinite;
415
- -moz-animation: cssAnimation .72s ease infinite;
416
- -o-animation: cssAnimation .72s ease infinite;
417
- -ms-animation: cssAnimation .72s ease infinite;
418
- animation: cssAnimation .72s ease infinite;
419
- }
420
-
421
- @-webkit-keyframes cssAnimation {
422
- from {
423
- -webkit-transform: rotate(0);
424
- -moz-transform: rotate(0);
425
- -o-transform: rotate(0);
426
- -ms-transform: rotate(0);
427
- transform: rotate(0);
428
- }
429
- to {
430
- -webkit-transform: rotate(360deg);
431
- -moz-transform: rotate(360deg);
432
- -o-transform: rotate(360deg);
433
- -ms-transform: rotate(360deg);
434
- transform: rotate(360deg);
435
- }
436
- }
437
- @-moz-keyframes cssAnimation {
438
- from {
439
- -webkit-transform: rotate(0);
440
- -moz-transform: rotate(0);
441
- -o-transform: rotate(0);
442
- -ms-transform: rotate(0);
443
- transform: rotate(0);
444
- }
445
- to {
446
- -webkit-transform: rotate(360deg);
447
- -moz-transform: rotate(360deg);
448
- -o-transform: rotate(360deg);
449
- -ms-transform: rotate(360deg);
450
- transform: rotate(360deg);
451
- }
452
- }
453
- @-o-keyframes cssAnimation {
454
- from {
455
- -webkit-transform: rotate(0);
456
- -moz-transform: rotate(0);
457
- -o-transform: rotate(0);
458
- -ms-transform: rotate(0);
459
- transform: rotate(0);
460
- }
461
- to {
462
- -webkit-transform: rotate(360deg);
463
- -moz-transform: rotate(360deg);
464
- -o-transform: rotate(360deg);
465
- -ms-transform: rotate(360deg);
466
- transform: rotate(360deg);
467
- }
468
- }
469
-
470
- #astra-sites-filters {
471
- display: inline-block;
472
- width: 100%;
473
- }
474
-
475
- .astra-site-down {
476
- padding: 1em 2em;
477
- margin-top: 1em;
478
- }
479
-
480
- #astra-sites-menu-page .nav-tab-wrapper {
481
- border: none;
482
- }
483
-
484
- #astra-sites-filters .wp-filter {
485
- margin-top: 0;
486
- }
487
-
488
- /**
489
- * Welcome Screen
490
- */
491
- .astra-sites-welcome {
492
- padding: 10em 0;
493
- text-align: center;
494
- }
495
- .astra-sites-welcome .inner {
496
- margin: 0 auto;
497
- display: inline-block;
498
- max-width: 700px;
499
- background: #fff;
500
- padding: 3em;
501
- }
502
-
503
- .astra-sites-welcome h1 {
504
- font-size: 2.5em;
505
- margin-bottom: 1em;
506
- }
507
-
508
- .astra-sites-welcome p {
509
- font-size: 1rem;
510
- }
511
-
512
- .astra-sites-welcome select {
513
- padding: 5px;
514
- height: 100%;
515
- }
516
-
517
- .astra-sites-welcome .submit {
518
- text-align: center;
519
- margin: 0;
520
- padding: 0;
521
- margin-left: .5em;
522
- }
523
-
524
- .astra-sites-welcome .disabled {
525
- pointer-events: none;
526
- }
527
-
528
- .astra-site-page-builder {
529
- opacity: 0;
530
- visibility: hidden;
531
- }
532
-
533
- .astra-sites-third-party-required-plugins-wrap .notice {
534
- margin: 0;
535
- }
536
-
537
- .required-plugins-list,
538
- .astra-sites-third-party-required-plugins {
539
- margin-left: 2em;
540
- margin-top: .5em;
541
- margin-bottom: .5em;
542
- list-style-type: disc;
543
- }
544
-
545
- .astra-sites-third-party-required-plugins .plugin-card,
546
- .required-plugins-list .plugin-card {
547
- background: transparent;
548
- border: none;
549
- margin: 0;
550
- line-height: 2;
551
- float: none;
552
- width: 100%;
553
- }
554
-
555
- .required-plugins-list .spinner {
556
- float: none;
557
- margin: 0;
558
- }
559
-
560
- .astra-site-import-process-wrap {
561
- display: flex;
562
- align-items: center;
563
- margin-top: -2px;
564
- z-index: 999999;
565
- position: relative;
566
- border-radius: 3px;
567
- overflow: hidden;
568
- }
569
-
570
- .astra-sites-result-preview .astra-site-import-process-wrap progress {
571
- background: #eeeeee;
572
- }
573
-
574
- .astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
575
- background: #0185ba;
576
- }
577
-
578
- .astra-site-import-process-wrap progress {
579
- padding: 0px;
580
- border: 0 none;
581
- background: #0085bd;
582
- border-radius: 5px;
583
- height: 4px;
584
- flex: 1;
585
- }
586
-
587
- .astra-sites-result-preview .dashicons {
588
- vertical-align: text-bottom;
589
- }
590
-
591
- .astra-site-import-process-wrap progress::-webkit-progress-value {
592
- background: #00679b;
593
- }
594
-
595
- .astra-site-import-process-wrap progress::-webkit-progress-bar {
596
- background: transparent;
597
- }
598
-
599
- .theme-browser .theme .site-preview > .theme-screenshot {
600
- transition: all linear 5s;
601
- background-position: center top;
602
- background-size: cover;
603
- background-repeat: no-repeat;
604
- }
605
- .theme-browser .theme .site-preview > .theme-screenshot:hover {
606
- background-position: center bottom;
607
- background-size: cover;
608
- }
609
-
610
- .astra-sites-tooltip-icon {
611
- cursor: pointer;
612
- }
613
-
614
- .astra-sites-preview .disabled {
615
- pointer-events: none;
616
- }
617
-
618
- .astra-sites-preview input[type="checkbox"].disabled {
619
- background: #eeeeee;
620
- opacity: 1;
621
- color: #fff;
622
- box-shadow: none;
623
- border-color: #b4b9be;
624
- }
625
-
626
- .astra-sites-tooltip-icon .dashicons {
627
- color: #757575;
628
- font-size: 15px;
629
- vertical-align: middle;
630
- height: auto;
631
- }
632
-
633
- #astra-sites-welcome-form-inline {
634
- position: absolute;
635
- right: 1em;
636
- top: 0;
637
- border-radius: 0;
638
- line-height: 1.7;
639
- padding: 0px 5px 2px 5px;
640
- outline: 2px solid transparent;
641
- outline-offset: 0;
642
- background: #fafafa;
643
- border: 1px solid #ccc;
644
- color: #72777c;
645
- font-weight: normal;
646
- font-size: 10px;
647
- font-size: 13px;
648
- line-height: 26px;
649
- height: 28px;
650
- cursor: pointer;
651
- }
652
-
653
- #astra-sites-welcome-form-inline select,
654
- #astra-sites-welcome-form-inline select:focus {
655
- border: none;
656
- outline: none;
657
- box-shadow: none;
658
- color: #72777c;
659
- }
660
-
661
- #astra-sites-menu-page .wp-full-overlay-main:before {
662
- content: '';
663
- display: none;
664
- }
665
-
666
- .theme-screenshot-wrap {
667
- overflow: hidden;
668
- max-height: 300px;
669
- margin: 15px 0;
670
- border: 1px solid #ccc;
671
- }
672
-
673
- .astra-sites-preview .install-theme-info .theme-screenshot {
674
- width: 100%;
675
- border: none;
676
- margin: 0;
677
- }
678
-
679
- #astra-sites-welcome-form #submit {
680
- padding: 0em 4rem;
681
- }
682
-
683
- .page-builders li {
684
- cursor: pointer;
685
- display: inline-block;
686
- padding: 1em;
687
- }
688
-
689
- .page-builders [type=radio] {
690
- position: absolute;
691
- opacity: 0;
692
- width: 0;
693
- height: 0;
694
- }
695
-
696
- .page-builders [type=radio] + img {
697
- cursor: pointer;
698
- opacity: .9;
699
- border: 3px solid transparent;
700
- border-radius: 10px;
701
- transition: all linear 0.2s;
702
- }
703
-
704
- .page-builders [type=radio]:hover + img,
705
- .page-builders [type=radio]:checked + img {
706
- opacity: 1;
707
- }
708
-
709
- .astra-sites-page-builder-notice {
710
- text-align: center;
711
- margin: 1em 0 2em 0;
712
- }
713
-
714
- .current-importing-status-wrap {
715
- font-size: 1rem;
716
- }
717
-
718
- .current-importing-status-wrap hr {
719
- border-color: #f1f1f1;
720
- }
721
-
722
- .astra-sites-result-preview {
723
- position: absolute;
724
- left: 0;
725
- right: 0;
726
- top: 0;
727
- bottom: 0;
728
- background: #fff;
729
- overflow-y: auto;
730
- }
731
-
732
- .astra-sites-result-preview .button {
733
- margin-top: 1em;
734
- }
735
-
736
- .astra-sites-result-preview .inner {
737
- margin: 0 auto;
738
- max-width: 700px;
739
- padding: 5em 0;
740
- }
741
-
742
- .astra-sites-result-preview h2 {
743
- font-size: 2rem;
744
- }
745
-
746
- .astra-sites-result-preview p {
747
- font-size: 1rem;
748
- }
749
-
750
- .current-importing-status {
751
- font-size: 1rem;
752
- background: #eeeeee;
753
- padding: 1em 1.5em;
754
- }
755
-
756
- .current-importing-status-title {
757
- margin-bottom: .5em;
758
- }
759
-
760
- .appearance_page_astra-sites .rotating {
761
- height: auto;
762
- animation: rotation 2s infinite linear;
763
- width: auto;
764
- color: #c1c1c1;
765
- }
766
-
767
- @-webkit-keyframes rotation {
768
- from {
769
- -webkit-transform: rotate(0deg);
770
- }
771
- to {
772
- -webkit-transform: rotate(359deg);
773
- }
774
- }
775
- .import-time {
776
- display: inline-block;
777
- background: #0185ba;
778
- color: #fff;
779
- padding: 2px 10px;
780
- border-radius: 3px;
781
- animation: astra-scale 0.5s alternate infinite ease-in;
782
- }
783
-
784
- @keyframes astra-scale {
785
- 0% {transform: scale(1);}
786
- 100% {transform: scale(1.03);}
787
- }
788
-
789
- .current-importing-status p {
790
- margin: 0;
791
}
1
+ .wrap .status,
2
+ .wrap .site-type {
3
+ position: absolute;
4
+ z-index: 1;
5
+ color: #fff;
6
+ padding: 0.5em 1em;
7
+ top: -0.5em;
8
+ text-transform: uppercase;
9
+ }
10
+ .wrap .status,
11
+ .wrap .site-type.premium {
12
+ background: #0073aa;
13
+ }
14
+ .wrap .status {
15
+ left: -0.5em;
16
+ }
17
+ .wrap .site-type.premium {
18
+ right: -0.5em;
19
+ }
20
+
21
+ .wrap .status.publish,
22
+ .wrap .site-type.free {
23
+ display: none;
24
+ }
25
+
26
+ .install-theme-info .site-type {
27
+ display: none;
28
+ }
29
+
30
+ .theme {
31
+ position: relative;
32
+ }
33
+ .wrap .astra-sites-preview .site-type.premium {
34
+ display: block;
35
+ display: none;
36
+ position: relative;
37
+ margin: 0.5em 0em 1em 0em;
38
+ top: 0;
39
+ left: 0;
40
+ text-align: center;
41
+ }
42
+
43
+ .theme-details-read-more.open {
44
+ margin: 0.5em 0 0 0;
45
+ }
46
+
47
+ .astra-sites-preview .theme-screenshot {
48
+ width: 100%;
49
+ }
50
+
51
+ .install-theme-info .site-type.premium {
52
+ display: none;
53
+ }
54
+
55
+ /**
56
+ * Required Plugins
57
+ */
58
+ .required-plugins.loading {
59
+ text-align: center;
60
+ }
61
+ .required-plugins button {
62
+ float: right;
63
+ }
64
+ .required-plugins .plugin-card {
65
+ float: none;
66
+ width: 100%;
67
+ border: none;
68
+ margin: 0 0 0.8em 0;
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ transition: background ease 0.8s;
73
+ }
74
+ .required-plugins .plugin-card.plugin-card-update-failed {
75
+ flex-wrap: wrap;
76
+ }
77
+ .required-plugins .spinner {
78
+ float: none;
79
+ margin: 0;
80
+ }
81
+
82
+ .expanded .wp-full-overlay-footer {
83
+ height: 111px;
84
+ }
85
+
86
+ .wp-full-overlay-footer .view-site,
87
+ .wp-full-overlay-footer .go-pro,
88
+ .wp-full-overlay-footer .astra-demo-import {
89
+ width: 100%;
90
+ text-align: center;
91
+ }
92
+
93
+ .wp-core-ui .wp-full-overlay-footer .button.button-hero,
94
+ .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
95
+ padding: 0 10px 1px;
96
+ }
97
+
98
+ .wp-full-overlay-footer .installing:before {
99
+ vertical-align: text-bottom;
100
+ }
101
+
102
+ .astra-sites-advanced-options-wrap h4 {
103
+ margin: 1em 0 0.5em 0;
104
+ padding: 0.5em 0;
105
+ transition: all ease 0.3s;
106
+ }
107
+
108
+ /**
109
+ * Read more link
110
+ */
111
+ .wp-core-ui .theme-details-read-more:focus,
112
+ .wp-core-ui .theme-details-read-more:hover {
113
+ outline: none;
114
+ box-shadow: none;
115
+ }
116
+ .wp-core-ui .theme-details-read-more {
117
+ margin: 10px 0;
118
+ display: none;
119
+ text-decoration: none;
120
+ }
121
+
122
+ /**
123
+ * Go pro.
124
+ */
125
+ .wp-core-ui .go-pro.button[disabled] {
126
+ background-color: #fcb92c !important;
127
+ color: white !important;
128
+ box-shadow: 1px 0 #eab23a !important;
129
+ text-shadow: 1px 0 #6b4e13 !important;
130
+ border-color: #e2a932 !important;
131
+ cursor: pointer;
132
+ }
133
+ .wp-core-ui .view-site .dashicons,
134
+ .wp-core-ui .go-pro .dashicons {
135
+ font-size: 1rem;
136
+ vertical-align: middle;
137
+ }
138
+
139
+ /**
140
+ * Errors
141
+ */
142
+ .plugin-card-update-failed .notice {
143
+ margin-top: 1.5em;
144
+ }
145
+
146
+ .no-themes {
147
+ margin-top: 40px;
148
+ }
149
+
150
+ .no-themes p {
151
+ font-size: 15px;
152
+ }
153
+
154
+ .no-themes .left-margin {
155
+ margin-left: 30px;
156
+ }
157
+
158
+ /**
159
+ *
160
+ */
161
+ .astra-sites-preview .wp-full-overlay-sidebar-content {
162
+ bottom: 100px;
163
+ }
164
+
165
+ .footer-import-button-wrap {
166
+ padding: 10px 20px;
167
+ }
168
+
169
+ .footer-import-button-wrap .button {
170
+ margin: 0;
171
+ }
172
+
173
+ .astra-sites-preview.expanded .wp-full-overlay-footer {
174
+ left: initial;
175
+ }
176
+
177
+ /**
178
+ * Menu Page
179
+ */
180
+ .astra-sites-title {
181
+ float: left;
182
+ font-size: 23px;
183
+ font-weight: 400;
184
+ margin: 0 0 6px 0px;
185
+ padding: 0;
186
+ line-height: 29px;
187
+ }
188
+
189
+ #astra-sites-menu-page {
190
+ margin-top: 10px;
191
+ }
192
+
193
+ /**
194
+ * API Error
195
+ */
196
+ .astra-api-error {
197
+ margin: 0 0 0.5em 0;
198
+ }
199
+
200
+ /**
201
+ * Grid
202
+ */
203
+ .wp-filter .search-form {
204
+ margin-left: 1em;
205
+ }
206
+ .wp-filter .search-form input[type="search"] {
207
+ width: 200px;
208
+ font-size: 13px;
209
+ padding: 5px 10px;
210
+ }
211
+ .section-left {
212
+ display: inline-block;
213
+ }
214
+ .section-right {
215
+ float: right;
216
+ }
217
+ .filter-count {
218
+ min-width: 3em;
219
+ }
220
+ .astra-site-preview-on {
221
+ overflow: hidden;
222
+ }
223
+
224
+ .appearance_page_astra-sites .notice {
225
+ margin-left: 0;
226
+ width: auto;
227
+ float: none;
228
+ margin-right: 220px;
229
+ }
230
+
231
+ .filters-wrap {
232
+ display: inline-block;
233
+ }
234
+ .spinner-wrap {
235
+ text-align: center;
236
+ }
237
+ .spinner-wrap .spinner {
238
+ float: none;
239
+ }
240
+ .hide-me {
241
+ display: none !important;
242
+ }
243
+ #astra-sites-admin {
244
+ height: 100vh;
245
+ }
246
+ .install-theme-info > .notice {
247
+ margin: 5px 0 10px 0;
248
+ }
249
+
250
+ .astra-sites-suggestions:before {
251
+ border: 5px dashed #ccc;
252
+ position: absolute;
253
+ left: 0;
254
+ right: 0;
255
+ top: 0;
256
+ bottom: 0px;
257
+ }
258
+
259
+ .astra-sites-suggestions {
260
+ min-height: 280px;
261
+ border: none !important;
262
+ }
263
+
264
+ .astra-sites-suggestions a {
265
+ border: none;
266
+ outline: none;
267
+ }
268
+
269
+ .astra-sites-suggestions .inner {
270
+ border: 6px solid #24282e !important;
271
+ padding: 27% 10% 50% 10%;
272
+ text-align: center;
273
+ position: absolute;
274
+ left: 0;
275
+ right: 0;
276
+ top: 0;
277
+ background: #33383d;
278
+ bottom: 0;
279
+ color: #eee;
280
+ cursor: auto;
281
+ }
282
+
283
+ .astra-sites-suggestions .inner a {
284
+ color: #00b9eb;
285
+ }
286
+
287
+ .astra-sites-suggestions p {
288
+ font-size: 1rem;
289
+ margin: 0;
290
+ }
291
+
292
+ .astra-notice {
293
+ margin: 2em 2em 0em 0em;
294
+ }
295
+
296
+ .no-themes .description {
297
+ display: block;
298
+ }
299
+
300
+ /**
301
+ * Responsive Button UI
302
+ */
303
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
304
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
305
+ color: #0073aa;
306
+ }
307
+ .astra-sites-preview .wp-full-overlay-footer .devices button:before {
308
+ color: #c1c1c1;
309
+ }
310
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
311
+ background-color: transparent;
312
+ }
313
+ .astra-sites-preview .wp-full-overlay-footer .devices button {
314
+ border: none;
315
+ }
316
+ .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
317
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
318
+ border-bottom-color: transparent;
319
+ background-color: transparent;
320
+ }
321
+ .not-click-able {
322
+ pointer-events: none !important;
323
+ }
324
+ body.page-builder-selected .select-page-builder,
325
+ body.loading-content .select-page-builder {
326
+ display: none;
327
+ }
328
+ .select-page-builder .up-arrow {
329
+ -webkit-transform: rotate(90deg);
330
+ -moz-transform: rotate(90deg);
331
+ -ms-transform: rotate(90deg);
332
+ transform: rotate(90deg);
333
+ display: inline-block;
334
+ font-size: 1.5em;
335
+ color: #797979;
336
+ vertical-align: middle;
337
+ margin-right: 10px;
338
+ -webkit-transition: all linear 0.6s;
339
+ -moz-transition: all linear 0.6s;
340
+ -ms-transition: all linear 0.6s;
341
+ transition: all linear 0.6s;
342
+ -webkit-animation-duration: 1s;
343
+ animation-duration: 1s;
344
+ -webkit-animation-fill-mode: both;
345
+ animation-fill-mode: both;
346
+ -webkit-animation-timing-function: ease-in-out;
347
+ animation-timing-function: ease-in-out;
348
+ animation-iteration-count: infinite;
349
+ -webkit-animation-iteration-count: infinite;
350
+ animation-name: bounce;
351
+ -moz-animation-name: bounce;
352
+ }
353
+ .select-page-builder {
354
+ margin-left: 6em;
355
+ }
356
+
357
+ .select-page-builder img {
358
+ max-width: 100%;
359
+ }
360
+
361
+ .select-page-builder .note-wrap {
362
+ position: absolute;
363
+ padding: 40px 0;
364
+ margin-left: 170px;
365
+ right: 0;
366
+ left: 0;
367
+ }
368
+
369
+ .select-page-builder h3 {
370
+ margin: 0;
371
+ font-size: 2em;
372
+ }
373
+ .select-page-builder {
374
+ margin: -20px 0 0 -5px;
375
+ position: absolute;
376
+ }
377
+ .select-page-builder .note {
378
+ margin-left: 1.5em;
379
+ }
380
+
381
+ @keyframes bounce {
382
+ 0%,
383
+ 100%,
384
+ 20%,
385
+ 50%,
386
+ 80% {
387
+ -webkit-transform: translateY(-0px) rotate(90deg);
388
+ -moz-transform: translateY(-0px) rotate(90deg);
389
+ -ms-transform: translateY(-0px) rotate(90deg);
390
+ transform: translateY(-0px) rotate(90deg);
391
+ }
392
+ 40% {
393
+ -webkit-transform: translateY(-2px) rotate(90deg);
394
+ -moz-transform: translateY(-2px) rotate(90deg);
395
+ -ms-transform: translateY(-2px) rotate(90deg);
396
+ transform: translateY(-2px) rotate(90deg);
397
+ }
398
+ 60% {
399
+ -webkit-transform: translateY(-1px) rotate(90deg);
400
+ -moz-transform: translateY(-1px) rotate(90deg);
401
+ -ms-transform: translateY(-1px) rotate(90deg);
402
+ transform: translateY(-1px) rotate(90deg);
403
+ }
404
+ }
405
+
406
+ /**
407
+ * Processing Animation
408
+ */
409
+ .astra-demo-import.disabled {
410
+ pointer-events: none;
411
+ }
412
+ .astra-demo-import.button.updating-message:before,
413
+ .astra-demo-import.button.installing:before {
414
+ -webkit-animation: cssAnimation .72s ease infinite;
415
+ -moz-animation: cssAnimation .72s ease infinite;
416
+ -o-animation: cssAnimation .72s ease infinite;
417
+ -ms-animation: cssAnimation .72s ease infinite;
418
+ animation: cssAnimation .72s ease infinite;
419
+ }
420
+
421
+ @-webkit-keyframes cssAnimation {
422
+ from {
423
+ -webkit-transform: rotate(0);
424
+ -moz-transform: rotate(0);
425
+ -o-transform: rotate(0);
426
+ -ms-transform: rotate(0);
427
+ transform: rotate(0);
428
+ }
429
+ to {
430
+ -webkit-transform: rotate(360deg);
431
+ -moz-transform: rotate(360deg);
432
+ -o-transform: rotate(360deg);
433
+ -ms-transform: rotate(360deg);
434
+ transform: rotate(360deg);
435
+ }
436
+ }
437
+ @-moz-keyframes cssAnimation {
438
+ from {
439
+ -webkit-transform: rotate(0);
440
+ -moz-transform: rotate(0);
441
+ -o-transform: rotate(0);
442
+ -ms-transform: rotate(0);
443
+ transform: rotate(0);
444
+ }
445
+ to {
446
+ -webkit-transform: rotate(360deg);
447
+ -moz-transform: rotate(360deg);
448
+ -o-transform: rotate(360deg);
449
+ -ms-transform: rotate(360deg);
450
+ transform: rotate(360deg);
451
+ }
452
+ }
453
+ @-o-keyframes cssAnimation {
454
+ from {
455
+ -webkit-transform: rotate(0);
456
+ -moz-transform: rotate(0);
457
+ -o-transform: rotate(0);
458
+ -ms-transform: rotate(0);
459
+ transform: rotate(0);
460
+ }
461
+ to {
462
+ -webkit-transform: rotate(360deg);
463
+ -moz-transform: rotate(360deg);
464
+ -o-transform: rotate(360deg);
465
+ -ms-transform: rotate(360deg);
466
+ transform: rotate(360deg);
467
+ }
468
+ }
469
+
470
+ #astra-sites-filters {
471
+ display: inline-block;
472
+ width: 100%;
473
+ }
474
+
475
+ .astra-site-down {
476
+ padding: 1em 2em;
477
+ margin-top: 1em;
478
+ }
479
+
480
+ #astra-sites-menu-page .nav-tab-wrapper {
481
+ border: none;
482
+ }
483
+
484
+ #astra-sites-filters .wp-filter {
485
+ margin-top: 0;
486
+ }
487
+
488
+ /**
489
+ * Welcome Screen
490
+ */
491
+ .astra-sites-welcome {
492
+ padding: 10em 0;
493
+ text-align: center;
494
+ }
495
+ .astra-sites-welcome .inner {
496
+ margin: 0 auto;
497
+ display: inline-block;
498
+ max-width: 700px;
499
+ background: #fff;
500
+ padding: 3em;
501
+ }
502
+
503
+ .astra-sites-welcome h1 {
504
+ font-size: 2.5em;
505
+ margin-bottom: 1em;
506
+ }
507
+
508
+ .astra-sites-welcome p {
509
+ font-size: 1rem;
510
+ }
511
+
512
+ .astra-sites-welcome select {
513
+ padding: 5px;
514
+ height: 100%;
515
+ }
516
+
517
+ .astra-sites-welcome .submit {
518
+ text-align: center;
519
+ margin: 0;
520
+ padding: 0;
521
+ margin-left: .5em;
522
+ }
523
+
524
+ .astra-sites-welcome .disabled {
525
+ pointer-events: none;
526
+ }
527
+
528
+ .astra-site-page-builder {
529
+ opacity: 0;
530
+ visibility: hidden;
531
+ }
532
+
533
+ .astra-sites-third-party-required-plugins-wrap .notice {
534
+ margin: 0;
535
+ }
536
+
537
+ .required-plugins-list,
538
+ .astra-sites-third-party-required-plugins {
539
+ margin-left: 2em;
540
+ margin-top: .5em;
541
+ margin-bottom: .5em;
542
+ list-style-type: disc;
543
+ }
544
+
545
+ .astra-sites-third-party-required-plugins .plugin-card,
546
+ .required-plugins-list .plugin-card {
547
+ background: transparent;
548
+ border: none;
549
+ margin: 0;
550
+ line-height: 2;
551
+ float: none;
552
+ width: 100%;
553
+ }
554
+
555
+ .required-plugins-list .spinner {
556
+ float: none;
557
+ margin: 0;
558
+ }
559
+
560
+ .astra-site-import-process-wrap {
561
+ display: flex;
562
+ align-items: center;
563
+ margin-top: -2px;
564
+ z-index: 999999;
565
+ position: relative;
566
+ border-radius: 3px;
567
+ overflow: hidden;
568
+ }
569
+
570
+ .astra-sites-result-preview .astra-site-import-process-wrap progress {
571
+ background: #eeeeee;
572
+ }
573
+
574
+ .astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
575
+ background: #0185ba;
576
+ }
577
+
578
+ .astra-site-import-process-wrap progress {
579
+ padding: 0px;
580
+ border: 0 none;
581
+ background: #0085bd;
582
+ border-radius: 5px;
583
+ height: 4px;
584
+ flex: 1;
585
+ }
586
+
587
+ .astra-sites-result-preview .dashicons {
588
+ vertical-align: text-bottom;
589
+ }
590
+
591
+ .astra-site-import-process-wrap progress::-webkit-progress-value {
592
+ background: #00679b;
593
+ }
594
+
595
+ .astra-site-import-process-wrap progress::-webkit-progress-bar {
596
+ background: transparent;
597
+ }
598
+
599
+ .theme-browser .theme .site-preview > .theme-screenshot {
600
+ transition: all linear 5s;
601
+ background-position: center top;
602
+ background-size: cover;
603
+ background-repeat: no-repeat;
604
+ }
605
+ .theme-browser .theme .site-preview > .theme-screenshot:hover {
606
+ background-position: center bottom;
607
+ background-size: cover;
608
+ }
609
+
610
+ .astra-sites-tooltip-icon {
611
+ cursor: pointer;
612
+ }
613
+
614
+ .astra-sites-preview .disabled {
615
+ pointer-events: none;
616
+ }
617
+
618
+ .astra-sites-preview input[type="checkbox"].disabled {
619
+ background: #eeeeee;
620
+ opacity: 1;
621
+ color: #fff;
622
+ box-shadow: none;
623
+ border-color: #b4b9be;
624
+ }
625
+
626
+ .astra-sites-tooltip-icon .dashicons {
627
+ color: #757575;
628
+ font-size: 15px;
629
+ vertical-align: middle;
630
+ height: auto;
631
+ }
632
+
633
+ #astra-sites-welcome-form-inline {
634
+ position: absolute;
635
+ right: 1em;
636
+ top: 0;
637
+ border-radius: 0;
638
+ line-height: 1.7;
639
+ padding: 0px 5px 2px 5px;
640
+ outline: 2px solid transparent;
641
+ outline-offset: 0;
642
+ background: #fafafa;
643
+ border: 1px solid #ccc;
644
+ color: #72777c;
645
+ font-weight: normal;
646
+ font-size: 10px;
647
+ font-size: 13px;
648
+ line-height: 26px;
649
+ height: 28px;
650
+ cursor: pointer;
651
+ }
652
+
653
+ #astra-sites-welcome-form-inline select,
654
+ #astra-sites-welcome-form-inline select:focus {
655
+ border: none;
656
+ outline: none;
657
+ box-shadow: none;
658
+ color: #72777c;
659
+ }
660
+
661
+ #astra-sites-menu-page .wp-full-overlay-main:before {
662
+ content: '';
663
+ display: none;
664
+ }
665
+
666
+ .theme-screenshot-wrap {
667
+ overflow: hidden;
668
+ max-height: 300px;
669
+ margin: 15px 0;
670
+ border: 1px solid #ccc;
671
+ }
672
+
673
+ .astra-sites-preview .install-theme-info .theme-screenshot {
674
+ width: 100%;
675
+ border: none;
676
+ margin: 0;
677
+ }
678
+
679
+ #astra-sites-welcome-form #submit {
680
+ padding: 0em 4rem;
681
+ }
682
+
683
+ .page-builders li {
684
+ cursor: pointer;
685
+ display: inline-block;
686
+ padding: 1em;
687
+ }
688
+
689
+ .page-builders [type=radio] {
690
+ position: absolute;
691
+ opacity: 0;
692
+ width: 0;
693
+ height: 0;
694
+ }
695
+
696
+ .page-builders [type=radio] + img {
697
+ cursor: pointer;
698
+ opacity: .9;
699
+ border: 3px solid transparent;
700
+ border-radius: 10px;
701
+ transition: all linear 0.2s;
702
+ }
703
+
704
+ .page-builders [type=radio]:hover + img,
705
+ .page-builders [type=radio]:checked + img {
706
+ opacity: 1;
707
+ }
708
+
709
+ .astra-sites-page-builder-notice {
710
+ text-align: center;
711
+ margin: 1em 0 2em 0;
712
+ }
713
+
714
+ .current-importing-status-wrap {
715
+ font-size: 1rem;
716
+ }
717
+
718
+ .current-importing-status-wrap hr {
719
+ border-color: #f1f1f1;
720
+ }
721
+
722
+ .astra-sites-result-preview {
723
+ position: absolute;
724
+ left: 0;
725
+ right: 0;
726
+ top: 0;
727
+ bottom: 0;
728
+ background: #fff;
729
+ overflow-y: auto;
730
+ }
731
+
732
+ .astra-sites-result-preview .button {
733
+ margin-top: 1em;
734
+ }
735
+
736
+ .astra-sites-result-preview .inner {
737
+ margin: 0 auto;
738
+ max-width: 700px;
739
+ padding: 5em 0;
740
+ }
741
+
742
+ .astra-sites-result-preview h2 {
743
+ font-size: 2rem;
744
+ }
745
+
746
+ .astra-sites-result-preview p {
747
+ font-size: 1rem;
748
+ }
749
+
750
+ .current-importing-status {
751
+ font-size: 1rem;
752
+ background: #eeeeee;
753
+ padding: 1em 1.5em;
754
+ }
755
+
756
+ .current-importing-status-title {
757
+ margin-bottom: .5em;
758
+ }
759
+
760
+ .appearance_page_astra-sites .rotating {
761
+ height: auto;
762
+ animation: rotation 2s infinite linear;
763
+ width: auto;
764
+ color: #c1c1c1;
765
+ }
766
+
767
+ @-webkit-keyframes rotation {
768
+ from {
769
+ -webkit-transform: rotate(0deg);
770
+ }
771
+ to {
772
+ -webkit-transform: rotate(359deg);
773
+ }
774
+ }
775
+ .import-time {
776
+ display: inline-block;
777
+ background: #0185ba;
778
+ color: #fff;
779
+ padding: 2px 10px;
780
+ border-radius: 3px;
781
+ animation: astra-scale 0.5s alternate infinite ease-in;
782
+ }
783
+
784
+ @keyframes astra-scale {
785
+ 0% {transform: scale(1);}
786
+ 100% {transform: scale(1.03);}
787
+ }
788
+
789
+ .current-importing-status p {
790
+ margin: 0;
791
}
inc/assets/css/install-theme.css CHANGED
@@ -1,21 +1,21 @@
1
- .processing:before {
2
- margin: 0 3px 0px 0px;
3
- }
4
- .processing:before {
5
- animation: rotation 2s infinite linear;
6
- }
7
- .processing:before {
8
- color: #f56e28;
9
- content: "\f463";
10
- }
11
- .processing:before {
12
- display: inline-block;
13
- font: normal 20px/1 dashicons;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- vertical-align: top;
17
- }
18
- #astra-theme-activation-nag a {
19
- box-shadow: none;
20
- outline: none;
21
}
1
+ .processing:before {
2
+ margin: 0 3px 0px 0px;
3
+ }
4
+ .processing:before {
5
+ animation: rotation 2s infinite linear;
6
+ }
7
+ .processing:before {
8
+ color: #f56e28;
9
+ content: "\f463";
10
+ }
11
+ .processing:before {
12
+ display: inline-block;
13
+ font: normal 20px/1 dashicons;
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale;
16
+ vertical-align: top;
17
+ }
18
+ #astra-theme-activation-nag a {
19
+ box-shadow: none;
20
+ outline: none;
21
}
inc/assets/js/admin-page.js CHANGED
@@ -1,1841 +1,1841 @@
1
- /**
2
- * AJAX Request Queue
3
- *
4
- * - add()
5
- * - remove()
6
- * - run()
7
- * - stop()
8
- *
9
- * @since 1.0.0
10
- */
11
- var AstraSitesAjaxQueue = (function() {
12
-
13
- var requests = [];
14
-
15
- return {
16
-
17
- /**
18
- * Add AJAX request
19
- *
20
- * @since 1.0.0
21
- */
22
- add: function(opt) {
23
- requests.push(opt);
24
- },
25
-
26
- /**
27
- * Remove AJAX request
28
- *
29
- * @since 1.0.0
30
- */
31
- remove: function(opt) {
32
- if( jQuery.inArray(opt, requests) > -1 )
33
- requests.splice($.inArray(opt, requests), 1);
34
- },
35
-
36
- /**
37
- * Run / Process AJAX request
38
- *
39
- * @since 1.0.0
40
- */
41
- run: function() {
42
- var self = this,
43
- oriSuc;
44
-
45
- if( requests.length ) {
46
- oriSuc = requests[0].complete;
47
-
48
- requests[0].complete = function() {
49
- if( typeof(oriSuc) === 'function' ) oriSuc();
50
- requests.shift();
51
- self.run.apply(self, []);
52
- };
53
-
54
- jQuery.ajax(requests[0]);
55
-
56
- } else {
57
-
58
- self.tid = setTimeout(function() {
59
- self.run.apply(self, []);
60
- }, 1000);
61
- }
62
- },
63
-
64
- /**
65
- * Stop AJAX request
66
- *
67
- * @since 1.0.0
68
- */
69
- stop: function() {
70
-
71
- requests = [];
72
- clearTimeout(this.tid);
73
- }
74
- };
75
-
76
- }());
77
-
78
- (function($){
79
-
80
- var AstraSSEImport = {
81
- complete: {
82
- posts: 0,
83
- media: 0,
84
- users: 0,
85
- comments: 0,
86
- terms: 0,
87
- },
88
-
89
- updateDelta: function (type, delta) {
90
- this.complete[ type ] += delta;
91
-
92
- var self = this;
93
- requestAnimationFrame(function () {
94
- self.render();
95
- });
96
- },
97
- updateProgress: function ( type, complete, total ) {
98
- var text = complete + '/' + total;
99
-
100
- if( 'undefined' !== type && 'undefined' !== text ) {
101
- total = parseInt( total, 10 );
102
- if ( 0 === total || isNaN( total ) ) {
103
- total = 1;
104
- }
105
- var percent = parseInt( complete, 10 ) / total;
106
- var progress = Math.round( percent * 100 ) + '%';
107
- var progress_bar = percent * 100;
108
-
109
- if( progress_bar <= 100 ) {
110
- var process_bars = document.getElementsByClassName( 'astra-site-import-process' );
111
- for ( var i = 0; i < process_bars.length; i++ ) {
112
- process_bars[i].value = progress_bar;
113
- }
114
- AstraSitesAdmin._log_title( 'Importing Content.. ' + progress );
115
- }
116
- }
117
- },
118
- render: function () {
119
- var types = Object.keys( this.complete );
120
- var complete = 0;
121
- var total = 0;
122
-
123
- for (var i = types.length - 1; i >= 0; i--) {
124
- var type = types[i];
125
- this.updateProgress( type, this.complete[ type ], this.data.count[ type ] );
126
-
127
- complete += this.complete[ type ];
128
- total += this.data.count[ type ];
129
- }
130
-
131
- this.updateProgress( 'total', complete, total );
132
- }
133
- };
134
-
135
- AstraSitesAdmin = {
136
-
137
- reset_remaining_posts: 0,
138
- reset_remaining_wp_forms: 0,
139
- reset_remaining_terms: 0,
140
- reset_processed_posts: 0,
141
- reset_processed_wp_forms: 0,
142
- reset_processed_terms: 0,
143
- site_imported_data: null,
144
-
145
- backup_taken: false,
146
-
147
- current_site: [],
148
- current_screen: '',
149
-
150
- templateData: {},
151
-
152
- log_file : '',
153
- customizer_data : '',
154
- wxr_url : '',
155
- wpforms_url : '',
156
- options_data : '',
157
- widgets_data : '',
158
- import_start_time : '',
159
- import_end_time : '',
160
-
161
- init: function()
162
- {
163
- this._resetPagedCount();
164
- this._bind();
165
- },
166
-
167
- /**
168
- * Debugging.
169
- *
170
- * @param {mixed} data Mixed data.
171
- */
172
- _log: function( data ) {
173
-
174
- if( astraSitesAdmin.debug ) {
175
-
176
- var date = new Date();
177
- var time = date.toLocaleTimeString();
178
-
179
- if (typeof data == 'object') {
180
- console.log('%c ' + JSON.stringify( data ) + ' ' + time, 'background: #ededed; color: #444');
181
- } else {
182
- console.log('%c ' + data + ' ' + time, 'background: #ededed; color: #444');
183
- }
184
-
185
-
186
- }
187
- },
188
-
189
- _log_title: function( data, append ) {
190
-
191
- var markup = '<p>' + data + '</p>';
192
- if (typeof data == 'object' ) {
193
- var markup = '<p>' + JSON.stringify( data ) + '</p>';
194
- }
195
-
196
- if ( append ) {
197
- $('.current-importing-status-title').append( markup );
198
- } else {
199
- $('.current-importing-status-title').html( markup );
200
- }
201
- },
202
-
203
- /**
204
- * Binds events for the Astra Sites.
205
- *
206
- * @since 1.0.0
207
- * @access private
208
- * @method _bind
209
- */
210
- _bind: function()
211
- {
212
- $( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
213
- $( document ).on( 'click' , '.page-builders li', AstraSitesAdmin._toggle_reset_notice );
214
- $( document ).on('click' , '#astra-sites-welcome-form .submit', AstraSitesAdmin._show_page_builder_notice);
215
- $( document ).on('click' , '#astra-sites-welcome-form li', AstraSitesAdmin._show_next_button);
216
- $( document ).on('change' , '#astra-sites-welcome-form-inline select', AstraSitesAdmin._change_page_builder);
217
- $( document ).on('click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
218
- $( document ).on('click' , '.astra-sites-advanced-options-button', AstraSitesAdmin._toggle_advanced_options);
219
-
220
- $( document ).on('click' , '.astra-import-settings', AstraSitesAdmin._import_settings);
221
- $( document ).on('click' , '.devices button', AstraSitesAdmin._previewDevice);
222
- $( document ).on('click' , '.theme-browser .theme-screenshot, .theme-browser .more-details, .theme-browser .install-theme-preview', AstraSitesAdmin._preview);
223
- $( document ).on('click' , '.next-theme', AstraSitesAdmin._nextTheme);
224
- $( document ).on('click' , '.previous-theme', AstraSitesAdmin._previousTheme);
225
- $( document ).on('click' , '.collapse-sidebar', AstraSitesAdmin._collapse);
226
- $( document ).on('click' , '.astra-demo-import', AstraSitesAdmin._importDemo);
227
-
228
- $( document ).on('astra-sites-install-and-activate-required-plugins-done' , AstraSitesAdmin._process_import );
229
-
230
- $( document ).on('click' , '.install-now', AstraSitesAdmin._installNow);
231
- $( document ).on('click' , '.close-full-overlay', AstraSitesAdmin._fullOverlay);
232
- $( document ).on('click' , '.activate-now', AstraSitesAdmin._activateNow);
233
- $( document ).on('wp-plugin-installing' , AstraSitesAdmin._pluginInstalling);
234
- $( document ).on('wp-plugin-install-error' , AstraSitesAdmin._installError);
235
- $( document ).on('wp-plugin-install-success' , AstraSitesAdmin._installSuccess);
236
-
237
- $( document ).on( 'astra-sites-import-set-site-data-done' , AstraSitesAdmin._resetData );
238
- $( document ).on( 'astra-sites-reset-data' , AstraSitesAdmin._backup_before_rest_options );
239
- $( document ).on( 'astra-sites-backup-settings-before-reset-done' , AstraSitesAdmin._reset_customizer_data );
240
- $( document ).on( 'astra-sites-reset-customizer-data-done' , AstraSitesAdmin._reset_site_options );
241
- $( document ).on( 'astra-sites-reset-site-options-done' , AstraSitesAdmin._reset_widgets_data );
242
- $( document ).on( 'astra-sites-reset-widgets-data-done' , AstraSitesAdmin._reset_terms );
243
- $( document ).on( 'astra-sites-delete-terms-done' , AstraSitesAdmin._reset_wp_forms );
244
- $( document ).on( 'astra-sites-delete-wp-forms-done' , AstraSitesAdmin._reset_posts );
245
-
246
- $( document ).on('astra-sites-reset-data-done' , AstraSitesAdmin._recheck_backup_options );
247
- $( document ).on('astra-sites-backup-settings-done' , AstraSitesAdmin._importWPForms );
248
- $( document ).on('astra-sites-import-wpforms-done' , AstraSitesAdmin._importCustomizerSettings );
249
- $( document ).on('astra-sites-import-customizer-settings-done' , AstraSitesAdmin._importXML );
250
- $( document ).on('astra-sites-import-xml-done' , AstraSitesAdmin._importSiteOptions );
251
- $( document ).on('astra-sites-import-options-done' , AstraSitesAdmin._importWidgets );
252
- $( document ).on('astra-sites-import-widgets-done' , AstraSitesAdmin._importEnd );
253
-
254
- },
255
-
256
- _show_next_button: function() {
257
- $( this ).parents('.page-builders').find('img').removeClass('wp-ui-highlight');
258
- $( this ).find('img').addClass('wp-ui-highlight');
259
-
260
- $('#submit').parent().removeClass('submit');
261
- $('#submit').removeClass('disabled');
262
- $('.astra-sites-page-builder-notice').hide();
263
- },
264
-
265
- _show_page_builder_notice: function() {
266
- $('.astra-sites-page-builder-notice').show();
267
- },
268
-
269
- _change_page_builder: function() {
270
- $(this).closest('form').submit();
271
- },
272
-
273
- _toggle_tooltip: function( event ) {
274
- event.preventDefault();
275
- var tip_id = $( this ).data('tip-id') || '';
276
- if( tip_id && $( '#' + tip_id ).length ) {
277
- $( '#' + tip_id ).toggle();
278
- }
279
- },
280
-
281
- _toggle_advanced_options: function( event ) {
282
- event.preventDefault();
283
- $('.astra-sites-advanced-options').toggle();
284
- },
285
-
286
- _resetData: function( event ) {
287
- event.preventDefault();
288
-
289
- if ( $( '.astra-sites-reset-data' ).find('.checkbox').is(':checked') ) {
290
- $(document).trigger( 'astra-sites-reset-data' );
291
- } else {
292
- $(document).trigger( 'astra-sites-reset-data-done' );
293
- }
294
- },
295
-
296
- _reset_customizer_data: function() {
297
- $.ajax({
298
- url : astraSitesAdmin.ajaxurl,
299
- type : 'POST',
300
- data : {
301
- action : 'astra-sites-reset-customizer-data'
302
- },
303
- beforeSend: function() {
304
- AstraSitesAdmin._log_title( 'Reseting Customizer Data..' );
305
- },
306
- })
307
- .fail(function( jqXHR ){
308
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
309
- })
310
- .done(function ( data ) {
311
- AstraSitesAdmin._log_title( 'Complete Resetting Customizer Data..' );
312
- $(document).trigger( 'astra-sites-reset-customizer-data-done' );
313
- });
314
- },
315
-
316
- _reset_site_options: function() {
317
- // Site Options.
318
- $.ajax({
319
- url : astraSitesAdmin.ajaxurl,
320
- type : 'POST',
321
- data : {
322
- action : 'astra-sites-reset-site-options'
323
- },
324
- beforeSend: function() {
325
- AstraSitesAdmin._log_title( 'Reseting Site Options..' );
326
- },
327
- })
328
- .fail(function( jqXHR ){
329
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
330
- })
331
- .done(function ( data ) {
332
- AstraSitesAdmin._log_title( 'Complete Reseting Site Options..' );
333
- $(document).trigger( 'astra-sites-reset-site-options-done' );
334
- });
335
- },
336
-
337
- _reset_widgets_data: function() {
338
- // Widgets.
339
- $.ajax({
340
- url : astraSitesAdmin.ajaxurl,
341
- type : 'POST',
342
- data : {
343
- action : 'astra-sites-reset-widgets-data'
344
- },
345
- beforeSend: function() {
346
- AstraSitesAdmin._log_title( 'Reseting Widgets..' );
347
- },
348
- })
349
- .fail(function( jqXHR ){
350
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
351
- })
352
- .done(function ( data ) {
353
- AstraSitesAdmin._log_title( 'Complete Reseting Widgets..' );
354
- $(document).trigger( 'astra-sites-reset-widgets-data-done' );
355
- });
356
- },
357
-
358
- _reset_posts: function() {
359
- if( AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
360
-
361
- AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
362
-
363
- $.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
364
-
365
- AstraSitesAdmin._log_title( 'Deleting Posts..' );
366
-
367
- AstraSitesAjaxQueue.add({
368
- url: astraSitesAdmin.ajaxurl,
369
- type: 'POST',
370
- data: {
371
- action : 'astra-sites-delete-posts',
372
- post_id : post_id,
373
- },
374
- success: function( result ){
375
-
376
- if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
377
- AstraSitesAdmin.reset_processed_posts+=1;
378
- }
379
-
380
- AstraSitesAdmin._log_title( 'Deleting Post ' + AstraSitesAdmin.reset_processed_posts + ' of ' + AstraSitesAdmin.site_imported_data['reset_posts'].length + '<br/>' + result.data );
381
-
382
- AstraSitesAdmin.reset_remaining_posts-=1;
383
- if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
384
- $(document).trigger( 'astra-sites-delete-posts-done' );
385
- $(document).trigger( 'astra-sites-reset-data-done' );
386
- }
387
- }
388
- });
389
- });
390
- AstraSitesAjaxQueue.run();
391
-
392
- } else {
393
- $(document).trigger( 'astra-sites-delete-posts-done' );
394
- $(document).trigger( 'astra-sites-reset-data-done' );
395
- }
396
- },
397
-
398
- _reset_wp_forms: function() {
399
-
400
- if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
401
- AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
402
-
403
- $.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
404
- AstraSitesAdmin._log_title( 'Deleting WP Forms..' );
405
- AstraSitesAjaxQueue.add({
406
- url: astraSitesAdmin.ajaxurl,
407
- type: 'POST',
408
- data: {
409
- action : 'astra-sites-delete-wp-forms',
410
- post_id : post_id,
411
- },
412
- success: function( result ){
413
-
414
- if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
415
- AstraSitesAdmin.reset_processed_wp_forms+=1;
416
- }
417
-
418
- AstraSitesAdmin._log_title( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
419
-
420
- AstraSitesAdmin.reset_remaining_wp_forms-=1;
421
- if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
422
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
423
- }
424
- }
425
- });
426
- });
427
- AstraSitesAjaxQueue.run();
428
-
429
- } else {
430
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
431
- }
432
- },
433
-
434
-
435
- _reset_terms: function() {
436
-
437
-
438
- if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
439
- AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
440
-
441
- $.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
442
- AstraSitesAdmin._log_title( 'Deleting Terms..' );
443
- AstraSitesAjaxQueue.add({
444
- url: astraSitesAdmin.ajaxurl,
445
- type: 'POST',
446
- data: {
447
- action : 'astra-sites-delete-terms',
448
- term_id : term_id,
449
- },
450
- success: function( result ){
451
- if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
452
- AstraSitesAdmin.reset_processed_terms+=1;
453
- }
454
-
455
- AstraSitesAdmin._log_title( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
456
-
457
- AstraSitesAdmin.reset_remaining_terms-=1;
458
- if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
459
- $(document).trigger( 'astra-sites-delete-terms-done' );
460
- }
461
- }
462
- });
463
- });
464
- AstraSitesAjaxQueue.run();
465
-
466
- } else {
467
- $(document).trigger( 'astra-sites-delete-terms-done' );
468
- }
469
-
470
- },
471
-
472
- _toggle_reset_notice: function() {
473
- if ( $( this ).is(':checked') ) {
474
- $('#astra-sites-tooltip-reset-data').show();
475
- } else {
476
- $('#astra-sites-tooltip-reset-data').hide();
477
- }
478
- },
479
-
480
- _backup_before_rest_options: function() {
481
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-before-reset-done' );
482
- AstraSitesAdmin.backup_taken = true;
483
- },
484
-
485
- _recheck_backup_options: function() {
486
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-done' );
487
- AstraSitesAdmin.backup_taken = true;
488
- },
489
-
490
- _backupOptions: function( trigger_name ) {
491
- $.ajax({
492
- url : astraSitesAdmin.ajaxurl,
493
- type : 'POST',
494
- data : {
495
- action : 'astra-sites-backup-settings',
496
- },
497
- beforeSend: function() {
498
- AstraSitesAdmin._log_title( 'Processing Customizer Settings Backup..' );
499
- },
500
- })
501
- .fail(function( jqXHR ){
502
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
503
- })
504
- .done(function ( data ) {
505
-
506
- // 1. Pass - Import Customizer Options.
507
- AstraSitesAdmin._log_title( 'Customizer Settings Backup Done..' );
508
-
509
- // Custom trigger.
510
- $(document).trigger( trigger_name );
511
- });
512
- },
513
-
514
- _import_settings: function( event ) {
515
- event.preventDefault();
516
-
517
- var btn = $(this);
518
-
519
- btn.addClass('updating-message');
520
-
521
-
522
- $.ajax({
523
- url : astraSitesAdmin.ajaxurl,
524
- type : 'POST',
525
- dataType: 'json',
526
- data : {
527
- action : 'astra-sites-import-customizer-settings',
528
- customizer_data : AstraSitesAdmin.current_site['astra-site-customizer-data'],
529
- },
530
- beforeSend: function() {
531
- AstraSitesAdmin._log_title( 'Importing Customizer Settings..' );
532
- },
533
- })
534
- .fail(function( jqXHR ){
535
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
536
- })
537
- .done(function ( customizer_data ) {
538
-
539
- btn.removeClass( 'updating-message' );
540
-
541
- // 1. Fail - Import Customizer Options.
542
- if( false === customizer_data.success ) {
543
- AstraSitesAdmin._log_title( customizer_data.data );
544
- } else {
545
-
546
- // 1. Pass - Import Customizer Options.
547
- AstraSitesAdmin._log_title( 'Imported Customizer Settings..' );
548
-
549
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
550
- }
551
- });
552
- },
553
-
554
- /**
555
- * 5. Import Complete.
556
- */
557
- _importEnd: function( event ) {
558
-
559
- $.ajax({
560
- url : astraSitesAdmin.ajaxurl,
561
- type : 'POST',
562
- dataType: 'json',
563
- data : {
564
- action : 'astra-sites-import-end',
565
- },
566
- beforeSend: function() {
567
- AstraSitesAdmin._log_title( 'Import Complete!' );
568
- }
569
- })
570
- .fail(function( jqXHR ){
571
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
572
- })
573
- .done(function ( data ) {
574
-
575
- // 5. Fail - Import Complete.
576
- if( false === data.success ) {
577
- AstraSitesAdmin._log_title( data.data );
578
- } else {
579
-
580
- $('body').removeClass('importing-site');
581
- $('.previous-theme, .next-theme').removeClass('disabled');
582
-
583
- var date = new Date();
584
-
585
- AstraSitesAdmin.import_end_time = new Date();
586
- var diff = ( AstraSitesAdmin.import_end_time.getTime() - AstraSitesAdmin.import_start_time.getTime() );
587
-
588
- var time = '';
589
- var seconds = Math.floor( diff / 1000 );
590
- var minutes = Math.floor( seconds / 60 );
591
- var hours = Math.floor( minutes / 60 );
592
-
593
- minutes = minutes - ( hours * 60 );
594
- seconds = seconds - ( minutes * 60 );
595
-
596
- if( hours ) {
597
- time += hours + ' Hours ';
598
- }
599
- if( minutes ) {
600
- time += minutes + ' Minutes ';
601
- }
602
- if( seconds ) {
603
- time += seconds + ' Seconds';
604
- }
605
-
606
- var output = '<h2>Done 🎉</h2>';
607
- output += '<p>Your starter site has been imported successfully in '+time+'! Now go ahead, customize the text, images, and design to make it yours!</p>';
608
- output += '<p>You can now start making changes according to your requirements.</p>';
609
- output += '<p><a class="button button-primary button-hero" href="'+astraSitesAdmin.siteURL+'" target="_blank">View Site <i class="dashicons dashicons-external"></i></a></p>';
610
-
611
- $('.rotating,.current-importing-status-wrap,.notice-warning').remove();
612
- $('.astra-sites-result-preview .inner').html(output);
613
-
614
- // 5. Pass - Import Complete.
615
- AstraSitesAdmin._importSuccessButton();
616
- }
617
- });
618
- },
619
-
620
- /**
621
- * 4. Import Widgets.
622
- */
623
- _importWidgets: function( event ) {
624
- if ( AstraSitesAdmin._is_process_widgets() ) {
625
- $.ajax({
626
- url : astraSitesAdmin.ajaxurl,
627
- type : 'POST',
628
- dataType: 'json',
629
- data : {
630
- action : 'astra-sites-import-widgets',
631
- widgets_data : AstraSitesAdmin.widgets_data,
632
- },
633
- beforeSend: function() {
634
- AstraSitesAdmin._log_title( 'Importing Widgets..' );
635
- },
636
- })
637
- .fail(function( jqXHR ){
638
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
639
- })
640
- .done(function ( widgets_data ) {
641
-
642
- // 4. Fail - Import Widgets.
643
- if( false === widgets_data.success ) {
644
- AstraSitesAdmin._log_title( widgets_data.data );
645
-
646
- } else {
647
-
648
- // 4. Pass - Import Widgets.
649
- AstraSitesAdmin._log_title( 'Imported Widgets!' );
650
- $(document).trigger( 'astra-sites-import-widgets-done' );
651
- }
652
- });
653
- } else {
654
- $(document).trigger( 'astra-sites-import-widgets-done' );
655
- }
656
- },
657
-
658
- /**
659
- * 3. Import Site Options.
660
- */
661
- _importSiteOptions: function( event ) {
662
-
663
- if ( AstraSitesAdmin._is_process_xml() ) {
664
- $.ajax({
665
- url : astraSitesAdmin.ajaxurl,
666
- type : 'POST',
667
- dataType: 'json',
668
- data : {
669
- action : 'astra-sites-import-options',
670
- options_data : AstraSitesAdmin.options_data,
671
- },
672
- beforeSend: function() {
673
- AstraSitesAdmin._log_title( 'Importing Options..' );
674
- $('.astra-demo-import .percent').html('');
675
- },
676
- })
677
- .fail(function( jqXHR ){
678
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
679
- })
680
- .done(function ( options_data ) {
681
-
682
- // 3. Fail - Import Site Options.
683
- if( false === options_data.success ) {
684
- AstraSitesAdmin._log_title( options_data );
685
- } else {
686
-
687
- // 3. Pass - Import Site Options.
688
- $(document).trigger( 'astra-sites-import-options-done' );
689
- }
690
- });
691
- } else {
692
- $(document).trigger( 'astra-sites-import-options-done' );
693
- }
694
- },
695
-
696
- /**
697
- * 2. Prepare XML Data.
698
- */
699
- _importXML: function() {
700
-
701
- if ( AstraSitesAdmin._is_process_xml() ) {
702
- $.ajax({
703
- url : astraSitesAdmin.ajaxurl,
704
- type : 'POST',
705
- dataType: 'json',
706
- data : {
707
- action : 'astra-sites-import-prepare-xml',
708
- wxr_url : AstraSitesAdmin.current_site['astra-site-wxr-path'],
709
- },
710
- beforeSend: function() {
711
- $('.astra-site-import-process-wrap').show();
712
- AstraSitesAdmin._log_title( 'Importing Content..' );
713
- },
714
- })
715
- .fail(function( jqXHR ){
716
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
717
- })
718
- .done(function ( xml_data ) {
719
-
720
- // 2. Fail - Prepare XML Data.
721
- if( false === xml_data.success ) {
722
- AstraSitesAdmin._log_title( xml_data );
723
- var error_msg = xml_data.data.error || xml_data.data;
724
- AstraSitesAdmin._log_title( error_msg );
725
-
726
- } else {
727
-
728
- var xml_processing = $('.astra-demo-import').attr( 'data-xml-processing' );
729
-
730
- if( 'yes' === xml_processing ) {
731
- return;
732
- }
733
-
734
- $('.astra-demo-import').attr( 'data-xml-processing', 'yes' );
735
-
736
- // 2. Pass - Prepare XML Data.
737
-
738
- // Import XML though Event Source.
739
- AstraSSEImport.data = xml_data.data;
740
- AstraSSEImport.render();
741
-
742
- $('.current-importing-status-description').html('').show();
743
-
744
- $('.astra-sites-result-preview .inner').append('<div class="astra-site-import-process-wrap"><progress class="astra-site-import-process" max="100" value="0"></progress></div>');
745
-
746
- var evtSource = new EventSource( AstraSSEImport.data.url );
747
- evtSource.onmessage = function ( message ) {
748
- var data = JSON.parse( message.data );
749
- switch ( data.action ) {
750
- case 'updateDelta':
751
-
752
- AstraSSEImport.updateDelta( data.type, data.delta );
753
- break;
754
-
755
- case 'complete':
756
- evtSource.close();
757
-
758
- $('.current-importing-status-description').hide();
759
- $('.astra-demo-import').removeAttr( 'data-xml-processing' );
760
-
761
- document.getElementsByClassName("astra-site-import-process").value = '100';
762
-
763
- $('.astra-site-import-process-wrap').hide();
764
-
765
- $(document).trigger( 'astra-sites-import-xml-done' );
766
-
767
- break;
768
- }
769
- };
770
- evtSource.addEventListener( 'log', function ( message ) {
771
- var data = JSON.parse( message.data );
772
- var message = data.message || '';
773
- if( message && 'info' === data.level ) {
774
- message = message.replace(/"/g, function(letter) {
775
- return '';
776
- });
777
- $('.current-importing-status-description').html( message );
778
- }
779
- });
780
- }
781
- });
782
- } else {
783
- $(document).trigger( 'astra-sites-import-xml-done' );
784
- }
785
-
786
-
787
- },
788
-
789
- _is_process_xml: function() {
790
- if ( $( '.astra-sites-import-xml' ).find('.checkbox').is(':checked') ) {
791
- return true;
792
- }
793
- return false;
794
- },
795
-
796
- _is_process_customizer: function() {
797
- if ( $( '.astra-sites-import-customizer' ).find('.checkbox').is(':checked') ) {
798
- return true;
799
- }
800
- return false;
801
- },
802
-
803
- _is_process_widgets: function() {
804
- if ( $( '.astra-sites-import-widgets' ).find('.checkbox').is(':checked') ) {
805
- return true;
806
- }
807
- return false;
808
- },
809
-
810
- /**
811
- * 1. Import WPForms Options.
812
- */
813
- _importWPForms: function( event ) {
814
- if ( AstraSitesAdmin._is_process_customizer() ) {
815
- $.ajax({
816
- url : astraSitesAdmin.ajaxurl,
817
- type : 'POST',
818
- dataType: 'json',
819
- data : {
820
- action : 'astra-sites-import-wpforms',
821
- wpforms_url : AstraSitesAdmin.wpforms_url,
822
- },
823
- beforeSend: function() {
824
- AstraSitesAdmin._log_title( 'Importing WP Forms..' );
825
- },
826
- })
827
- .fail(function( jqXHR ){
828
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
829
- })
830
- .done(function ( forms ) {
831
-
832
- // 1. Fail - Import WPForms Options.
833
- if( false === forms.success ) {
834
- AstraSitesAdmin._log_title( forms.data );
835
- } else {
836
-
837
- // 1. Pass - Import Customizer Options.
838
- $(document).trigger( 'astra-sites-import-wpforms-done' );
839
- }
840
- });
841
- } else {
842
- $(document).trigger( 'astra-sites-import-wpforms-done' );
843
- }
844
- },
845
-
846
- /**
847
- * 1. Import Customizer Options.
848
- */
849
- _importCustomizerSettings: function( event ) {
850
- if ( AstraSitesAdmin._is_process_customizer() ) {
851
- $.ajax({
852
- url : astraSitesAdmin.ajaxurl,
853
- type : 'POST',
854
- dataType: 'json',
855
- data : {
856
- action : 'astra-sites-import-customizer-settings',
857
- customizer_data : AstraSitesAdmin.customizer_data,
858
- },
859
- beforeSend: function() {
860
- },
861
- })
862
- .fail(function( jqXHR ){
863
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
864
- })
865
- .done(function ( customizer_data ) {
866
-
867
- // 1. Fail - Import Customizer Options.
868
- if( false === customizer_data.success ) {
869
- AstraSitesAdmin._log_title( customizer_data.data );
870
- } else {
871
-
872
- // 1. Pass - Import Customizer Options.
873
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
874
- }
875
- });
876
- } else {
877
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
878
- }
879
-
880
- },
881
-
882
- /**
883
- * Import Success Button.
884
- *
885
- * @param {string} data Error message.
886
- */
887
- _importSuccessButton: function() {
888
-
889
- $('.astra-demo-import').removeClass('updating-message installing')
890
- .removeAttr('data-import')
891
- .addClass('view-site')
892
- .removeClass('astra-demo-import')
893
- .text( astraSitesAdmin.strings.viewSite )
894
- .attr('target', '_blank')
895
- .append('<i class="dashicons dashicons-external"></i>')
896
- .attr('href', astraSitesAdmin.siteURL );
897
- },
898
-
899
- /**
900
- * Preview Device
901
- */
902
- _previewDevice: function( event ) {
903
- var device = $( event.currentTarget ).data( 'device' );
904
-
905
- $('.theme-install-overlay')
906
- .removeClass( 'preview-desktop preview-tablet preview-mobile' )
907
- .addClass( 'preview-' + device )
908
- .data( 'current-preview-device', device );
909
-
910
- AstraSitesAdmin._tooglePreviewDeviceButtons( device );
911
- },
912
-
913
- /**
914
- * Toggle Preview Buttons
915
- */
916
- _tooglePreviewDeviceButtons: function( newDevice ) {
917
- var $devices = $( '.wp-full-overlay-footer .devices' );
918
-
919
- $devices.find( 'button' )
920
- .removeClass( 'active' )
921
- .attr( 'aria-pressed', false );
922
-
923
- $devices.find( 'button.preview-' + newDevice )
924
- .addClass( 'active' )
925
- .attr( 'aria-pressed', true );
926
- },
927
-
928
- /**
929
- * Import Error Button.
930
- *
931
- * @param {string} data Error message.
932
- */
933
- _importFailMessage: function( message ) {
934
-
935
- $('.astra-demo-import')
936
- .addClass('go-pro button-primary')
937
- .removeClass('updating-message installing')
938
- .removeAttr('data-import')
939
- .attr('target', '_blank')
940
- .append('<i class="dashicons dashicons-external"></i>')
941
- .removeClass('astra-demo-import');
942
-
943
- AstraSitesAdmin._log_title( message );
944
-
945
- $('.wp-full-overlay-header .go-pro').text( astraSitesAdmin.strings.importFailBtn );
946
- $('.wp-full-overlay-footer .go-pro').text( astraSitesAdmin.strings.importFailBtnLarge )
947
- },
948
-
949
-
950
- /**
951
- * Install Now
952
- */
953
- _installNow: function(event)
954
- {
955
- event.preventDefault();
956
-
957
- var $button = jQuery( event.target ),
958
- $document = jQuery(document);
959
-
960
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
961
- return;
962
- }
963
-
964
- AstraSitesAdmin._log_title( 'Installing Required Plugin..' );
965
-
966
- if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
967
- wp.updates.requestFilesystemCredentials( event );
968
-
969
- $document.on( 'credential-modal-cancel', function() {
970
- var $message = $( '.install-now.updating-message' );
971
-
972
- $message
973
- .removeClass( 'updating-message' )
974
- .text( wp.updates.l10n.installNow );
975
-
976
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
977
- } );
978
- }
979
-
980
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $button.data( 'name' ) ) );
981
-
982
- wp.updates.installPlugin( {
983
- slug: $button.data( 'slug' )
984
- } );
985
- },
986
-
987
- ucwords: function( str ) {
988
- if( ! str ) {
989
- return '';
990
- }
991
-
992
- str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
993
- return letter.toUpperCase();
994
- });
995
-
996
- str = str.replace(/-/g, function(letter) {
997
- return ' ';
998
- });
999
-
1000
- return str;
1001
- },
1002
-
1003
- /**
1004
- * Install Success
1005
- */
1006
- _installSuccess: function( event, response ) {
1007
-
1008
- event.preventDefault();
1009
-
1010
-
1011
- var $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val();
1012
-
1013
- var $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1014
-
1015
- // Transform the 'Install' button into an 'Activate' button.
1016
- var $init = $( '.plugin-card-' + response.slug ).data('init');
1017
- var $name = $( '.plugin-card-' + response.slug ).data('name');
1018
-
1019
- // Reset not installed plugins list.
1020
- var pluginsList = astraSitesAdmin.requiredPlugins.notinstalled;
1021
- astraSitesAdmin.requiredPlugins.notinstalled = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1022
-
1023
- // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
1024
- setTimeout( function() {
1025
-
1026
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords($name) );
1027
-
1028
- $.ajax({
1029
- url: astraSitesAdmin.ajaxurl,
1030
- type: 'POST',
1031
- data: {
1032
- 'action' : 'astra-required-plugin-activate',
1033
- 'init' : $init,
1034
- 'options' : $siteOptions,
1035
- 'enabledExtensions' : $enabledExtensions,
1036
- },
1037
- })
1038
- .done(function (result) {
1039
-
1040
- if( result.success ) {
1041
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1042
-
1043
- AstraSitesAdmin._log_title( 'Installed Plugin - ' + AstraSitesAdmin.ucwords($name) );
1044
-
1045
- // Reset not installed plugins list.
1046
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1047
-
1048
- // Enable Demo Import Button
1049
- AstraSitesAdmin._enable_demo_import_button();
1050
-
1051
- }
1052
- });
1053
-
1054
- }, 1200 );
1055
-
1056
- },
1057
-
1058
- /**
1059
- * Plugin Installation Error.
1060
- */
1061
- _installError: function( event, response ) {
1062
-
1063
- var $card = $( '.plugin-card-' + response.slug );
1064
- var $name = $card.data('name');
1065
-
1066
- AstraSitesAdmin._log_title( response.errorMessage + ' ' + AstraSitesAdmin.ucwords($name) );
1067
-
1068
-
1069
- $card
1070
- .removeClass( 'button-primary' )
1071
- .addClass( 'disabled' )
1072
- .html( wp.updates.l10n.installFailedShort );
1073
-
1074
- },
1075
-
1076
- /**
1077
- * Installing Plugin
1078
- */
1079
- _pluginInstalling: function(event, args) {
1080
- event.preventDefault();
1081
-
1082
- var $card = $( '.plugin-card-' + args.slug );
1083
- var $name = $card.data('name');
1084
-
1085
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $name ));
1086
-
1087
- $card.addClass('updating-message');
1088
-
1089
- },
1090
-
1091
- /**
1092
- * Render Demo Preview
1093
- */
1094
- _activateNow: function( eventn ) {
1095
-
1096
- event.preventDefault();
1097
-
1098
- var $button = jQuery( event.target ),
1099
- $init = $button.data( 'init' ),
1100
- $slug = $button.data( 'slug' );
1101
- $name = $button.data( 'name' );
1102
-
1103
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
1104
- return;
1105
- }
1106
-
1107
- AstraSitesAdmin._log_title( 'Activating Plugin - ' + AstraSitesAdmin.ucwords( $name ) );
1108
-
1109
- $button.addClass('updating-message button-primary')
1110
- .html( astraSitesAdmin.strings.btnActivating );
1111
-
1112
- var $siteOptions = jQuery( '.wp-full-overlay-header').find('.astra-site-options').val();
1113
- var $enabledExtensions = jQuery( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1114
-
1115
- $.ajax({
1116
- url: astraSitesAdmin.ajaxurl,
1117
- type: 'POST',
1118
- data: {
1119
- 'action' : 'astra-required-plugin-activate',
1120
- 'init' : $init,
1121
- 'options' : $siteOptions,
1122
- 'enabledExtensions' : $enabledExtensions,
1123
- },
1124
- })
1125
- .done(function (result) {
1126
-
1127
- if( result.success ) {
1128
-
1129
- AstraSitesAdmin._log_title( 'Activated Plugin - ' + AstraSitesAdmin.ucwords($name) );
1130
-
1131
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1132
-
1133
- // Reset not installed plugins list.
1134
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( $slug, pluginsList );
1135
-
1136
- $button.removeClass( 'button-primary install-now activate-now updating-message' )
1137
- .attr('disabled', 'disabled')
1138
- .addClass('disabled')
1139
- .text( astraSitesAdmin.strings.btnActive );
1140
-
1141
- // Enable Demo Import Button
1142
- AstraSitesAdmin._enable_demo_import_button();
1143
-
1144
- }
1145
-
1146
- })
1147
- .fail(function () {
1148
- });
1149
-
1150
- },
1151
-
1152
- /**
1153
- * Full Overlay
1154
- */
1155
- _fullOverlay: function (event) {
1156
- event.preventDefault();
1157
-
1158
- // Import process is started?
1159
- // And Closing the window? Then showing the warning confirm message.
1160
- if( $('body').hasClass('importing-site') && ! confirm( astraSitesAdmin.strings.warningBeforeCloseWindow ) ) {
1161
- return;
1162
- }
1163
-
1164
- $('body').removeClass('importing-site');
1165
- $('.previous-theme, .next-theme').removeClass('disabled');
1166
- $('.theme-install-overlay').css('display', 'none');
1167
- $('.theme-install-overlay').remove();
1168
- $('.theme-preview-on').removeClass('theme-preview-on');
1169
- $('html').removeClass('astra-site-preview-on');
1170
- },
1171
-
1172
- /**
1173
- * Bulk Plugin Active & Install
1174
- */
1175
- _bulkPluginInstallActivate: function()
1176
- {
1177
- if( 0 === astraSitesAdmin.requiredPlugins.length ) {
1178
- return;
1179
- }
1180
-
1181
- var not_installed = astraSitesAdmin.requiredPlugins.notinstalled || '';
1182
- var activate_plugins = astraSitesAdmin.requiredPlugins.inactive || '';
1183
-
1184
- // First Install Bulk.
1185
- if( not_installed.length > 0 ) {
1186
- AstraSitesAdmin._installAllPlugins( not_installed );
1187
- }
1188
-
1189
- // Second Activate Bulk.
1190
- if( activate_plugins.length > 0 ) {
1191
- AstraSitesAdmin._activateAllPlugins( activate_plugins );
1192
- }
1193
-
1194
- if( activate_plugins.length <= 0 && not_installed.length <= 0 ) {
1195
- AstraSitesAdmin._enable_demo_import_button();
1196
- }
1197
-
1198
- },
1199
-
1200
- /**
1201
- * Activate All Plugins.
1202
- */
1203
- _activateAllPlugins: function( activate_plugins ) {
1204
-
1205
- AstraSitesAdmin._log_title( 'Activating Required Plugins..' );
1206
-
1207
- $.each( activate_plugins, function(index, single_plugin) {
1208
-
1209
- var $card = $( '.plugin-card-' + single_plugin.slug ),
1210
- $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val(),
1211
- $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1212
-
1213
-
1214
- AstraSitesAjaxQueue.add({
1215
- url: astraSitesAdmin.ajaxurl,
1216
- type: 'POST',
1217
- data: {
1218
- 'action' : 'astra-required-plugin-activate',
1219
- 'init' : single_plugin.init,
1220
- 'options' : $siteOptions,
1221
- 'enabledExtensions' : $enabledExtensions,
1222
- },
1223
- success: function( result ){
1224
-
1225
- if( result.success ) {
1226
-
1227
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1228
-
1229
- // Reset not installed plugins list.
1230
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( single_plugin.slug, pluginsList );
1231
-
1232
- // Enable Demo Import Button
1233
- AstraSitesAdmin._enable_demo_import_button();
1234
- } else {
1235
- }
1236
- }
1237
- });
1238
- });
1239
- AstraSitesAjaxQueue.run();
1240
- },
1241
-
1242
- /**
1243
- * Install All Plugins.
1244
- */
1245
- _installAllPlugins: function( not_installed ) {
1246
-
1247
- AstraSitesAdmin._log_title( 'Installing Required Plugins..' );
1248
-
1249
- $.each( not_installed, function(index, single_plugin) {
1250
-
1251
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( single_plugin.name ));
1252
-
1253
- var $card = $( '.plugin-card-' + single_plugin.slug );
1254
-
1255
- // Add each plugin activate request in Ajax queue.
1256
- // @see wp-admin/js/updates.js
1257
- wp.updates.queue.push( {
1258
- action: 'install-plugin', // Required action.
1259
- data: {
1260
- slug: single_plugin.slug
1261
- }
1262
- } );
1263
- });
1264
-
1265
- // Required to set queue.
1266
- wp.updates.queueChecker();
1267
- },
1268
-
1269
- /**
1270
- * Fires when a nav item is clicked.
1271
- *
1272
- * @since 1.0
1273
- * @access private
1274
- * @method _importDemo
1275
- */
1276
- _importDemo: function(event) {
1277
- event.preventDefault();
1278
-
1279
- var date = new Date();
1280
-
1281
- AstraSitesAdmin.import_start_time = new Date();
1282
-
1283
- var disabled = $(this).attr('data-import');
1284
-
1285
- if ( typeof disabled !== 'undefined' && disabled === 'disabled' || $this.hasClass('disabled') ) {
1286
-
1287
- $('.astra-demo-import').addClass('updating-message installing')
1288
- .text( wp.updates.l10n.installing );
1289
-
1290
- $('.astra-sites-result-preview').show();
1291
- var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
1292
- $('.current-importing-status').html( output );
1293
-
1294
- /**
1295
- * Process Bulk Plugin Install & Activate
1296
- */
1297
- AstraSitesAdmin._bulkPluginInstallActivate();
1298
- }
1299
- },
1300
-
1301
- _process_import: function() {
1302
-
1303
- var $theme = $('.astra-sites-preview').find('.wp-full-overlay-header'),
1304
- apiURL = $theme.data('demo-api') || '';
1305
-
1306
- $('body').addClass('importing-site');
1307
- $('.previous-theme, .next-theme').addClass('disabled');
1308
-
1309
- // Remove all notices before import start.
1310
- $('.install-theme-info > .notice').remove();
1311
-
1312
- $('.astra-demo-import').attr('data-import', 'disabled')
1313
- .addClass('updating-message installing')
1314
- .text( astraSitesAdmin.strings.importingDemo );
1315
-
1316
- // Site Import by API URL.
1317
- if( apiURL ) {
1318
- AstraSitesAdmin._importSite( apiURL );
1319
- }
1320
-
1321
- },
1322
-
1323
- /**
1324
- * Start Import Process by API URL.
1325
- *
1326
- * @param {string} apiURL Site API URL.
1327
- */
1328
- _importSite: function( apiURL ) {
1329
-
1330
- AstraSitesAdmin._log_title( 'Started Importing..' );
1331
-
1332
- // 1. Request Site Import
1333
- $.ajax({
1334
- url : astraSitesAdmin.ajaxurl,
1335
- type : 'POST',
1336
- dataType: 'json',
1337
- data : {
1338
- 'action' : 'astra-sites-import-set-site-data',
1339
- 'api_url' : apiURL,
1340
- },
1341
- })
1342
- .fail(function( jqXHR ){
1343
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
1344
- })
1345
- .done(function ( demo_data ) {
1346
-
1347
- // 1. Fail - Request Site Import
1348
- if( false === demo_data.success ) {
1349
- AstraSitesAdmin._importFailMessage( demo_data.data );
1350
- } else {
1351
-
1352
- // Set log file URL.
1353
- if( 'log_file' in demo_data.data ){
1354
- AstraSitesAdmin.log_file_url = decodeURIComponent( demo_data.data.log_file ) || '';
1355
- }
1356
-
1357
- // 1. Pass - Request Site Import
1358
- AstraSitesAdmin.customizer_data = JSON.stringify( demo_data.data['astra-site-customizer-data'] ) || '';
1359
- AstraSitesAdmin.wxr_url = encodeURI( demo_data.data['astra-site-wxr-path'] ) || '';
1360
- AstraSitesAdmin.wpforms_url = encodeURI( demo_data.data['astra-site-wpforms-path'] ) || '';
1361
- AstraSitesAdmin.options_data = JSON.stringify( demo_data.data['astra-site-options-data'] ) || '';
1362
- AstraSitesAdmin.widgets_data = JSON.stringify( demo_data.data['astra-site-widgets-data'] ) || '';
1363
-
1364
- $(document).trigger( 'astra-sites-import-set-site-data-done' );
1365
- }
1366
-
1367
- });
1368
-
1369
- },
1370
-
1371
- /**
1372
- * Collapse Sidebar.
1373
- */
1374
- _collapse: function() {
1375
- event.preventDefault();
1376
-
1377
- overlay = jQuery('.wp-full-overlay');
1378
-
1379
- if (overlay.hasClass('expanded')) {
1380
- overlay.removeClass('expanded');
1381
- overlay.addClass('collapsed');
1382
- return;
1383
- }
1384
-
1385
- if (overlay.hasClass('collapsed')) {
1386
- overlay.removeClass('collapsed');
1387
- overlay.addClass('expanded');
1388
- return;
1389
- }
1390
- },
1391
-
1392
- /**
1393
- * Previous Theme.
1394
- */
1395
- _previousTheme: function (event) {
1396
- event.preventDefault();
1397
-
1398
- currentDemo = jQuery('.theme-preview-on');
1399
- currentDemo.removeClass('theme-preview-on');
1400
- prevDemo = currentDemo.prev('.theme');
1401
- prevDemo.addClass('theme-preview-on');
1402
-
1403
- var site_id = $(this).parents('.wp-full-overlay-header').data('demo-id') || '';
1404
-
1405
- if( AstraSitesAPI._stored_data ) {
1406
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1407
-
1408
-
1409
- if( site_data ) {
1410
- // Set current site details.
1411
- AstraSitesAdmin.current_site = site_data;
1412
- }
1413
- }
1414
-
1415
- AstraSitesAdmin._renderDemoPreview(prevDemo);
1416
- },
1417
-
1418
- /**
1419
- * Next Theme.
1420
- */
1421
- _nextTheme: function (event) {
1422
- event.preventDefault();
1423
- currentDemo = jQuery('.theme-preview-on')
1424
- currentDemo.removeClass('theme-preview-on');
1425
- nextDemo = currentDemo.next('.theme');
1426
- nextDemo.addClass('theme-preview-on');
1427
-
1428
- var site_id = $(this).parents('.wp-full-overlay-header').data('demo-id') || '';
1429
-
1430
- if( AstraSitesAPI._stored_data ) {
1431
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1432
-
1433
- if( site_data ) {
1434