Version Description
Download this release
Release Info
Developer | patilvikasj |
Plugin | Astra Starter Sites |
Version | 1.3.5 |
Comparing to | |
See all releases |
Code changes from version 1.3.4 to 1.3.5
- astra-sites.php +54 -54
- inc/assets/css/admin.css +149 -21
- inc/assets/images/beaver-builder.png +0 -0
- inc/assets/images/brizy.jpg +0 -0
- inc/assets/images/elementor.jpg +0 -0
- inc/assets/images/gutenberg.jpg +0 -0
- inc/assets/js/admin-page.js +181 -143
- inc/assets/js/astra-sites-api.js +27 -31
- inc/assets/js/astra-sites-notices.js +0 -21
- inc/assets/js/fetch.umd.js +531 -0
- inc/assets/js/install-theme.js +23 -3
- inc/assets/js/render-grid.js +118 -16
- inc/classes/class-astra-sites-importer-log.php +1 -190
- inc/classes/class-astra-sites-importer.php +25 -28
- inc/classes/class-astra-sites-notices.php +0 -214
- inc/classes/class-astra-sites-page.php +86 -12
- inc/classes/class-astra-sites-white-label.php +1 -1
- inc/classes/class-astra-sites.php +40 -25
- inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php +3 -3
- inc/importers/batch-processing/class-astra-sites-batch-processing-beaver-builder.php +2 -2
- inc/importers/batch-processing/class-astra-sites-batch-processing-brizy.php +1 -1
- inc/importers/batch-processing/class-astra-sites-batch-processing-elementor.php +0 -2
- inc/importers/batch-processing/class-astra-sites-batch-processing-gutenberg.php +2 -2
- inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php +2 -2
- inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php +1 -1
- inc/importers/batch-processing/class-astra-sites-batch-processing.php +3 -2
- inc/importers/batch-processing/helpers/class-astra-sites-image-importer.php +5 -25
- inc/importers/batch-processing/helpers/class-wp-background-process-astra.php +5 -1
- inc/importers/wxr-importer/class-astra-wxr-importer.php +5 -0
- inc/includes/admin-page.php +15 -5
- inc/lib/astra-notices/class-astra-notices.php +334 -0
- inc/lib/astra-notices/notices.js +94 -0
- languages/astra-sites.pot +178 -155
- readme.txt +7 -1
astra-sites.php
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Astra Starter Sites – Elementor, Beaver Builder & Gutenberg Templates
|
4 |
-
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
-
* Description: Import free sites build with Astra theme.
|
6 |
-
* Version: 1.3.
|
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.
|
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 – Elementor, Beaver Builder & Gutenberg Templates
|
4 |
+
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
+
* Description: Import free sites build with Astra theme.
|
6 |
+
* Version: 1.3.5
|
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.5' );
|
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
@@ -503,9 +503,8 @@ body.loading-content .select-page-builder {
|
|
503 |
margin-bottom: 1em;
|
504 |
}
|
505 |
|
506 |
-
.astra-sites-welcome p
|
507 |
font-size: 1rem;
|
508 |
-
margin-bottom: 2em;
|
509 |
}
|
510 |
|
511 |
.astra-sites-welcome select {
|
@@ -513,24 +512,15 @@ body.loading-content .select-page-builder {
|
|
513 |
height: 100%;
|
514 |
}
|
515 |
|
516 |
-
.astra-sites-welcome
|
517 |
text-align: center;
|
518 |
margin: 0;
|
519 |
padding: 0;
|
520 |
margin-left: .5em;
|
521 |
}
|
522 |
|
523 |
-
.astra-sites-welcome .
|
524 |
-
|
525 |
-
vertical-align: middle;
|
526 |
-
align-items: center;
|
527 |
-
justify-content: center;
|
528 |
-
}
|
529 |
-
|
530 |
-
.astra-sites-welcome #submit {
|
531 |
-
line-height: 1;
|
532 |
-
padding: .5rem 1rem;
|
533 |
-
height: auto;
|
534 |
}
|
535 |
|
536 |
.astra-site-page-builder {
|
@@ -559,7 +549,7 @@ body.loading-content .select-page-builder {
|
|
559 |
margin: 0;
|
560 |
}
|
561 |
|
562 |
-
|
563 |
display: flex;
|
564 |
align-items: center;
|
565 |
margin-top: -2px;
|
@@ -568,7 +558,16 @@ body.loading-content .select-page-builder {
|
|
568 |
border-radius: 3px;
|
569 |
overflow: hidden;
|
570 |
}
|
571 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
padding: 0px;
|
573 |
border: 0 none;
|
574 |
background: #0085bd;
|
@@ -577,10 +576,15 @@ body.loading-content .select-page-builder {
|
|
577 |
flex: 1;
|
578 |
}
|
579 |
|
580 |
-
|
|
|
|
|
|
|
|
|
581 |
background: #00679b;
|
582 |
}
|
583 |
-
|
|
|
584 |
background: transparent;
|
585 |
}
|
586 |
|
@@ -603,9 +607,19 @@ body.loading-content .select-page-builder {
|
|
603 |
pointer-events: none;
|
604 |
}
|
605 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
.astra-sites-tooltip-icon .dashicons {
|
607 |
-
color: #
|
608 |
-
font-size:
|
|
|
|
|
609 |
}
|
610 |
|
611 |
#astra-sites-welcome-form-inline {
|
@@ -652,4 +666,118 @@ body.loading-content .select-page-builder {
|
|
652 |
width: 100%;
|
653 |
border: none;
|
654 |
margin: 0;
|
655 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
margin-bottom: 1em;
|
504 |
}
|
505 |
|
506 |
+
.astra-sites-welcome p {
|
507 |
font-size: 1rem;
|
|
|
508 |
}
|
509 |
|
510 |
.astra-sites-welcome select {
|
512 |
height: 100%;
|
513 |
}
|
514 |
|
515 |
+
.astra-sites-welcome .submit {
|
516 |
text-align: center;
|
517 |
margin: 0;
|
518 |
padding: 0;
|
519 |
margin-left: .5em;
|
520 |
}
|
521 |
|
522 |
+
.astra-sites-welcome .disabled {
|
523 |
+
pointer-events: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
}
|
525 |
|
526 |
.astra-site-page-builder {
|
549 |
margin: 0;
|
550 |
}
|
551 |
|
552 |
+
.astra-site-import-process-wrap {
|
553 |
display: flex;
|
554 |
align-items: center;
|
555 |
margin-top: -2px;
|
558 |
border-radius: 3px;
|
559 |
overflow: hidden;
|
560 |
}
|
561 |
+
|
562 |
+
.astra-sites-result-preview .astra-site-import-process-wrap progress {
|
563 |
+
background: #eeeeee;
|
564 |
+
}
|
565 |
+
|
566 |
+
.astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
|
567 |
+
background: #0185ba;
|
568 |
+
}
|
569 |
+
|
570 |
+
.astra-site-import-process-wrap progress {
|
571 |
padding: 0px;
|
572 |
border: 0 none;
|
573 |
background: #0085bd;
|
576 |
flex: 1;
|
577 |
}
|
578 |
|
579 |
+
.astra-sites-result-preview .dashicons {
|
580 |
+
vertical-align: text-bottom;
|
581 |
+
}
|
582 |
+
|
583 |
+
.astra-site-import-process-wrap progress::-webkit-progress-value {
|
584 |
background: #00679b;
|
585 |
}
|
586 |
+
|
587 |
+
.astra-site-import-process-wrap progress::-webkit-progress-bar {
|
588 |
background: transparent;
|
589 |
}
|
590 |
|
607 |
pointer-events: none;
|
608 |
}
|
609 |
|
610 |
+
.astra-sites-preview input[type="checkbox"].disabled {
|
611 |
+
background: #eeeeee;
|
612 |
+
opacity: 1;
|
613 |
+
color: #fff;
|
614 |
+
box-shadow: none;
|
615 |
+
border-color: #b4b9be;
|
616 |
+
}
|
617 |
+
|
618 |
.astra-sites-tooltip-icon .dashicons {
|
619 |
+
color: #757575;
|
620 |
+
font-size: 15px;
|
621 |
+
vertical-align: middle;
|
622 |
+
height: auto;
|
623 |
}
|
624 |
|
625 |
#astra-sites-welcome-form-inline {
|
666 |
width: 100%;
|
667 |
border: none;
|
668 |
margin: 0;
|
669 |
+
}
|
670 |
+
|
671 |
+
#astra-sites-welcome-form #submit {
|
672 |
+
padding: 0em 4rem;
|
673 |
+
}
|
674 |
+
|
675 |
+
.page-builders li {
|
676 |
+
cursor: pointer;
|
677 |
+
display: inline-block;
|
678 |
+
padding: 1em;
|
679 |
+
}
|
680 |
+
|
681 |
+
.page-builders [type=radio] {
|
682 |
+
position: absolute;
|
683 |
+
opacity: 0;
|
684 |
+
width: 0;
|
685 |
+
height: 0;
|
686 |
+
}
|
687 |
+
|
688 |
+
.page-builders [type=radio] + img {
|
689 |
+
cursor: pointer;
|
690 |
+
opacity: .9;
|
691 |
+
border: 3px solid transparent;
|
692 |
+
border-radius: 10px;
|
693 |
+
transition: all linear 0.2s;
|
694 |
+
}
|
695 |
+
|
696 |
+
.page-builders [type=radio]:hover + img,
|
697 |
+
.page-builders [type=radio]:checked + img {
|
698 |
+
opacity: 1;
|
699 |
+
}
|
700 |
+
|
701 |
+
.astra-sites-page-builder-notice {
|
702 |
+
text-align: center;
|
703 |
+
margin: 1em 0 2em 0;
|
704 |
+
}
|
705 |
+
|
706 |
+
.current-importing-status-wrap {
|
707 |
+
font-size: 1rem;
|
708 |
+
}
|
709 |
+
|
710 |
+
.current-importing-status-wrap hr {
|
711 |
+
border-color: #f1f1f1;
|
712 |
+
}
|
713 |
+
|
714 |
+
.astra-sites-result-preview {
|
715 |
+
position: absolute;
|
716 |
+
left: 0;
|
717 |
+
right: 0;
|
718 |
+
top: 0;
|
719 |
+
bottom: 0;
|
720 |
+
background: #fff;
|
721 |
+
overflow-y: auto;
|
722 |
+
}
|
723 |
+
|
724 |
+
.astra-sites-result-preview .button {
|
725 |
+
margin-top: 1em;
|
726 |
+
}
|
727 |
+
|
728 |
+
.astra-sites-result-preview .inner {
|
729 |
+
margin: 0 auto;
|
730 |
+
max-width: 700px;
|
731 |
+
padding: 5em 0;
|
732 |
+
}
|
733 |
+
|
734 |
+
.astra-sites-result-preview h2 {
|
735 |
+
font-size: 2rem;
|
736 |
+
}
|
737 |
+
|
738 |
+
.astra-sites-result-preview p {
|
739 |
+
font-size: 1rem;
|
740 |
+
}
|
741 |
+
|
742 |
+
.current-importing-status {
|
743 |
+
font-size: 1rem;
|
744 |
+
background: #eeeeee;
|
745 |
+
padding: 1em 1.5em;
|
746 |
+
}
|
747 |
+
|
748 |
+
.current-importing-status-title {
|
749 |
+
margin-bottom: .5em;
|
750 |
+
}
|
751 |
+
|
752 |
+
.appearance_page_astra-sites .rotating {
|
753 |
+
height: auto;
|
754 |
+
animation: rotation 2s infinite linear;
|
755 |
+
width: auto;
|
756 |
+
color: #c1c1c1;
|
757 |
+
}
|
758 |
+
|
759 |
+
@-webkit-keyframes rotation {
|
760 |
+
from {
|
761 |
+
-webkit-transform: rotate(0deg);
|
762 |
+
}
|
763 |
+
to {
|
764 |
+
-webkit-transform: rotate(359deg);
|
765 |
+
}
|
766 |
+
}
|
767 |
+
.import-time {
|
768 |
+
display: inline-block;
|
769 |
+
background: #0185ba;
|
770 |
+
color: #fff;
|
771 |
+
padding: 2px 10px;
|
772 |
+
border-radius: 3px;
|
773 |
+
animation: astra-scale 0.5s alternate infinite ease-in;
|
774 |
+
}
|
775 |
+
|
776 |
+
@keyframes astra-scale {
|
777 |
+
0% {transform: scale(1);}
|
778 |
+
100% {transform: scale(1.03);}
|
779 |
+
}
|
780 |
+
|
781 |
+
.current-importing-status p {
|
782 |
+
margin: 0;
|
783 |
+
}
|
inc/assets/images/beaver-builder.png
ADDED
Binary file
|
inc/assets/images/brizy.jpg
ADDED
Binary file
|
inc/assets/images/elementor.jpg
ADDED
Binary file
|
inc/assets/images/gutenberg.jpg
ADDED
Binary file
|
inc/assets/js/admin-page.js
CHANGED
@@ -107,8 +107,11 @@ var AstraSitesAjaxQueue = (function() {
|
|
107 |
var progress_bar = percent * 100;
|
108 |
|
109 |
if( progress_bar <= 100 ) {
|
110 |
-
document.
|
111 |
-
|
|
|
|
|
|
|
112 |
}
|
113 |
}
|
114 |
},
|
@@ -153,6 +156,8 @@ var AstraSitesAjaxQueue = (function() {
|
|
153 |
wpforms_url : '',
|
154 |
options_data : '',
|
155 |
widgets_data : '',
|
|
|
|
|
156 |
|
157 |
init: function()
|
158 |
{
|
@@ -182,6 +187,20 @@ var AstraSitesAjaxQueue = (function() {
|
|
182 |
}
|
183 |
},
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
/**
|
186 |
* Binds events for the Astra Sites.
|
187 |
*
|
@@ -192,6 +211,9 @@ var AstraSitesAjaxQueue = (function() {
|
|
192 |
_bind: function()
|
193 |
{
|
194 |
$( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
|
|
|
|
|
|
|
195 |
$( document ).on('change' , '#astra-sites-welcome-form-inline select', AstraSitesAdmin._change_page_builder);
|
196 |
$( document ).on('click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
|
197 |
$( document ).on('click' , '.astra-sites-advanced-options-button', AstraSitesAdmin._toggle_advanced_options);
|
@@ -232,6 +254,19 @@ var AstraSitesAjaxQueue = (function() {
|
|
232 |
|
233 |
},
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
_change_page_builder: function() {
|
236 |
$(this).closest('form').submit();
|
237 |
},
|
@@ -267,15 +302,14 @@ var AstraSitesAjaxQueue = (function() {
|
|
267 |
action : 'astra-sites-reset-customizer-data'
|
268 |
},
|
269 |
beforeSend: function() {
|
270 |
-
AstraSitesAdmin.
|
271 |
-
$('.button-hero.astra-demo-import').text( 'Reseting Customizer Data' );
|
272 |
},
|
273 |
})
|
274 |
.fail(function( jqXHR ){
|
275 |
-
AstraSitesAdmin.
|
276 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
277 |
})
|
278 |
.done(function ( data ) {
|
|
|
279 |
$(document).trigger( 'astra-sites-reset-customizer-data-done' );
|
280 |
});
|
281 |
},
|
@@ -289,17 +323,14 @@ var AstraSitesAjaxQueue = (function() {
|
|
289 |
action : 'astra-sites-reset-site-options'
|
290 |
},
|
291 |
beforeSend: function() {
|
292 |
-
AstraSitesAdmin.
|
293 |
-
$('.button-hero.astra-demo-import').text( 'Reseting Site Options' );
|
294 |
},
|
295 |
})
|
296 |
.fail(function( jqXHR ){
|
297 |
-
AstraSitesAdmin.
|
298 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
299 |
})
|
300 |
.done(function ( data ) {
|
301 |
-
|
302 |
-
|
303 |
$(document).trigger( 'astra-sites-reset-site-options-done' );
|
304 |
});
|
305 |
},
|
@@ -313,16 +344,14 @@ var AstraSitesAjaxQueue = (function() {
|
|
313 |
action : 'astra-sites-reset-widgets-data'
|
314 |
},
|
315 |
beforeSend: function() {
|
316 |
-
AstraSitesAdmin.
|
317 |
-
$('.button-hero.astra-demo-import').text( 'Reseting Widgets' );
|
318 |
},
|
319 |
})
|
320 |
.fail(function( jqXHR ){
|
321 |
-
AstraSitesAdmin.
|
322 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
323 |
})
|
324 |
.done(function ( data ) {
|
325 |
-
AstraSitesAdmin.
|
326 |
$(document).trigger( 'astra-sites-reset-widgets-data-done' );
|
327 |
});
|
328 |
},
|
@@ -332,11 +361,10 @@ var AstraSitesAjaxQueue = (function() {
|
|
332 |
|
333 |
AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
|
334 |
|
335 |
-
// Delete all posts.
|
336 |
-
// AstraSitesAjaxQueue.stop();
|
337 |
-
// AstraSitesAjaxQueue.run();
|
338 |
-
|
339 |
$.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
|
|
|
|
|
|
|
340 |
AstraSitesAjaxQueue.add({
|
341 |
url: astraSitesAdmin.ajaxurl,
|
342 |
type: 'POST',
|
@@ -349,8 +377,9 @@ var AstraSitesAjaxQueue = (function() {
|
|
349 |
if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
|
350 |
AstraSitesAdmin.reset_processed_posts+=1;
|
351 |
}
|
352 |
-
|
353 |
-
|
|
|
354 |
AstraSitesAdmin.reset_remaining_posts-=1;
|
355 |
if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
|
356 |
$(document).trigger( 'astra-sites-delete-posts-done' );
|
@@ -369,14 +398,11 @@ var AstraSitesAjaxQueue = (function() {
|
|
369 |
|
370 |
_reset_wp_forms: function() {
|
371 |
|
372 |
-
AstraSitesAdmin._log( AstraSitesAdmin.site_imported_data['reset_wp_forms'] );
|
373 |
-
AstraSitesAdmin._log( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length );
|
374 |
-
|
375 |
if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
|
376 |
AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
|
377 |
|
378 |
$.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
|
379 |
-
AstraSitesAdmin.
|
380 |
AstraSitesAjaxQueue.add({
|
381 |
url: astraSitesAdmin.ajaxurl,
|
382 |
type: 'POST',
|
@@ -385,13 +411,13 @@ var AstraSitesAjaxQueue = (function() {
|
|
385 |
post_id : post_id,
|
386 |
},
|
387 |
success: function( result ){
|
388 |
-
|
389 |
-
AstraSitesAdmin._log( result );
|
390 |
if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
|
391 |
AstraSitesAdmin.reset_processed_wp_forms+=1;
|
392 |
}
|
393 |
|
394 |
-
|
|
|
395 |
AstraSitesAdmin.reset_remaining_wp_forms-=1;
|
396 |
if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
|
397 |
$(document).trigger( 'astra-sites-delete-wp-forms-done' );
|
@@ -409,13 +435,12 @@ var AstraSitesAjaxQueue = (function() {
|
|
409 |
|
410 |
_reset_terms: function() {
|
411 |
|
412 |
-
AstraSitesAdmin._log( AstraSitesAdmin.site_imported_data['reset_terms'] );
|
413 |
-
AstraSitesAdmin._log( AstraSitesAdmin.site_imported_data['reset_terms'].length );
|
414 |
|
415 |
if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
|
416 |
AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
|
417 |
|
418 |
$.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
|
|
|
419 |
AstraSitesAjaxQueue.add({
|
420 |
url: astraSitesAdmin.ajaxurl,
|
421 |
type: 'POST',
|
@@ -427,10 +452,10 @@ var AstraSitesAjaxQueue = (function() {
|
|
427 |
if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
|
428 |
AstraSitesAdmin.reset_processed_terms+=1;
|
429 |
}
|
430 |
-
|
431 |
-
|
|
|
432 |
AstraSitesAdmin.reset_remaining_terms-=1;
|
433 |
-
AstraSitesAdmin._log( AstraSitesAdmin.reset_remaining_terms );
|
434 |
if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
|
435 |
$(document).trigger( 'astra-sites-delete-terms-done' );
|
436 |
}
|
@@ -471,18 +496,16 @@ var AstraSitesAjaxQueue = (function() {
|
|
471 |
action : 'astra-sites-backup-settings',
|
472 |
},
|
473 |
beforeSend: function() {
|
474 |
-
AstraSitesAdmin.
|
475 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.backupCustomizer );
|
476 |
},
|
477 |
})
|
478 |
.fail(function( jqXHR ){
|
479 |
-
AstraSitesAdmin.
|
480 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
481 |
})
|
482 |
.done(function ( data ) {
|
483 |
|
484 |
// 1. Pass - Import Customizer Options.
|
485 |
-
AstraSitesAdmin.
|
486 |
|
487 |
// Custom trigger.
|
488 |
$(document).trigger( trigger_name );
|
@@ -506,13 +529,11 @@ var AstraSitesAjaxQueue = (function() {
|
|
506 |
customizer_data : AstraSitesAdmin.current_site['astra-site-customizer-data'],
|
507 |
},
|
508 |
beforeSend: function() {
|
509 |
-
AstraSitesAdmin.
|
510 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingCustomizer );
|
511 |
},
|
512 |
})
|
513 |
.fail(function( jqXHR ){
|
514 |
-
AstraSitesAdmin.
|
515 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
516 |
})
|
517 |
.done(function ( customizer_data ) {
|
518 |
|
@@ -520,12 +541,11 @@ var AstraSitesAjaxQueue = (function() {
|
|
520 |
|
521 |
// 1. Fail - Import Customizer Options.
|
522 |
if( false === customizer_data.success ) {
|
523 |
-
AstraSitesAdmin.
|
524 |
-
AstraSitesAdmin._log( customizer_data.data );
|
525 |
} else {
|
526 |
|
527 |
// 1. Pass - Import Customizer Options.
|
528 |
-
AstraSitesAdmin.
|
529 |
|
530 |
$(document).trigger( 'astra-sites-import-customizer-settings-done' );
|
531 |
}
|
@@ -545,27 +565,55 @@ var AstraSitesAjaxQueue = (function() {
|
|
545 |
action : 'astra-sites-import-end',
|
546 |
},
|
547 |
beforeSend: function() {
|
548 |
-
|
549 |
}
|
550 |
})
|
551 |
.fail(function( jqXHR ){
|
552 |
-
AstraSitesAdmin.
|
553 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
554 |
})
|
555 |
.done(function ( data ) {
|
556 |
|
557 |
// 5. Fail - Import Complete.
|
558 |
if( false === data.success ) {
|
559 |
-
AstraSitesAdmin.
|
560 |
-
AstraSitesAdmin._log( data.data );
|
561 |
} else {
|
562 |
|
563 |
$('body').removeClass('importing-site');
|
564 |
$('.previous-theme, .next-theme').removeClass('disabled');
|
565 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
566 |
// 5. Pass - Import Complete.
|
567 |
-
AstraSitesAdmin.
|
568 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.success + ' ' + astraSitesAdmin.siteURL );
|
569 |
}
|
570 |
});
|
571 |
},
|
@@ -584,25 +632,22 @@ var AstraSitesAjaxQueue = (function() {
|
|
584 |
widgets_data : AstraSitesAdmin.widgets_data,
|
585 |
},
|
586 |
beforeSend: function() {
|
587 |
-
AstraSitesAdmin.
|
588 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingWidgets );
|
589 |
},
|
590 |
})
|
591 |
.fail(function( jqXHR ){
|
592 |
-
AstraSitesAdmin.
|
593 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
594 |
})
|
595 |
.done(function ( widgets_data ) {
|
596 |
|
597 |
// 4. Fail - Import Widgets.
|
598 |
if( false === widgets_data.success ) {
|
599 |
-
AstraSitesAdmin.
|
600 |
-
AstraSitesAdmin._log( widgets_data.data );
|
601 |
|
602 |
} else {
|
603 |
|
604 |
// 4. Pass - Import Widgets.
|
605 |
-
AstraSitesAdmin.
|
606 |
$(document).trigger( 'astra-sites-import-widgets-done' );
|
607 |
}
|
608 |
});
|
@@ -626,27 +671,21 @@ var AstraSitesAjaxQueue = (function() {
|
|
626 |
options_data : AstraSitesAdmin.options_data,
|
627 |
},
|
628 |
beforeSend: function() {
|
629 |
-
AstraSitesAdmin.
|
630 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingOptions );
|
631 |
$('.astra-demo-import .percent').html('');
|
632 |
},
|
633 |
})
|
634 |
.fail(function( jqXHR ){
|
635 |
-
AstraSitesAdmin.
|
636 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
637 |
})
|
638 |
.done(function ( options_data ) {
|
639 |
|
640 |
// 3. Fail - Import Site Options.
|
641 |
if( false === options_data.success ) {
|
642 |
-
AstraSitesAdmin.
|
643 |
-
AstraSitesAdmin._importFailMessage( options_data.data );
|
644 |
-
AstraSitesAdmin._log( options_data.data );
|
645 |
-
|
646 |
} else {
|
647 |
|
648 |
// 3. Pass - Import Site Options.
|
649 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importOptionsSuccess );
|
650 |
$(document).trigger( 'astra-sites-import-options-done' );
|
651 |
}
|
652 |
});
|
@@ -670,58 +709,50 @@ var AstraSitesAjaxQueue = (function() {
|
|
670 |
wxr_url : AstraSitesAdmin.current_site['astra-site-wxr-path'],
|
671 |
},
|
672 |
beforeSend: function() {
|
673 |
-
$('
|
674 |
-
AstraSitesAdmin.
|
675 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importXMLPreparing );
|
676 |
},
|
677 |
})
|
678 |
.fail(function( jqXHR ){
|
679 |
-
AstraSitesAdmin.
|
680 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
681 |
})
|
682 |
.done(function ( xml_data ) {
|
683 |
|
684 |
-
|
685 |
// 2. Fail - Prepare XML Data.
|
686 |
if( false === xml_data.success ) {
|
687 |
-
AstraSitesAdmin.
|
688 |
var error_msg = xml_data.data.error || xml_data.data;
|
689 |
-
AstraSitesAdmin.
|
690 |
-
AstraSitesAdmin._log( error_msg );
|
691 |
|
692 |
} else {
|
693 |
|
694 |
// 2. Pass - Prepare XML Data.
|
695 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importXMLPrepareSuccess );
|
696 |
|
697 |
// Import XML though Event Source.
|
698 |
AstraSSEImport.data = xml_data.data;
|
699 |
AstraSSEImport.render();
|
700 |
|
701 |
-
|
702 |
-
|
|
|
703 |
|
704 |
var evtSource = new EventSource( AstraSSEImport.data.url );
|
705 |
evtSource.onmessage = function ( message ) {
|
706 |
var data = JSON.parse( message.data );
|
707 |
switch ( data.action ) {
|
708 |
case 'updateDelta':
|
|
|
709 |
AstraSSEImport.updateDelta( data.type, data.delta );
|
710 |
break;
|
711 |
|
712 |
case 'complete':
|
713 |
evtSource.close();
|
714 |
|
715 |
-
|
716 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importXMLSuccess );
|
717 |
-
AstraSitesAdmin._log( '----- SSE - XML import Complete -----' );
|
718 |
|
719 |
-
document.
|
720 |
|
721 |
-
|
722 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingXML + ' (100%)' );
|
723 |
-
|
724 |
-
$('#astra-site-import-process-wrap').hide();
|
725 |
|
726 |
$(document).trigger( 'astra-sites-import-xml-done' );
|
727 |
|
@@ -730,7 +761,13 @@ var AstraSitesAjaxQueue = (function() {
|
|
730 |
};
|
731 |
evtSource.addEventListener( 'log', function ( message ) {
|
732 |
var data = JSON.parse( message.data );
|
733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
});
|
735 |
}
|
736 |
});
|
@@ -776,25 +813,20 @@ var AstraSitesAjaxQueue = (function() {
|
|
776 |
wpforms_url : AstraSitesAdmin.wpforms_url,
|
777 |
},
|
778 |
beforeSend: function() {
|
779 |
-
AstraSitesAdmin.
|
780 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingWPForms );
|
781 |
},
|
782 |
})
|
783 |
.fail(function( jqXHR ){
|
784 |
-
AstraSitesAdmin.
|
785 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
786 |
})
|
787 |
.done(function ( forms ) {
|
788 |
|
789 |
// 1. Fail - Import WPForms Options.
|
790 |
if( false === forms.success ) {
|
791 |
-
AstraSitesAdmin.
|
792 |
-
AstraSitesAdmin._log( forms.data );
|
793 |
} else {
|
794 |
|
795 |
// 1. Pass - Import Customizer Options.
|
796 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importWPFormsSuccess );
|
797 |
-
|
798 |
$(document).trigger( 'astra-sites-import-wpforms-done' );
|
799 |
}
|
800 |
});
|
@@ -817,25 +849,19 @@ var AstraSitesAjaxQueue = (function() {
|
|
817 |
customizer_data : AstraSitesAdmin.customizer_data,
|
818 |
},
|
819 |
beforeSend: function() {
|
820 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importCustomizer );
|
821 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.importingCustomizer );
|
822 |
},
|
823 |
})
|
824 |
.fail(function( jqXHR ){
|
825 |
-
AstraSitesAdmin.
|
826 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
827 |
})
|
828 |
.done(function ( customizer_data ) {
|
829 |
|
830 |
// 1. Fail - Import Customizer Options.
|
831 |
if( false === customizer_data.success ) {
|
832 |
-
AstraSitesAdmin.
|
833 |
-
AstraSitesAdmin._log( customizer_data.data );
|
834 |
} else {
|
835 |
|
836 |
// 1. Pass - Import Customizer Options.
|
837 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importCustomizerSuccess );
|
838 |
-
|
839 |
$(document).trigger( 'astra-sites-import-customizer-settings-done' );
|
840 |
}
|
841 |
});
|
@@ -850,7 +876,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
850 |
*
|
851 |
* @param {string} data Error message.
|
852 |
*/
|
853 |
-
|
854 |
|
855 |
$('.astra-demo-import').removeClass('updating-message installing')
|
856 |
.removeAttr('data-import')
|
@@ -937,7 +963,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
937 |
// Fail Notice.
|
938 |
$('.install-theme-info').append( output );
|
939 |
|
940 |
-
|
941 |
// !important to add trigger.
|
942 |
// Which reinitialize the dismiss error message events.
|
943 |
$(document).trigger('wp-updates-notice-added');
|
@@ -958,6 +983,8 @@ var AstraSitesAjaxQueue = (function() {
|
|
958 |
return;
|
959 |
}
|
960 |
|
|
|
|
|
961 |
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
|
962 |
wp.updates.requestFilesystemCredentials( event );
|
963 |
|
@@ -972,13 +999,29 @@ var AstraSitesAjaxQueue = (function() {
|
|
972 |
} );
|
973 |
}
|
974 |
|
975 |
-
AstraSitesAdmin.
|
976 |
|
977 |
wp.updates.installPlugin( {
|
978 |
slug: $button.data( 'slug' )
|
979 |
} );
|
980 |
},
|
981 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
982 |
/**
|
983 |
* Install Success
|
984 |
*/
|
@@ -986,9 +1029,9 @@ var AstraSitesAjaxQueue = (function() {
|
|
986 |
|
987 |
event.preventDefault();
|
988 |
|
989 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.installed + ' ' + response.slug );
|
990 |
|
991 |
var $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val();
|
|
|
992 |
var $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
|
993 |
|
994 |
// Transform the 'Install' button into an 'Activate' button.
|
@@ -1001,6 +1044,8 @@ var AstraSitesAjaxQueue = (function() {
|
|
1001 |
// WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
|
1002 |
setTimeout( function() {
|
1003 |
|
|
|
|
|
1004 |
$.ajax({
|
1005 |
url: astraSitesAdmin.ajaxurl,
|
1006 |
type: 'POST',
|
@@ -1014,6 +1059,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1014 |
.done(function (result) {
|
1015 |
|
1016 |
if( result.success ) {
|
|
|
1017 |
|
1018 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1019 |
|
@@ -1037,14 +1083,14 @@ var AstraSitesAjaxQueue = (function() {
|
|
1037 |
|
1038 |
var $card = $( '.plugin-card-' + response.slug );
|
1039 |
|
1040 |
-
AstraSitesAdmin.
|
|
|
1041 |
|
1042 |
$card
|
1043 |
.removeClass( 'button-primary' )
|
1044 |
.addClass( 'disabled' )
|
1045 |
.html( wp.updates.l10n.installFailedShort );
|
1046 |
|
1047 |
-
AstraSitesAdmin._importFailMessage( response.errorMessage );
|
1048 |
},
|
1049 |
|
1050 |
/**
|
@@ -1055,7 +1101,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1055 |
|
1056 |
var $card = $( '.plugin-card-' + args.slug );
|
1057 |
|
1058 |
-
AstraSitesAdmin.
|
1059 |
|
1060 |
$card.addClass('updating-message');
|
1061 |
|
@@ -1071,12 +1117,13 @@ var AstraSitesAjaxQueue = (function() {
|
|
1071 |
var $button = jQuery( event.target ),
|
1072 |
$init = $button.data( 'init' ),
|
1073 |
$slug = $button.data( 'slug' );
|
|
|
1074 |
|
1075 |
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
|
1076 |
return;
|
1077 |
}
|
1078 |
|
1079 |
-
AstraSitesAdmin.
|
1080 |
|
1081 |
$button.addClass('updating-message button-primary')
|
1082 |
.html( astraSitesAdmin.strings.btnActivating );
|
@@ -1098,7 +1145,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1098 |
|
1099 |
if( result.success ) {
|
1100 |
|
1101 |
-
AstraSitesAdmin.
|
1102 |
|
1103 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1104 |
|
@@ -1174,7 +1221,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1174 |
*/
|
1175 |
_activateAllPlugins: function( activate_plugins ) {
|
1176 |
|
1177 |
-
AstraSitesAdmin.
|
1178 |
|
1179 |
$.each( activate_plugins, function(index, single_plugin) {
|
1180 |
|
@@ -1182,6 +1229,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1182 |
$siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val(),
|
1183 |
$enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
|
1184 |
|
|
|
1185 |
AstraSitesAjaxQueue.add({
|
1186 |
url: astraSitesAdmin.ajaxurl,
|
1187 |
type: 'POST',
|
@@ -1195,8 +1243,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1195 |
|
1196 |
if( result.success ) {
|
1197 |
|
1198 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.activate + ' ' + single_plugin.slug );
|
1199 |
-
|
1200 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1201 |
|
1202 |
// Reset not installed plugins list.
|
@@ -1205,7 +1251,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1205 |
// Enable Demo Import Button
|
1206 |
AstraSitesAdmin._enable_demo_import_button();
|
1207 |
} else {
|
1208 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.activationError + ' - ' + single_plugin.slug );
|
1209 |
}
|
1210 |
}
|
1211 |
});
|
@@ -1218,10 +1263,12 @@ var AstraSitesAjaxQueue = (function() {
|
|
1218 |
*/
|
1219 |
_installAllPlugins: function( not_installed ) {
|
1220 |
|
1221 |
-
AstraSitesAdmin.
|
1222 |
|
1223 |
$.each( not_installed, function(index, single_plugin) {
|
1224 |
|
|
|
|
|
1225 |
var $card = $( '.plugin-card-' + single_plugin.slug );
|
1226 |
|
1227 |
// Add each plugin activate request in Ajax queue.
|
@@ -1248,6 +1295,10 @@ var AstraSitesAjaxQueue = (function() {
|
|
1248 |
_importDemo: function(event) {
|
1249 |
event.preventDefault();
|
1250 |
|
|
|
|
|
|
|
|
|
1251 |
var disabled = $(this).attr('data-import');
|
1252 |
|
1253 |
if ( typeof disabled !== 'undefined' && disabled === 'disabled' || $this.hasClass('disabled') ) {
|
@@ -1255,6 +1306,10 @@ var AstraSitesAjaxQueue = (function() {
|
|
1255 |
$('.astra-demo-import').addClass('updating-message installing')
|
1256 |
.text( wp.updates.l10n.installing );
|
1257 |
|
|
|
|
|
|
|
|
|
1258 |
/**
|
1259 |
* Process Bulk Plugin Install & Activate
|
1260 |
*/
|
@@ -1291,10 +1346,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1291 |
*/
|
1292 |
_importSite: function( apiURL ) {
|
1293 |
|
1294 |
-
AstraSitesAdmin.
|
1295 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.importing );
|
1296 |
-
|
1297 |
-
$('.button-hero.astra-demo-import').text( astraSitesAdmin.log.gettingData );
|
1298 |
|
1299 |
// 1. Request Site Import
|
1300 |
$.ajax({
|
@@ -1307,15 +1359,13 @@ var AstraSitesAjaxQueue = (function() {
|
|
1307 |
},
|
1308 |
})
|
1309 |
.fail(function( jqXHR ){
|
1310 |
-
AstraSitesAdmin.
|
1311 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText );
|
1312 |
})
|
1313 |
.done(function ( demo_data ) {
|
1314 |
|
1315 |
// 1. Fail - Request Site Import
|
1316 |
if( false === demo_data.success ) {
|
1317 |
|
1318 |
-
AstraSitesAdmin._importFailMessage( demo_data.data );
|
1319 |
|
1320 |
} else {
|
1321 |
|
@@ -1325,8 +1375,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1325 |
}
|
1326 |
|
1327 |
// 1. Pass - Request Site Import
|
1328 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.processingRequest );
|
1329 |
-
|
1330 |
AstraSitesAdmin.customizer_data = JSON.stringify( demo_data.data['astra-site-customizer-data'] ) || '';
|
1331 |
AstraSitesAdmin.wxr_url = encodeURI( demo_data.data['astra-site-wxr-path'] ) || '';
|
1332 |
AstraSitesAdmin.wpforms_url = encodeURI( demo_data.data['astra-site-wpforms-path'] ) || '';
|
@@ -1402,8 +1450,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1402 |
if( AstraSitesAPI._stored_data ) {
|
1403 |
var site_data = AstraSitesAdmin._get_site_details( site_id );
|
1404 |
|
1405 |
-
|
1406 |
-
|
1407 |
if( site_data ) {
|
1408 |
// Set current site details.
|
1409 |
AstraSitesAdmin.current_site = site_data;
|
@@ -1516,9 +1562,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1516 |
astraSiteOptions = anchor.find('.astra-site-options').val() || '';
|
1517 |
astraEnabledExtensions = anchor.find('.astra-enabled-extensions').val() || '';
|
1518 |
|
1519 |
-
AstraSitesAdmin._log( astraSitesAdmin.log.preview + ' "' + demo_name + '" URL : ' + demoURL );
|
1520 |
-
|
1521 |
-
|
1522 |
var template = wp.template('astra-site-preview');
|
1523 |
|
1524 |
templateData = [{
|
@@ -1535,8 +1578,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1535 |
astra_enabled_extensions : astraEnabledExtensions,
|
1536 |
}];
|
1537 |
|
1538 |
-
// return;
|
1539 |
-
|
1540 |
// delete any earlier fullscreen preview before we render new one.
|
1541 |
$('.theme-install-overlay').remove();
|
1542 |
|
@@ -1557,7 +1598,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1557 |
},
|
1558 |
})
|
1559 |
.done(function ( response ) {
|
1560 |
-
AstraSitesAdmin._log( response );
|
1561 |
if( response.success ) {
|
1562 |
AstraSitesAdmin.site_imported_data = response.data;
|
1563 |
}
|
@@ -1619,8 +1659,6 @@ var AstraSitesAjaxQueue = (function() {
|
|
1619 |
// Remove loader.
|
1620 |
$('.required-plugins').removeClass('loading').html('');
|
1621 |
|
1622 |
-
AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.responseText, 'plugins' );
|
1623 |
-
AstraSitesAdmin._log( jqXHR.status + ' ' + jqXHR.responseText );
|
1624 |
})
|
1625 |
.done(function ( response ) {
|
1626 |
|
@@ -1651,7 +1689,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1651 |
remaining_plugins += parseInt( response.data.notinstalled.length );
|
1652 |
|
1653 |
$( response.data.notinstalled ).each(function( index, plugin ) {
|
1654 |
-
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'">'+plugin.name+'</li>');
|
1655 |
});
|
1656 |
}
|
1657 |
|
@@ -1666,7 +1704,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1666 |
remaining_plugins += parseInt( response.data.inactive.length );
|
1667 |
|
1668 |
$( response.data.inactive ).each(function( index, plugin ) {
|
1669 |
-
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'">'+plugin.name+'</li>');
|
1670 |
});
|
1671 |
}
|
1672 |
|
@@ -1678,7 +1716,7 @@ var AstraSitesAjaxQueue = (function() {
|
|
1678 |
if ( typeof response.data.active !== 'undefined' ) {
|
1679 |
|
1680 |
$( response.data.active ).each(function( index, plugin ) {
|
1681 |
-
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'">'+plugin.name+'</li>');
|
1682 |
});
|
1683 |
}
|
1684 |
|
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 |
},
|
156 |
wpforms_url : '',
|
157 |
options_data : '',
|
158 |
widgets_data : '',
|
159 |
+
import_start_time : '',
|
160 |
+
import_end_time : '',
|
161 |
|
162 |
init: function()
|
163 |
{
|
187 |
}
|
188 |
},
|
189 |
|
190 |
+
_log_title: function( data, append ) {
|
191 |
+
|
192 |
+
var markup = '<p>' + data + '</p>';
|
193 |
+
if (typeof data == 'object' ) {
|
194 |
+
var markup = '<p>' + JSON.stringify( data ) + '</p>';
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( append ) {
|
198 |
+
$('.current-importing-status-title').append( markup );
|
199 |
+
} else {
|
200 |
+
$('.current-importing-status-title').html( markup );
|
201 |
+
}
|
202 |
+
},
|
203 |
+
|
204 |
/**
|
205 |
* Binds events for the Astra Sites.
|
206 |
*
|
211 |
_bind: function()
|
212 |
{
|
213 |
$( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
|
214 |
+
$( document ).on( 'click' , '.page-builders li', AstraSitesAdmin._toggle_reset_notice );
|
215 |
+
$( document ).on('click' , '#astra-sites-welcome-form .submit', AstraSitesAdmin._show_page_builder_notice);
|
216 |
+
$( document ).on('click' , '#astra-sites-welcome-form li', AstraSitesAdmin._show_next_button);
|
217 |
$( document ).on('change' , '#astra-sites-welcome-form-inline select', AstraSitesAdmin._change_page_builder);
|
218 |
$( document ).on('click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
|
219 |
$( document ).on('click' , '.astra-sites-advanced-options-button', AstraSitesAdmin._toggle_advanced_options);
|
254 |
|
255 |
},
|
256 |
|
257 |
+
_show_next_button: function() {
|
258 |
+
$( this ).parents('.page-builders').find('img').removeClass('wp-ui-highlight');
|
259 |
+
$( this ).find('img').addClass('wp-ui-highlight');
|
260 |
+
|
261 |
+
$('#submit').parent().removeClass('submit');
|
262 |
+
$('#submit').removeClass('disabled');
|
263 |
+
$('.astra-sites-page-builder-notice').hide();
|
264 |
+
},
|
265 |
+
|
266 |
+
_show_page_builder_notice: function() {
|
267 |
+
$('.astra-sites-page-builder-notice').show();
|
268 |
+
},
|
269 |
+
|
270 |
_change_page_builder: function() {
|
271 |
$(this).closest('form').submit();
|
272 |
},
|
302 |
action : 'astra-sites-reset-customizer-data'
|
303 |
},
|
304 |
beforeSend: function() {
|
305 |
+
AstraSitesAdmin._log_title( 'Reseting Customizer Data..' );
|
|
|
306 |
},
|
307 |
})
|
308 |
.fail(function( jqXHR ){
|
309 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
310 |
})
|
311 |
.done(function ( data ) {
|
312 |
+
AstraSitesAdmin._log_title( 'Complete Resetting Customizer Data..' );
|
313 |
$(document).trigger( 'astra-sites-reset-customizer-data-done' );
|
314 |
});
|
315 |
},
|
323 |
action : 'astra-sites-reset-site-options'
|
324 |
},
|
325 |
beforeSend: function() {
|
326 |
+
AstraSitesAdmin._log_title( 'Reseting Site Options..' );
|
|
|
327 |
},
|
328 |
})
|
329 |
.fail(function( jqXHR ){
|
330 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
331 |
})
|
332 |
.done(function ( data ) {
|
333 |
+
AstraSitesAdmin._log_title( 'Complete Reseting Site Options..' );
|
|
|
334 |
$(document).trigger( 'astra-sites-reset-site-options-done' );
|
335 |
});
|
336 |
},
|
344 |
action : 'astra-sites-reset-widgets-data'
|
345 |
},
|
346 |
beforeSend: function() {
|
347 |
+
AstraSitesAdmin._log_title( 'Reseting Widgets..' );
|
|
|
348 |
},
|
349 |
})
|
350 |
.fail(function( jqXHR ){
|
351 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
352 |
})
|
353 |
.done(function ( data ) {
|
354 |
+
AstraSitesAdmin._log_title( 'Complete Reseting Widgets..' );
|
355 |
$(document).trigger( 'astra-sites-reset-widgets-data-done' );
|
356 |
});
|
357 |
},
|
361 |
|
362 |
AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
|
363 |
|
|
|
|
|
|
|
|
|
364 |
$.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
|
365 |
+
|
366 |
+
AstraSitesAdmin._log_title( 'Deleting Posts..' );
|
367 |
+
|
368 |
AstraSitesAjaxQueue.add({
|
369 |
url: astraSitesAdmin.ajaxurl,
|
370 |
type: 'POST',
|
377 |
if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
|
378 |
AstraSitesAdmin.reset_processed_posts+=1;
|
379 |
}
|
380 |
+
|
381 |
+
AstraSitesAdmin._log_title( 'Deleting Post ' + AstraSitesAdmin.reset_processed_posts + ' of ' + AstraSitesAdmin.site_imported_data['reset_posts'].length + '<br/>' + result.data );
|
382 |
+
|
383 |
AstraSitesAdmin.reset_remaining_posts-=1;
|
384 |
if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
|
385 |
$(document).trigger( 'astra-sites-delete-posts-done' );
|
398 |
|
399 |
_reset_wp_forms: function() {
|
400 |
|
|
|
|
|
|
|
401 |
if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
|
402 |
AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
|
403 |
|
404 |
$.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
|
405 |
+
AstraSitesAdmin._log_title( 'Deleting WP Forms..' );
|
406 |
AstraSitesAjaxQueue.add({
|
407 |
url: astraSitesAdmin.ajaxurl,
|
408 |
type: 'POST',
|
411 |
post_id : post_id,
|
412 |
},
|
413 |
success: function( result ){
|
414 |
+
|
|
|
415 |
if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
|
416 |
AstraSitesAdmin.reset_processed_wp_forms+=1;
|
417 |
}
|
418 |
|
419 |
+
AstraSitesAdmin._log_title( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
|
420 |
+
|
421 |
AstraSitesAdmin.reset_remaining_wp_forms-=1;
|
422 |
if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
|
423 |
$(document).trigger( 'astra-sites-delete-wp-forms-done' );
|
435 |
|
436 |
_reset_terms: function() {
|
437 |
|
|
|
|
|
438 |
|
439 |
if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
|
440 |
AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
|
441 |
|
442 |
$.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
|
443 |
+
AstraSitesAdmin._log_title( 'Deleting Terms..' );
|
444 |
AstraSitesAjaxQueue.add({
|
445 |
url: astraSitesAdmin.ajaxurl,
|
446 |
type: 'POST',
|
452 |
if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
|
453 |
AstraSitesAdmin.reset_processed_terms+=1;
|
454 |
}
|
455 |
+
|
456 |
+
AstraSitesAdmin._log_title( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
|
457 |
+
|
458 |
AstraSitesAdmin.reset_remaining_terms-=1;
|
|
|
459 |
if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
|
460 |
$(document).trigger( 'astra-sites-delete-terms-done' );
|
461 |
}
|
496 |
action : 'astra-sites-backup-settings',
|
497 |
},
|
498 |
beforeSend: function() {
|
499 |
+
AstraSitesAdmin._log_title( 'Processing Customizer Settings Backup..' );
|
|
|
500 |
},
|
501 |
})
|
502 |
.fail(function( jqXHR ){
|
503 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
504 |
})
|
505 |
.done(function ( data ) {
|
506 |
|
507 |
// 1. Pass - Import Customizer Options.
|
508 |
+
AstraSitesAdmin._log_title( 'Customizer Settings Backup Done..' );
|
509 |
|
510 |
// Custom trigger.
|
511 |
$(document).trigger( trigger_name );
|
529 |
customizer_data : AstraSitesAdmin.current_site['astra-site-customizer-data'],
|
530 |
},
|
531 |
beforeSend: function() {
|
532 |
+
AstraSitesAdmin._log_title( 'Importing Customizer Settings..' );
|
|
|
533 |
},
|
534 |
})
|
535 |
.fail(function( jqXHR ){
|
536 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
537 |
})
|
538 |
.done(function ( customizer_data ) {
|
539 |
|
541 |
|
542 |
// 1. Fail - Import Customizer Options.
|
543 |
if( false === customizer_data.success ) {
|
544 |
+
AstraSitesAdmin._log_title( customizer_data.data );
|
|
|
545 |
} else {
|
546 |
|
547 |
// 1. Pass - Import Customizer Options.
|
548 |
+
AstraSitesAdmin._log_title( 'Imported Customizer Settings..' );
|
549 |
|
550 |
$(document).trigger( 'astra-sites-import-customizer-settings-done' );
|
551 |
}
|
565 |
action : 'astra-sites-import-end',
|
566 |
},
|
567 |
beforeSend: function() {
|
568 |
+
AstraSitesAdmin._log_title( 'Import Complete!' );
|
569 |
}
|
570 |
})
|
571 |
.fail(function( jqXHR ){
|
572 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
573 |
})
|
574 |
.done(function ( data ) {
|
575 |
|
576 |
// 5. Fail - Import Complete.
|
577 |
if( false === data.success ) {
|
578 |
+
AstraSitesAdmin._log_title( data.data );
|
|
|
579 |
} else {
|
580 |
|
581 |
$('body').removeClass('importing-site');
|
582 |
$('.previous-theme, .next-theme').removeClass('disabled');
|
583 |
|
584 |
+
var date = new Date();
|
585 |
+
|
586 |
+
AstraSitesAdmin.import_end_time = new Date();
|
587 |
+
var diff = ( AstraSitesAdmin.import_end_time.getTime() - AstraSitesAdmin.import_start_time.getTime() );
|
588 |
+
|
589 |
+
var time = '';
|
590 |
+
var seconds = Math.floor( diff / 1000 );
|
591 |
+
var minutes = Math.floor( seconds / 60 );
|
592 |
+
var hours = Math.floor( minutes / 60 );
|
593 |
+
|
594 |
+
minutes = minutes - ( hours * 60 );
|
595 |
+
seconds = seconds - ( minutes * 60 );
|
596 |
+
|
597 |
+
if( hours ) {
|
598 |
+
time += hours + ' Hours ';
|
599 |
+
}
|
600 |
+
if( minutes ) {
|
601 |
+
time += minutes + ' Minutes ';
|
602 |
+
}
|
603 |
+
if( seconds ) {
|
604 |
+
time += seconds + ' Seconds';
|
605 |
+
}
|
606 |
+
|
607 |
+
var output = '<h2>Done 🎉</h2>';
|
608 |
+
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>';
|
609 |
+
output += '<p>You can now start making changes according to your requirements.</p>';
|
610 |
+
output += '<p><a class="button button-primary button-hero" href="'+astraSitesAdmin.siteURL+'" target="_blank">View Site <i class="dashicons dashicons-external"></i></a></p>';
|
611 |
+
|
612 |
+
$('.rotating,.current-importing-status-wrap,.notice-warning').remove();
|
613 |
+
$('.astra-sites-result-preview .inner').html(output);
|
614 |
+
|
615 |
// 5. Pass - Import Complete.
|
616 |
+
AstraSitesAdmin._importSuccessButton();
|
|
|
617 |
}
|
618 |
});
|
619 |
},
|
632 |
widgets_data : AstraSitesAdmin.widgets_data,
|
633 |
},
|
634 |
beforeSend: function() {
|
635 |
+
AstraSitesAdmin._log_title( 'Importing Widgets..' );
|
|
|
636 |
},
|
637 |
})
|
638 |
.fail(function( jqXHR ){
|
639 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
640 |
})
|
641 |
.done(function ( widgets_data ) {
|
642 |
|
643 |
// 4. Fail - Import Widgets.
|
644 |
if( false === widgets_data.success ) {
|
645 |
+
AstraSitesAdmin._log_title( widgets_data.data );
|
|
|
646 |
|
647 |
} else {
|
648 |
|
649 |
// 4. Pass - Import Widgets.
|
650 |
+
AstraSitesAdmin._log_title( 'Imported Widgets!' );
|
651 |
$(document).trigger( 'astra-sites-import-widgets-done' );
|
652 |
}
|
653 |
});
|
671 |
options_data : AstraSitesAdmin.options_data,
|
672 |
},
|
673 |
beforeSend: function() {
|
674 |
+
AstraSitesAdmin._log_title( 'Importing Options..' );
|
|
|
675 |
$('.astra-demo-import .percent').html('');
|
676 |
},
|
677 |
})
|
678 |
.fail(function( jqXHR ){
|
679 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
680 |
})
|
681 |
.done(function ( options_data ) {
|
682 |
|
683 |
// 3. Fail - Import Site Options.
|
684 |
if( false === options_data.success ) {
|
685 |
+
AstraSitesAdmin._log_title( options_data );
|
|
|
|
|
|
|
686 |
} else {
|
687 |
|
688 |
// 3. Pass - Import Site Options.
|
|
|
689 |
$(document).trigger( 'astra-sites-import-options-done' );
|
690 |
}
|
691 |
});
|
709 |
wxr_url : AstraSitesAdmin.current_site['astra-site-wxr-path'],
|
710 |
},
|
711 |
beforeSend: function() {
|
712 |
+
$('.astra-site-import-process-wrap').show();
|
713 |
+
AstraSitesAdmin._log_title( 'Importing Content..' );
|
|
|
714 |
},
|
715 |
})
|
716 |
.fail(function( jqXHR ){
|
717 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
718 |
})
|
719 |
.done(function ( xml_data ) {
|
720 |
|
|
|
721 |
// 2. Fail - Prepare XML Data.
|
722 |
if( false === xml_data.success ) {
|
723 |
+
AstraSitesAdmin._log_title( xml_data );
|
724 |
var error_msg = xml_data.data.error || xml_data.data;
|
725 |
+
AstraSitesAdmin._log_title( error_msg );
|
|
|
726 |
|
727 |
} else {
|
728 |
|
729 |
// 2. Pass - Prepare XML Data.
|
|
|
730 |
|
731 |
// Import XML though Event Source.
|
732 |
AstraSSEImport.data = xml_data.data;
|
733 |
AstraSSEImport.render();
|
734 |
|
735 |
+
$('.current-importing-status-description').html('').show();
|
736 |
+
|
737 |
+
$('.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>');
|
738 |
|
739 |
var evtSource = new EventSource( AstraSSEImport.data.url );
|
740 |
evtSource.onmessage = function ( message ) {
|
741 |
var data = JSON.parse( message.data );
|
742 |
switch ( data.action ) {
|
743 |
case 'updateDelta':
|
744 |
+
|
745 |
AstraSSEImport.updateDelta( data.type, data.delta );
|
746 |
break;
|
747 |
|
748 |
case 'complete':
|
749 |
evtSource.close();
|
750 |
|
751 |
+
$('.current-importing-status-description').hide();
|
|
|
|
|
752 |
|
753 |
+
document.getElementsByClassName("astra-site-import-process").value = '100';
|
754 |
|
755 |
+
$('.astra-site-import-process-wrap').hide();
|
|
|
|
|
|
|
756 |
|
757 |
$(document).trigger( 'astra-sites-import-xml-done' );
|
758 |
|
761 |
};
|
762 |
evtSource.addEventListener( 'log', function ( message ) {
|
763 |
var data = JSON.parse( message.data );
|
764 |
+
var message = data.message || '';
|
765 |
+
if( message ) {
|
766 |
+
message = message.replace(/"/g, function(letter) {
|
767 |
+
return '';
|
768 |
+
});
|
769 |
+
$('.current-importing-status-description').html( message );
|
770 |
+
}
|
771 |
});
|
772 |
}
|
773 |
});
|
813 |
wpforms_url : AstraSitesAdmin.wpforms_url,
|
814 |
},
|
815 |
beforeSend: function() {
|
816 |
+
AstraSitesAdmin._log_title( 'Importing WP Forms..' );
|
|
|
817 |
},
|
818 |
})
|
819 |
.fail(function( jqXHR ){
|
820 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
821 |
})
|
822 |
.done(function ( forms ) {
|
823 |
|
824 |
// 1. Fail - Import WPForms Options.
|
825 |
if( false === forms.success ) {
|
826 |
+
AstraSitesAdmin._log_title( forms.data );
|
|
|
827 |
} else {
|
828 |
|
829 |
// 1. Pass - Import Customizer Options.
|
|
|
|
|
830 |
$(document).trigger( 'astra-sites-import-wpforms-done' );
|
831 |
}
|
832 |
});
|
849 |
customizer_data : AstraSitesAdmin.customizer_data,
|
850 |
},
|
851 |
beforeSend: function() {
|
|
|
|
|
852 |
},
|
853 |
})
|
854 |
.fail(function( jqXHR ){
|
855 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
|
|
|
856 |
})
|
857 |
.done(function ( customizer_data ) {
|
858 |
|
859 |
// 1. Fail - Import Customizer Options.
|
860 |
if( false === customizer_data.success ) {
|
861 |
+
AstraSitesAdmin._log_title( customizer_data.data );
|
|
|
862 |
} else {
|
863 |
|
864 |
// 1. Pass - Import Customizer Options.
|
|
|
|
|
865 |
$(document).trigger( 'astra-sites-import-customizer-settings-done' );
|
866 |
}
|
867 |
});
|
876 |
*
|
877 |
* @param {string} data Error message.
|
878 |
*/
|
879 |
+
_importSuccessButton: function() {
|
880 |
|
881 |
$('.astra-demo-import').removeClass('updating-message installing')
|
882 |
.removeAttr('data-import')
|
963 |
// Fail Notice.
|
964 |
$('.install-theme-info').append( output );
|
965 |
|
|
|
966 |
// !important to add trigger.
|
967 |
// Which reinitialize the dismiss error message events.
|
968 |
$(document).trigger('wp-updates-notice-added');
|
983 |
return;
|
984 |
}
|
985 |
|
986 |
+
AstraSitesAdmin._log_title( 'Installing Plugin..' );
|
987 |
+
|
988 |
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
|
989 |
wp.updates.requestFilesystemCredentials( event );
|
990 |
|
999 |
} );
|
1000 |
}
|
1001 |
|
1002 |
+
AstraSitesAdmin._log_title( 'Installing ' + AstraSitesAdmin.ucwords( $button.data( 'name' ) ) );
|
1003 |
|
1004 |
wp.updates.installPlugin( {
|
1005 |
slug: $button.data( 'slug' )
|
1006 |
} );
|
1007 |
},
|
1008 |
|
1009 |
+
ucwords: function( str ) {
|
1010 |
+
if( ! str ) {
|
1011 |
+
return '';
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
|
1015 |
+
return letter.toUpperCase();
|
1016 |
+
});
|
1017 |
+
|
1018 |
+
str = str.replace(/-/g, function(letter) {
|
1019 |
+
return ' ';
|
1020 |
+
});
|
1021 |
+
|
1022 |
+
return str;
|
1023 |
+
},
|
1024 |
+
|
1025 |
/**
|
1026 |
* Install Success
|
1027 |
*/
|
1029 |
|
1030 |
event.preventDefault();
|
1031 |
|
|
|
1032 |
|
1033 |
var $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val();
|
1034 |
+
|
1035 |
var $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
|
1036 |
|
1037 |
// Transform the 'Install' button into an 'Activate' button.
|
1044 |
// WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
|
1045 |
setTimeout( function() {
|
1046 |
|
1047 |
+
AstraSitesAdmin._log_title( 'Activating Plugin..' );
|
1048 |
+
|
1049 |
$.ajax({
|
1050 |
url: astraSitesAdmin.ajaxurl,
|
1051 |
type: 'POST',
|
1059 |
.done(function (result) {
|
1060 |
|
1061 |
if( result.success ) {
|
1062 |
+
AstraSitesAdmin._log_title( 'Activating Plugin ' + AstraSitesAdmin.ucwords(response.name) );
|
1063 |
|
1064 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1065 |
|
1083 |
|
1084 |
var $card = $( '.plugin-card-' + response.slug );
|
1085 |
|
1086 |
+
AstraSitesAdmin._log_title( response.errorMessage + ' ' + AstraSitesAdmin.ucwords(response.name) );
|
1087 |
+
|
1088 |
|
1089 |
$card
|
1090 |
.removeClass( 'button-primary' )
|
1091 |
.addClass( 'disabled' )
|
1092 |
.html( wp.updates.l10n.installFailedShort );
|
1093 |
|
|
|
1094 |
},
|
1095 |
|
1096 |
/**
|
1101 |
|
1102 |
var $card = $( '.plugin-card-' + args.slug );
|
1103 |
|
1104 |
+
AstraSitesAdmin._log_title( 'Installing ' + AstraSitesAdmin.ucwords(args.name ));
|
1105 |
|
1106 |
$card.addClass('updating-message');
|
1107 |
|
1117 |
var $button = jQuery( event.target ),
|
1118 |
$init = $button.data( 'init' ),
|
1119 |
$slug = $button.data( 'slug' );
|
1120 |
+
$name = $button.data( 'name' );
|
1121 |
|
1122 |
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
|
1123 |
return;
|
1124 |
}
|
1125 |
|
1126 |
+
AstraSitesAdmin._log_title( 'Activating plugin ' + AstraSitesAdmin.ucwords( $name ) );
|
1127 |
|
1128 |
$button.addClass('updating-message button-primary')
|
1129 |
.html( astraSitesAdmin.strings.btnActivating );
|
1145 |
|
1146 |
if( result.success ) {
|
1147 |
|
1148 |
+
AstraSitesAdmin._log_title( 'Activated ' + AstraSitesAdmin.ucwords($name) );
|
1149 |
|
1150 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1151 |
|
1221 |
*/
|
1222 |
_activateAllPlugins: function( activate_plugins ) {
|
1223 |
|
1224 |
+
AstraSitesAdmin._log_title( 'Activating Plugins..' );
|
1225 |
|
1226 |
$.each( activate_plugins, function(index, single_plugin) {
|
1227 |
|
1229 |
$siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val(),
|
1230 |
$enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
|
1231 |
|
1232 |
+
|
1233 |
AstraSitesAjaxQueue.add({
|
1234 |
url: astraSitesAdmin.ajaxurl,
|
1235 |
type: 'POST',
|
1243 |
|
1244 |
if( result.success ) {
|
1245 |
|
|
|
|
|
1246 |
var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
|
1247 |
|
1248 |
// Reset not installed plugins list.
|
1251 |
// Enable Demo Import Button
|
1252 |
AstraSitesAdmin._enable_demo_import_button();
|
1253 |
} else {
|
|
|
1254 |
}
|
1255 |
}
|
1256 |
});
|
1263 |
*/
|
1264 |
_installAllPlugins: function( not_installed ) {
|
1265 |
|
1266 |
+
AstraSitesAdmin._log_title( 'Installing Plugins..' );
|
1267 |
|
1268 |
$.each( not_installed, function(index, single_plugin) {
|
1269 |
|
1270 |
+
AstraSitesAdmin._log_title( 'Installing ' + AstraSitesAdmin.ucwords( single_plugin.name ));
|
1271 |
+
|
1272 |
var $card = $( '.plugin-card-' + single_plugin.slug );
|
1273 |
|
1274 |
// Add each plugin activate request in Ajax queue.
|
1295 |
_importDemo: function(event) {
|
1296 |
event.preventDefault();
|
1297 |
|
1298 |
+
var date = new Date();
|
1299 |
+
|
1300 |
+
AstraSitesAdmin.import_start_time = new Date();
|
1301 |
+
|
1302 |
var disabled = $(this).attr('data-import');
|
1303 |
|
1304 |
if ( typeof disabled !== 'undefined' && disabled === 'disabled' || $this.hasClass('disabled') ) {
|
1306 |
$('.astra-demo-import').addClass('updating-message installing')
|
1307 |
.text( wp.updates.l10n.installing );
|
1308 |
|
1309 |
+
$('.astra-sites-result-preview').show();
|
1310 |
+
var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
|
1311 |
+
$('.current-importing-status').html( output );
|
1312 |
+
|
1313 |
/**
|
1314 |
* Process Bulk Plugin Install & Activate
|
1315 |
*/
|
1346 |
*/
|
1347 |
_importSite: function( apiURL ) {
|
1348 |
|
1349 |
+
AstraSitesAdmin._log_title( 'Started Importing..' );
|
|
|
|
|
|
|
1350 |
|
1351 |
// 1. Request Site Import
|
1352 |
$.ajax({
|
1359 |
},
|
1360 |
})
|
1361 |
.fail(function( jqXHR ){
|
1362 |
+
AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
|
|
|
1363 |
})
|
1364 |
.done(function ( demo_data ) {
|
1365 |
|
1366 |
// 1. Fail - Request Site Import
|
1367 |
if( false === demo_data.success ) {
|
1368 |
|
|
|
1369 |
|
1370 |
} else {
|
1371 |
|
1375 |
}
|
1376 |
|
1377 |
// 1. Pass - Request Site Import
|
|
|
|
|
1378 |
AstraSitesAdmin.customizer_data = JSON.stringify( demo_data.data['astra-site-customizer-data'] ) || '';
|
1379 |
AstraSitesAdmin.wxr_url = encodeURI( demo_data.data['astra-site-wxr-path'] ) || '';
|
1380 |
AstraSitesAdmin.wpforms_url = encodeURI( demo_data.data['astra-site-wpforms-path'] ) || '';
|
1450 |
if( AstraSitesAPI._stored_data ) {
|
1451 |
var site_data = AstraSitesAdmin._get_site_details( site_id );
|
1452 |
|
|
|
|
|
1453 |
if( site_data ) {
|
1454 |
// Set current site details.
|
1455 |
AstraSitesAdmin.current_site = site_data;
|
1562 |
astraSiteOptions = anchor.find('.astra-site-options').val() || '';
|
1563 |
astraEnabledExtensions = anchor.find('.astra-enabled-extensions').val() || '';
|
1564 |
|
|
|
|
|
|
|
1565 |
var template = wp.template('astra-site-preview');
|
1566 |
|
1567 |
templateData = [{
|
1578 |
astra_enabled_extensions : astraEnabledExtensions,
|
1579 |
}];
|
1580 |
|
|
|
|
|
1581 |
// delete any earlier fullscreen preview before we render new one.
|
1582 |
$('.theme-install-overlay').remove();
|
1583 |
|
1598 |
},
|
1599 |
})
|
1600 |
.done(function ( response ) {
|
|
|
1601 |
if( response.success ) {
|
1602 |
AstraSitesAdmin.site_imported_data = response.data;
|
1603 |
}
|
1659 |
// Remove loader.
|
1660 |
$('.required-plugins').removeClass('loading').html('');
|
1661 |
|
|
|
|
|
1662 |
})
|
1663 |
.done(function ( response ) {
|
1664 |
|
1689 |
remaining_plugins += parseInt( response.data.notinstalled.length );
|
1690 |
|
1691 |
$( response.data.notinstalled ).each(function( index, plugin ) {
|
1692 |
+
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
|
1693 |
});
|
1694 |
}
|
1695 |
|
1704 |
remaining_plugins += parseInt( response.data.inactive.length );
|
1705 |
|
1706 |
$( response.data.inactive ).each(function( index, plugin ) {
|
1707 |
+
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
|
1708 |
});
|
1709 |
}
|
1710 |
|
1716 |
if ( typeof response.data.active !== 'undefined' ) {
|
1717 |
|
1718 |
$( response.data.active ).each(function( index, plugin ) {
|
1719 |
+
$('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
|
1720 |
});
|
1721 |
}
|
1722 |
|
inc/assets/js/astra-sites-api.js
CHANGED
@@ -12,54 +12,50 @@
|
|
12 |
/**
|
13 |
* API Request
|
14 |
*/
|
15 |
-
_api_request: function( args ) {
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
};
|
21 |
|
22 |
if( astraRenderGrid.headers ) {
|
23 |
-
|
24 |
}
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
if( 'success' === status && XHR.getResponseHeader('x-wp-total') ) {
|
30 |
-
|
31 |
-
if( args.id ) {
|
32 |
-
AstraSitesAPI._stored_data[ args.id ] = $.merge( AstraSitesAPI._stored_data[ args.id ], items );
|
33 |
-
}
|
34 |
-
|
35 |
-
var data = {
|
36 |
-
args : args,
|
37 |
items : items,
|
38 |
-
items_count :
|
39 |
-
|
40 |
-
|
41 |
-
if( 'undefined' !== args.trigger && '' !== args.trigger ) {
|
42 |
-
$(document).trigger( args.trigger, [data] );
|
43 |
-
}
|
44 |
-
|
45 |
} else {
|
46 |
$(document).trigger( 'astra-sites-api-request-error' );
|
|
|
47 |
}
|
48 |
-
|
49 |
})
|
50 |
-
.
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
|
|
|
|
53 |
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
|
57 |
-
$(document).trigger( 'astra-sites-api-request-always' );
|
58 |
|
59 |
-
|
60 |
|
61 |
},
|
62 |
|
63 |
};
|
64 |
|
65 |
-
})(jQuery);
|
12 |
/**
|
13 |
* API Request
|
14 |
*/
|
15 |
+
_api_request: function( args, callback ) {
|
16 |
|
17 |
+
var params = {
|
18 |
+
method: 'GET',
|
19 |
+
cache: 'default',
|
20 |
};
|
21 |
|
22 |
if( astraRenderGrid.headers ) {
|
23 |
+
params['headers'] = astraRenderGrid.headers;
|
24 |
}
|
25 |
|
26 |
+
fetch( AstraSitesAPI._api_url + args.slug, params).then(response => {
|
27 |
+
if ( response.status === 200 ) {
|
28 |
+
return response.json().then(items => ({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
items : items,
|
30 |
+
items_count : response.headers.get( 'x-wp-total' ),
|
31 |
+
item_pages : response.headers.get( 'x-wp-totalpages' ),
|
32 |
+
}))
|
|
|
|
|
|
|
|
|
33 |
} else {
|
34 |
$(document).trigger( 'astra-sites-api-request-error' );
|
35 |
+
return response.json();
|
36 |
}
|
|
|
37 |
})
|
38 |
+
.then(data => {
|
39 |
+
if( 'object' === typeof data ) {
|
40 |
+
data['args'] = args;
|
41 |
+
if( data.args.id ) {
|
42 |
+
AstraSitesAPI._stored_data[ args.id ] = $.merge( AstraSitesAPI._stored_data[ data.args.id ], data.items );
|
43 |
+
}
|
44 |
|
45 |
+
if( 'undefined' !== typeof args.trigger && '' !== args.trigger ) {
|
46 |
+
$(document).trigger( args.trigger, [data] );
|
47 |
+
}
|
48 |
|
49 |
+
if( callback && typeof callback == "function"){
|
50 |
+
callback( data );
|
51 |
+
}
|
52 |
+
}
|
53 |
|
|
|
54 |
|
55 |
+
});
|
56 |
|
57 |
},
|
58 |
|
59 |
};
|
60 |
|
61 |
+
})(jQuery);
|
inc/assets/js/astra-sites-notices.js
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
|
3 |
-
jQuery( '.astra-notice.is-dismissible .notice-dismiss' ).on( 'click', function() {
|
4 |
-
var $id = jQuery( this ).attr( 'id' ) || '';
|
5 |
-
var $time = jQuery( this ).attr( 'dismissible-time' ) || '';
|
6 |
-
var $meta = jQuery( this ).attr( 'dismissible-meta' ) || '';
|
7 |
-
|
8 |
-
jQuery.ajax({
|
9 |
-
url: ajaxurl,
|
10 |
-
type: 'POST',
|
11 |
-
data: {
|
12 |
-
action : 'astra-notices',
|
13 |
-
id : $id,
|
14 |
-
meta : $meta,
|
15 |
-
time : $time,
|
16 |
-
},
|
17 |
-
});
|
18 |
-
|
19 |
-
});
|
20 |
-
|
21 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/assets/js/fetch.umd.js
ADDED
@@ -0,0 +1,531 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function (global, factory) {
|
2 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3 |
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
4 |
+
(factory((global.WHATWGFetch = {})));
|
5 |
+
}(this, (function (exports) { 'use strict';
|
6 |
+
|
7 |
+
var support = {
|
8 |
+
searchParams: 'URLSearchParams' in self,
|
9 |
+
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
10 |
+
blob:
|
11 |
+
'FileReader' in self &&
|
12 |
+
'Blob' in self &&
|
13 |
+
(function() {
|
14 |
+
try {
|
15 |
+
new Blob();
|
16 |
+
return true
|
17 |
+
} catch (e) {
|
18 |
+
return false
|
19 |
+
}
|
20 |
+
})(),
|
21 |
+
formData: 'FormData' in self,
|
22 |
+
arrayBuffer: 'ArrayBuffer' in self
|
23 |
+
};
|
24 |
+
|
25 |
+
function isDataView(obj) {
|
26 |
+
return obj && DataView.prototype.isPrototypeOf(obj)
|
27 |
+
}
|
28 |
+
|
29 |
+
if (support.arrayBuffer) {
|
30 |
+
var viewClasses = [
|
31 |
+
'[object Int8Array]',
|
32 |
+
'[object Uint8Array]',
|
33 |
+
'[object Uint8ClampedArray]',
|
34 |
+
'[object Int16Array]',
|
35 |
+
'[object Uint16Array]',
|
36 |
+
'[object Int32Array]',
|
37 |
+
'[object Uint32Array]',
|
38 |
+
'[object Float32Array]',
|
39 |
+
'[object Float64Array]'
|
40 |
+
];
|
41 |
+
|
42 |
+
var isArrayBufferView =
|
43 |
+
ArrayBuffer.isView ||
|
44 |
+
function(obj) {
|
45 |
+
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
46 |
+
};
|
47 |
+
}
|
48 |
+
|
49 |
+
function normalizeName(name) {
|
50 |
+
if (typeof name !== 'string') {
|
51 |
+
name = String(name);
|
52 |
+
}
|
53 |
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
54 |
+
throw new TypeError('Invalid character in header field name')
|
55 |
+
}
|
56 |
+
return name.toLowerCase()
|
57 |
+
}
|
58 |
+
|
59 |
+
function normalizeValue(value) {
|
60 |
+
if (typeof value !== 'string') {
|
61 |
+
value = String(value);
|
62 |
+
}
|
63 |
+
return value
|
64 |
+
}
|
65 |
+
|
66 |
+
// Build a destructive iterator for the value list
|
67 |
+
function iteratorFor(items) {
|
68 |
+
var iterator = {
|
69 |
+
next: function() {
|
70 |
+
var value = items.shift();
|
71 |
+
return {done: value === undefined, value: value}
|
72 |
+
}
|
73 |
+
};
|
74 |
+
|
75 |
+
if (support.iterable) {
|
76 |
+
iterator[Symbol.iterator] = function() {
|
77 |
+
return iterator
|
78 |
+
};
|
79 |
+
}
|
80 |
+
|
81 |
+
return iterator
|
82 |
+
}
|
83 |
+
|
84 |
+
function Headers(headers) {
|
85 |
+
this.map = {};
|
86 |
+
|
87 |
+
if (headers instanceof Headers) {
|
88 |
+
headers.forEach(function(value, name) {
|
89 |
+
this.append(name, value);
|
90 |
+
}, this);
|
91 |
+
} else if (Array.isArray(headers)) {
|
92 |
+
headers.forEach(function(header) {
|
93 |
+
this.append(header[0], header[1]);
|
94 |
+
}, this);
|
95 |
+
} else if (headers) {
|
96 |
+
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
97 |
+
this.append(name, headers[name]);
|
98 |
+
}, this);
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
Headers.prototype.append = function(name, value) {
|
103 |
+
name = normalizeName(name);
|
104 |
+
value = normalizeValue(value);
|
105 |
+
var oldValue = this.map[name];
|
106 |
+
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
107 |
+
};
|
108 |
+
|
109 |
+
Headers.prototype['delete'] = function(name) {
|
110 |
+
delete this.map[normalizeName(name)];
|
111 |
+
};
|
112 |
+
|
113 |
+
Headers.prototype.get = function(name) {
|
114 |
+
name = normalizeName(name);
|
115 |
+
return this.has(name) ? this.map[name] : null
|
116 |
+
};
|
117 |
+
|
118 |
+
Headers.prototype.has = function(name) {
|
119 |
+
return this.map.hasOwnProperty(normalizeName(name))
|
120 |
+
};
|
121 |
+
|
122 |
+
Headers.prototype.set = function(name, value) {
|
123 |
+
this.map[normalizeName(name)] = normalizeValue(value);
|
124 |
+
};
|
125 |
+
|
126 |
+
Headers.prototype.forEach = function(callback, thisArg) {
|
127 |
+
for (var name in this.map) {
|
128 |
+
if (this.map.hasOwnProperty(name)) {
|
129 |
+
callback.call(thisArg, this.map[name], name, this);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
};
|
133 |
+
|
134 |
+
Headers.prototype.keys = function() {
|
135 |
+
var items = [];
|
136 |
+
this.forEach(function(value, name) {
|
137 |
+
items.push(name);
|
138 |
+
});
|
139 |
+
return iteratorFor(items)
|
140 |
+
};
|
141 |
+
|
142 |
+
Headers.prototype.values = function() {
|
143 |
+
var items = [];
|
144 |
+
this.forEach(function(value) {
|
145 |
+
items.push(value);
|
146 |
+
});
|
147 |
+
return iteratorFor(items)
|
148 |
+
};
|
149 |
+
|
150 |
+
Headers.prototype.entries = function() {
|
151 |
+
var items = [];
|
152 |
+
this.forEach(function(value, name) {
|
153 |
+
items.push([name, value]);
|
154 |
+
});
|
155 |
+
return iteratorFor(items)
|
156 |
+
};
|
157 |
+
|
158 |
+
if (support.iterable) {
|
159 |
+
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
160 |
+
}
|
161 |
+
|
162 |
+
function consumed(body) {
|
163 |
+
if (body.bodyUsed) {
|
164 |
+
return Promise.reject(new TypeError('Already read'))
|
165 |
+
}
|
166 |
+
body.bodyUsed = true;
|
167 |
+
}
|
168 |
+
|
169 |
+
function fileReaderReady(reader) {
|
170 |
+
return new Promise(function(resolve, reject) {
|
171 |
+
reader.onload = function() {
|
172 |
+
resolve(reader.result);
|
173 |
+
};
|
174 |
+
reader.onerror = function() {
|
175 |
+
reject(reader.error);
|
176 |
+
};
|
177 |
+
})
|
178 |
+
}
|
179 |
+
|
180 |
+
function readBlobAsArrayBuffer(blob) {
|
181 |
+
var reader = new FileReader();
|
182 |
+
var promise = fileReaderReady(reader);
|
183 |
+
reader.readAsArrayBuffer(blob);
|
184 |
+
return promise
|
185 |
+
}
|
186 |
+
|
187 |
+
function readBlobAsText(blob) {
|
188 |
+
var reader = new FileReader();
|
189 |
+
var promise = fileReaderReady(reader);
|
190 |
+
reader.readAsText(blob);
|
191 |
+
return promise
|
192 |
+
}
|
193 |
+
|
194 |
+
function readArrayBufferAsText(buf) {
|
195 |
+
var view = new Uint8Array(buf);
|
196 |
+
var chars = new Array(view.length);
|
197 |
+
|
198 |
+
for (var i = 0; i < view.length; i++) {
|
199 |
+
chars[i] = String.fromCharCode(view[i]);
|
200 |
+
}
|
201 |
+
return chars.join('')
|
202 |
+
}
|
203 |
+
|
204 |
+
function bufferClone(buf) {
|
205 |
+
if (buf.slice) {
|
206 |
+
return buf.slice(0)
|
207 |
+
} else {
|
208 |
+
var view = new Uint8Array(buf.byteLength);
|
209 |
+
view.set(new Uint8Array(buf));
|
210 |
+
return view.buffer
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
function Body() {
|
215 |
+
this.bodyUsed = false;
|
216 |
+
|
217 |
+
this._initBody = function(body) {
|
218 |
+
this._bodyInit = body;
|
219 |
+
if (!body) {
|
220 |
+
this._bodyText = '';
|
221 |
+
} else if (typeof body === 'string') {
|
222 |
+
this._bodyText = body;
|
223 |
+
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
224 |
+
this._bodyBlob = body;
|
225 |
+
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
226 |
+
this._bodyFormData = body;
|
227 |
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
228 |
+
this._bodyText = body.toString();
|
229 |
+
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
230 |
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
231 |
+
// IE 10-11 can't handle a DataView body.
|
232 |
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
233 |
+
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
234 |
+
this._bodyArrayBuffer = bufferClone(body);
|
235 |
+
} else {
|
236 |
+
this._bodyText = body = Object.prototype.toString.call(body);
|
237 |
+
}
|
238 |
+
|
239 |
+
if (!this.headers.get('content-type')) {
|
240 |
+
if (typeof body === 'string') {
|
241 |
+
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
242 |
+
} else if (this._bodyBlob && this._bodyBlob.type) {
|
243 |
+
this.headers.set('content-type', this._bodyBlob.type);
|
244 |
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
245 |
+
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
246 |
+
}
|
247 |
+
}
|
248 |
+
};
|
249 |
+
|
250 |
+
if (support.blob) {
|
251 |
+
this.blob = function() {
|
252 |
+
var rejected = consumed(this);
|
253 |
+
if (rejected) {
|
254 |
+
return rejected
|
255 |
+
}
|
256 |
+
|
257 |
+
if (this._bodyBlob) {
|
258 |
+
return Promise.resolve(this._bodyBlob)
|
259 |
+
} else if (this._bodyArrayBuffer) {
|
260 |
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
261 |
+
} else if (this._bodyFormData) {
|
262 |
+
throw new Error('could not read FormData body as blob')
|
263 |
+
} else {
|
264 |
+
return Promise.resolve(new Blob([this._bodyText]))
|
265 |
+
}
|
266 |
+
};
|
267 |
+
|
268 |
+
this.arrayBuffer = function() {
|
269 |
+
if (this._bodyArrayBuffer) {
|
270 |
+
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
271 |
+
} else {
|
272 |
+
return this.blob().then(readBlobAsArrayBuffer)
|
273 |
+
}
|
274 |
+
};
|
275 |
+
}
|
276 |
+
|
277 |
+
this.text = function() {
|
278 |
+
var rejected = consumed(this);
|
279 |
+
if (rejected) {
|
280 |
+
return rejected
|
281 |
+
}
|
282 |
+
|
283 |
+
if (this._bodyBlob) {
|
284 |
+
return readBlobAsText(this._bodyBlob)
|
285 |
+
} else if (this._bodyArrayBuffer) {
|
286 |
+
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
287 |
+
} else if (this._bodyFormData) {
|
288 |
+
throw new Error('could not read FormData body as text')
|
289 |
+
} else {
|
290 |
+
return Promise.resolve(this._bodyText)
|
291 |
+
}
|
292 |
+
};
|
293 |
+
|
294 |
+
if (support.formData) {
|
295 |
+
this.formData = function() {
|
296 |
+
return this.text().then(decode)
|
297 |
+
};
|
298 |
+
}
|
299 |
+
|
300 |
+
this.json = function() {
|
301 |
+
return this.text().then(JSON.parse)
|
302 |
+
};
|
303 |
+
|
304 |
+
return this
|
305 |
+
}
|
306 |
+
|
307 |
+
// HTTP methods whose capitalization should be normalized
|
308 |
+
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
309 |
+
|
310 |
+
function normalizeMethod(method) {
|
311 |
+
var upcased = method.toUpperCase();
|
312 |
+
return methods.indexOf(upcased) > -1 ? upcased : method
|
313 |
+
}
|
314 |
+
|
315 |
+
function Request(input, options) {
|
316 |
+
options = options || {};
|
317 |
+
var body = options.body;
|
318 |
+
|
319 |
+
if (input instanceof Request) {
|
320 |
+
if (input.bodyUsed) {
|
321 |
+
throw new TypeError('Already read')
|
322 |
+
}
|
323 |
+
this.url = input.url;
|
324 |
+
this.credentials = input.credentials;
|
325 |
+
if (!options.headers) {
|
326 |
+
this.headers = new Headers(input.headers);
|
327 |
+
}
|
328 |
+
this.method = input.method;
|
329 |
+
this.mode = input.mode;
|
330 |
+
this.signal = input.signal;
|
331 |
+
if (!body && input._bodyInit != null) {
|
332 |
+
body = input._bodyInit;
|
333 |
+
input.bodyUsed = true;
|
334 |
+
}
|
335 |
+
} else {
|
336 |
+
this.url = String(input);
|
337 |
+
}
|
338 |
+
|
339 |
+
this.credentials = options.credentials || this.credentials || 'same-origin';
|
340 |
+
if (options.headers || !this.headers) {
|
341 |
+
this.headers = new Headers(options.headers);
|
342 |
+
}
|
343 |
+
this.method = normalizeMethod(options.method || this.method || 'GET');
|
344 |
+
this.mode = options.mode || this.mode || null;
|
345 |
+
this.signal = options.signal || this.signal;
|
346 |
+
this.referrer = null;
|
347 |
+
|
348 |
+
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
349 |
+
throw new TypeError('Body not allowed for GET or HEAD requests')
|
350 |
+
}
|
351 |
+
this._initBody(body);
|
352 |
+
}
|
353 |
+
|
354 |
+
Request.prototype.clone = function() {
|
355 |
+
return new Request(this, {body: this._bodyInit})
|
356 |
+
};
|
357 |
+
|
358 |
+
function decode(body) {
|
359 |
+
var form = new FormData();
|
360 |
+
body
|
361 |
+
.trim()
|
362 |
+
.split('&')
|
363 |
+
.forEach(function(bytes) {
|
364 |
+
if (bytes) {
|
365 |
+
var split = bytes.split('=');
|
366 |
+
var name = split.shift().replace(/\+/g, ' ');
|
367 |
+
var value = split.join('=').replace(/\+/g, ' ');
|
368 |
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
369 |
+
}
|
370 |
+
});
|
371 |
+
return form
|
372 |
+
}
|
373 |
+
|
374 |
+
function parseHeaders(rawHeaders) {
|
375 |
+
var headers = new Headers();
|
376 |
+
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
377 |
+
// https://tools.ietf.org/html/rfc7230#section-3.2
|
378 |
+
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
379 |
+
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
380 |
+
var parts = line.split(':');
|
381 |
+
var key = parts.shift().trim();
|
382 |
+
if (key) {
|
383 |
+
var value = parts.join(':').trim();
|
384 |
+
headers.append(key, value);
|
385 |
+
}
|
386 |
+
});
|
387 |
+
return headers
|
388 |
+
}
|
389 |
+
|
390 |
+
Body.call(Request.prototype);
|
391 |
+
|
392 |
+
function Response(bodyInit, options) {
|
393 |
+
if (!options) {
|
394 |
+
options = {};
|
395 |
+
}
|
396 |
+
|
397 |
+
this.type = 'default';
|
398 |
+
this.status = options.status === undefined ? 200 : options.status;
|
399 |
+
this.ok = this.status >= 200 && this.status < 300;
|
400 |
+
this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
401 |
+
this.headers = new Headers(options.headers);
|
402 |
+
this.url = options.url || '';
|
403 |
+
this._initBody(bodyInit);
|
404 |
+
}
|
405 |
+
|
406 |
+
Body.call(Response.prototype);
|
407 |
+
|
408 |
+
Response.prototype.clone = function() {
|
409 |
+
return new Response(this._bodyInit, {
|
410 |
+
status: this.status,
|
411 |
+
statusText: this.statusText,
|
412 |
+
headers: new Headers(this.headers),
|
413 |
+
url: this.url
|
414 |
+
})
|
415 |
+
};
|
416 |
+
|
417 |
+
Response.error = function() {
|
418 |
+
var response = new Response(null, {status: 0, statusText: ''});
|
419 |
+
response.type = 'error';
|
420 |
+
return response
|
421 |
+
};
|
422 |
+
|
423 |
+
var redirectStatuses = [301, 302, 303, 307, 308];
|
424 |
+
|
425 |
+
Response.redirect = function(url, status) {
|
426 |
+
if (redirectStatuses.indexOf(status) === -1) {
|
427 |
+
throw new RangeError('Invalid status code')
|
428 |
+
}
|
429 |
+
|
430 |
+
return new Response(null, {status: status, headers: {location: url}})
|
431 |
+
};
|
432 |
+
|
433 |
+
exports.DOMException = self.DOMException;
|
434 |
+
try {
|
435 |
+
new exports.DOMException();
|
436 |
+
} catch (err) {
|
437 |
+
exports.DOMException = function(message, name) {
|
438 |
+
this.message = message;
|
439 |
+
this.name = name;
|
440 |
+
var error = Error(message);
|
441 |
+
this.stack = error.stack;
|
442 |
+
};
|
443 |
+
exports.DOMException.prototype = Object.create(Error.prototype);
|
444 |
+
exports.DOMException.prototype.constructor = exports.DOMException;
|
445 |
+
}
|
446 |
+
|
447 |
+
function fetch(input, init) {
|
448 |
+
return new Promise(function(resolve, reject) {
|
449 |
+
var request = new Request(input, init);
|
450 |
+
|
451 |
+
if (request.signal && request.signal.aborted) {
|
452 |
+
return reject(new exports.DOMException('Aborted', 'AbortError'))
|
453 |
+
}
|
454 |
+
|
455 |
+
var xhr = new XMLHttpRequest();
|
456 |
+
|
457 |
+
function abortXhr() {
|
458 |
+
xhr.abort();
|
459 |
+
}
|
460 |
+
|
461 |
+
xhr.onload = function() {
|
462 |
+
var options = {
|
463 |
+
status: xhr.status,
|
464 |
+
statusText: xhr.statusText,
|
465 |
+
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
466 |
+
};
|
467 |
+
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
468 |
+
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
469 |
+
resolve(new Response(body, options));
|
470 |
+
};
|
471 |
+
|
472 |
+
xhr.onerror = function() {
|
473 |
+
reject(new TypeError('Network request failed'));
|
474 |
+
};
|
475 |
+
|
476 |
+
xhr.ontimeout = function() {
|
477 |
+
reject(new TypeError('Network request failed'));
|
478 |
+
};
|
479 |
+
|
480 |
+
xhr.onabort = function() {
|
481 |
+
reject(new exports.DOMException('Aborted', 'AbortError'));
|
482 |
+
};
|
483 |
+
|
484 |
+
xhr.open(request.method, request.url, true);
|
485 |
+
|
486 |
+
if (request.credentials === 'include') {
|
487 |
+
xhr.withCredentials = true;
|
488 |
+
} else if (request.credentials === 'omit') {
|
489 |
+
xhr.withCredentials = false;
|
490 |
+
}
|
491 |
+
|
492 |
+
if ('responseType' in xhr && support.blob) {
|
493 |
+
xhr.responseType = 'blob';
|
494 |
+
}
|
495 |
+
|
496 |
+
request.headers.forEach(function(value, name) {
|
497 |
+
xhr.setRequestHeader(name, value);
|
498 |
+
});
|
499 |
+
|
500 |
+
if (request.signal) {
|
501 |
+
request.signal.addEventListener('abort', abortXhr);
|
502 |
+
|
503 |
+
xhr.onreadystatechange = function() {
|
504 |
+
// DONE (success or failure)
|
505 |
+
if (xhr.readyState === 4) {
|
506 |
+
request.signal.removeEventListener('abort', abortXhr);
|
507 |
+
}
|
508 |
+
};
|
509 |
+
}
|
510 |
+
|
511 |
+
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
512 |
+
})
|
513 |
+
}
|
514 |
+
|
515 |
+
fetch.polyfill = true;
|
516 |
+
|
517 |
+
if (!self.fetch) {
|
518 |
+
self.fetch = fetch;
|
519 |
+
self.Headers = Headers;
|
520 |
+
self.Request = Request;
|
521 |
+
self.Response = Response;
|
522 |
+
}
|
523 |
+
|
524 |
+
exports.Headers = Headers;
|
525 |
+
exports.Request = Request;
|
526 |
+
exports.Response = Response;
|
527 |
+
exports.fetch = fetch;
|
528 |
+
|
529 |
+
Object.defineProperty(exports, '__esModule', { value: true });
|
530 |
+
|
531 |
+
})));
|
inc/assets/js/install-theme.js
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
* Init
|
7 |
*/
|
8 |
init: function() {
|
|
|
9 |
this._bind();
|
10 |
},
|
11 |
|
@@ -24,6 +25,28 @@
|
|
24 |
$( document ).on('wp-theme-install-success' , AstraSitesInstallTheme._activateTheme);
|
25 |
},
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Activate Theme
|
29 |
*
|
@@ -76,9 +99,6 @@
|
|
76 |
_install_and_activate: function(event ) {
|
77 |
event.preventDefault();
|
78 |
var theme_slug = $(this).data('theme-slug') || '';
|
79 |
-
console.log( theme_slug );
|
80 |
-
console.log( 'yes' );
|
81 |
-
|
82 |
var btn = $( event.target );
|
83 |
|
84 |
if ( btn.hasClass( 'processing' ) ) {
|
6 |
* Init
|
7 |
*/
|
8 |
init: function() {
|
9 |
+
this._auto_close_notice();
|
10 |
this._bind();
|
11 |
},
|
12 |
|
25 |
$( document ).on('wp-theme-install-success' , AstraSitesInstallTheme._activateTheme);
|
26 |
},
|
27 |
|
28 |
+
/**
|
29 |
+
* Close Getting Started Notice
|
30 |
+
*
|
31 |
+
* @param {object} event
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
_auto_close_notice: function() {
|
35 |
+
|
36 |
+
if( $( '.astra-sites-getting-started-btn' ).length ) {
|
37 |
+
$.ajax({
|
38 |
+
url: AstraSitesInstallThemeVars.ajaxurl,
|
39 |
+
type: 'POST',
|
40 |
+
data: {
|
41 |
+
'action' : 'astra-sites-getting-started-notice'
|
42 |
+
},
|
43 |
+
})
|
44 |
+
.done(function (result) {
|
45 |
+
});
|
46 |
+
}
|
47 |
+
|
48 |
+
},
|
49 |
+
|
50 |
/**
|
51 |
* Activate Theme
|
52 |
*
|
99 |
_install_and_activate: function(event ) {
|
100 |
event.preventDefault();
|
101 |
var theme_slug = $(this).data('theme-slug') || '';
|
|
|
|
|
|
|
102 |
var btn = $( event.target );
|
103 |
|
104 |
if ( btn.hasClass( 'processing' ) ) {
|
inc/assets/js/render-grid.js
CHANGED
@@ -18,6 +18,7 @@
|
|
18 |
_api_params : {},
|
19 |
_breakpoint : 768,
|
20 |
_has_default_page_builder : false,
|
|
|
21 |
|
22 |
init: function()
|
23 |
{
|
@@ -190,7 +191,7 @@
|
|
190 |
|
191 |
_apiAddParam_per_page: function() {
|
192 |
// Add 'per_page'
|
193 |
-
var per_page_val =
|
194 |
if( astraRenderGrid.sites && astraRenderGrid.sites["par-page"] ) {
|
195 |
per_page_val = parseInt( astraRenderGrid.sites["par-page"] );
|
196 |
}
|
@@ -272,8 +273,8 @@
|
|
272 |
AstraRender._apiAddParam_search();
|
273 |
AstraRender._apiAddParam_per_page();
|
274 |
AstraRender._apiAddParam_astra_site_category();
|
275 |
-
AstraRender._apiAddParam_astra_site_page_builder();
|
276 |
AstraRender._apiAddParam_page();
|
|
|
277 |
AstraRender._apiAddParam_site_url();
|
278 |
AstraRender._apiAddParam_purchase_key();
|
279 |
|
@@ -380,20 +381,85 @@
|
|
380 |
*/
|
381 |
_loadPageBuilders: function() {
|
382 |
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
},
|
398 |
|
399 |
/**
|
@@ -520,6 +586,42 @@
|
|
520 |
$('body').removeClass('listed-all-sites');
|
521 |
}
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
},
|
525 |
|
18 |
_api_params : {},
|
19 |
_breakpoint : 768,
|
20 |
_has_default_page_builder : false,
|
21 |
+
_first_time_loaded : true,
|
22 |
|
23 |
init: function()
|
24 |
{
|
191 |
|
192 |
_apiAddParam_per_page: function() {
|
193 |
// Add 'per_page'
|
194 |
+
var per_page_val = 30;
|
195 |
if( astraRenderGrid.sites && astraRenderGrid.sites["par-page"] ) {
|
196 |
per_page_val = parseInt( astraRenderGrid.sites["par-page"] );
|
197 |
}
|
273 |
AstraRender._apiAddParam_search();
|
274 |
AstraRender._apiAddParam_per_page();
|
275 |
AstraRender._apiAddParam_astra_site_category();
|
|
|
276 |
AstraRender._apiAddParam_page();
|
277 |
+
AstraRender._apiAddParam_astra_site_page_builder();
|
278 |
AstraRender._apiAddParam_site_url();
|
279 |
AstraRender._apiAddParam_purchase_key();
|
280 |
|
381 |
*/
|
382 |
_loadPageBuilders: function() {
|
383 |
|
384 |
+
// Is Welcome screen?
|
385 |
+
// Then pre-send the API request to avoid the loader.
|
386 |
+
if( $('.astra-sites-welcome').length ) {
|
387 |
+
|
388 |
+
var plugins = $('.astra-sites-welcome').attr( 'data-plugins' ) || '';
|
389 |
+
var plugins = plugins.split(",");
|
390 |
+
|
391 |
+
// Also, Send page builder request with `/?search=` parameter. Because, We send the selected page builder request
|
392 |
+
// Which does not cached due to extra parameter `/?search=`. For that we initially send all these requests.
|
393 |
+
$.each(plugins, function( key, plugin) {
|
394 |
+
var category_slug = 'astra-site-page-builder';
|
395 |
+
var category = {
|
396 |
+
slug : category_slug + '/?search=' + plugin,
|
397 |
+
id : category_slug,
|
398 |
+
class : category_slug,
|
399 |
+
trigger : '',
|
400 |
+
wrapper_class : 'filter-links',
|
401 |
+
show_all : false,
|
402 |
+
};
|
403 |
+
|
404 |
+
// Pre-Send `sites` request for each active page builder to avoid the loader.
|
405 |
+
AstraSitesAPI._api_request( category, function( data ) {
|
406 |
+
if( data.items ) {
|
407 |
+
|
408 |
+
var per_page_val = 30;
|
409 |
+
if( astraRenderGrid.sites && astraRenderGrid.sites["par-page"] ) {
|
410 |
+
per_page_val = parseInt( astraRenderGrid.sites["par-page"] );
|
411 |
+
}
|
412 |
+
|
413 |
+
var api_params = {
|
414 |
+
per_page : per_page_val,
|
415 |
+
page : 1,
|
416 |
+
};
|
417 |
+
// Load `all` sites from each page builder.
|
418 |
+
$.each(data.items, function(index, item) {
|
419 |
+
|
420 |
+
if( item.id ) {
|
421 |
+
api_params['astra-site-page-builder'] = item.id;
|
422 |
+
|
423 |
+
// API Request.
|
424 |
+
var api_post = {
|
425 |
+
id: 'astra-sites',
|
426 |
+
slug: 'astra-sites?' + decodeURIComponent( $.param( api_params ) ),
|
427 |
+
};
|
428 |
+
|
429 |
+
AstraSitesAPI._api_request( api_post );
|
430 |
+
}
|
431 |
+
});
|
432 |
+
}
|
433 |
+
});
|
434 |
+
|
435 |
+
} );
|
436 |
+
|
437 |
+
// Pre-Send `category` request to avoid the loader.
|
438 |
+
var category_slug = 'astra-site-category';
|
439 |
+
var category = {
|
440 |
+
slug : category_slug + '/',
|
441 |
+
id : category_slug,
|
442 |
+
class : category_slug,
|
443 |
+
trigger : '',
|
444 |
+
wrapper_class : 'filter-links',
|
445 |
+
show_all : false,
|
446 |
+
};
|
447 |
+
AstraSitesAPI._api_request( category );
|
448 |
+
|
449 |
+
// Load `sites` from selected page builder.
|
450 |
+
} else {
|
451 |
+
var category_slug = 'astra-site-page-builder';
|
452 |
+
var category = {
|
453 |
+
slug : category_slug + AstraRender._getPageBuilderParams(),
|
454 |
+
id : category_slug,
|
455 |
+
class : category_slug,
|
456 |
+
trigger : 'astra-api-page-builder-loaded',
|
457 |
+
wrapper_class : 'filter-links',
|
458 |
+
show_all : false,
|
459 |
+
};
|
460 |
+
|
461 |
+
AstraSitesAPI._api_request( category );
|
462 |
+
}
|
463 |
},
|
464 |
|
465 |
/**
|
586 |
$('body').removeClass('listed-all-sites');
|
587 |
}
|
588 |
|
589 |
+
// Re-Send `categories` sites request to avoid the loader.
|
590 |
+
var categories = AstraSitesAPI._stored_data['astra-site-category'];
|
591 |
+
if( categories && AstraRender._first_time_loaded ) {
|
592 |
+
|
593 |
+
var per_page_val = 30;
|
594 |
+
if( astraRenderGrid.sites && astraRenderGrid.sites["par-page"] ) {
|
595 |
+
per_page_val = parseInt( astraRenderGrid.sites["par-page"] );
|
596 |
+
}
|
597 |
+
|
598 |
+
var api_params = {
|
599 |
+
per_page : per_page_val,
|
600 |
+
};
|
601 |
+
|
602 |
+
var page_builder_id = $('#astra-site-page-builder').find('.current').data('group') || '';
|
603 |
+
|
604 |
+
$.each( categories, function( index, category ) {
|
605 |
+
|
606 |
+
api_params['astra-site-category'] = category.id;
|
607 |
+
|
608 |
+
api_params['page'] = 1;
|
609 |
+
|
610 |
+
if( page_builder_id ) {
|
611 |
+
api_params['astra-site-page-builder'] = page_builder_id;
|
612 |
+
}
|
613 |
+
|
614 |
+
// API Request.
|
615 |
+
var api_post = {
|
616 |
+
id: 'astra-sites',
|
617 |
+
slug: 'astra-sites?' + decodeURIComponent( $.param( api_params ) ),
|
618 |
+
};
|
619 |
+
|
620 |
+
AstraSitesAPI._api_request( api_post );
|
621 |
+
} );
|
622 |
+
|
623 |
+
AstraRender._first_time_loaded = false;
|
624 |
+
}
|
625 |
|
626 |
},
|
627 |
|
inc/classes/class-astra-sites-importer-log.php
CHANGED
@@ -77,22 +77,6 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
|
|
77 |
|
78 |
// Initial AJAX Import Hooks.
|
79 |
add_action( 'astra_sites_import_start', array( $this, 'start' ), 10, 2 );
|
80 |
-
add_action( 'astra_sites_import_customizer_settings', array( $this, 'start_customizer' ) );
|
81 |
-
add_action( 'astra_sites_import_prepare_xml_data', array( $this, 'start_xml' ) );
|
82 |
-
add_action( 'astra_sites_import_options', array( $this, 'start_options' ) );
|
83 |
-
add_action( 'astra_sites_import_widgets', array( $this, 'start_widgets' ) );
|
84 |
-
add_action( 'astra_sites_import_complete', array( $this, 'start_end' ) );
|
85 |
-
|
86 |
-
add_action( 'wxr_importer.processed.post', array( $this, 'track_post' ) );
|
87 |
-
add_action( 'wxr_importer.processed.term', array( $this, 'track_term' ) );
|
88 |
-
|
89 |
-
// Delete..
|
90 |
-
add_action( 'astra_sites_reset_customizer_data', array( $this, 'reset_customizer_data' ) );
|
91 |
-
add_action( 'astra_sites_reset_site_options', array( $this, 'reset_site_options' ) );
|
92 |
-
add_action( 'astra_sites_reset_widgets_data', array( $this, 'reset_widgets_data' ) );
|
93 |
-
add_action( 'astra_sites_delete_imported_posts', array( $this, 'delete_imported_posts' ) );
|
94 |
-
add_action( 'astra_sites_delete_imported_wp_forms', array( $this, 'delete_imported_wp_forms' ) );
|
95 |
-
add_action( 'astra_sites_delete_imported_terms', array( $this, 'delete_imported_terms' ), 10, 2 );
|
96 |
}
|
97 |
|
98 |
/**
|
@@ -133,7 +117,7 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
|
|
133 |
*/
|
134 |
function start( $data = array(), $demo_api_uri = '' ) {
|
135 |
|
136 |
-
Astra_Sites_Importer_Log::add( '
|
137 |
|
138 |
Astra_Sites_Importer_Log::add( '# System Details: ' );
|
139 |
Astra_Sites_Importer_Log::add( "Debug Mode \t\t: " . self::get_debug_mode() );
|
@@ -159,179 +143,6 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
|
|
159 |
|
160 |
}
|
161 |
|
162 |
-
/**
|
163 |
-
* Track Post
|
164 |
-
*
|
165 |
-
* @since 1.3.0
|
166 |
-
*
|
167 |
-
* @param int $post_id Post ID.
|
168 |
-
* @return void
|
169 |
-
*/
|
170 |
-
function track_post( $post_id ) {
|
171 |
-
Astra_Sites_Importer_Log::add( '==== INSERTED - Post ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id ) );
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Track Term
|
176 |
-
*
|
177 |
-
* @since 1.3.0
|
178 |
-
*
|
179 |
-
* @param int $term_id Term ID.
|
180 |
-
* @return void
|
181 |
-
*/
|
182 |
-
function track_term( $term_id ) {
|
183 |
-
$term = get_term( $term_id );
|
184 |
-
if ( $term ) {
|
185 |
-
Astra_Sites_Importer_Log::add( '==== INSERTED - Term ' . $term_id . ' - ' . json_encode( $term ) );
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Reset Customizer Data
|
191 |
-
*
|
192 |
-
* @since 1.3.0
|
193 |
-
*
|
194 |
-
* @param array $data Customizer Data.
|
195 |
-
* @return void
|
196 |
-
*/
|
197 |
-
function reset_customizer_data( $data ) {
|
198 |
-
if ( $data ) {
|
199 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - CUSTOMIZER SETTINGS ' . json_encode( $data ) );
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Reset Site Options
|
205 |
-
*
|
206 |
-
* @since 1.3.0
|
207 |
-
*
|
208 |
-
* @param array $data Site options.
|
209 |
-
* @return void
|
210 |
-
*/
|
211 |
-
function reset_site_options( $data ) {
|
212 |
-
if ( $data ) {
|
213 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - SITE OPTIONS ' . json_encode( $data ) );
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Reset Widgets Data
|
219 |
-
*
|
220 |
-
* @since 1.3.0
|
221 |
-
*
|
222 |
-
* @param array $old_widgets Old Widgets.
|
223 |
-
* @return void
|
224 |
-
*/
|
225 |
-
function reset_widgets_data( $old_widgets ) {
|
226 |
-
if ( $old_widgets ) {
|
227 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - WIDGETS ' . json_encode( $old_widgets ) );
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Delete Imported Posts
|
233 |
-
*
|
234 |
-
* @since 1.3.0
|
235 |
-
*
|
236 |
-
* @param int $post_id Post ID.
|
237 |
-
* @return void
|
238 |
-
*/
|
239 |
-
function delete_imported_posts( $post_id ) {
|
240 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - POST ID ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id ) );
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Delete Imported WP Forms
|
245 |
-
*
|
246 |
-
* @since 1.3.0
|
247 |
-
*
|
248 |
-
* @param int $form_id Form ID.
|
249 |
-
* @return void
|
250 |
-
*/
|
251 |
-
function delete_imported_wp_forms( $form_id ) {
|
252 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - FORM ID ' . $form_id . ' - ' . get_post_type( $form_id ) . ' - ' . get_the_title( $form_id ) );
|
253 |
-
}
|
254 |
-
|
255 |
-
/**
|
256 |
-
* Delete Imported Terms
|
257 |
-
*
|
258 |
-
* @since 1.3.0
|
259 |
-
*
|
260 |
-
* @param int $term_id Term ID.
|
261 |
-
* @param array $term Term array.
|
262 |
-
* @return void
|
263 |
-
*/
|
264 |
-
function delete_imported_terms( $term_id, $term ) {
|
265 |
-
Astra_Sites_Importer_Log::add( '==== DELETED - TERM ID ' . $term_id . ' - ' . json_encode( $term ) );
|
266 |
-
}
|
267 |
-
|
268 |
-
/**
|
269 |
-
* Start Customizer Import
|
270 |
-
*
|
271 |
-
* @since 1.3.0
|
272 |
-
*
|
273 |
-
* @param array $data Customizer Data.
|
274 |
-
* @return void
|
275 |
-
*/
|
276 |
-
function start_customizer( $data ) {
|
277 |
-
if ( $data ) {
|
278 |
-
Astra_Sites_Importer_Log::add( '==== IMPORTED - CUSTOMIZER SETTINGS ' . json_encode( $data ) );
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Start XML Import
|
284 |
-
*
|
285 |
-
* @param string $xml XML file URL.
|
286 |
-
* @since 1.3.0
|
287 |
-
* @return void
|
288 |
-
*/
|
289 |
-
function start_xml( $xml ) {
|
290 |
-
Astra_Sites_Importer_Log::add( '==== IMPORTING from XML ' . $xml );
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Start Options Import
|
295 |
-
*
|
296 |
-
* @since 1.3.0
|
297 |
-
*
|
298 |
-
* @param array $data Site options.
|
299 |
-
* @return void
|
300 |
-
*/
|
301 |
-
function start_options( $data ) {
|
302 |
-
if ( $data ) {
|
303 |
-
Astra_Sites_Importer_Log::add( '==== IMPORTED - SITE OPTIONS ' . json_encode( $data ) );
|
304 |
-
}
|
305 |
-
}
|
306 |
-
|
307 |
-
/**
|
308 |
-
* Start Widgets Import
|
309 |
-
*
|
310 |
-
* @since 1.3.0
|
311 |
-
*
|
312 |
-
* @param array $old_widgets Widgets Data.
|
313 |
-
* @return void
|
314 |
-
*/
|
315 |
-
function start_widgets( $old_widgets ) {
|
316 |
-
if ( $old_widgets ) {
|
317 |
-
Astra_Sites_Importer_Log::add( '==== IMPORTED - WIDGETS ' . json_encode( $old_widgets ) );
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* End Import Process
|
323 |
-
*
|
324 |
-
* @since 1.3.0
|
325 |
-
*
|
326 |
-
* @return void
|
327 |
-
*/
|
328 |
-
function start_end() {
|
329 |
-
Astra_Sites_Importer_Log::add( '==== Complete ====' );
|
330 |
-
|
331 |
-
// Delete Log file.
|
332 |
-
delete_option( 'astra_sites_recent_import_log_file' );
|
333 |
-
}
|
334 |
-
|
335 |
/**
|
336 |
* Get an instance of WP_Filesystem_Direct.
|
337 |
*
|
77 |
|
78 |
// Initial AJAX Import Hooks.
|
79 |
add_action( 'astra_sites_import_start', array( $this, 'start' ), 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
117 |
*/
|
118 |
function start( $data = array(), $demo_api_uri = '' ) {
|
119 |
|
120 |
+
Astra_Sites_Importer_Log::add( 'Started Import Process' );
|
121 |
|
122 |
Astra_Sites_Importer_Log::add( '# System Details: ' );
|
123 |
Astra_Sites_Importer_Log::add( "Debug Mode \t\t: " . self::get_debug_mode() );
|
143 |
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
/**
|
147 |
* Get an instance of WP_Filesystem_Direct.
|
148 |
*
|
inc/classes/class-astra-sites-importer.php
CHANGED
@@ -169,7 +169,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
169 |
|
170 |
// Set meta for tracking the post.
|
171 |
update_post_meta( $new_id, '_astra_sites_imported_wp_forms', true );
|
172 |
-
|
173 |
}
|
174 |
|
175 |
if ( $new_id ) {
|
@@ -207,12 +207,11 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
207 |
|
208 |
$customizer_data = ( isset( $_POST['customizer_data'] ) ) ? (array) json_decode( stripcslashes( $_POST['customizer_data'] ), 1 ) : array();
|
209 |
|
210 |
-
do_action( 'astra_sites_import_customizer_settings', $customizer_data );
|
211 |
-
|
212 |
if ( ! empty( $customizer_data ) ) {
|
213 |
|
|
|
|
|
214 |
// Set meta for tracking the post.
|
215 |
-
Astra_Sites_Image_Importer::log( 'Customizer Data ' . json_encode( $customizer_data ) );
|
216 |
update_option( '_astra_sites_old_customizer_data', $customizer_data );
|
217 |
|
218 |
Astra_Customizer_Import::instance()->import( $customizer_data );
|
@@ -239,10 +238,10 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
239 |
|
240 |
$wxr_url = ( isset( $_REQUEST['wxr_url'] ) ) ? urldecode( $_REQUEST['wxr_url'] ) : '';
|
241 |
|
242 |
-
do_action( 'astra_sites_import_prepare_xml_data', $wxr_url );
|
243 |
-
|
244 |
if ( isset( $wxr_url ) ) {
|
245 |
|
|
|
|
|
246 |
// Download XML file.
|
247 |
$xml_path = Astra_Sites_Helper::download_file( $wxr_url );
|
248 |
|
@@ -273,13 +272,11 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
273 |
|
274 |
$options_data = ( isset( $_POST['options_data'] ) ) ? (array) json_decode( stripcslashes( $_POST['options_data'] ), 1 ) : '';
|
275 |
|
276 |
-
do_action( 'astra_sites_import_options', $options_data );
|
277 |
-
|
278 |
if ( ! empty( $options_data ) ) {
|
279 |
|
280 |
// Set meta for tracking the post.
|
281 |
if ( is_array( $options_data ) ) {
|
282 |
-
|
283 |
update_option( '_astra_sites_old_site_options', $options_data );
|
284 |
}
|
285 |
|
@@ -302,7 +299,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
302 |
|
303 |
$widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripcslashes( $_POST['widgets_data'] ) ) : '';
|
304 |
|
305 |
-
|
306 |
|
307 |
if ( ! empty( $widgets_data ) ) {
|
308 |
|
@@ -312,7 +309,6 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
312 |
// Set meta for tracking the post.
|
313 |
if ( is_object( $widgets_data ) ) {
|
314 |
$widgets_data = (array) $widgets_data;
|
315 |
-
Astra_Sites_Image_Importer::log( 'Widget Data ' . json_encode( $widgets_data ) );
|
316 |
update_option( '_astra_sites_old_widgets_data', $widgets_data );
|
317 |
}
|
318 |
|
@@ -431,6 +427,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
431 |
Astra_Minify::refresh_assets();
|
432 |
}
|
433 |
|
|
|
434 |
}
|
435 |
|
436 |
/**
|
@@ -440,7 +437,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
440 |
* @return void
|
441 |
*/
|
442 |
function reset_customizer_data() {
|
443 |
-
|
444 |
|
445 |
delete_option( 'astra-settings' );
|
446 |
|
@@ -457,7 +454,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
457 |
|
458 |
$options = get_option( '_astra_sites_old_site_options', array() );
|
459 |
|
460 |
-
|
461 |
|
462 |
if ( $options ) {
|
463 |
foreach ( $options as $option_key => $option_value ) {
|
@@ -477,7 +474,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
477 |
function reset_widgets_data() {
|
478 |
$old_widgets = get_option( '_astra_sites_old_widgets_data', array() );
|
479 |
|
480 |
-
|
481 |
|
482 |
if ( $old_widgets ) {
|
483 |
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
|
@@ -489,7 +486,6 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
489 |
|
490 |
if ( isset( $sidebars_widgets['wp_inactive_widgets'] ) ) {
|
491 |
if ( ! in_array( $widget_key, $sidebars_widgets['wp_inactive_widgets'] ) ) {
|
492 |
-
Astra_Sites_Image_Importer::log( '==== IN ACTIVATE - Widget ' . $widget_key );
|
493 |
$sidebars_widgets['wp_inactive_widgets'][] = $widget_key;
|
494 |
}
|
495 |
}
|
@@ -511,15 +507,13 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
511 |
*/
|
512 |
function delete_imported_posts() {
|
513 |
$post_id = isset( $_REQUEST['post_id'] ) ? absint( $_REQUEST['post_id'] ) : '';
|
|
|
514 |
|
515 |
-
|
516 |
-
|
517 |
-
if ( $post_id ) {
|
518 |
-
wp_delete_post( $post_id, true );
|
519 |
-
}
|
520 |
|
521 |
/* translators: %s is the post ID */
|
522 |
-
wp_send_json_success(
|
523 |
}
|
524 |
|
525 |
/**
|
@@ -531,14 +525,14 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
531 |
function delete_imported_wp_forms() {
|
532 |
$post_id = isset( $_REQUEST['post_id'] ) ? absint( $_REQUEST['post_id'] ) : '';
|
533 |
|
534 |
-
|
535 |
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
|
540 |
/* translators: %s is the form ID */
|
541 |
-
wp_send_json_success(
|
542 |
}
|
543 |
|
544 |
/**
|
@@ -551,16 +545,19 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
|
|
551 |
|
552 |
$term_id = isset( $_REQUEST['term_id'] ) ? absint( $_REQUEST['term_id'] ) : '';
|
553 |
|
|
|
|
|
554 |
if ( $term_id ) {
|
555 |
$term = get_term( $term_id );
|
556 |
if ( $term ) {
|
557 |
-
|
|
|
558 |
wp_delete_term( $term_id, $term->taxonomy );
|
559 |
}
|
560 |
}
|
561 |
|
562 |
/* translators: %s is the term ID */
|
563 |
-
wp_send_json_success(
|
564 |
}
|
565 |
|
566 |
}
|
169 |
|
170 |
// Set meta for tracking the post.
|
171 |
update_post_meta( $new_id, '_astra_sites_imported_wp_forms', true );
|
172 |
+
Astra_Sites_Importer_Log::add( 'Inserted WP Form ' . $new_id );
|
173 |
}
|
174 |
|
175 |
if ( $new_id ) {
|
207 |
|
208 |
$customizer_data = ( isset( $_POST['customizer_data'] ) ) ? (array) json_decode( stripcslashes( $_POST['customizer_data'] ), 1 ) : array();
|
209 |
|
|
|
|
|
210 |
if ( ! empty( $customizer_data ) ) {
|
211 |
|
212 |
+
Astra_Sites_Importer_Log::add( 'Imported Customizer Settings ' . json_encode( $customizer_data ) );
|
213 |
+
|
214 |
// Set meta for tracking the post.
|
|
|
215 |
update_option( '_astra_sites_old_customizer_data', $customizer_data );
|
216 |
|
217 |
Astra_Customizer_Import::instance()->import( $customizer_data );
|
238 |
|
239 |
$wxr_url = ( isset( $_REQUEST['wxr_url'] ) ) ? urldecode( $_REQUEST['wxr_url'] ) : '';
|
240 |
|
|
|
|
|
241 |
if ( isset( $wxr_url ) ) {
|
242 |
|
243 |
+
Astra_Sites_Importer_Log::add( 'Importing from XML ' . $xml );
|
244 |
+
|
245 |
// Download XML file.
|
246 |
$xml_path = Astra_Sites_Helper::download_file( $wxr_url );
|
247 |
|
272 |
|
273 |
$options_data = ( isset( $_POST['options_data'] ) ) ? (array) json_decode( stripcslashes( $_POST['options_data'] ), 1 ) : '';
|
274 |
|
|
|
|
|
275 |
if ( ! empty( $options_data ) ) {
|
276 |
|
277 |
// Set meta for tracking the post.
|
278 |
if ( is_array( $options_data ) ) {
|
279 |
+
Astra_Sites_Importer_Log::add( 'Imported - Site Options ' . json_encode( $options_data ) );
|
280 |
update_option( '_astra_sites_old_site_options', $options_data );
|
281 |
}
|
282 |
|
299 |
|
300 |
$widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripcslashes( $_POST['widgets_data'] ) ) : '';
|
301 |
|
302 |
+
Astra_Sites_Importer_Log::add( 'Imported - Widgets ' . json_encode( $widgets_data ) );
|
303 |
|
304 |
if ( ! empty( $widgets_data ) ) {
|
305 |
|
309 |
// Set meta for tracking the post.
|
310 |
if ( is_object( $widgets_data ) ) {
|
311 |
$widgets_data = (array) $widgets_data;
|
|
|
312 |
update_option( '_astra_sites_old_widgets_data', $widgets_data );
|
313 |
}
|
314 |
|
427 |
Astra_Minify::refresh_assets();
|
428 |
}
|
429 |
|
430 |
+
Astra_Sites_Importer_Log::add( 'Complete ' );
|
431 |
}
|
432 |
|
433 |
/**
|
437 |
* @return void
|
438 |
*/
|
439 |
function reset_customizer_data() {
|
440 |
+
Astra_Sites_Importer_Log::add( 'Deleted customizer Settings ' . json_encode( get_option( 'astra-settings', array() ) ) );
|
441 |
|
442 |
delete_option( 'astra-settings' );
|
443 |
|
454 |
|
455 |
$options = get_option( '_astra_sites_old_site_options', array() );
|
456 |
|
457 |
+
Astra_Sites_Importer_Log::add( 'Deleted - Site Options ' . json_encode( $options ) );
|
458 |
|
459 |
if ( $options ) {
|
460 |
foreach ( $options as $option_key => $option_value ) {
|
474 |
function reset_widgets_data() {
|
475 |
$old_widgets = get_option( '_astra_sites_old_widgets_data', array() );
|
476 |
|
477 |
+
Astra_Sites_Importer_Log::add( 'DELETED - WIDGETS ' . json_encode( $old_widgets ) );
|
478 |
|
479 |
if ( $old_widgets ) {
|
480 |
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
|
486 |
|
487 |
if ( isset( $sidebars_widgets['wp_inactive_widgets'] ) ) {
|
488 |
if ( ! in_array( $widget_key, $sidebars_widgets['wp_inactive_widgets'] ) ) {
|
|
|
489 |
$sidebars_widgets['wp_inactive_widgets'][] = $widget_key;
|
490 |
}
|
491 |
}
|
507 |
*/
|
508 |
function delete_imported_posts() {
|
509 |
$post_id = isset( $_REQUEST['post_id'] ) ? absint( $_REQUEST['post_id'] ) : '';
|
510 |
+
$message = 'Deleted - Post ID ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id );
|
511 |
|
512 |
+
Astra_Sites_Importer_Log::add( $message );
|
513 |
+
wp_delete_post( $post_id, true );
|
|
|
|
|
|
|
514 |
|
515 |
/* translators: %s is the post ID */
|
516 |
+
wp_send_json_success( $message );
|
517 |
}
|
518 |
|
519 |
/**
|
525 |
function delete_imported_wp_forms() {
|
526 |
$post_id = isset( $_REQUEST['post_id'] ) ? absint( $_REQUEST['post_id'] ) : '';
|
527 |
|
528 |
+
$message = 'Deleted - Form ID ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id );
|
529 |
|
530 |
+
Astra_Sites_Importer_Log::add( $message );
|
531 |
+
|
532 |
+
wp_delete_post( $post_id, true );
|
533 |
|
534 |
/* translators: %s is the form ID */
|
535 |
+
wp_send_json_success( $message );
|
536 |
}
|
537 |
|
538 |
/**
|
545 |
|
546 |
$term_id = isset( $_REQUEST['term_id'] ) ? absint( $_REQUEST['term_id'] ) : '';
|
547 |
|
548 |
+
$message = '';
|
549 |
+
|
550 |
if ( $term_id ) {
|
551 |
$term = get_term( $term_id );
|
552 |
if ( $term ) {
|
553 |
+
$message = 'Deleted - Term ' . $term_id . ' - ' . $term->name . ' ' . $term->taxonomy;
|
554 |
+
Astra_Sites_Importer_Log::add( $message );
|
555 |
wp_delete_term( $term_id, $term->taxonomy );
|
556 |
}
|
557 |
}
|
558 |
|
559 |
/* translators: %s is the term ID */
|
560 |
+
wp_send_json_success( $message );
|
561 |
}
|
562 |
|
563 |
}
|
inc/classes/class-astra-sites-notices.php
DELETED
@@ -1,214 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Astra Sites Notices
|
4 |
-
*
|
5 |
-
* @package Astra Sites
|
6 |
-
* @since 1.0.8
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! class_exists( 'Astra_Sites_Notices' ) ) :
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Astra_Sites_Notices
|
13 |
-
*
|
14 |
-
* @since 1.0.8
|
15 |
-
*/
|
16 |
-
class Astra_Sites_Notices {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Notices
|
20 |
-
*
|
21 |
-
* @access private
|
22 |
-
* @var array Notices.
|
23 |
-
* @since 1.0.8
|
24 |
-
*/
|
25 |
-
private static $notices = array();
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Instance
|
29 |
-
*
|
30 |
-
* @access private
|
31 |
-
* @var object Class object.
|
32 |
-
* @since 1.0.8
|
33 |
-
*/
|
34 |
-
private static $instance;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Initiator
|
38 |
-
*
|
39 |
-
* @since 1.0.8
|
40 |
-
* @return object initialized object of class.
|
41 |
-
*/
|
42 |
-
public static function get_instance() {
|
43 |
-
if ( ! isset( self::$instance ) ) {
|
44 |
-
self::$instance = new self;
|
45 |
-
}
|
46 |
-
return self::$instance;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Constructor
|
51 |
-
*
|
52 |
-
* @since 1.0.8
|
53 |
-
*/
|
54 |
-
public function __construct() {
|
55 |
-
|
56 |
-
add_action( 'admin_notices', array( $this, 'show_notices' ) );
|
57 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
58 |
-
add_action( 'wp_ajax_astra-notices', array( $this, 'dismiss' ) );
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Add Notice.
|
64 |
-
*
|
65 |
-
* @since 1.0.8
|
66 |
-
* @param array $args Notice arguments.
|
67 |
-
* @return void
|
68 |
-
*/
|
69 |
-
public static function add_notice( $args = array() ) {
|
70 |
-
if ( is_array( $args ) ) {
|
71 |
-
self::$notices[] = $args;
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Dismiss Notice.
|
77 |
-
*
|
78 |
-
* @since 1.0.8
|
79 |
-
* @return void
|
80 |
-
*/
|
81 |
-
function dismiss() {
|
82 |
-
|
83 |
-
$id = ( isset( $_POST['id'] ) ) ? $_POST['id'] : '';
|
84 |
-
$time = ( isset( $_POST['time'] ) ) ? $_POST['time'] : '';
|
85 |
-
$meta = ( isset( $_POST['meta'] ) ) ? $_POST['meta'] : '';
|
86 |
-
|
87 |
-
// Valid inputs?
|
88 |
-
if ( ! empty( $id ) ) {
|
89 |
-
|
90 |
-
if ( 'user' === $meta ) {
|
91 |
-
update_user_meta( get_current_user_id(), $id, true );
|
92 |
-
} else {
|
93 |
-
set_transient( $id, true, $time );
|
94 |
-
}
|
95 |
-
|
96 |
-
wp_send_json_success();
|
97 |
-
}
|
98 |
-
|
99 |
-
wp_send_json_error();
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Enqueue Scripts.
|
104 |
-
*
|
105 |
-
* @since 1.0.8
|
106 |
-
* @return void
|
107 |
-
*/
|
108 |
-
function enqueue_scripts() {
|
109 |
-
wp_register_script( 'astra-sites-notices', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-notices.js', array( 'jquery' ), ASTRA_SITES_VER, true );
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Notice Types
|
114 |
-
*
|
115 |
-
* @since 1.0.8
|
116 |
-
* @return void
|
117 |
-
*/
|
118 |
-
function show_notices() {
|
119 |
-
|
120 |
-
$defaults = array(
|
121 |
-
'id' => '',
|
122 |
-
'type' => 'info',
|
123 |
-
'show_if' => true,
|
124 |
-
'message' => '',
|
125 |
-
'class' => 'astra-active-notice',
|
126 |
-
'dismissible' => false,
|
127 |
-
'dismissible-meta' => 'user',
|
128 |
-
'dismissible-time' => WEEK_IN_SECONDS,
|
129 |
-
|
130 |
-
'data' => '',
|
131 |
-
);
|
132 |
-
|
133 |
-
foreach ( self::$notices as $key => $notice ) {
|
134 |
-
|
135 |
-
$notice = wp_parse_args( $notice, $defaults );
|
136 |
-
|
137 |
-
$classes = array( 'astra-notice', 'notice' );
|
138 |
-
|
139 |
-
$classes[] = $notice['class'];
|
140 |
-
if ( isset( $notice['type'] ) ) {
|
141 |
-
$classes[] = 'notice-' . $notice['type'];
|
142 |
-
}
|
143 |
-
|
144 |
-
// Is notice dismissible?
|
145 |
-
if ( true === $notice['dismissible'] ) {
|
146 |
-
$classes[] = 'is-dismissible';
|
147 |
-
|
148 |
-
// Dismissable time.
|
149 |
-
$notice['data'] = ' dismissible-time=' . esc_attr( $notice['dismissible-time'] ) . ' ';
|
150 |
-
}
|
151 |
-
|
152 |
-
// Notice ID.
|
153 |
-
$notice_id = 'astra-sites-notices-id-' . $key;
|
154 |
-
if ( isset( $notice['id'] ) && ! empty( $notice['id'] ) ) {
|
155 |
-
$notice_id = $notice['id'];
|
156 |
-
}
|
157 |
-
$notice['id'] = $notice_id;
|
158 |
-
$notice['classes'] = implode( ' ', $classes );
|
159 |
-
|
160 |
-
// User meta.
|
161 |
-
$notice['data'] .= ' dismissible-meta=' . esc_attr( $notice['dismissible-meta'] ) . ' ';
|
162 |
-
if ( 'user' === $notice['dismissible-meta'] ) {
|
163 |
-
$expired = get_user_meta( get_current_user_id(), $notice_id, true );
|
164 |
-
} elseif ( 'transient' === $notice['dismissible-meta'] ) {
|
165 |
-
$expired = get_transient( $notice_id );
|
166 |
-
}
|
167 |
-
|
168 |
-
// Notices visible after transient expire.
|
169 |
-
if ( isset( $notice['show_if'] ) ) {
|
170 |
-
|
171 |
-
if ( true === $notice['show_if'] ) {
|
172 |
-
|
173 |
-
// Is transient expired?
|
174 |
-
if ( false === $expired || empty( $expired ) ) {
|
175 |
-
self::markup( $notice );
|
176 |
-
}
|
177 |
-
}
|
178 |
-
} else {
|
179 |
-
|
180 |
-
// No transient notices.
|
181 |
-
self::markup( $notice );
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Markup Notice.
|
189 |
-
*
|
190 |
-
* @since 1.0.8
|
191 |
-
* @param array $notice Notice markup.
|
192 |
-
* @return void
|
193 |
-
*/
|
194 |
-
public static function markup( $notice = array() ) {
|
195 |
-
|
196 |
-
wp_enqueue_script( 'astra-sites-notices' );
|
197 |
-
|
198 |
-
?>
|
199 |
-
<div id="<?php echo esc_attr( $notice['id'] ); ?>" class="<?php echo esc_attr( $notice['classes'] ); ?>" <?php echo $notice['data']; ?>>
|
200 |
-
<p>
|
201 |
-
<?php echo $notice['message']; ?>
|
202 |
-
</p>
|
203 |
-
</div>
|
204 |
-
<?php
|
205 |
-
}
|
206 |
-
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Kicking this off by calling 'get_instance()' method
|
211 |
-
*/
|
212 |
-
Astra_Sites_Notices::get_instance();
|
213 |
-
|
214 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/classes/class-astra-sites-page.php
CHANGED
@@ -57,6 +57,34 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
|
|
57 |
|
58 |
add_action( 'after_setup_theme', array( $this, 'init_admin_settings' ), 99 );
|
59 |
add_action( 'admin_init', array( $this, 'save_page_builder' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
/**
|
@@ -223,22 +251,68 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
|
|
223 |
|
224 |
$default_page_builder = $this->get_setting( 'page_builder' );
|
225 |
|
226 |
-
if ( empty( $default_page_builder ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
?>
|
228 |
-
<div class="astra-sites-welcome">
|
229 |
<div class="inner">
|
230 |
<form id="astra-sites-welcome-form" enctype="multipart/form-data" method="post">
|
231 |
-
<h1
|
232 |
-
<p
|
233 |
<div class="fields">
|
234 |
-
<
|
235 |
-
<
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
</div>
|
|
|
242 |
<input type="hidden" name="message" value="saved" />
|
243 |
<?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
|
244 |
</form>
|
@@ -316,7 +390,7 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
|
|
316 |
* @since 1.0.6
|
317 |
*/
|
318 |
public function add_admin_menu() {
|
319 |
-
$page_title = apply_filters( 'astra_sites_menu_page_title', __( 'Astra Sites', 'astra-sites' ) );
|
320 |
|
321 |
$page = add_theme_page( $page_title, $page_title, 'manage_options', 'astra-sites', array( $this, 'menu_callback' ) );
|
322 |
}
|
57 |
|
58 |
add_action( 'after_setup_theme', array( $this, 'init_admin_settings' ), 99 );
|
59 |
add_action( 'admin_init', array( $this, 'save_page_builder' ) );
|
60 |
+
add_action( 'admin_notices', array( $this, 'getting_started' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Admin notice
|
65 |
+
*
|
66 |
+
* @since 1.3.5
|
67 |
+
*
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
function getting_started() {
|
71 |
+
if ( 'plugins' !== get_current_screen()->base ) {
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
$processed = get_user_meta( get_current_user_id(), '_astra_sites_gettings_started', true );
|
76 |
+
$product_name = Astra_Sites_White_Label::get_instance()->page_title( 'Astra' );
|
77 |
+
|
78 |
+
if ( $processed ) {
|
79 |
+
return;
|
80 |
+
}
|
81 |
+
|
82 |
+
?>
|
83 |
+
<div class="notice notice-info is-dismissible astra-sites-getting-started-notice">
|
84 |
+
<?php /* translators: %1$s is the admin page URL, %2$s is product name. */ ?>
|
85 |
+
<p><?php printf( __( 'Thank you for choosing %1$s! Check the library of <a class="astra-sites-getting-started-btn" href="%2$s">ready starter sites here »</a>', 'astra-sites' ), $product_name, admin_url( 'themes.php?page=astra-sites' ) ); ?></p>
|
86 |
+
</div>
|
87 |
+
<?php
|
88 |
}
|
89 |
|
90 |
/**
|
251 |
|
252 |
$default_page_builder = $this->get_setting( 'page_builder' );
|
253 |
|
254 |
+
if ( empty( $default_page_builder ) || isset( $_GET['change-page-builder'] ) ) {
|
255 |
+
|
256 |
+
$plugins = get_option( 'active_plugins', array() );
|
257 |
+
$page_builders = array();
|
258 |
+
if ( $plugins ) {
|
259 |
+
foreach ( $plugins as $key => $plugin_init ) {
|
260 |
+
if ( false !== strpos( $plugin_init, 'elementor' ) ) {
|
261 |
+
$page_builders[] = 'elementor';
|
262 |
+
}
|
263 |
+
if ( false !== strpos( $plugin_init, 'beaver-builder' ) ) {
|
264 |
+
$page_builders[] = 'beaver-builder';
|
265 |
+
}
|
266 |
+
if ( false !== strpos( $plugin_init, 'brizy' ) ) {
|
267 |
+
$page_builders[] = 'brizy';
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
$page_builders = array_unique( $page_builders );
|
272 |
+
$page_builders[] = 'gutenberg';
|
273 |
+
$page_builders = implode( ',', $page_builders );
|
274 |
?>
|
275 |
+
<div class="astra-sites-welcome" data-plugins="<?php echo esc_attr( $page_builders ); ?>">
|
276 |
<div class="inner">
|
277 |
<form id="astra-sites-welcome-form" enctype="multipart/form-data" method="post">
|
278 |
+
<h1><?php _e( 'Select Page Builder', 'astra-sites' ); ?></h1>
|
279 |
+
<p><?php _e( 'Astra offers starter sites that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list below.', 'astra-sites' ); ?></p>
|
280 |
<div class="fields">
|
281 |
+
<ul class="page-builders">
|
282 |
+
<li>
|
283 |
+
<label>
|
284 |
+
<input type="radio" name="page_builder" value="gutenberg">
|
285 |
+
<img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/gutenberg.jpg' ); ?>" />
|
286 |
+
<div class="title"><?php _e( 'Gutenberg', 'astra-sites' ); ?></div>
|
287 |
+
</label>
|
288 |
+
</li>
|
289 |
+
<li>
|
290 |
+
<label>
|
291 |
+
<input type="radio" name="page_builder" value="elementor">
|
292 |
+
<img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/elementor.jpg' ); ?>" />
|
293 |
+
<div class="title"><?php _e( 'Elementor', 'astra-sites' ); ?></div>
|
294 |
+
</label>
|
295 |
+
</li>
|
296 |
+
<li>
|
297 |
+
<label>
|
298 |
+
<input type="radio" name="page_builder" value="beaver-builder">
|
299 |
+
<img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/beaver-builder.png' ); ?>" />
|
300 |
+
<div class="title"><?php _e( 'Beaver Builder', 'astra-sites' ); ?></div>
|
301 |
+
</li>
|
302 |
+
<li>
|
303 |
+
<label>
|
304 |
+
<input type="radio" name="page_builder" value="brizy">
|
305 |
+
<img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/brizy.jpg' ); ?>" />
|
306 |
+
<div class="title"><?php _e( 'Brizy', 'astra-sites' ); ?></div>
|
307 |
+
</label>
|
308 |
+
</li>
|
309 |
+
</ul>
|
310 |
+
<div class="astra-sites-page-builder-notice" style="display: none;">
|
311 |
+
<p class="description"><?php _e( 'Please select your favorite page builder to continue..', 'astra-sites' ); ?></p>
|
312 |
+
</div>
|
313 |
+
<?php submit_button( __( 'Next', 'astra-sites' ), 'primary button-hero disabled' ); ?>
|
314 |
</div>
|
315 |
+
|
316 |
<input type="hidden" name="message" value="saved" />
|
317 |
<?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
|
318 |
</form>
|
390 |
* @since 1.0.6
|
391 |
*/
|
392 |
public function add_admin_menu() {
|
393 |
+
$page_title = apply_filters( 'astra_sites_menu_page_title', __( 'Astra Starter Sites', 'astra-sites' ) );
|
394 |
|
395 |
$page = add_theme_page( $page_title, $page_title, 'manage_options', 'astra-sites', array( $this, 'menu_callback' ) );
|
396 |
}
|
inc/classes/class-astra-sites-white-label.php
CHANGED
@@ -197,7 +197,7 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
|
|
197 |
* @param string $title Page Title.
|
198 |
* @return string Filtered Page Title.
|
199 |
*/
|
200 |
-
function page_title( $title ) {
|
201 |
|
202 |
if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
|
203 |
$astra_sites_name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
|
197 |
* @param string $title Page Title.
|
198 |
* @return string Filtered Page Title.
|
199 |
*/
|
200 |
+
function page_title( $title = '' ) {
|
201 |
|
202 |
if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
|
203 |
$astra_sites_name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
|
inc/classes/class-astra-sites.php
CHANGED
@@ -68,6 +68,18 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
68 |
add_action( 'wp_ajax_astra-sites-backup-settings', array( $this, 'backup_settings' ) );
|
69 |
add_action( 'wp_ajax_astra-sites-set-reset-data', array( $this, 'set_reset_data' ) );
|
70 |
add_action( 'wp_ajax_astra-sites-activate-theme', array( $this, 'activate_theme' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -83,7 +95,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
83 |
wp_send_json_success(
|
84 |
array(
|
85 |
'success' => true,
|
86 |
-
'message' => __( 'Theme
|
87 |
)
|
88 |
);
|
89 |
}
|
@@ -141,18 +153,17 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
141 |
|
142 |
$theme_status = 'astra-sites-theme-' . $this->get_theme_status();
|
143 |
|
144 |
-
|
145 |
array(
|
146 |
'id' => 'astra-theme-activation-nag',
|
147 |
'type' => 'error',
|
148 |
'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
|
149 |
/* translators: 1: theme.php file*/
|
150 |
-
'message' => sprintf( __( 'Astra Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="#" class="%3$s" data-theme-slug="astra">Install & Activate Now</a>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ) ), $theme_status ),
|
151 |
'dismissible' => true,
|
152 |
'dismissible-time' => WEEK_IN_SECONDS,
|
153 |
)
|
154 |
);
|
155 |
-
|
156 |
}
|
157 |
|
158 |
/**
|
@@ -268,8 +279,11 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
268 |
wp_enqueue_script( 'astra-sites-eventsource', ASTRA_SITES_URI . 'inc/assets/js/eventsource.min.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
269 |
}
|
270 |
|
|
|
|
|
|
|
271 |
// API.
|
272 |
-
wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery' ), ASTRA_SITES_VER, true );
|
273 |
|
274 |
// Admin Page.
|
275 |
wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
|
@@ -302,7 +316,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
302 |
array(
|
303 |
'purchase_key' => '',
|
304 |
'site_url' => '',
|
305 |
-
'par-page' =>
|
306 |
)
|
307 |
);
|
308 |
|
@@ -327,6 +341,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
327 |
'isWhiteLabeled' => Astra_Sites_White_Label::get_instance()->is_white_labeled(),
|
328 |
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
|
329 |
'siteURL' => site_url(),
|
|
|
330 |
'getProText' => __( 'Get Agency Bundle', 'astra-sites' ),
|
331 |
'getProURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
|
332 |
'getUpgradeText' => __( 'Upgrade', 'astra-sites' ),
|
@@ -355,30 +370,30 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
355 |
),
|
356 |
'log' => array(
|
357 |
'installingPlugin' => __( 'Installing plugin ', 'astra-sites' ),
|
358 |
-
'installed' => __( '
|
359 |
'activating' => __( 'Activating plugin ', 'astra-sites' ),
|
360 |
-
'activated' => __( '
|
361 |
'bulkActivation' => __( 'Bulk plugin activation...', 'astra-sites' ),
|
362 |
-
'activate' => __( '
|
363 |
'activationError' => __( 'Error! While activating plugin - ', 'astra-sites' ),
|
364 |
'bulkInstall' => __( 'Bulk plugin installation...', 'astra-sites' ),
|
365 |
'api' => __( 'Site API ', 'astra-sites' ),
|
366 |
'importing' => __( 'Importing..', 'astra-sites' ),
|
367 |
'processingRequest' => __( 'Processing requests...', 'astra-sites' ),
|
368 |
-
'importCustomizer' => __( '
|
369 |
-
'importCustomizerSuccess' => __( '
|
370 |
-
'importWPForms' => __( '
|
371 |
-
'importWPFormsSuccess' => __( '
|
372 |
-
'importXMLPrepare' => __( '
|
373 |
-
'importXMLPrepareSuccess' => __( '
|
374 |
-
'importXML' => __( '
|
375 |
-
'importXMLSuccess' => __( '
|
376 |
-
'importOptions' => __( '
|
377 |
-
'importOptionsSuccess' => __( '
|
378 |
-
'importWidgets' => __( '
|
379 |
-
'importWidgetsSuccess' => __( '
|
380 |
'serverConfiguration' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' ),
|
381 |
-
'success' => __( '
|
382 |
'gettingData' => __( 'Getting Site Information..', 'astra-sites' ),
|
383 |
'importingCustomizer' => __( 'Importing Customizer Settings..', 'astra-sites' ),
|
384 |
'importingWPForms' => __( 'Importing Contact Forms..', 'astra-sites' ),
|
@@ -404,10 +419,10 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
404 |
*/
|
405 |
private function includes() {
|
406 |
|
407 |
-
require_once ASTRA_SITES_DIR . 'inc/
|
|
|
408 |
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-page.php';
|
409 |
require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/class-astra-sites-compatibility.php';
|
410 |
-
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-white-label.php';
|
411 |
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer.php';
|
412 |
}
|
413 |
|
@@ -451,7 +466,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
451 |
wp_send_json_success(
|
452 |
array(
|
453 |
'success' => true,
|
454 |
-
'message' => __( 'Plugin
|
455 |
)
|
456 |
);
|
457 |
|
68 |
add_action( 'wp_ajax_astra-sites-backup-settings', array( $this, 'backup_settings' ) );
|
69 |
add_action( 'wp_ajax_astra-sites-set-reset-data', array( $this, 'set_reset_data' ) );
|
70 |
add_action( 'wp_ajax_astra-sites-activate-theme', array( $this, 'activate_theme' ) );
|
71 |
+
add_action( 'wp_ajax_astra-sites-getting-started-notice', array( $this, 'getting_started_notice' ) );
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Close getting started notice for current user
|
76 |
+
*
|
77 |
+
* @since 1.3.5
|
78 |
+
* @return void
|
79 |
+
*/
|
80 |
+
function getting_started_notice() {
|
81 |
+
update_user_meta( get_current_user_id(), '_astra_sites_gettings_started', true );
|
82 |
+
wp_send_json_success();
|
83 |
}
|
84 |
|
85 |
/**
|
95 |
wp_send_json_success(
|
96 |
array(
|
97 |
'success' => true,
|
98 |
+
'message' => __( 'Theme Activated', 'astra-sites' ),
|
99 |
)
|
100 |
);
|
101 |
}
|
153 |
|
154 |
$theme_status = 'astra-sites-theme-' . $this->get_theme_status();
|
155 |
|
156 |
+
Astra_Notices::add_notice(
|
157 |
array(
|
158 |
'id' => 'astra-theme-activation-nag',
|
159 |
'type' => 'error',
|
160 |
'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
|
161 |
/* translators: 1: theme.php file*/
|
162 |
+
'message' => sprintf( __( '<p>Astra Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="#" class="%3$s" data-theme-slug="astra">Install & Activate Now</a></p>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ) ), $theme_status ),
|
163 |
'dismissible' => true,
|
164 |
'dismissible-time' => WEEK_IN_SECONDS,
|
165 |
)
|
166 |
);
|
|
|
167 |
}
|
168 |
|
169 |
/**
|
279 |
wp_enqueue_script( 'astra-sites-eventsource', ASTRA_SITES_URI . 'inc/assets/js/eventsource.min.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
280 |
}
|
281 |
|
282 |
+
// Fetch.
|
283 |
+
wp_register_script( 'astra-sites-fetch', ASTRA_SITES_URI . 'inc/assets/js/fetch.umd.js', array( 'jquery' ), ASTRA_SITES_VER, true );
|
284 |
+
|
285 |
// API.
|
286 |
+
wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery', 'astra-sites-fetch' ), ASTRA_SITES_VER, true );
|
287 |
|
288 |
// Admin Page.
|
289 |
wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
|
316 |
array(
|
317 |
'purchase_key' => '',
|
318 |
'site_url' => '',
|
319 |
+
'par-page' => 30,
|
320 |
)
|
321 |
);
|
322 |
|
341 |
'isWhiteLabeled' => Astra_Sites_White_Label::get_instance()->is_white_labeled(),
|
342 |
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
|
343 |
'siteURL' => site_url(),
|
344 |
+
'docUrl' => 'https://wpastra.com/',
|
345 |
'getProText' => __( 'Get Agency Bundle', 'astra-sites' ),
|
346 |
'getProURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
|
347 |
'getUpgradeText' => __( 'Upgrade', 'astra-sites' ),
|
370 |
),
|
371 |
'log' => array(
|
372 |
'installingPlugin' => __( 'Installing plugin ', 'astra-sites' ),
|
373 |
+
'installed' => __( 'Plugin installed!', 'astra-sites' ),
|
374 |
'activating' => __( 'Activating plugin ', 'astra-sites' ),
|
375 |
+
'activated' => __( 'Plugin activated ', 'astra-sites' ),
|
376 |
'bulkActivation' => __( 'Bulk plugin activation...', 'astra-sites' ),
|
377 |
+
'activate' => __( 'Plugin activate - ', 'astra-sites' ),
|
378 |
'activationError' => __( 'Error! While activating plugin - ', 'astra-sites' ),
|
379 |
'bulkInstall' => __( 'Bulk plugin installation...', 'astra-sites' ),
|
380 |
'api' => __( 'Site API ', 'astra-sites' ),
|
381 |
'importing' => __( 'Importing..', 'astra-sites' ),
|
382 |
'processingRequest' => __( 'Processing requests...', 'astra-sites' ),
|
383 |
+
'importCustomizer' => __( 'Importing "Customizer Settings"...', 'astra-sites' ),
|
384 |
+
'importCustomizerSuccess' => __( 'Imported customizer settings!', 'astra-sites' ),
|
385 |
+
'importWPForms' => __( 'Importing "Contact Forms"...', 'astra-sites' ),
|
386 |
+
'importWPFormsSuccess' => __( 'Imported Contact Forms!', 'astra-sites' ),
|
387 |
+
'importXMLPrepare' => __( 'Preparing "XML" Data...', 'astra-sites' ),
|
388 |
+
'importXMLPrepareSuccess' => __( 'Set XML data!', 'astra-sites' ),
|
389 |
+
'importXML' => __( 'Importing "XML"...', 'astra-sites' ),
|
390 |
+
'importXMLSuccess' => __( 'Imported XML!', 'astra-sites' ),
|
391 |
+
'importOptions' => __( 'Importing "Options"...', 'astra-sites' ),
|
392 |
+
'importOptionsSuccess' => __( 'Imported Options!', 'astra-sites' ),
|
393 |
+
'importWidgets' => __( 'Importing "Widgets"...', 'astra-sites' ),
|
394 |
+
'importWidgetsSuccess' => __( 'Imported Widgets!', 'astra-sites' ),
|
395 |
'serverConfiguration' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' ),
|
396 |
+
'success' => __( 'View site: ', 'astra-sites' ),
|
397 |
'gettingData' => __( 'Getting Site Information..', 'astra-sites' ),
|
398 |
'importingCustomizer' => __( 'Importing Customizer Settings..', 'astra-sites' ),
|
399 |
'importingWPForms' => __( 'Importing Contact Forms..', 'astra-sites' ),
|
419 |
*/
|
420 |
private function includes() {
|
421 |
|
422 |
+
require_once ASTRA_SITES_DIR . 'inc/lib/astra-notices/class-astra-notices.php';
|
423 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-white-label.php';
|
424 |
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-page.php';
|
425 |
require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/class-astra-sites-compatibility.php';
|
|
|
426 |
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer.php';
|
427 |
}
|
428 |
|
466 |
wp_send_json_success(
|
467 |
array(
|
468 |
'success' => true,
|
469 |
+
'message' => __( 'Plugin Activated', 'astra-sites' ),
|
470 |
)
|
471 |
);
|
472 |
|
inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php
CHANGED
@@ -57,7 +57,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
|
|
57 |
* @return void
|
58 |
*/
|
59 |
public function import() {
|
60 |
-
|
61 |
self::start_post_mapping();
|
62 |
}
|
63 |
|
@@ -171,7 +171,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
|
|
171 |
* @return void
|
172 |
*/
|
173 |
public static function update_header_mapping( $post_id = '', $meta_key = '', $mapping = array() ) {
|
174 |
-
|
175 |
$headers_old = get_post_meta( $post_id, $meta_key, true );
|
176 |
$headers_new = self::get_header_mapping( $headers_old, $mapping );
|
177 |
update_post_meta( $post_id, $meta_key, $headers_new );
|
@@ -188,7 +188,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
|
|
188 |
* @return void
|
189 |
*/
|
190 |
public static function update_location_rules( $post_id = '', $meta_key = '', $mapping = array() ) {
|
191 |
-
|
192 |
$location_new = self::get_location_mappings( $mapping );
|
193 |
update_post_meta( $post_id, $meta_key, $location_new );
|
194 |
}
|
57 |
* @return void
|
58 |
*/
|
59 |
public function import() {
|
60 |
+
Astra_Sites_Importer_Log::add( '---- Processing Mapping - for Astra Pro ----' );
|
61 |
self::start_post_mapping();
|
62 |
}
|
63 |
|
171 |
* @return void
|
172 |
*/
|
173 |
public static function update_header_mapping( $post_id = '', $meta_key = '', $mapping = array() ) {
|
174 |
+
Astra_Sites_Importer_Log::add( 'Mapping "' . $meta_key . '" for ' . $post_id );
|
175 |
$headers_old = get_post_meta( $post_id, $meta_key, true );
|
176 |
$headers_new = self::get_header_mapping( $headers_old, $mapping );
|
177 |
update_post_meta( $post_id, $meta_key, $headers_new );
|
188 |
* @return void
|
189 |
*/
|
190 |
public static function update_location_rules( $post_id = '', $meta_key = '', $mapping = array() ) {
|
191 |
+
Astra_Sites_Importer_Log::add( 'Mapping "' . $meta_key . '" for ' . $post_id );
|
192 |
$location_new = self::get_location_mappings( $mapping );
|
193 |
update_post_meta( $post_id, $meta_key, $location_new );
|
194 |
}
|
inc/importers/batch-processing/class-astra-sites-batch-processing-beaver-builder.php
CHANGED
@@ -54,7 +54,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
|
|
54 |
*/
|
55 |
public function import() {
|
56 |
|
57 |
-
|
58 |
if ( ! is_callable( 'FLBuilderModel::get_post_types' ) ) {
|
59 |
return;
|
60 |
}
|
@@ -85,7 +85,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
|
|
85 |
*/
|
86 |
public function import_single_post( $post_id = 0 ) {
|
87 |
|
88 |
-
|
89 |
if ( ! empty( $post_id ) ) {
|
90 |
|
91 |
// Get page builder data.
|
54 |
*/
|
55 |
public function import() {
|
56 |
|
57 |
+
Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for Beaver Builder ----' );
|
58 |
if ( ! is_callable( 'FLBuilderModel::get_post_types' ) ) {
|
59 |
return;
|
60 |
}
|
85 |
*/
|
86 |
public function import_single_post( $post_id = 0 ) {
|
87 |
|
88 |
+
Astra_Sites_Importer_Log::add( 'Post ID: ' . $post_id );
|
89 |
if ( ! empty( $post_id ) ) {
|
90 |
|
91 |
// Get page builder data.
|
inc/importers/batch-processing/class-astra-sites-batch-processing-brizy.php
CHANGED
@@ -53,7 +53,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Brizy' ) ) :
|
|
53 |
*/
|
54 |
public function import() {
|
55 |
|
56 |
-
|
57 |
if ( ! is_callable( 'Brizy_Editor_Storage_Common::instance' ) ) {
|
58 |
return;
|
59 |
}
|
53 |
*/
|
54 |
public function import() {
|
55 |
|
56 |
+
Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for "Brizy" ----' );
|
57 |
if ( ! is_callable( 'Brizy_Editor_Storage_Common::instance' ) ) {
|
58 |
return;
|
59 |
}
|
inc/importers/batch-processing/class-astra-sites-batch-processing-elementor.php
CHANGED
@@ -45,7 +45,6 @@ class Astra_Sites_Batch_Processing_Elementor extends Source_Local {
|
|
45 |
*/
|
46 |
public function import() {
|
47 |
|
48 |
-
// \Astra_Sites_Image_Importer::log( '---- Processing WordPress Posts / Pages - for Elementor ----' );
|
49 |
$post_types = get_option( 'elementor_cpt_support', array( 'page', 'post' ) );
|
50 |
if ( empty( $post_types ) && ! is_array( $post_types ) ) {
|
51 |
return;
|
@@ -72,7 +71,6 @@ class Astra_Sites_Batch_Processing_Elementor extends Source_Local {
|
|
72 |
*/
|
73 |
public function import_single_post( $post_id = 0 ) {
|
74 |
|
75 |
-
// \Astra_Sites_Image_Importer::log( 'Post ID: ' . $post_id );
|
76 |
if ( ! empty( $post_id ) ) {
|
77 |
|
78 |
$hotlink_imported = get_post_meta( $post_id, '_astra_sites_hotlink_imported', true );
|
45 |
*/
|
46 |
public function import() {
|
47 |
|
|
|
48 |
$post_types = get_option( 'elementor_cpt_support', array( 'page', 'post' ) );
|
49 |
if ( empty( $post_types ) && ! is_array( $post_types ) ) {
|
50 |
return;
|
71 |
*/
|
72 |
public function import_single_post( $post_id = 0 ) {
|
73 |
|
|
|
74 |
if ( ! empty( $post_id ) ) {
|
75 |
|
76 |
$hotlink_imported = get_post_meta( $post_id, '_astra_sites_hotlink_imported', true );
|
inc/importers/batch-processing/class-astra-sites-batch-processing-gutenberg.php
CHANGED
@@ -85,7 +85,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
|
|
85 |
// Allow the SVG tags in batch update process.
|
86 |
add_filter( 'wp_kses_allowed_html', array( $this, 'allowed_tags_and_attributes' ), 10, 2 );
|
87 |
|
88 |
-
|
89 |
|
90 |
$post_ids = Astra_Sites_Batch_Processing::get_pages( array( 'page' ) );
|
91 |
if ( empty( $post_ids ) && ! is_array( $post_ids ) ) {
|
@@ -125,7 +125,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
|
|
125 |
// expects as 'u0026amp;'. So, Converted '&' with 'u0026amp;'.
|
126 |
//
|
127 |
// @todo This affect for normal page content too. Detect only Gutenberg pages and process only on it.
|
128 |
-
$content = str_replace( '&',
|
129 |
|
130 |
// Update content.
|
131 |
wp_update_post(
|
85 |
// Allow the SVG tags in batch update process.
|
86 |
add_filter( 'wp_kses_allowed_html', array( $this, 'allowed_tags_and_attributes' ), 10, 2 );
|
87 |
|
88 |
+
Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for "Gutenberg" ----' );
|
89 |
|
90 |
$post_ids = Astra_Sites_Batch_Processing::get_pages( array( 'page' ) );
|
91 |
if ( empty( $post_ids ) && ! is_array( $post_ids ) ) {
|
125 |
// expects as 'u0026amp;'. So, Converted '&' with 'u0026amp;'.
|
126 |
//
|
127 |
// @todo This affect for normal page content too. Detect only Gutenberg pages and process only on it.
|
128 |
+
$content = str_replace( '&', "\u0026amp;", $content );
|
129 |
|
130 |
// Update content.
|
131 |
wp_update_post(
|
inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php
CHANGED
@@ -53,7 +53,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Misc' ) ) :
|
|
53 |
*/
|
54 |
public function import() {
|
55 |
|
56 |
-
|
57 |
self::fix_nav_menus();
|
58 |
}
|
59 |
|
@@ -87,7 +87,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Misc' ) ) :
|
|
87 |
$post_ids = self::get_menu_post_ids();
|
88 |
if ( is_array( $post_ids ) ) {
|
89 |
foreach ( $post_ids as $post_id ) {
|
90 |
-
|
91 |
$menu_url = get_post_meta( $post_id, '_menu_item_url', true );
|
92 |
|
93 |
if ( $menu_url ) {
|
53 |
*/
|
54 |
public function import() {
|
55 |
|
56 |
+
Astra_Sites_Importer_Log::add( '---- Processing MISC ----' );
|
57 |
self::fix_nav_menus();
|
58 |
}
|
59 |
|
87 |
$post_ids = self::get_menu_post_ids();
|
88 |
if ( is_array( $post_ids ) ) {
|
89 |
foreach ( $post_ids as $post_id ) {
|
90 |
+
Astra_Sites_Importer_Log::add( 'Post ID: ' . $post_id );
|
91 |
$menu_url = get_post_meta( $post_id, '_menu_item_url', true );
|
92 |
|
93 |
if ( $menu_url ) {
|
inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php
CHANGED
@@ -65,7 +65,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) :
|
|
65 |
|
66 |
$data = get_option( 'widget_media_image', null );
|
67 |
|
68 |
-
|
69 |
foreach ( $data as $key => $value ) {
|
70 |
|
71 |
if (
|
65 |
|
66 |
$data = get_option( 'widget_media_image', null );
|
67 |
|
68 |
+
Astra_Sites_Importer_Log::add( '---- Processing Images from Widgets -----' );
|
69 |
foreach ( $data as $key => $value ) {
|
70 |
|
71 |
if (
|
inc/importers/batch-processing/class-astra-sites-batch-processing.php
CHANGED
@@ -119,7 +119,8 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
|
|
119 |
*/
|
120 |
public function start_process() {
|
121 |
|
122 |
-
|
|
|
123 |
|
124 |
// Add "widget" in import [queue].
|
125 |
if ( class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) {
|
@@ -148,7 +149,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
|
|
148 |
self::$process_all->push_to_queue( $import );
|
149 |
}
|
150 |
} else {
|
151 |
-
|
152 |
}
|
153 |
|
154 |
// Add "astra-addon" in import [queue].
|
119 |
*/
|
120 |
public function start_process() {
|
121 |
|
122 |
+
Astra_Sites_Importer_Log::add( 'Batch Process Started!' );
|
123 |
+
Astra_Sites_Importer_Log::add( Astra_Sites_White_Label::get_instance()->page_title( ASTRA_SITES_NAME ) . ' - Importing Images for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
|
124 |
|
125 |
// Add "widget" in import [queue].
|
126 |
if ( class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) {
|
149 |
self::$process_all->push_to_queue( $import );
|
150 |
}
|
151 |
} else {
|
152 |
+
Astra_Sites_Importer_Log::add( 'Couldn\'t not import image due to allow_url_fopen() is disabled!' );
|
153 |
}
|
154 |
|
155 |
// Add "astra-addon" in import [queue].
|
inc/importers/batch-processing/helpers/class-astra-sites-image-importer.php
CHANGED
@@ -107,7 +107,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
|
|
107 |
private function get_saved_image( $attachment ) {
|
108 |
|
109 |
if ( apply_filters( 'astra_sites_image_importer_skip_image', false, $attachment ) ) {
|
110 |
-
|
111 |
return $attachment;
|
112 |
}
|
113 |
|
@@ -115,7 +115,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
|
|
115 |
|
116 |
// Already imported? Then return!
|
117 |
if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) {
|
118 |
-
|
119 |
return $this->already_imported_ids[ $attachment['id'] ];
|
120 |
}
|
121 |
|
@@ -146,7 +146,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
|
|
146 |
)
|
147 |
);
|
148 |
|
149 |
-
|
150 |
}
|
151 |
|
152 |
if ( $post_id ) {
|
@@ -188,7 +188,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
|
|
188 |
|
189 |
// Empty file content?
|
190 |
if ( empty( $file_content ) ) {
|
191 |
-
|
192 |
return $attachment;
|
193 |
}
|
194 |
|
@@ -226,33 +226,13 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
|
|
226 |
'url' => $upload['url'],
|
227 |
);
|
228 |
|
229 |
-
|
230 |
|
231 |
$this->already_imported_ids[ $attachment['id'] ] = $new_attachment;
|
232 |
|
233 |
return $new_attachment;
|
234 |
}
|
235 |
|
236 |
-
/**
|
237 |
-
* Debugging Log.
|
238 |
-
*
|
239 |
-
* @since 1.0.14
|
240 |
-
* @param mixed $log Log data.
|
241 |
-
* @return void
|
242 |
-
*/
|
243 |
-
public static function log( $log ) {
|
244 |
-
|
245 |
-
if ( ! WP_DEBUG_LOG ) {
|
246 |
-
return;
|
247 |
-
}
|
248 |
-
|
249 |
-
if ( is_array( $log ) || is_object( $log ) ) {
|
250 |
-
error_log( print_r( $log, true ) );
|
251 |
-
} else {
|
252 |
-
error_log( $log );
|
253 |
-
}
|
254 |
-
}
|
255 |
-
|
256 |
}
|
257 |
|
258 |
/**
|
107 |
private function get_saved_image( $attachment ) {
|
108 |
|
109 |
if ( apply_filters( 'astra_sites_image_importer_skip_image', false, $attachment ) ) {
|
110 |
+
Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image - {from filter} - ' . $attachment['url'] . ' - Filter name `astra_sites_image_importer_skip_image`.' );
|
111 |
return $attachment;
|
112 |
}
|
113 |
|
115 |
|
116 |
// Already imported? Then return!
|
117 |
if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) {
|
118 |
+
Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image {already imported from batch process} - ' . $attachment['url'] . ' - already imported.' );
|
119 |
return $this->already_imported_ids[ $attachment['id'] ];
|
120 |
}
|
121 |
|
146 |
)
|
147 |
);
|
148 |
|
149 |
+
Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image {already imported from xml} - ' . $attachment['url'] );
|
150 |
}
|
151 |
|
152 |
if ( $post_id ) {
|
188 |
|
189 |
// Empty file content?
|
190 |
if ( empty( $file_content ) ) {
|
191 |
+
Astra_Sites_Importer_Log::add( 'BATCH - FAIL Image {Error: Failed wp_remote_retrieve_body} - ' . $attachment['url'] );
|
192 |
return $attachment;
|
193 |
}
|
194 |
|
226 |
'url' => $upload['url'],
|
227 |
);
|
228 |
|
229 |
+
Astra_Sites_Importer_Log::add( 'BATCH - SUCCESS Image {Imported} - ' . $new_attachment['url'] );
|
230 |
|
231 |
$this->already_imported_ids[ $attachment['id'] ] = $new_attachment;
|
232 |
|
233 |
return $new_attachment;
|
234 |
}
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
|
238 |
/**
|
inc/importers/batch-processing/helpers/class-wp-background-process-astra.php
CHANGED
@@ -56,8 +56,12 @@ if ( class_exists( 'WP_Background_Process' ) ) :
|
|
56 |
|
57 |
parent::complete();
|
58 |
|
59 |
-
|
|
|
|
|
|
|
60 |
|
|
|
61 |
}
|
62 |
|
63 |
}
|
56 |
|
57 |
parent::complete();
|
58 |
|
59 |
+
Astra_Sites_Importer_Log::add( 'Batch Process Complete!' );
|
60 |
+
|
61 |
+
// Delete Log file.
|
62 |
+
delete_option( 'astra_sites_recent_import_log_file' );
|
63 |
|
64 |
+
do_action( 'astra_sites_image_import_complete' );
|
65 |
}
|
66 |
|
67 |
}
|
inc/importers/wxr-importer/class-astra-wxr-importer.php
CHANGED
@@ -70,6 +70,7 @@ class Astra_WXR_Importer {
|
|
70 |
* @return void
|
71 |
*/
|
72 |
function track_post( $post_id ) {
|
|
|
73 |
update_post_meta( $post_id, '_astra_sites_imported_post', true );
|
74 |
}
|
75 |
|
@@ -80,6 +81,10 @@ class Astra_WXR_Importer {
|
|
80 |
* @return void
|
81 |
*/
|
82 |
function track_term( $term_id ) {
|
|
|
|
|
|
|
|
|
83 |
update_term_meta( $term_id, '_astra_sites_imported_term', true );
|
84 |
}
|
85 |
|
70 |
* @return void
|
71 |
*/
|
72 |
function track_post( $post_id ) {
|
73 |
+
Astra_Sites_Importer_Log::add( 'Inserted - Post ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id ) );
|
74 |
update_post_meta( $post_id, '_astra_sites_imported_post', true );
|
75 |
}
|
76 |
|
81 |
* @return void
|
82 |
*/
|
83 |
function track_term( $term_id ) {
|
84 |
+
$term = get_term( $term_id );
|
85 |
+
if ( $term ) {
|
86 |
+
Astra_Sites_Importer_Log::add( 'Inserted - Term ' . $term_id . ' - ' . json_encode( $term ) );
|
87 |
+
}
|
88 |
update_term_meta( $term_id, '_astra_sites_imported_term', true );
|
89 |
}
|
90 |
|
inc/includes/admin-page.php
CHANGED
@@ -170,9 +170,7 @@ defined( 'ABSPATH' ) or exit;
|
|
170 |
<strong><?php _e( 'Install Required Plugins', 'astra-sites' ); ?></strong>
|
171 |
<span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-plugins-settings"><span class="dashicons dashicons-editor-help"></span></span>
|
172 |
<div class="astra-sites-tooltip-message" id="astra-sites-tooltip-plugins-settings" style="display: none;">
|
173 |
-
<p><?php _e( 'Plugins below are used to build this website:', 'astra-sites' ); ?></p>
|
174 |
<ul class="required-plugins-list"><span class="spinner is-active"></span></ul>
|
175 |
-
<p><?php _e( 'These are required for this website to work.', 'astra-sites' ); ?></p>
|
176 |
</div>
|
177 |
</li>
|
178 |
<li class="astra-sites-import-customizer">
|
@@ -230,9 +228,8 @@ defined( 'ABSPATH' ) or exit;
|
|
230 |
<?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
|
231 |
<span class="percent"></span>
|
232 |
</a>
|
233 |
-
<div
|
234 |
-
<progress
|
235 |
-
<!-- <span id="astra-site-import-process-text"></span> -->
|
236 |
</div>
|
237 |
<!-- <a class="button button-hero hide-if-no-customize astra-site-import" href="#">
|
238 |
<?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
|
@@ -262,6 +259,19 @@ defined( 'ABSPATH' ) or exit;
|
|
262 |
</div>
|
263 |
<div class="wp-full-overlay-main">
|
264 |
<iframe src="{{{data.astra_demo_url}}}" title="<?php esc_attr_e( 'Preview', 'astra-sites' ); ?>"></iframe>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
</div>
|
266 |
</div>
|
267 |
</script>
|
170 |
<strong><?php _e( 'Install Required Plugins', 'astra-sites' ); ?></strong>
|
171 |
<span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-plugins-settings"><span class="dashicons dashicons-editor-help"></span></span>
|
172 |
<div class="astra-sites-tooltip-message" id="astra-sites-tooltip-plugins-settings" style="display: none;">
|
|
|
173 |
<ul class="required-plugins-list"><span class="spinner is-active"></span></ul>
|
|
|
174 |
</div>
|
175 |
</li>
|
176 |
<li class="astra-sites-import-customizer">
|
228 |
<?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
|
229 |
<span class="percent"></span>
|
230 |
</a>
|
231 |
+
<div class="astra-site-import-process-wrap" style="display: none;">
|
232 |
+
<progress class="astra-site-import-process" max="100" value="0"></progress>
|
|
|
233 |
</div>
|
234 |
<!-- <a class="button button-hero hide-if-no-customize astra-site-import" href="#">
|
235 |
<?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
|
259 |
</div>
|
260 |
<div class="wp-full-overlay-main">
|
261 |
<iframe src="{{{data.astra_demo_url}}}" title="<?php esc_attr_e( 'Preview', 'astra-sites' ); ?>"></iframe>
|
262 |
+
<div class="astra-sites-result-preview" style="display: none;">
|
263 |
+
<div class="inner">
|
264 |
+
<h2><?php _e( 'We\'re building your website.', 'astra-sites' ); ?></h2>
|
265 |
+
<p><?php _e( 'The process can take anywhere between 2 to 10 minutes depending on the size of the website and speed of connection.', 'astra-sites' ); ?></p>
|
266 |
+
<p><?php _e( 'Please do not close this browser window until the site is imported completely.', 'astra-sites' ); ?></p>
|
267 |
+
<div class="current-importing-status-wrap">
|
268 |
+
<div class="current-importing-status">
|
269 |
+
<div class="current-importing-status-title"></div>
|
270 |
+
<div class="current-importing-status-description"></div>
|
271 |
+
</div>
|
272 |
+
</div>
|
273 |
+
</div>
|
274 |
+
</div>
|
275 |
</div>
|
276 |
</div>
|
277 |
</script>
|
inc/lib/astra-notices/class-astra-notices.php
ADDED
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Astra Sites Notices
|
4 |
+
*
|
5 |
+
* Closing notice on click on `astra-notice-close` class.
|
6 |
+
*
|
7 |
+
* If notice has the data attribute `data-repeat-notice-after="%2$s"` then notice close for that SPECIFIC TIME.
|
8 |
+
* If notice has NO data attribute `data-repeat-notice-after="%2$s"` then notice close for the CURRENT USER FOREVER.
|
9 |
+
*
|
10 |
+
* > Create custom close notice link in the notice markup. E.g.
|
11 |
+
* `<a href="#" data-repeat-notice-after="<?php echo MONTH_IN_SECONDS; ?>" class="astra-notice-close">`
|
12 |
+
* It close the notice for 30 days.
|
13 |
+
*
|
14 |
+
* @package Astra Sites
|
15 |
+
* @since 1.4.0
|
16 |
+
*/
|
17 |
+
|
18 |
+
if ( ! class_exists( 'Astra_Notices' ) ) :
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Astra_Notices
|
22 |
+
*
|
23 |
+
* @since 1.4.0
|
24 |
+
*/
|
25 |
+
class Astra_Notices {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Notices
|
29 |
+
*
|
30 |
+
* @access private
|
31 |
+
* @var array Notices.
|
32 |
+
* @since 1.4.0
|
33 |
+
*/
|
34 |
+
private static $version = '1.1.3';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Notices
|
38 |
+
*
|
39 |
+
* @access private
|
40 |
+
* @var array Notices.
|
41 |
+
* @since 1.4.0
|
42 |
+
*/
|
43 |
+
private static $notices = array();
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Instance
|
47 |
+
*
|
48 |
+
* @access private
|
49 |
+
* @var object Class object.
|
50 |
+
* @since 1.4.0
|
51 |
+
*/
|
52 |
+
private static $instance;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Initiator
|
56 |
+
*
|
57 |
+
* @since 1.4.0
|
58 |
+
* @return object initialized object of class.
|
59 |
+
*/
|
60 |
+
public static function get_instance() {
|
61 |
+
if ( ! isset( self::$instance ) ) {
|
62 |
+
self::$instance = new self;
|
63 |
+
}
|
64 |
+
return self::$instance;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Constructor
|
69 |
+
*
|
70 |
+
* @since 1.4.0
|
71 |
+
*/
|
72 |
+
public function __construct() {
|
73 |
+
add_action( 'admin_notices', array( $this, 'show_notices' ), 30 );
|
74 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
75 |
+
add_action( 'wp_ajax_astra-notice-dismiss', array( $this, 'dismiss_notice' ) );
|
76 |
+
add_filter( 'wp_kses_allowed_html', array( $this, 'add_data_attributes' ), 10, 2 );
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Filters and Returns a list of allowed tags and attributes for a given context.
|
81 |
+
*
|
82 |
+
* @param Array $allowedposttags Array of allowed tags.
|
83 |
+
* @param String $context Context type (explicit).
|
84 |
+
* @since 1.4.0
|
85 |
+
* @return Array
|
86 |
+
*/
|
87 |
+
public function add_data_attributes( $allowedposttags, $context ) {
|
88 |
+
$allowedposttags['a']['data-repeat-notice-after'] = true;
|
89 |
+
|
90 |
+
return $allowedposttags;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Add Notice.
|
95 |
+
*
|
96 |
+
* @since 1.4.0
|
97 |
+
* @param array $args Notice arguments.
|
98 |
+
* @return void
|
99 |
+
*/
|
100 |
+
public static function add_notice( $args = array() ) {
|
101 |
+
self::$notices[] = $args;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Dismiss Notice.
|
106 |
+
*
|
107 |
+
* @since 1.4.0
|
108 |
+
* @return void
|
109 |
+
*/
|
110 |
+
public function dismiss_notice() {
|
111 |
+
$notice_id = ( isset( $_POST['notice_id'] ) ) ? sanitize_key( $_POST['notice_id'] ) : '';
|
112 |
+
$repeat_notice_after = ( isset( $_POST['repeat_notice_after'] ) ) ? absint( $_POST['repeat_notice_after'] ) : '';
|
113 |
+
|
114 |
+
// Valid inputs?
|
115 |
+
if ( ! empty( $notice_id ) ) {
|
116 |
+
|
117 |
+
if ( ! empty( $repeat_notice_after ) ) {
|
118 |
+
set_transient( $notice_id, true, $repeat_notice_after );
|
119 |
+
} else {
|
120 |
+
update_user_meta( get_current_user_id(), $notice_id, 'notice-dismissed' );
|
121 |
+
}
|
122 |
+
|
123 |
+
wp_send_json_success();
|
124 |
+
}
|
125 |
+
|
126 |
+
wp_send_json_error();
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Enqueue Scripts.
|
131 |
+
*
|
132 |
+
* @since 1.4.0
|
133 |
+
* @return void
|
134 |
+
*/
|
135 |
+
public function enqueue_scripts() {
|
136 |
+
wp_register_script( 'astra-notices', self::_get_uri() . 'notices.js', array( 'jquery' ), self::$version, true );
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Rating priority sort
|
141 |
+
*
|
142 |
+
* @since 1.5.2
|
143 |
+
* @param array $array1 array one.
|
144 |
+
* @param array $array2 array two.
|
145 |
+
* @return array
|
146 |
+
*/
|
147 |
+
public function sort_notices( $array1, $array2 ) {
|
148 |
+
if ( ! isset( $array1['priority'] ) ) {
|
149 |
+
$array1['priority'] = 10;
|
150 |
+
}
|
151 |
+
if ( ! isset( $array2['priority'] ) ) {
|
152 |
+
$array2['priority'] = 10;
|
153 |
+
}
|
154 |
+
|
155 |
+
return $array1['priority'] - $array2['priority'];
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Notice Types
|
160 |
+
*
|
161 |
+
* @since 1.4.0
|
162 |
+
* @return void
|
163 |
+
*/
|
164 |
+
public function show_notices() {
|
165 |
+
|
166 |
+
$defaults = array(
|
167 |
+
'id' => '', // Optional, Notice ID. If empty it set `astra-notices-id-<$array-index>`.
|
168 |
+
'type' => 'info', // Optional, Notice type. Default `info`. Expected [info, warning, notice, error].
|
169 |
+
'message' => '', // Optional, Message.
|
170 |
+
'show_if' => true, // Optional, Show notice on custom condition. E.g. 'show_if' => if( is_admin() ) ? true, false, .
|
171 |
+
'repeat-notice-after' => '', // Optional, Dismiss-able notice time. It'll auto show after given time.
|
172 |
+
'display-notice-after' => false, // Optional, Dismiss-able notice time. It'll auto show after given time.
|
173 |
+
'class' => '', // Optional, Additional notice wrapper class.
|
174 |
+
'priority' => 10, // Priority of the notice.
|
175 |
+
'display-with-other-notices' => true, // Should the notice be displayed if other notices are being displayed from Astra_Notices.
|
176 |
+
);
|
177 |
+
|
178 |
+
// Count for the notices that are rendered.
|
179 |
+
$notices_displayed = 0;
|
180 |
+
|
181 |
+
// sort the array with priority.
|
182 |
+
usort( self::$notices, array( $this, 'sort_notices' ) );
|
183 |
+
|
184 |
+
foreach ( self::$notices as $key => $notice ) {
|
185 |
+
|
186 |
+
$notice = wp_parse_args( $notice, $defaults );
|
187 |
+
|
188 |
+
$notice['id'] = self::get_notice_id( $notice, $key );
|
189 |
+
|
190 |
+
$notice['classes'] = self::get_wrap_classes( $notice );
|
191 |
+
|
192 |
+
// Notices visible after transient expire.
|
193 |
+
if ( isset( $notice['show_if'] ) && true === $notice['show_if'] ) {
|
194 |
+
|
195 |
+
// don't display the notice if it is not supposed to be displayed with other notices.
|
196 |
+
if ( 0 !== $notices_displayed && false === $notice['display-with-other-notices'] ) {
|
197 |
+
continue;
|
198 |
+
}
|
199 |
+
|
200 |
+
if ( self::is_expired( $notice ) ) {
|
201 |
+
|
202 |
+
self::markup( $notice );
|
203 |
+
++$notices_displayed;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Markup Notice.
|
212 |
+
*
|
213 |
+
* @since 1.4.0
|
214 |
+
* @param array $notice Notice markup.
|
215 |
+
* @return void
|
216 |
+
*/
|
217 |
+
public static function markup( $notice = array() ) {
|
218 |
+
|
219 |
+
wp_enqueue_script( 'astra-notices' );
|
220 |
+
|
221 |
+
do_action( "astra_notice_before_markup_{$notice['id']}" );
|
222 |
+
|
223 |
+
?>
|
224 |
+
<div id="<?php echo esc_attr( $notice['id'] ); ?>" class="<?php echo esc_attr( $notice['classes'] ); ?>" data-repeat-notice-after="<?php echo esc_attr( $notice['repeat-notice-after'] ); ?>">
|
225 |
+
<div class="notice-container">
|
226 |
+
<?php do_action( "astra_notice_inside_markup_{$notice['id']}" ); ?>
|
227 |
+
<?php echo wp_kses_post( $notice['message'] ); ?>
|
228 |
+
</div>
|
229 |
+
</div>
|
230 |
+
<?php
|
231 |
+
|
232 |
+
do_action( "astra_notice_after_markup_{$notice['id']}" );
|
233 |
+
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Notice classes.
|
238 |
+
*
|
239 |
+
* @since 1.4.0
|
240 |
+
*
|
241 |
+
* @param array $notice Notice arguments.
|
242 |
+
* @return array Notice wrapper classes.
|
243 |
+
*/
|
244 |
+
private static function get_wrap_classes( $notice ) {
|
245 |
+
$classes = array( 'astra-notice', 'notice', 'is-dismissible' );
|
246 |
+
$classes[] = $notice['class'];
|
247 |
+
if ( isset( $notice['type'] ) && '' !== $notice['type'] ) {
|
248 |
+
$classes[] = 'notice-' . $notice['type'];
|
249 |
+
}
|
250 |
+
|
251 |
+
return esc_attr( implode( ' ', $classes ) );
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Get Notice ID.
|
256 |
+
*
|
257 |
+
* @since 1.4.0
|
258 |
+
*
|
259 |
+
* @param array $notice Notice arguments.
|
260 |
+
* @param int $key Notice array index.
|
261 |
+
* @return string Notice id.
|
262 |
+
*/
|
263 |
+
private static function get_notice_id( $notice, $key ) {
|
264 |
+
if ( isset( $notice['id'] ) && ! empty( $notice['id'] ) ) {
|
265 |
+
return $notice['id'];
|
266 |
+
}
|
267 |
+
|
268 |
+
return 'astra-notices-id-' . $key;
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Is notice expired?
|
273 |
+
*
|
274 |
+
* @since 1.4.0
|
275 |
+
*
|
276 |
+
* @param array $notice Notice arguments.
|
277 |
+
* @return boolean
|
278 |
+
*/
|
279 |
+
private static function is_expired( $notice ) {
|
280 |
+
$transient_status = get_transient( $notice['id'] );
|
281 |
+
|
282 |
+
if ( false === $transient_status ) {
|
283 |
+
|
284 |
+
if ( isset( $notice['display-notice-after'] ) && false !== $notice['display-notice-after'] ) {
|
285 |
+
|
286 |
+
if ( 'delayed-notice' !== get_user_meta( get_current_user_id(), $notice['id'], true ) &&
|
287 |
+
'notice-dismissed' !== get_user_meta( get_current_user_id(), $notice['id'], true ) ) {
|
288 |
+
set_transient( $notice['id'], 'delayed-notice', $notice['display-notice-after'] );
|
289 |
+
update_user_meta( get_current_user_id(), $notice['id'], 'delayed-notice' );
|
290 |
+
|
291 |
+
return false;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
// Check the user meta status if current notice is dismissed or delay completed.
|
296 |
+
$meta_status = get_user_meta( get_current_user_id(), $notice['id'], true );
|
297 |
+
|
298 |
+
if ( empty( $meta_status ) || 'delayed-notice' === $meta_status ) {
|
299 |
+
return true;
|
300 |
+
}
|
301 |
+
}
|
302 |
+
|
303 |
+
return false;
|
304 |
+
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Get URI
|
308 |
+
*
|
309 |
+
* @return mixed URL.
|
310 |
+
*/
|
311 |
+
public static function _get_uri() {
|
312 |
+
$path = wp_normalize_path( dirname( __FILE__ ) );
|
313 |
+
$theme_dir = wp_normalize_path( get_template_directory() );
|
314 |
+
$plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
|
315 |
+
|
316 |
+
if ( strpos( $path, $theme_dir ) !== false ) {
|
317 |
+
return trailingslashit( get_template_directory_uri() . str_replace( $theme_dir, '', $path ) );
|
318 |
+
} elseif ( strpos( $path, $plugin_dir ) !== false ) {
|
319 |
+
return plugin_dir_url( __FILE__ );
|
320 |
+
} elseif ( strpos( $path, dirname( plugin_basename( __FILE__ ) ) ) !== false ) {
|
321 |
+
return plugin_dir_url( __FILE__ );
|
322 |
+
}
|
323 |
+
|
324 |
+
return;
|
325 |
+
}
|
326 |
+
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Kicking this off by calling 'get_instance()' method
|
331 |
+
*/
|
332 |
+
Astra_Notices::get_instance();
|
333 |
+
|
334 |
+
endif;
|
inc/lib/astra-notices/notices.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Customizer controls toggles
|
3 |
+
*
|
4 |
+
* @package Astra
|
5 |
+
*/
|
6 |
+
|
7 |
+
( function( $ ) {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Helper class for the main Customizer interface.
|
11 |
+
*
|
12 |
+
* @since 1.0.0
|
13 |
+
* @class ASTCustomizer
|
14 |
+
*/
|
15 |
+
AstraNotices = {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Initializes our custom logic for the Customizer.
|
19 |
+
*
|
20 |
+
* @since 1.0.0
|
21 |
+
* @method init
|
22 |
+
*/
|
23 |
+
init: function()
|
24 |
+
{
|
25 |
+
this._bind();
|
26 |
+
},
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Binds events for the Astra Portfolio.
|
30 |
+
*
|
31 |
+
* @since 1.0.0
|
32 |
+
* @access private
|
33 |
+
* @method _bind
|
34 |
+
*/
|
35 |
+
_bind: function()
|
36 |
+
{
|
37 |
+
$( document ).on('click', '.astra-notice-close', AstraNotices._dismissNoticeNew );
|
38 |
+
$( document ).on('click', '.astra-notice .notice-dismiss', AstraNotices._dismissNotice );
|
39 |
+
},
|
40 |
+
|
41 |
+
_dismissNotice: function( event ) {
|
42 |
+
event.preventDefault();
|
43 |
+
|
44 |
+
var repeat_notice_after = $( this ).parents('.astra-notice').data( 'repeat-notice-after' ) || '';
|
45 |
+
var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || '';
|
46 |
+
|
47 |
+
AstraNotices._ajax( notice_id, repeat_notice_after );
|
48 |
+
},
|
49 |
+
|
50 |
+
_dismissNoticeNew: function( event ) {
|
51 |
+
event.preventDefault();
|
52 |
+
|
53 |
+
var repeat_notice_after = $( this ).attr( 'data-repeat-notice-after' ) || '';
|
54 |
+
var notice_id = $( this ).parents('.astra-notice').attr( 'id' ) || '';
|
55 |
+
|
56 |
+
var $el = $( this ).parents('.astra-notice');
|
57 |
+
$el.fadeTo( 100, 0, function() {
|
58 |
+
$el.slideUp( 100, function() {
|
59 |
+
$el.remove();
|
60 |
+
});
|
61 |
+
});
|
62 |
+
|
63 |
+
AstraNotices._ajax( notice_id, repeat_notice_after );
|
64 |
+
|
65 |
+
var link = $( this ).attr( 'href' ) || '';
|
66 |
+
var target = $( this ).attr( 'target' ) || '';
|
67 |
+
if( '' !== link && '_blank' === target ) {
|
68 |
+
window.open(link , '_blank');
|
69 |
+
}
|
70 |
+
},
|
71 |
+
|
72 |
+
_ajax: function( notice_id, repeat_notice_after ) {
|
73 |
+
|
74 |
+
if( '' === notice_id ) {
|
75 |
+
return;
|
76 |
+
}
|
77 |
+
|
78 |
+
$.ajax({
|
79 |
+
url: ajaxurl,
|
80 |
+
type: 'POST',
|
81 |
+
data: {
|
82 |
+
action : 'astra-notice-dismiss',
|
83 |
+
notice_id : notice_id,
|
84 |
+
repeat_notice_after : parseInt( repeat_notice_after ),
|
85 |
+
},
|
86 |
+
});
|
87 |
+
|
88 |
+
}
|
89 |
+
};
|
90 |
+
|
91 |
+
$( function() {
|
92 |
+
AstraNotices.init();
|
93 |
+
} );
|
94 |
+
} )( jQuery );
|
languages/astra-sites.pot
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Astra Starter Sites – Elementor, Beaver Builder & "
|
6 |
-
"Gutenberg Templates 1.3.
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
8 |
-
"POT-Creation-Date: 2019-04-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -25,25 +25,25 @@ msgstr ""
|
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
"X-Generator: grunt-wp-i18n1.0.0\n"
|
27 |
|
28 |
-
#: astra-sites.php:18
|
29 |
msgid "Astra Sites"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
33 |
msgid "Enabled"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
37 |
msgid "Disabled"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
41 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
42 |
msgid "Yes"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
46 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
47 |
msgid "No"
|
48 |
msgstr ""
|
49 |
|
@@ -55,53 +55,46 @@ msgstr ""
|
|
55 |
msgid "Request site API URL is empty. Try again!"
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: inc/classes/class-astra-sites-importer.php:
|
59 |
msgid "Customizer data is empty!"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: inc/classes/class-astra-sites-importer.php:
|
63 |
msgid ""
|
64 |
"If XMLReader is not available, it imports all other settings and only skips "
|
65 |
"XML import. This creates an incomplete website. We should bail early and "
|
66 |
"not import anything if this is not present."
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: inc/classes/class-astra-sites-importer.php:
|
70 |
msgid "There was an error downloading the XML file."
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: inc/classes/class-astra-sites-importer.php:
|
74 |
msgid "Invalid site XML file!"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: inc/classes/class-astra-sites-importer.php:
|
78 |
msgid "Site options are empty!"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: inc/classes/class-astra-sites-importer.php:
|
82 |
msgid "Widget data is empty!"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: inc/classes/class-astra-sites-
|
86 |
-
#. translators: %s is the
|
87 |
-
msgid "
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
#. translators: %s is the form ID
|
92 |
-
msgid "Form ID %s deleted!"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: inc/classes/class-astra-sites-importer.php:563
|
96 |
-
#. translators: %s is the term ID
|
97 |
-
msgid "Term ID %s deleted!"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: inc/classes/class-astra-sites-page.php:
|
101 |
msgid "Required XMLReader PHP extension is missing on your server!"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: inc/classes/class-astra-sites-page.php:
|
105 |
#. translators: %s is the white label name.
|
106 |
msgid ""
|
107 |
"%s import requires XMLReader extension to be installed. Please contact your "
|
@@ -109,92 +102,114 @@ msgid ""
|
|
109 |
"extension."
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: inc/classes/class-astra-sites-page.php:
|
113 |
msgid "Settings saved successfully."
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: inc/classes/class-astra-sites-page.php:
|
117 |
-
|
118 |
-
msgid "Block Editor (Gutenberg)"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: inc/classes/class-astra-sites-page.php:
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
msgid "Elementor"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: inc/classes/class-astra-sites-page.php:
|
127 |
-
#: inc/classes/class-astra-sites-page.php:
|
128 |
msgid "Beaver Builder"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: inc/classes/class-astra-sites-page.php:
|
132 |
-
#: inc/classes/class-astra-sites-page.php:
|
133 |
msgid "Brizy"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: inc/classes/class-astra-sites-page.php:
|
|
|
|
|
|
|
|
|
137 |
msgid "Next"
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: inc/classes/class-astra-sites-page.php:
|
141 |
msgid "Astra Starter Sites - Your Library of 100+ Ready Templates!"
|
142 |
msgstr ""
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
#: inc/classes/class-astra-sites-white-label.php:187
|
145 |
#. translators: %1$s product name
|
146 |
msgid "%1$s Branding"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: inc/classes/class-astra-sites.php:
|
150 |
-
msgid "Theme
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: inc/classes/class-astra-sites.php:
|
154 |
#. translators: 1: theme.php file
|
155 |
msgid ""
|
156 |
-
"Astra Theme needs to be active for you to use currently installed
|
157 |
-
"plugin. <a href=\"#\" class=\"%3$s\"
|
158 |
-
"Activate Now</a>"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: inc/classes/class-astra-sites.php:
|
162 |
msgid "See Library"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: inc/classes/class-astra-sites.php:
|
166 |
msgid "Installed! Activating.."
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: inc/classes/class-astra-sites.php:
|
170 |
msgid "Activating.."
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: inc/classes/class-astra-sites.php:
|
174 |
msgid "Activated! Reloading.."
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: inc/classes/class-astra-sites.php:
|
178 |
msgid "Installing.."
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: inc/classes/class-astra-sites.php:
|
182 |
msgid "Page Builder"
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: inc/classes/class-astra-sites.php:
|
186 |
msgid "Categories"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: inc/classes/class-astra-sites.php:
|
190 |
msgid "Get Agency Bundle"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: inc/classes/class-astra-sites.php:
|
194 |
msgid "Upgrade"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: inc/classes/class-astra-sites.php:
|
198 |
#. translators: %s are HTML tags.
|
199 |
msgid ""
|
200 |
"%1$sRequired XMLReader PHP extension is missing on your server!%2$sAstra "
|
@@ -203,202 +218,202 @@ msgid ""
|
|
203 |
"XMLReader PHP extension."
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: inc/classes/class-astra-sites.php:
|
207 |
msgid ""
|
208 |
"Warning! Astra Site Import process is not complete. Don't close the window "
|
209 |
"until import process complete. Do you still want to leave the window?"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: inc/classes/class-astra-sites.php:
|
213 |
msgid "Error!"
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: inc/classes/class-astra-sites.php:
|
217 |
msgid "Error! Read Possibilities."
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: inc/classes/class-astra-sites.php:
|
221 |
msgid "Done! View Site"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: inc/classes/class-astra-sites.php:
|
225 |
msgid "Activating"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: inc/classes/class-astra-sites.php:
|
229 |
msgid "Active"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: inc/classes/class-astra-sites.php:
|
233 |
msgid "Import failed."
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: inc/classes/class-astra-sites.php:
|
237 |
msgid "Import failed. See error log."
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: inc/classes/class-astra-sites.php:
|
241 |
msgid "Import This Site"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: inc/classes/class-astra-sites.php:
|
245 |
msgid "Importing.."
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: inc/classes/class-astra-sites.php:
|
249 |
msgid "Read more"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: inc/classes/class-astra-sites.php:
|
253 |
msgid "Hide"
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: inc/classes/class-astra-sites.php:
|
257 |
msgid "There was a problem receiving a response from server."
|
258 |
msgstr ""
|
259 |
|
260 |
-
#: inc/classes/class-astra-sites.php:
|
261 |
msgid "No Demos found, Try a different search."
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: inc/classes/class-astra-sites.php:
|
265 |
msgid "Installing plugin "
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: inc/classes/class-astra-sites.php:
|
269 |
-
msgid "
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: inc/classes/class-astra-sites.php:
|
273 |
msgid "Activating plugin "
|
274 |
msgstr ""
|
275 |
|
276 |
-
#: inc/classes/class-astra-sites.php:
|
277 |
-
msgid "
|
278 |
msgstr ""
|
279 |
|
280 |
-
#: inc/classes/class-astra-sites.php:
|
281 |
msgid "Bulk plugin activation..."
|
282 |
msgstr ""
|
283 |
|
284 |
-
#: inc/classes/class-astra-sites.php:
|
285 |
-
msgid "
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: inc/classes/class-astra-sites.php:
|
289 |
msgid "Error! While activating plugin - "
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: inc/classes/class-astra-sites.php:
|
293 |
msgid "Bulk plugin installation..."
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: inc/classes/class-astra-sites.php:
|
297 |
msgid "Site API "
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: inc/classes/class-astra-sites.php:
|
301 |
msgid "Processing requests..."
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: inc/classes/class-astra-sites.php:
|
305 |
-
msgid "
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: inc/classes/class-astra-sites.php:
|
309 |
-
msgid "
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: inc/classes/class-astra-sites.php:
|
313 |
-
msgid "
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: inc/classes/class-astra-sites.php:
|
317 |
-
msgid "
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: inc/classes/class-astra-sites.php:
|
321 |
-
msgid "
|
322 |
msgstr ""
|
323 |
|
324 |
-
#: inc/classes/class-astra-sites.php:
|
325 |
-
msgid "
|
326 |
msgstr ""
|
327 |
|
328 |
-
#: inc/classes/class-astra-sites.php:
|
329 |
-
msgid "
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: inc/classes/class-astra-sites.php:
|
333 |
-
msgid "
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: inc/classes/class-astra-sites.php:
|
337 |
-
msgid "
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: inc/classes/class-astra-sites.php:
|
341 |
-
msgid "
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: inc/classes/class-astra-sites.php:
|
345 |
-
msgid "
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: inc/classes/class-astra-sites.php:
|
349 |
-
msgid "
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: inc/classes/class-astra-sites.php:
|
353 |
-
msgid "
|
354 |
msgstr ""
|
355 |
|
356 |
-
#: inc/classes/class-astra-sites.php:
|
357 |
msgid "Getting Site Information.."
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: inc/classes/class-astra-sites.php:
|
361 |
msgid "Importing Customizer Settings.."
|
362 |
msgstr ""
|
363 |
|
364 |
-
#: inc/classes/class-astra-sites.php:
|
365 |
msgid "Importing Contact Forms.."
|
366 |
msgstr ""
|
367 |
|
368 |
-
#: inc/classes/class-astra-sites.php:
|
369 |
msgid "Setting up import data.."
|
370 |
msgstr ""
|
371 |
|
372 |
-
#: inc/classes/class-astra-sites.php:
|
373 |
msgid "Importing Content.."
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: inc/classes/class-astra-sites.php:
|
377 |
msgid "Importing Site Options.."
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: inc/classes/class-astra-sites.php:
|
381 |
msgid "Importing Widgets.."
|
382 |
msgstr ""
|
383 |
|
384 |
-
#: inc/classes/class-astra-sites.php:
|
385 |
msgid "Import Complete.."
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: inc/classes/class-astra-sites.php:
|
389 |
msgid "Previewing "
|
390 |
msgstr ""
|
391 |
|
392 |
-
#: inc/classes/class-astra-sites.php:
|
393 |
msgid "See Error Log →"
|
394 |
msgstr ""
|
395 |
|
396 |
-
#: inc/classes/class-astra-sites.php:
|
397 |
msgid "No plugin specified"
|
398 |
msgstr ""
|
399 |
|
400 |
-
#: inc/classes/class-astra-sites.php:
|
401 |
-
msgid "Plugin
|
402 |
msgstr ""
|
403 |
|
404 |
#: inc/importers/batch-processing/helpers/class-wp-background-process.php:433
|
@@ -433,7 +448,7 @@ msgstr ""
|
|
433 |
msgid "No Title"
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: inc/importers/wxr-importer/class-astra-wxr-importer.php:
|
437 |
msgid "Import complete!"
|
438 |
msgstr ""
|
439 |
|
@@ -644,7 +659,7 @@ msgid "Previous"
|
|
644 |
msgstr ""
|
645 |
|
646 |
#: inc/includes/admin-page.php:142 inc/includes/admin-page.php:143
|
647 |
-
#: inc/includes/admin-page.php:
|
648 |
msgid "Import Site"
|
649 |
msgstr ""
|
650 |
|
@@ -652,88 +667,96 @@ msgstr ""
|
|
652 |
msgid "Install Required Plugins"
|
653 |
msgstr ""
|
654 |
|
655 |
-
#: inc/includes/admin-page.php:
|
656 |
-
msgid "Plugins below are used to build this website:"
|
657 |
-
msgstr ""
|
658 |
-
|
659 |
-
#: inc/includes/admin-page.php:175
|
660 |
-
msgid "These are required for this website to work."
|
661 |
-
msgstr ""
|
662 |
-
|
663 |
-
#: inc/includes/admin-page.php:184
|
664 |
msgid ""
|
665 |
"Customizer is what gives a design to the website; and selecting this option "
|
666 |
"replaces your current design with a new one."
|
667 |
msgstr ""
|
668 |
|
669 |
-
#: inc/includes/admin-page.php:
|
670 |
msgid ""
|
671 |
"Backup of current customizer settings will be stored in "
|
672 |
"\"wp-content/astra-sites\" directory, just in case if you want to restore "
|
673 |
"it later."
|
674 |
msgstr ""
|
675 |
|
676 |
-
#: inc/includes/admin-page.php:
|
677 |
msgid ""
|
678 |
"Selecting this option will import dummy pages, posts, images and menus. If "
|
679 |
"you do not want to import dummy content, please uncheck this option."
|
680 |
msgstr ""
|
681 |
|
682 |
-
#: inc/includes/admin-page.php:
|
683 |
msgid ""
|
684 |
"WARNING: Selecting this option will delete data from your current website. "
|
685 |
"Choose this option only if this is intended."
|
686 |
msgstr ""
|
687 |
|
688 |
-
#: inc/includes/admin-page.php:
|
689 |
msgid "Advanced Options"
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: inc/includes/admin-page.php:
|
693 |
msgid "Required Plugins"
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: inc/includes/admin-page.php:
|
697 |
msgid "Collapse"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: inc/includes/admin-page.php:
|
701 |
msgid "Enter desktop preview mode"
|
702 |
msgstr ""
|
703 |
|
704 |
-
#: inc/includes/admin-page.php:
|
705 |
msgid "Enter tablet preview mode"
|
706 |
msgstr ""
|
707 |
|
708 |
-
#: inc/includes/admin-page.php:
|
709 |
msgid "Enter mobile preview mode"
|
710 |
msgstr ""
|
711 |
|
712 |
-
#: inc/includes/admin-page.php:
|
713 |
msgid "Preview"
|
714 |
msgstr ""
|
715 |
|
716 |
-
#: inc/includes/admin-page.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
717 |
#. translators: %1$s & %2$s are a Demo API URL
|
718 |
msgid ""
|
719 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
720 |
"unreachable from your site.</p>"
|
721 |
msgstr ""
|
722 |
|
723 |
-
#: inc/includes/admin-page.php:
|
724 |
msgid ""
|
725 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
726 |
"temporary issues. No kidding!</p>"
|
727 |
msgstr ""
|
728 |
|
729 |
-
#: inc/includes/admin-page.php:
|
730 |
msgid ""
|
731 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
732 |
"to your server administrator and check if demo server is being blocked by "
|
733 |
"the firewall!</p>"
|
734 |
msgstr ""
|
735 |
|
736 |
-
#: inc/includes/admin-page.php:
|
737 |
#. translators: %1$s is a support link
|
738 |
msgid ""
|
739 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
@@ -741,24 +764,24 @@ msgid ""
|
|
741 |
"for you.</p>"
|
742 |
msgstr ""
|
743 |
|
744 |
-
#: inc/includes/admin-page.php:
|
745 |
msgid "Under Maintenance.."
|
746 |
msgstr ""
|
747 |
|
748 |
-
#: inc/includes/admin-page.php:
|
749 |
msgid ""
|
750 |
"If you are seeing this message, most likely our servers are under routine "
|
751 |
"maintenance and we will be back shortly. "
|
752 |
msgstr ""
|
753 |
|
754 |
-
#: inc/includes/admin-page.php:
|
755 |
msgid ""
|
756 |
"In rare case, it is possible your website is having trouble connecting with "
|
757 |
"ours. If you need help, please feel free to get in touch with us from our "
|
758 |
"website."
|
759 |
msgstr ""
|
760 |
|
761 |
-
#: inc/includes/admin-page.php:
|
762 |
#. translators: %1$s External Link
|
763 |
msgid ""
|
764 |
"Don't see a site that you would like to import?<br><a target=\"_blank\" "
|
@@ -793,13 +816,13 @@ msgstr ""
|
|
793 |
msgid "http://www.brainstormforce.com"
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
797 |
#. translators: %1$s Memory Limit, %2$s Recommended memory limit.
|
798 |
msgctxt "Recommended Memory Limit"
|
799 |
msgid "Current memory limit %1$s. We recommend setting memory to at least %2$s."
|
800 |
msgstr ""
|
801 |
|
802 |
-
#: inc/classes/class-astra-sites-importer-log.php:
|
803 |
msgctxt "PHP Version"
|
804 |
msgid "We recommend to use php 5.4 or higher"
|
805 |
msgstr ""
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Astra Starter Sites – Elementor, Beaver Builder & "
|
6 |
+
"Gutenberg Templates 1.3.5\n"
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
8 |
+
"POT-Creation-Date: 2019-04-18 06:55:00+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
"X-Generator: grunt-wp-i18n1.0.0\n"
|
27 |
|
28 |
+
#: astra-sites.php:18
|
29 |
msgid "Astra Sites"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: inc/classes/class-astra-sites-importer-log.php:254
|
33 |
msgid "Enabled"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: inc/classes/class-astra-sites-importer-log.php:257
|
37 |
msgid "Disabled"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: inc/classes/class-astra-sites-importer-log.php:342
|
41 |
+
#: inc/classes/class-astra-sites-importer-log.php:399
|
42 |
msgid "Yes"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: inc/classes/class-astra-sites-importer-log.php:345
|
46 |
+
#: inc/classes/class-astra-sites-importer-log.php:402
|
47 |
msgid "No"
|
48 |
msgstr ""
|
49 |
|
55 |
msgid "Request site API URL is empty. Try again!"
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: inc/classes/class-astra-sites-importer.php:222
|
59 |
msgid "Customizer data is empty!"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: inc/classes/class-astra-sites-importer.php:236
|
63 |
msgid ""
|
64 |
"If XMLReader is not available, it imports all other settings and only skips "
|
65 |
"XML import. This creates an incomplete website. We should bail early and "
|
66 |
"not import anything if this is not present."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: inc/classes/class-astra-sites-importer.php:254
|
70 |
msgid "There was an error downloading the XML file."
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: inc/classes/class-astra-sites-importer.php:260
|
74 |
msgid "Invalid site XML file!"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: inc/classes/class-astra-sites-importer.php:287
|
78 |
msgid "Site options are empty!"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: inc/classes/class-astra-sites-importer.php:317
|
82 |
msgid "Widget data is empty!"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: inc/classes/class-astra-sites-page.php:85
|
86 |
+
#. translators: %1$s is the admin page URL, %2$s is product name.
|
87 |
+
msgid ""
|
88 |
+
"Thank you for choosing %1$s! Check the library of <a "
|
89 |
+
"class=\"astra-sites-getting-started-btn\" href=\"%2$s\">ready starter sites "
|
90 |
+
"here »</a>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: inc/classes/class-astra-sites-page.php:184
|
94 |
msgid "Required XMLReader PHP extension is missing on your server!"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: inc/classes/class-astra-sites-page.php:186
|
98 |
#. translators: %s is the white label name.
|
99 |
msgid ""
|
100 |
"%s import requires XMLReader extension to be installed. Please contact your "
|
102 |
"extension."
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: inc/classes/class-astra-sites-page.php:248
|
106 |
msgid "Settings saved successfully."
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: inc/classes/class-astra-sites-page.php:278
|
110 |
+
msgid "Select Page Builder"
|
|
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: inc/classes/class-astra-sites-page.php:279
|
114 |
+
msgid ""
|
115 |
+
"Astra offers starter sites that can be imported in one click. These "
|
116 |
+
"templates are available in few different page builders. Please choose your "
|
117 |
+
"preferred page builder from the list below."
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: inc/classes/class-astra-sites-page.php:286
|
121 |
+
msgid "Gutenberg"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: inc/classes/class-astra-sites-page.php:293
|
125 |
+
#: inc/classes/class-astra-sites-page.php:331
|
126 |
msgid "Elementor"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: inc/classes/class-astra-sites-page.php:300
|
130 |
+
#: inc/classes/class-astra-sites-page.php:332
|
131 |
msgid "Beaver Builder"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: inc/classes/class-astra-sites-page.php:306
|
135 |
+
#: inc/classes/class-astra-sites-page.php:333
|
136 |
msgid "Brizy"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: inc/classes/class-astra-sites-page.php:311
|
140 |
+
msgid "Please select your favorite page builder to continue.."
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: inc/classes/class-astra-sites-page.php:313 inc/includes/admin-page.php:141
|
144 |
msgid "Next"
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: inc/classes/class-astra-sites-page.php:323
|
148 |
msgid "Astra Starter Sites - Your Library of 100+ Ready Templates!"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: inc/classes/class-astra-sites-page.php:330
|
152 |
+
msgid "Block Editor (Gutenberg)"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: inc/classes/class-astra-sites-page.php:393
|
156 |
+
msgid "Astra Starter Sites"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
#: inc/classes/class-astra-sites-white-label.php:187
|
160 |
#. translators: %1$s product name
|
161 |
msgid "%1$s Branding"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: inc/classes/class-astra-sites.php:98
|
165 |
+
msgid "Theme Activated"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: inc/classes/class-astra-sites.php:162
|
169 |
#. translators: 1: theme.php file
|
170 |
msgid ""
|
171 |
+
"<p>Astra Theme needs to be active for you to use currently installed "
|
172 |
+
"\"%1$s\" plugin. <a href=\"#\" class=\"%3$s\" "
|
173 |
+
"data-theme-slug=\"astra\">Install & Activate Now</a></p>"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: inc/classes/class-astra-sites.php:227
|
177 |
msgid "See Library"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: inc/classes/class-astra-sites.php:263
|
181 |
msgid "Installed! Activating.."
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: inc/classes/class-astra-sites.php:264
|
185 |
msgid "Activating.."
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: inc/classes/class-astra-sites.php:265
|
189 |
msgid "Activated! Reloading.."
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: inc/classes/class-astra-sites.php:266
|
193 |
msgid "Installing.."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: inc/classes/class-astra-sites.php:299
|
197 |
msgid "Page Builder"
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: inc/classes/class-astra-sites.php:304
|
201 |
msgid "Categories"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: inc/classes/class-astra-sites.php:345
|
205 |
msgid "Get Agency Bundle"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: inc/classes/class-astra-sites.php:347
|
209 |
msgid "Upgrade"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: inc/classes/class-astra-sites.php:354
|
213 |
#. translators: %s are HTML tags.
|
214 |
msgid ""
|
215 |
"%1$sRequired XMLReader PHP extension is missing on your server!%2$sAstra "
|
218 |
"XMLReader PHP extension."
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: inc/classes/class-astra-sites.php:355
|
222 |
msgid ""
|
223 |
"Warning! Astra Site Import process is not complete. Don't close the window "
|
224 |
"until import process complete. Do you still want to leave the window?"
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: inc/classes/class-astra-sites.php:356
|
228 |
msgid "Error!"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: inc/classes/class-astra-sites.php:357
|
232 |
msgid "Error! Read Possibilities."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: inc/classes/class-astra-sites.php:359
|
236 |
msgid "Done! View Site"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: inc/classes/class-astra-sites.php:360
|
240 |
msgid "Activating"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: inc/classes/class-astra-sites.php:361
|
244 |
msgid "Active"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: inc/classes/class-astra-sites.php:362
|
248 |
msgid "Import failed."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: inc/classes/class-astra-sites.php:363
|
252 |
msgid "Import failed. See error log."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: inc/classes/class-astra-sites.php:364
|
256 |
msgid "Import This Site"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: inc/classes/class-astra-sites.php:365 inc/classes/class-astra-sites.php:381
|
260 |
msgid "Importing.."
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: inc/classes/class-astra-sites.php:366 inc/includes/admin-page.php:161
|
264 |
msgid "Read more"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: inc/classes/class-astra-sites.php:367
|
268 |
msgid "Hide"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: inc/classes/class-astra-sites.php:368
|
272 |
msgid "There was a problem receiving a response from server."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: inc/classes/class-astra-sites.php:369 inc/includes/admin-page.php:391
|
276 |
msgid "No Demos found, Try a different search."
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: inc/classes/class-astra-sites.php:372
|
280 |
msgid "Installing plugin "
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: inc/classes/class-astra-sites.php:373
|
284 |
+
msgid "Plugin installed!"
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: inc/classes/class-astra-sites.php:374
|
288 |
msgid "Activating plugin "
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: inc/classes/class-astra-sites.php:375
|
292 |
+
msgid "Plugin activated "
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: inc/classes/class-astra-sites.php:376
|
296 |
msgid "Bulk plugin activation..."
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: inc/classes/class-astra-sites.php:377
|
300 |
+
msgid "Plugin activate - "
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: inc/classes/class-astra-sites.php:378
|
304 |
msgid "Error! While activating plugin - "
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: inc/classes/class-astra-sites.php:379
|
308 |
msgid "Bulk plugin installation..."
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: inc/classes/class-astra-sites.php:380
|
312 |
msgid "Site API "
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: inc/classes/class-astra-sites.php:382
|
316 |
msgid "Processing requests..."
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: inc/classes/class-astra-sites.php:383
|
320 |
+
msgid "Importing \"Customizer Settings\"..."
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: inc/classes/class-astra-sites.php:384
|
324 |
+
msgid "Imported customizer settings!"
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: inc/classes/class-astra-sites.php:385
|
328 |
+
msgid "Importing \"Contact Forms\"..."
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: inc/classes/class-astra-sites.php:386
|
332 |
+
msgid "Imported Contact Forms!"
|
333 |
msgstr ""
|
334 |
|
335 |
+
#: inc/classes/class-astra-sites.php:387
|
336 |
+
msgid "Preparing \"XML\" Data..."
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: inc/classes/class-astra-sites.php:388
|
340 |
+
msgid "Set XML data!"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: inc/classes/class-astra-sites.php:389
|
344 |
+
msgid "Importing \"XML\"..."
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: inc/classes/class-astra-sites.php:390
|
348 |
+
msgid "Imported XML!"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: inc/classes/class-astra-sites.php:391
|
352 |
+
msgid "Importing \"Options\"..."
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: inc/classes/class-astra-sites.php:392
|
356 |
+
msgid "Imported Options!"
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: inc/classes/class-astra-sites.php:393
|
360 |
+
msgid "Importing \"Widgets\"..."
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: inc/classes/class-astra-sites.php:394
|
364 |
+
msgid "Imported Widgets!"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: inc/classes/class-astra-sites.php:396
|
368 |
+
msgid "View site: "
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: inc/classes/class-astra-sites.php:397
|
372 |
msgid "Getting Site Information.."
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: inc/classes/class-astra-sites.php:398
|
376 |
msgid "Importing Customizer Settings.."
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: inc/classes/class-astra-sites.php:399
|
380 |
msgid "Importing Contact Forms.."
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: inc/classes/class-astra-sites.php:400
|
384 |
msgid "Setting up import data.."
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: inc/classes/class-astra-sites.php:401
|
388 |
msgid "Importing Content.."
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: inc/classes/class-astra-sites.php:402
|
392 |
msgid "Importing Site Options.."
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: inc/classes/class-astra-sites.php:403
|
396 |
msgid "Importing Widgets.."
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: inc/classes/class-astra-sites.php:404
|
400 |
msgid "Import Complete.."
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: inc/classes/class-astra-sites.php:405
|
404 |
msgid "Previewing "
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: inc/classes/class-astra-sites.php:406
|
408 |
msgid "See Error Log →"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: inc/classes/class-astra-sites.php:440
|
412 |
msgid "No plugin specified"
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: inc/classes/class-astra-sites.php:469
|
416 |
+
msgid "Plugin Activated"
|
417 |
msgstr ""
|
418 |
|
419 |
#: inc/importers/batch-processing/helpers/class-wp-background-process.php:433
|
448 |
msgid "No Title"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: inc/importers/wxr-importer/class-astra-wxr-importer.php:307
|
452 |
msgid "Import complete!"
|
453 |
msgstr ""
|
454 |
|
659 |
msgstr ""
|
660 |
|
661 |
#: inc/includes/admin-page.php:142 inc/includes/admin-page.php:143
|
662 |
+
#: inc/includes/admin-page.php:228 inc/includes/admin-page.php:235
|
663 |
msgid "Import Site"
|
664 |
msgstr ""
|
665 |
|
667 |
msgid "Install Required Plugins"
|
668 |
msgstr ""
|
669 |
|
670 |
+
#: inc/includes/admin-page.php:182
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
msgid ""
|
672 |
"Customizer is what gives a design to the website; and selecting this option "
|
673 |
"replaces your current design with a new one."
|
674 |
msgstr ""
|
675 |
|
676 |
+
#: inc/includes/admin-page.php:183
|
677 |
msgid ""
|
678 |
"Backup of current customizer settings will be stored in "
|
679 |
"\"wp-content/astra-sites\" directory, just in case if you want to restore "
|
680 |
"it later."
|
681 |
msgstr ""
|
682 |
|
683 |
+
#: inc/includes/admin-page.php:193
|
684 |
msgid ""
|
685 |
"Selecting this option will import dummy pages, posts, images and menus. If "
|
686 |
"you do not want to import dummy content, please uncheck this option."
|
687 |
msgstr ""
|
688 |
|
689 |
+
#: inc/includes/admin-page.php:209
|
690 |
msgid ""
|
691 |
"WARNING: Selecting this option will delete data from your current website. "
|
692 |
"Choose this option only if this is intended."
|
693 |
msgstr ""
|
694 |
|
695 |
+
#: inc/includes/admin-page.php:214
|
696 |
msgid "Advanced Options"
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: inc/includes/admin-page.php:219
|
700 |
msgid "Required Plugins"
|
701 |
msgstr ""
|
702 |
|
703 |
+
#: inc/includes/admin-page.php:241
|
704 |
msgid "Collapse"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: inc/includes/admin-page.php:247
|
708 |
msgid "Enter desktop preview mode"
|
709 |
msgstr ""
|
710 |
|
711 |
+
#: inc/includes/admin-page.php:250
|
712 |
msgid "Enter tablet preview mode"
|
713 |
msgstr ""
|
714 |
|
715 |
+
#: inc/includes/admin-page.php:253
|
716 |
msgid "Enter mobile preview mode"
|
717 |
msgstr ""
|
718 |
|
719 |
+
#: inc/includes/admin-page.php:261 inc/includes/admin-page.php:383
|
720 |
msgid "Preview"
|
721 |
msgstr ""
|
722 |
|
723 |
+
#: inc/includes/admin-page.php:264
|
724 |
+
msgid "We're building your website."
|
725 |
+
msgstr ""
|
726 |
+
|
727 |
+
#: inc/includes/admin-page.php:265
|
728 |
+
msgid ""
|
729 |
+
"The process can take anywhere between 2 to 10 minutes depending on the size "
|
730 |
+
"of the website and speed of connection."
|
731 |
+
msgstr ""
|
732 |
+
|
733 |
+
#: inc/includes/admin-page.php:266
|
734 |
+
msgid ""
|
735 |
+
"Please do not close this browser window until the site is imported "
|
736 |
+
"completely."
|
737 |
+
msgstr ""
|
738 |
+
|
739 |
+
#: inc/includes/admin-page.php:289
|
740 |
#. translators: %1$s & %2$s are a Demo API URL
|
741 |
msgid ""
|
742 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
743 |
"unreachable from your site.</p>"
|
744 |
msgstr ""
|
745 |
|
746 |
+
#: inc/includes/admin-page.php:291
|
747 |
msgid ""
|
748 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
749 |
"temporary issues. No kidding!</p>"
|
750 |
msgstr ""
|
751 |
|
752 |
+
#: inc/includes/admin-page.php:293
|
753 |
msgid ""
|
754 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
755 |
"to your server administrator and check if demo server is being blocked by "
|
756 |
"the firewall!</p>"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: inc/includes/admin-page.php:296
|
760 |
#. translators: %1$s is a support link
|
761 |
msgid ""
|
762 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
764 |
"for you.</p>"
|
765 |
msgstr ""
|
766 |
|
767 |
+
#: inc/includes/admin-page.php:308
|
768 |
msgid "Under Maintenance.."
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: inc/includes/admin-page.php:309
|
772 |
msgid ""
|
773 |
"If you are seeing this message, most likely our servers are under routine "
|
774 |
"maintenance and we will be back shortly. "
|
775 |
msgstr ""
|
776 |
|
777 |
+
#: inc/includes/admin-page.php:310
|
778 |
msgid ""
|
779 |
"In rare case, it is possible your website is having trouble connecting with "
|
780 |
"ours. If you need help, please feel free to get in touch with us from our "
|
781 |
"website."
|
782 |
msgstr ""
|
783 |
|
784 |
+
#: inc/includes/admin-page.php:395 inc/includes/admin-page.php:413
|
785 |
#. translators: %1$s External Link
|
786 |
msgid ""
|
787 |
"Don't see a site that you would like to import?<br><a target=\"_blank\" "
|
816 |
msgid "http://www.brainstormforce.com"
|
817 |
msgstr ""
|
818 |
|
819 |
+
#: inc/classes/class-astra-sites-importer-log.php:275
|
820 |
#. translators: %1$s Memory Limit, %2$s Recommended memory limit.
|
821 |
msgctxt "Recommended Memory Limit"
|
822 |
msgid "Current memory limit %1$s. We recommend setting memory to at least %2$s."
|
823 |
msgstr ""
|
824 |
|
825 |
+
#: inc/classes/class-astra-sites-importer-log.php:356
|
826 |
msgctxt "PHP Version"
|
827 |
msgid "We recommend to use php 5.4 or higher"
|
828 |
msgstr ""
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: Elementor,Beaver Builder,Templates,Gutenberg,Astra Starter Sites
|
|
5 |
Requires at least: 4.4
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 5.1
|
8 |
-
Stable tag: 1.3.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -117,6 +117,12 @@ We are open to suggestions and would love to work on topics that our users are l
|
|
117 |
|
118 |
== Changelog ==
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
v1.3.4 - 16-April-2019
|
121 |
- Hot Fix: Sites not visible for import.
|
122 |
|
5 |
Requires at least: 4.4
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 5.1
|
8 |
+
Stable tag: 1.3.5
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
117 |
|
118 |
== Changelog ==
|
119 |
|
120 |
+
v1.3.5 - 18-April-2019
|
121 |
+
- Improvement: Updated page builder selection screen UI.
|
122 |
+
- Improvement: Showing import process on separate window. In which we can see all the current import process.
|
123 |
+
- Improvement: Added one time welcome notice after plugin install and activate.
|
124 |
+
- Improvement: Used fetch() instead of AJAX to load the Astra Sites. Also, Caching the Astra sites response and initially showing 30 sites.
|
125 |
+
|
126 |
v1.3.4 - 16-April-2019
|
127 |
- Hot Fix: Sites not visible for import.
|
128 |
|