Version Description
Download this release
Release Info
Developer | Nikschavan |
Plugin | Astra Starter Sites |
Version | 1.2.7 |
Comparing to | |
See all releases |
Code changes from version 1.2.6 to 1.2.7
- astra-sites.php +2 -2
- inc/assets/css/admin.css +5 -0
- inc/assets/js/render-grid.js +37 -30
- inc/classes/class-astra-sites.php +457 -455
- inc/importers/wxr-importer/class-astra-wxr-importer.php +332 -332
- inc/includes/admin-page.php +299 -295
- languages/astra-sites.pot +71 -71
- readme.txt +5 -1
astra-sites.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Astra Starter Sites
|
4 |
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
* Description: Import free sites build with Astra theme.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: http://www.brainstormforce.com
|
9 |
* Text Domain: astra-sites
|
@@ -19,7 +19,7 @@ if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
|
|
19 |
}
|
20 |
|
21 |
if ( ! defined( 'ASTRA_SITES_VER' ) ) {
|
22 |
-
define( 'ASTRA_SITES_VER', '1.2.
|
23 |
}
|
24 |
|
25 |
if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
|
3 |
* Plugin Name: Astra Starter Sites
|
4 |
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
* Description: Import free sites build with Astra theme.
|
6 |
+
* Version: 1.2.7
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: http://www.brainstormforce.com
|
9 |
* Text Domain: astra-sites
|
19 |
}
|
20 |
|
21 |
if ( ! defined( 'ASTRA_SITES_VER' ) ) {
|
22 |
+
define( 'ASTRA_SITES_VER', '1.2.7' );
|
23 |
}
|
24 |
|
25 |
if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
|
inc/assets/css/admin.css
CHANGED
@@ -460,4 +460,9 @@ body.loading-content .select-page-builder {
|
|
460 |
-ms-transform: rotate(360deg);
|
461 |
transform: rotate(360deg);
|
462 |
}
|
|
|
|
|
|
|
|
|
|
|
463 |
}
|
460 |
-ms-transform: rotate(360deg);
|
461 |
transform: rotate(360deg);
|
462 |
}
|
463 |
+
}
|
464 |
+
|
465 |
+
#astra-sites-filters {
|
466 |
+
display: inline-block;
|
467 |
+
width: 100%;
|
468 |
}
|
inc/assets/js/render-grid.js
CHANGED
@@ -188,14 +188,11 @@
|
|
188 |
var selected_category_id = jQuery('.filter-links.astra-site-category').find('.current').data('group') || '';
|
189 |
if( '' !== selected_category_id && 'all' !== selected_category_id ) {
|
190 |
AstraRender._api_params['astra-site-category'] = selected_category_id;
|
191 |
-
} else if(
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
return value != 'all';
|
197 |
-
});
|
198 |
-
AstraRender._api_params['astra-site-category'] = storedCategories.join(',');
|
199 |
}
|
200 |
}
|
201 |
},
|
@@ -205,13 +202,11 @@
|
|
205 |
var selected_page_builder_id = jQuery('.filter-links.astra-site-page-builder').find('.current').data('group') || '';
|
206 |
if( '' !== selected_page_builder_id && 'all' !== selected_page_builder_id ) {
|
207 |
AstraRender._api_params['astra-site-page-builder'] = selected_page_builder_id;
|
208 |
-
} else if( '
|
209 |
-
if(
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
});
|
214 |
-
AstraRender._api_params['astra-site-page-builder'] = storedBuilders.join(',');
|
215 |
}
|
216 |
}
|
217 |
},
|
@@ -287,17 +282,25 @@
|
|
287 |
*/
|
288 |
_getPageBuilderParams: function()
|
289 |
{
|
290 |
-
var
|
291 |
|
292 |
if( astraRenderGrid.sites && astraRenderGrid.sites.purchase_key ) {
|
293 |
-
|
294 |
}
|
295 |
|
296 |
if( astraRenderGrid.sites && astraRenderGrid.sites.site_url ) {
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
|
300 |
-
return '/?' + decodeURIComponent( $.param(
|
301 |
},
|
302 |
|
303 |
/**
|
@@ -308,20 +311,17 @@
|
|
308 |
*/
|
309 |
_getCategoryParams: function( category_slug ) {
|
310 |
|
311 |
-
|
312 |
-
if( category_slug in astraRenderGrid.settings ) {
|
313 |
-
|
314 |
-
var storedBuilders = astraRenderGrid.settings[ category_slug ];
|
315 |
-
|
316 |
-
// Remove `all` from stored list?
|
317 |
-
storedBuilders = jQuery.grep(storedBuilders, function(value) {
|
318 |
-
return value != 'all';
|
319 |
-
});
|
320 |
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
|
324 |
-
return '';
|
325 |
},
|
326 |
|
327 |
/**
|
@@ -389,6 +389,8 @@
|
|
389 |
$('#astra-sites-admin').append( wp.template( 'astra-site-select-page-builder' ) );
|
390 |
}
|
391 |
}
|
|
|
|
|
392 |
}
|
393 |
|
394 |
},
|
@@ -545,6 +547,11 @@
|
|
545 |
jQuery('body').attr('data-astra-demo-search', '');
|
546 |
jQuery('body').attr('data-scrolling', false);
|
547 |
|
|
|
|
|
|
|
|
|
|
|
548 |
}
|
549 |
|
550 |
};
|
188 |
var selected_category_id = jQuery('.filter-links.astra-site-category').find('.current').data('group') || '';
|
189 |
if( '' !== selected_category_id && 'all' !== selected_category_id ) {
|
190 |
AstraRender._api_params['astra-site-category'] = selected_category_id;
|
191 |
+
} else if( astraRenderGrid.sites && astraRenderGrid['categories'].include ) {
|
192 |
+
if( AstraRender._isArray( astraRenderGrid['categories'].include ) ) {
|
193 |
+
AstraRender._api_params['astra-site-category'] = astraRenderGrid['categories'].include.join(',');
|
194 |
+
} else {
|
195 |
+
AstraRender._api_params['astra-site-category'] = astraRenderGrid['categories'].include;
|
|
|
|
|
|
|
196 |
}
|
197 |
}
|
198 |
},
|
202 |
var selected_page_builder_id = jQuery('.filter-links.astra-site-page-builder').find('.current').data('group') || '';
|
203 |
if( '' !== selected_page_builder_id && 'all' !== selected_page_builder_id ) {
|
204 |
AstraRender._api_params['astra-site-page-builder'] = selected_page_builder_id;
|
205 |
+
} else if( astraRenderGrid.sites && astraRenderGrid['page-builders'].include ) {
|
206 |
+
if( AstraRender._isArray( astraRenderGrid['page-builders'].include ) ) {
|
207 |
+
AstraRender._api_params['astra-site-page-builder'] = astraRenderGrid['page-builders'].include.join(',');
|
208 |
+
} else {
|
209 |
+
AstraRender._api_params['astra-site-page-builder'] = astraRenderGrid['page-builders'].include;
|
|
|
|
|
210 |
}
|
211 |
}
|
212 |
},
|
282 |
*/
|
283 |
_getPageBuilderParams: function()
|
284 |
{
|
285 |
+
var _params = {};
|
286 |
|
287 |
if( astraRenderGrid.sites && astraRenderGrid.sites.purchase_key ) {
|
288 |
+
_params['purchase_key'] = astraRenderGrid.sites.purchase_key;
|
289 |
}
|
290 |
|
291 |
if( astraRenderGrid.sites && astraRenderGrid.sites.site_url ) {
|
292 |
+
_params['site_url'] = astraRenderGrid.sites.site_url;
|
293 |
+
}
|
294 |
+
|
295 |
+
if( astraRenderGrid.sites && astraRenderGrid['page-builders'].include ) {
|
296 |
+
if( AstraRender._isArray( astraRenderGrid['page-builders'].include ) ) {
|
297 |
+
_params['include'] = astraRenderGrid['page-builders'].include.join(',');
|
298 |
+
} else {
|
299 |
+
_params['include'] = astraRenderGrid['page-builders'].include;
|
300 |
+
}
|
301 |
}
|
302 |
|
303 |
+
return '/?' + decodeURIComponent( $.param( _params ) );
|
304 |
},
|
305 |
|
306 |
/**
|
311 |
*/
|
312 |
_getCategoryParams: function( category_slug ) {
|
313 |
|
314 |
+
var _params = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
+
if( astraRenderGrid.sites && astraRenderGrid['categories'].include ) {
|
317 |
+
if( AstraRender._isArray( astraRenderGrid['categories'].include ) ) {
|
318 |
+
_params['include'] = astraRenderGrid['categories'].include.join(',');
|
319 |
+
} else {
|
320 |
+
_params['include'] = astraRenderGrid['categories'].include;
|
321 |
+
}
|
322 |
}
|
323 |
|
324 |
+
return '/?' + decodeURIComponent( $.param( _params ) );
|
325 |
},
|
326 |
|
327 |
/**
|
389 |
$('#astra-sites-admin').append( wp.template( 'astra-site-select-page-builder' ) );
|
390 |
}
|
391 |
}
|
392 |
+
} else {
|
393 |
+
AstraRender._showSites();
|
394 |
}
|
395 |
|
396 |
},
|
547 |
jQuery('body').attr('data-astra-demo-search', '');
|
548 |
jQuery('body').attr('data-scrolling', false);
|
549 |
|
550 |
+
},
|
551 |
+
|
552 |
+
// Returns if a value is an array
|
553 |
+
_isArray: function(value) {
|
554 |
+
return value && typeof value === 'object' && value.constructor === Array;
|
555 |
}
|
556 |
|
557 |
};
|
inc/classes/class-astra-sites.php
CHANGED
@@ -1,455 +1,457 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Astra Sites
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package Astra Sites
|
7 |
-
*/
|
8 |
-
|
9 |
-
defined( 'ABSPATH' ) or exit;
|
10 |
-
|
11 |
-
if ( ! class_exists( 'Astra_Sites' ) ) :
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Astra_Sites
|
15 |
-
*/
|
16 |
-
class Astra_Sites {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* API URL which is used to get the response from.
|
20 |
-
*
|
21 |
-
* @since 1.0.0
|
22 |
-
* @var (String) URL
|
23 |
-
*/
|
24 |
-
public static $api_url;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Instance of Astra_Sites
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
* @var (Object) Astra_Sites
|
31 |
-
*/
|
32 |
-
private static $_instance = null;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Instance of Astra_Sites.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
*
|
39 |
-
* @return object Class object.
|
40 |
-
*/
|
41 |
-
public static function get_instance() {
|
42 |
-
if ( ! isset( self::$_instance ) ) {
|
43 |
-
self::$_instance = new self;
|
44 |
-
}
|
45 |
-
|
46 |
-
return self::$_instance;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Constructor.
|
51 |
-
*
|
52 |
-
* @since 1.0.0
|
53 |
-
*/
|
54 |
-
private function __construct() {
|
55 |
-
|
56 |
-
self::set_api_url();
|
57 |
-
|
58 |
-
$this->includes();
|
59 |
-
|
60 |
-
add_action( 'admin_notices', array( $this, 'add_notice' ), 1 );
|
61 |
-
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
62 |
-
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
63 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
|
64 |
-
|
65 |
-
// AJAX.
|
66 |
-
add_action( 'wp_ajax_astra-required-plugins', array( $this, 'required_plugin' ) );
|
67 |
-
add_action( 'wp_ajax_astra-required-plugin-activate', array( $this, 'required_plugin_activate' ) );
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Add Admin Notice.
|
72 |
-
*/
|
73 |
-
function add_notice() {
|
74 |
-
|
75 |
-
Astra_Sites_Notices::add_notice(
|
76 |
-
array(
|
77 |
-
'id' => 'astra-theme-activation-nag',
|
78 |
-
'type' => 'error',
|
79 |
-
'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
|
80 |
-
/* translators: 1: theme.php file*/
|
81 |
-
'message' => sprintf( __( 'Astra Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="%2$s">Install & Activate Now</a>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ) ) ),
|
82 |
-
'dismissible' => true,
|
83 |
-
'dismissible-time' => WEEK_IN_SECONDS,
|
84 |
-
)
|
85 |
-
);
|
86 |
-
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Loads textdomain for the plugin.
|
91 |
-
*
|
92 |
-
* @since 1.0.1
|
93 |
-
*/
|
94 |
-
function load_textdomain() {
|
95 |
-
load_plugin_textdomain( 'astra-sites' );
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Admin Notices
|
100 |
-
*
|
101 |
-
* @since 1.0.5
|
102 |
-
* @return void
|
103 |
-
*/
|
104 |
-
function admin_notices() {
|
105 |
-
|
106 |
-
if ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) {
|
107 |
-
return;
|
108 |
-
}
|
109 |
-
|
110 |
-
add_action( 'plugin_action_links_' . ASTRA_SITES_BASE, array( $this, 'action_links' ) );
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Show action links on the plugin screen.
|
115 |
-
*
|
116 |
-
* @param mixed $links Plugin Action links.
|
117 |
-
* @return array
|
118 |
-
*/
|
119 |
-
function action_links( $links ) {
|
120 |
-
$action_links = array(
|
121 |
-
'settings' => '<a href="' . admin_url( 'themes.php?page=astra-sites' ) . '" aria-label="' . esc_attr__( 'See Library', 'astra-sites' ) . '">' . esc_html__( 'See Library', 'astra-sites' ) . '</a>',
|
122 |
-
);
|
123 |
-
|
124 |
-
return array_merge( $action_links, $links );
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Setter for $api_url
|
129 |
-
*
|
130 |
-
* @since 1.0.0
|
131 |
-
*/
|
132 |
-
public static function set_api_url() {
|
133 |
-
|
134 |
-
self::$api_url = apply_filters( 'astra_sites_api_url', 'https://websitedemos.net/wp-json/wp/v2/' );
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Enqueue admin scripts.
|
140 |
-
*
|
141 |
-
* @since 1.0.5 Added 'getUpgradeText' and 'getUpgradeURL' localize variables.
|
142 |
-
*
|
143 |
-
* @since 1.0.0
|
144 |
-
*
|
145 |
-
* @param string $hook Current hook name.
|
146 |
-
* @return void
|
147 |
-
*/
|
148 |
-
public function admin_enqueue( $hook = '' ) {
|
149 |
-
|
150 |
-
if ( 'appearance_page_astra-sites' !== $hook ) {
|
151 |
-
return;
|
152 |
-
}
|
153 |
-
|
154 |
-
global $is_IE, $is_edge;
|
155 |
-
|
156 |
-
if ( $is_IE || $is_edge ) {
|
157 |
-
wp_enqueue_script( 'astra-sites-eventsource', ASTRA_SITES_URI . 'inc/assets/js/eventsource.min.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
158 |
-
}
|
159 |
-
|
160 |
-
// API.
|
161 |
-
wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery' ), ASTRA_SITES_VER, true );
|
162 |
-
|
163 |
-
// Admin Page.
|
164 |
-
wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
|
165 |
-
wp_enqueue_script( 'astra-sites-admin-page', ASTRA_SITES_URI . 'inc/assets/js/admin-page.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
166 |
-
wp_enqueue_script( 'astra-sites-render-grid', ASTRA_SITES_URI . 'inc/assets/js/render-grid.js', array( 'wp-util', 'astra-sites-api', 'imagesloaded', 'jquery' ), ASTRA_SITES_VER, true );
|
167 |
-
|
168 |
-
$data = array(
|
169 |
-
'ApiURL' => self::$api_url,
|
170 |
-
'filters' => array(
|
171 |
-
'page_builder' => array(
|
172 |
-
'title' => __( 'Page Builder', 'astra-sites' ),
|
173 |
-
'slug' => 'astra-site-page-builder',
|
174 |
-
'trigger' => 'astra-api-category-loaded',
|
175 |
-
),
|
176 |
-
'categories' => array(
|
177 |
-
'title' => __( 'Categories', 'astra-sites' ),
|
178 |
-
'slug' => 'astra-site-category',
|
179 |
-
'trigger' => 'astra-api-category-loaded',
|
180 |
-
),
|
181 |
-
),
|
182 |
-
);
|
183 |
-
wp_localize_script( 'astra-sites-api', 'astraSitesApi', $data );
|
184 |
-
|
185 |
-
// Use this for premium demos.
|
186 |
-
$request_params = apply_filters(
|
187 |
-
'astra_sites_api_params', array(
|
188 |
-
'purchase_key' => '',
|
189 |
-
'site_url' => '',
|
190 |
-
'par-page' => 15,
|
191 |
-
)
|
192 |
-
);
|
193 |
-
|
194 |
-
$data = apply_filters(
|
195 |
-
'
|
196 |
-
array(
|
197 |
-
'sites'
|
198 |
-
'
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
$data
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
'
|
210 |
-
'
|
211 |
-
'
|
212 |
-
'
|
213 |
-
'
|
214 |
-
'
|
215 |
-
'
|
216 |
-
'
|
217 |
-
|
218 |
-
|
219 |
-
'
|
220 |
-
'
|
221 |
-
'
|
222 |
-
'
|
223 |
-
'
|
224 |
-
'
|
225 |
-
'
|
226 |
-
'
|
227 |
-
'
|
228 |
-
'
|
229 |
-
'
|
230 |
-
'
|
231 |
-
'
|
232 |
-
'
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
'
|
238 |
-
'
|
239 |
-
'
|
240 |
-
'
|
241 |
-
'
|
242 |
-
'
|
243 |
-
'
|
244 |
-
'
|
245 |
-
'
|
246 |
-
'
|
247 |
-
'
|
248 |
-
'
|
249 |
-
'
|
250 |
-
'
|
251 |
-
'
|
252 |
-
'
|
253 |
-
'
|
254 |
-
'
|
255 |
-
'
|
256 |
-
'
|
257 |
-
'
|
258 |
-
'
|
259 |
-
'
|
260 |
-
'
|
261 |
-
'
|
262 |
-
'
|
263 |
-
'
|
264 |
-
'
|
265 |
-
'
|
266 |
-
'
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
*
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
require_once ASTRA_SITES_DIR . 'inc/classes/
|
285 |
-
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-
|
286 |
-
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
*
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
$
|
309 |
-
$
|
310 |
-
|
311 |
-
$
|
312 |
-
|
313 |
-
|
314 |
-
$
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
*
|
340 |
-
*
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
'
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
*
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
}
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
*
|
406 |
-
*
|
407 |
-
*
|
408 |
-
*
|
409 |
-
*
|
410 |
-
*
|
411 |
-
*
|
412 |
-
*
|
413 |
-
*
|
414 |
-
*
|
415 |
-
* @
|
416 |
-
*
|
417 |
-
*
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
'
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
'
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Astra Sites
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package Astra Sites
|
7 |
+
*/
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) or exit;
|
10 |
+
|
11 |
+
if ( ! class_exists( 'Astra_Sites' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Astra_Sites
|
15 |
+
*/
|
16 |
+
class Astra_Sites {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* API URL which is used to get the response from.
|
20 |
+
*
|
21 |
+
* @since 1.0.0
|
22 |
+
* @var (String) URL
|
23 |
+
*/
|
24 |
+
public static $api_url;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Instance of Astra_Sites
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
* @var (Object) Astra_Sites
|
31 |
+
*/
|
32 |
+
private static $_instance = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Instance of Astra_Sites.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
*
|
39 |
+
* @return object Class object.
|
40 |
+
*/
|
41 |
+
public static function get_instance() {
|
42 |
+
if ( ! isset( self::$_instance ) ) {
|
43 |
+
self::$_instance = new self;
|
44 |
+
}
|
45 |
+
|
46 |
+
return self::$_instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Constructor.
|
51 |
+
*
|
52 |
+
* @since 1.0.0
|
53 |
+
*/
|
54 |
+
private function __construct() {
|
55 |
+
|
56 |
+
self::set_api_url();
|
57 |
+
|
58 |
+
$this->includes();
|
59 |
+
|
60 |
+
add_action( 'admin_notices', array( $this, 'add_notice' ), 1 );
|
61 |
+
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
62 |
+
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
63 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
|
64 |
+
|
65 |
+
// AJAX.
|
66 |
+
add_action( 'wp_ajax_astra-required-plugins', array( $this, 'required_plugin' ) );
|
67 |
+
add_action( 'wp_ajax_astra-required-plugin-activate', array( $this, 'required_plugin_activate' ) );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Add Admin Notice.
|
72 |
+
*/
|
73 |
+
function add_notice() {
|
74 |
+
|
75 |
+
Astra_Sites_Notices::add_notice(
|
76 |
+
array(
|
77 |
+
'id' => 'astra-theme-activation-nag',
|
78 |
+
'type' => 'error',
|
79 |
+
'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
|
80 |
+
/* translators: 1: theme.php file*/
|
81 |
+
'message' => sprintf( __( 'Astra Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="%2$s">Install & Activate Now</a>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ) ) ),
|
82 |
+
'dismissible' => true,
|
83 |
+
'dismissible-time' => WEEK_IN_SECONDS,
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Loads textdomain for the plugin.
|
91 |
+
*
|
92 |
+
* @since 1.0.1
|
93 |
+
*/
|
94 |
+
function load_textdomain() {
|
95 |
+
load_plugin_textdomain( 'astra-sites' );
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Admin Notices
|
100 |
+
*
|
101 |
+
* @since 1.0.5
|
102 |
+
* @return void
|
103 |
+
*/
|
104 |
+
function admin_notices() {
|
105 |
+
|
106 |
+
if ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) {
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
+
add_action( 'plugin_action_links_' . ASTRA_SITES_BASE, array( $this, 'action_links' ) );
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Show action links on the plugin screen.
|
115 |
+
*
|
116 |
+
* @param mixed $links Plugin Action links.
|
117 |
+
* @return array
|
118 |
+
*/
|
119 |
+
function action_links( $links ) {
|
120 |
+
$action_links = array(
|
121 |
+
'settings' => '<a href="' . admin_url( 'themes.php?page=astra-sites' ) . '" aria-label="' . esc_attr__( 'See Library', 'astra-sites' ) . '">' . esc_html__( 'See Library', 'astra-sites' ) . '</a>',
|
122 |
+
);
|
123 |
+
|
124 |
+
return array_merge( $action_links, $links );
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Setter for $api_url
|
129 |
+
*
|
130 |
+
* @since 1.0.0
|
131 |
+
*/
|
132 |
+
public static function set_api_url() {
|
133 |
+
|
134 |
+
self::$api_url = apply_filters( 'astra_sites_api_url', 'https://websitedemos.net/wp-json/wp/v2/' );
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Enqueue admin scripts.
|
140 |
+
*
|
141 |
+
* @since 1.0.5 Added 'getUpgradeText' and 'getUpgradeURL' localize variables.
|
142 |
+
*
|
143 |
+
* @since 1.0.0
|
144 |
+
*
|
145 |
+
* @param string $hook Current hook name.
|
146 |
+
* @return void
|
147 |
+
*/
|
148 |
+
public function admin_enqueue( $hook = '' ) {
|
149 |
+
|
150 |
+
if ( 'appearance_page_astra-sites' !== $hook ) {
|
151 |
+
return;
|
152 |
+
}
|
153 |
+
|
154 |
+
global $is_IE, $is_edge;
|
155 |
+
|
156 |
+
if ( $is_IE || $is_edge ) {
|
157 |
+
wp_enqueue_script( 'astra-sites-eventsource', ASTRA_SITES_URI . 'inc/assets/js/eventsource.min.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
158 |
+
}
|
159 |
+
|
160 |
+
// API.
|
161 |
+
wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery' ), ASTRA_SITES_VER, true );
|
162 |
+
|
163 |
+
// Admin Page.
|
164 |
+
wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
|
165 |
+
wp_enqueue_script( 'astra-sites-admin-page', ASTRA_SITES_URI . 'inc/assets/js/admin-page.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_SITES_VER, true );
|
166 |
+
wp_enqueue_script( 'astra-sites-render-grid', ASTRA_SITES_URI . 'inc/assets/js/render-grid.js', array( 'wp-util', 'astra-sites-api', 'imagesloaded', 'jquery' ), ASTRA_SITES_VER, true );
|
167 |
+
|
168 |
+
$data = array(
|
169 |
+
'ApiURL' => self::$api_url,
|
170 |
+
'filters' => array(
|
171 |
+
'page_builder' => array(
|
172 |
+
'title' => __( 'Page Builder', 'astra-sites' ),
|
173 |
+
'slug' => 'astra-site-page-builder',
|
174 |
+
'trigger' => 'astra-api-category-loaded',
|
175 |
+
),
|
176 |
+
'categories' => array(
|
177 |
+
'title' => __( 'Categories', 'astra-sites' ),
|
178 |
+
'slug' => 'astra-site-category',
|
179 |
+
'trigger' => 'astra-api-category-loaded',
|
180 |
+
),
|
181 |
+
),
|
182 |
+
);
|
183 |
+
wp_localize_script( 'astra-sites-api', 'astraSitesApi', $data );
|
184 |
+
|
185 |
+
// Use this for premium demos.
|
186 |
+
$request_params = apply_filters(
|
187 |
+
'astra_sites_api_params', array(
|
188 |
+
'purchase_key' => '',
|
189 |
+
'site_url' => '',
|
190 |
+
'par-page' => 15,
|
191 |
+
)
|
192 |
+
);
|
193 |
+
|
194 |
+
$data = apply_filters(
|
195 |
+
'astra_sites_render_localize_vars',
|
196 |
+
array(
|
197 |
+
'sites' => $request_params,
|
198 |
+
'page-builders' => array(),
|
199 |
+
'categories' => array(),
|
200 |
+
'settings' => array(),
|
201 |
+
)
|
202 |
+
);
|
203 |
+
|
204 |
+
wp_localize_script( 'astra-sites-render-grid', 'astraRenderGrid', $data );
|
205 |
+
|
206 |
+
$data = apply_filters(
|
207 |
+
'astra_sites_localize_vars',
|
208 |
+
array(
|
209 |
+
'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false,
|
210 |
+
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
|
211 |
+
'siteURL' => site_url(),
|
212 |
+
'getProText' => __( 'Purchase', 'astra-sites' ),
|
213 |
+
'getProURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
|
214 |
+
'getUpgradeText' => __( 'Upgrade', 'astra-sites' ),
|
215 |
+
'getUpgradeURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
|
216 |
+
'_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
|
217 |
+
'requiredPlugins' => array(),
|
218 |
+
'strings' => array(
|
219 |
+
'warningBeforeCloseWindow' => __( 'Warning! Astra Site Import process is not complete. Don\'t close the window until import process complete. Do you still want to leave the window?', 'astra-sites' ),
|
220 |
+
'importFailedBtnSmall' => __( 'Error!', 'astra-sites' ),
|
221 |
+
'importFailedBtnLarge' => __( 'Error! Read Possibilities.', 'astra-sites' ),
|
222 |
+
'importFailedURL' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=import-failed' ),
|
223 |
+
'viewSite' => __( 'Done! View Site', 'astra-sites' ),
|
224 |
+
'btnActivating' => __( 'Activating', 'astra-sites' ) . '…',
|
225 |
+
'btnActive' => __( 'Active', 'astra-sites' ),
|
226 |
+
'importFailBtn' => __( 'Import failed.', 'astra-sites' ),
|
227 |
+
'importFailBtnLarge' => __( 'Import failed. See error log.', 'astra-sites' ),
|
228 |
+
'importDemo' => __( 'Import This Site', 'astra-sites' ),
|
229 |
+
'importingDemo' => __( 'Importing..', 'astra-sites' ),
|
230 |
+
'DescExpand' => __( 'Read more', 'astra-sites' ) . '…',
|
231 |
+
'DescCollapse' => __( 'Hide', 'astra-sites' ),
|
232 |
+
'responseError' => __( 'There was a problem receiving a response from server.', 'astra-sites' ),
|
233 |
+
'searchNoFound' => __( 'No Demos found, Try a different search.', 'astra-sites' ),
|
234 |
+
'importWarning' => __( "Executing Demo Import will make your site similar as ours. Please bear in mind -\n\n1. It is recommended to run import on a fresh WordPress installation.\n\n2. Importing site does not delete any pages or posts. However, it can overwrite your existing content.\n\n3. Copyrighted media will not be imported. Instead it will be replaced with placeholders.", 'astra-sites' ),
|
235 |
+
),
|
236 |
+
'log' => array(
|
237 |
+
'installingPlugin' => __( 'Installing plugin ', 'astra-sites' ),
|
238 |
+
'installed' => __( 'Successfully plugin installed!', 'astra-sites' ),
|
239 |
+
'activating' => __( 'Activating plugin ', 'astra-sites' ),
|
240 |
+
'activated' => __( 'Successfully plugin activated ', 'astra-sites' ),
|
241 |
+
'bulkActivation' => __( 'Bulk plugin activation...', 'astra-sites' ),
|
242 |
+
'activate' => __( 'Successfully plugin activate - ', 'astra-sites' ),
|
243 |
+
'activationError' => __( 'Error! While activating plugin - ', 'astra-sites' ),
|
244 |
+
'bulkInstall' => __( 'Bulk plugin installation...', 'astra-sites' ),
|
245 |
+
'api' => __( 'Site API ', 'astra-sites' ),
|
246 |
+
'importing' => __( 'Importing..', 'astra-sites' ),
|
247 |
+
'processingRequest' => __( 'Processing requests...', 'astra-sites' ),
|
248 |
+
'importCustomizer' => __( '1) Importing "Customizer Settings"...', 'astra-sites' ),
|
249 |
+
'importCustomizerSuccess' => __( 'Successfully imported customizer settings!', 'astra-sites' ),
|
250 |
+
'importXMLPrepare' => __( '2) Preparing "XML" Data...', 'astra-sites' ),
|
251 |
+
'importXMLPrepareSuccess' => __( 'Successfully set XML data!', 'astra-sites' ),
|
252 |
+
'importXML' => __( '3) Importing "XML"...', 'astra-sites' ),
|
253 |
+
'importXMLSuccess' => __( 'Successfully imported XML!', 'astra-sites' ),
|
254 |
+
'importOptions' => __( '4) Importing "Options"...', 'astra-sites' ),
|
255 |
+
'importOptionsSuccess' => __( 'Successfully imported Options!', 'astra-sites' ),
|
256 |
+
'importWidgets' => __( '5) Importing "Widgets"...', 'astra-sites' ),
|
257 |
+
'importWidgetsSuccess' => __( 'Successfully imported Widgets!', 'astra-sites' ),
|
258 |
+
'serverConfiguration' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' ),
|
259 |
+
'success' => __( 'Site imported successfully! visit : ', 'astra-sites' ),
|
260 |
+
'gettingData' => __( 'Getting Site Information..', 'astra-sites' ),
|
261 |
+
'importingCustomizer' => __( 'Importing Customizer Settings..', 'astra-sites' ),
|
262 |
+
'importXMLPreparing' => __( 'Setting up import data..', 'astra-sites' ),
|
263 |
+
'importingXML' => __( 'Importing Pages, Posts & Media..', 'astra-sites' ),
|
264 |
+
'importingOptions' => __( 'Importing Site Options..', 'astra-sites' ),
|
265 |
+
'importingWidgets' => __( 'Importing Widgets..', 'astra-sites' ),
|
266 |
+
'importComplete' => __( 'Import Complete..', 'astra-sites' ),
|
267 |
+
'preview' => __( 'Previewing ', 'astra-sites' ),
|
268 |
+
'importLogText' => __( 'See Error Log →', 'astra-sites' ),
|
269 |
+
),
|
270 |
+
)
|
271 |
+
);
|
272 |
+
|
273 |
+
wp_localize_script( 'astra-sites-admin-page', 'astraSitesAdmin', $data );
|
274 |
+
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Load all the required files in the importer.
|
279 |
+
*
|
280 |
+
* @since 1.0.0
|
281 |
+
*/
|
282 |
+
private function includes() {
|
283 |
+
|
284 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-notices.php';
|
285 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-page.php';
|
286 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/class-astra-sites-compatibility.php';
|
287 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-white-label.php';
|
288 |
+
require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer.php';
|
289 |
+
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Required Plugin Activate
|
294 |
+
*
|
295 |
+
* @since 1.0.0
|
296 |
+
*/
|
297 |
+
public function required_plugin_activate() {
|
298 |
+
|
299 |
+
if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['init'] ) || ! $_POST['init'] ) {
|
300 |
+
wp_send_json_error(
|
301 |
+
array(
|
302 |
+
'success' => false,
|
303 |
+
'message' => __( 'No plugin specified', 'astra-sites' ),
|
304 |
+
)
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
$data = array();
|
309 |
+
$plugin_init = ( isset( $_POST['init'] ) ) ? esc_attr( $_POST['init'] ) : '';
|
310 |
+
$astra_site_options = ( isset( $_POST['options'] ) ) ? json_decode( stripslashes( $_POST['options'] ) ) : '';
|
311 |
+
$enabled_extensions = ( isset( $_POST['enabledExtensions'] ) ) ? json_decode( stripslashes( $_POST['enabledExtensions'] ) ) : '';
|
312 |
+
|
313 |
+
$data['astra_site_options'] = $astra_site_options;
|
314 |
+
$data['enabled_extensions'] = $enabled_extensions;
|
315 |
+
|
316 |
+
$activate = activate_plugin( $plugin_init, '', false, true );
|
317 |
+
|
318 |
+
if ( is_wp_error( $activate ) ) {
|
319 |
+
wp_send_json_error(
|
320 |
+
array(
|
321 |
+
'success' => false,
|
322 |
+
'message' => $activate->get_error_message(),
|
323 |
+
)
|
324 |
+
);
|
325 |
+
}
|
326 |
+
|
327 |
+
do_action( 'astra_sites_after_plugin_activation', $plugin_init, $data );
|
328 |
+
|
329 |
+
wp_send_json_success(
|
330 |
+
array(
|
331 |
+
'success' => true,
|
332 |
+
'message' => __( 'Plugin Successfully Activated', 'astra-sites' ),
|
333 |
+
)
|
334 |
+
);
|
335 |
+
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Required Plugin
|
340 |
+
*
|
341 |
+
* @since 1.0.0
|
342 |
+
* @return void
|
343 |
+
*/
|
344 |
+
public function required_plugin() {
|
345 |
+
|
346 |
+
// Verify Nonce.
|
347 |
+
check_ajax_referer( 'astra-sites', '_ajax_nonce' );
|
348 |
+
|
349 |
+
$response = array(
|
350 |
+
'active' => array(),
|
351 |
+
'inactive' => array(),
|
352 |
+
'notinstalled' => array(),
|
353 |
+
);
|
354 |
+
|
355 |
+
if ( ! current_user_can( 'customize' ) ) {
|
356 |
+
wp_send_json_error( $response );
|
357 |
+
}
|
358 |
+
|
359 |
+
$required_plugins = ( isset( $_POST['required_plugins'] ) ) ? $_POST['required_plugins'] : array();
|
360 |
+
|
361 |
+
if ( count( $required_plugins ) > 0 ) {
|
362 |
+
foreach ( $required_plugins as $key => $plugin ) {
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Has Pro Version Support?
|
366 |
+
* And
|
367 |
+
* Is Pro Version Installed?
|
368 |
+
*/
|
369 |
+
$plugin_pro = self::pro_plugin_exist( $plugin['init'] );
|
370 |
+
if ( $plugin_pro ) {
|
371 |
+
|
372 |
+
// Pro - Active.
|
373 |
+
if ( is_plugin_active( $plugin_pro['init'] ) ) {
|
374 |
+
$response['active'][] = $plugin_pro;
|
375 |
+
|
376 |
+
// Pro - Inactive.
|
377 |
+
} else {
|
378 |
+
$response['inactive'][] = $plugin_pro;
|
379 |
+
}
|
380 |
+
} else {
|
381 |
+
|
382 |
+
// Lite - Installed but Inactive.
|
383 |
+
if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) && is_plugin_inactive( $plugin['init'] ) ) {
|
384 |
+
|
385 |
+
$response['inactive'][] = $plugin;
|
386 |
+
|
387 |
+
// Lite - Not Installed.
|
388 |
+
} elseif ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) ) {
|
389 |
+
|
390 |
+
$response['notinstalled'][] = $plugin;
|
391 |
+
|
392 |
+
// Lite - Active.
|
393 |
+
} else {
|
394 |
+
$response['active'][] = $plugin;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
+
// Send response.
|
401 |
+
wp_send_json_success( $response );
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* Has Pro Version Support?
|
406 |
+
* And
|
407 |
+
* Is Pro Version Installed?
|
408 |
+
*
|
409 |
+
* Check Pro plugin version exist of requested plugin lite version.
|
410 |
+
*
|
411 |
+
* Eg. If plugin 'BB Lite Version' required to import demo. Then we check the 'BB Agency Version' is exist?
|
412 |
+
* If yes then we only 'Activate' Agency Version. [We couldn't install agency version.]
|
413 |
+
* Else we 'Activate' or 'Install' Lite Version.
|
414 |
+
*
|
415 |
+
* @since 1.0.1
|
416 |
+
*
|
417 |
+
* @param string $lite_version Lite version init file.
|
418 |
+
* @return mixed Return false if not installed or not supported by us
|
419 |
+
* else return 'Pro' version details.
|
420 |
+
*/
|
421 |
+
public static function pro_plugin_exist( $lite_version = '' ) {
|
422 |
+
|
423 |
+
// Lite init => Pro init.
|
424 |
+
$plugins = apply_filters(
|
425 |
+
'astra_sites_pro_plugin_exist', array(
|
426 |
+
'beaver-builder-lite-version/fl-builder.php' => array(
|
427 |
+
'slug' => 'bb-plugin',
|
428 |
+
'init' => 'bb-plugin/fl-builder.php',
|
429 |
+
'name' => 'Beaver Builder Plugin',
|
430 |
+
),
|
431 |
+
'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' => array(
|
432 |
+
'slug' => 'bb-ultimate-addon',
|
433 |
+
'init' => 'bb-ultimate-addon/bb-ultimate-addon.php',
|
434 |
+
'name' => 'Ultimate Addon for Beaver Builder',
|
435 |
+
),
|
436 |
+
), $lite_version
|
437 |
+
);
|
438 |
+
|
439 |
+
if ( isset( $plugins[ $lite_version ] ) ) {
|
440 |
+
|
441 |
+
// Pro plugin directory exist?
|
442 |
+
if ( file_exists( WP_PLUGIN_DIR . '/' . $plugins[ $lite_version ]['init'] ) ) {
|
443 |
+
return $plugins[ $lite_version ];
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
return false;
|
448 |
+
}
|
449 |
+
|
450 |
+
}
|
451 |
+
|
452 |
+
/**
|
453 |
+
* Kicking this off by calling 'get_instance()' method
|
454 |
+
*/
|
455 |
+
Astra_Sites::get_instance();
|
456 |
+
|
457 |
+
endif;
|
inc/importers/wxr-importer/class-astra-wxr-importer.php
CHANGED
@@ -1,332 +1,332 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Class Astra WXR Importer
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package Astra Addon
|
7 |
-
*/
|
8 |
-
|
9 |
-
defined( 'ABSPATH' ) or exit;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Class Astra WXR Importer
|
13 |
-
*
|
14 |
-
* @since 1.0.0
|
15 |
-
*/
|
16 |
-
class Astra_WXR_Importer {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Instance of Astra_WXR_Importer
|
20 |
-
*
|
21 |
-
* @since 1.0.0
|
22 |
-
* @var Astra_WXR_Importer
|
23 |
-
*/
|
24 |
-
private static $_instance = null;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Instantiate Astra_WXR_Importer
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
-
* @return (Object) Astra_WXR_Importer.
|
31 |
-
*/
|
32 |
-
public static function instance() {
|
33 |
-
if ( ! isset( self::$_instance ) ) {
|
34 |
-
self::$_instance = new self();
|
35 |
-
}
|
36 |
-
|
37 |
-
return self::$_instance;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Constructor.
|
42 |
-
*
|
43 |
-
* @since 1.0.0
|
44 |
-
*/
|
45 |
-
private function __construct() {
|
46 |
-
|
47 |
-
if ( ! class_exists( 'WP_Importer' ) ) {
|
48 |
-
defined( 'WP_LOAD_IMPORTERS' ) || define( 'WP_LOAD_IMPORTERS', true );
|
49 |
-
require ABSPATH . '/wp-admin/includes/class-wp-importer.php';
|
50 |
-
}
|
51 |
-
|
52 |
-
if ( ! class_exists( 'WP_Importer_Logger' ) ) {
|
53 |
-
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-logger.php';
|
54 |
-
}
|
55 |
-
|
56 |
-
if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) ) {
|
57 |
-
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php';
|
58 |
-
}
|
59 |
-
|
60 |
-
if ( ! class_exists( 'WXR_Importer' ) ) {
|
61 |
-
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-importer.php';
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( ! class_exists( 'WXR_Import_Info' ) ) {
|
65 |
-
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-import-info.php';
|
66 |
-
}
|
67 |
-
|
68 |
-
add_filter( 'upload_mimes', array( $this, 'custom_upload_mimes' ) );
|
69 |
-
add_action( 'wp_ajax_astra-wxr-import', array( $this, 'sse_import' ) );
|
70 |
-
add_filter( 'wxr_importer.pre_process.user', '__return_null' );
|
71 |
-
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Constructor.
|
76 |
-
*
|
77 |
-
* @since 1.1.0
|
78 |
-
*/
|
79 |
-
function sse_import() {
|
80 |
-
|
81 |
-
// Start the event stream.
|
82 |
-
header( 'Content-Type: text/event-stream' );
|
83 |
-
|
84 |
-
// Turn off PHP output compression.
|
85 |
-
$previous = error_reporting( error_reporting() ^ E_WARNING );
|
86 |
-
ini_set( 'output_buffering', 'off' );
|
87 |
-
ini_set( 'zlib.output_compression', false );
|
88 |
-
error_reporting( $previous );
|
89 |
-
|
90 |
-
if ( $GLOBALS['is_nginx'] ) {
|
91 |
-
// Setting this header instructs Nginx to disable fastcgi_buffering
|
92 |
-
// and disable gzip for this request.
|
93 |
-
header( 'X-Accel-Buffering: no' );
|
94 |
-
header( 'Content-Encoding: none' );
|
95 |
-
}
|
96 |
-
|
97 |
-
$xml_url = urldecode( $_REQUEST['xml_url'] );
|
98 |
-
if ( empty( $xml_url ) ) {
|
99 |
-
exit;
|
100 |
-
}
|
101 |
-
|
102 |
-
// 2KB padding for IE
|
103 |
-
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
104 |
-
|
105 |
-
// Time to run the import!
|
106 |
-
set_time_limit( 0 );
|
107 |
-
|
108 |
-
// Ensure we're not buffered.
|
109 |
-
wp_ob_end_flush_all();
|
110 |
-
flush();
|
111 |
-
|
112 |
-
// Are we allowed to create users?
|
113 |
-
add_filter( 'wxr_importer.pre_process.user', '__return_null' );
|
114 |
-
|
115 |
-
// Keep track of our progress.
|
116 |
-
add_action( 'wxr_importer.processed.post', array( $this, 'imported_post' ), 10, 2 );
|
117 |
-
add_action( 'wxr_importer.process_failed.post', array( $this, 'imported_post' ), 10, 2 );
|
118 |
-
add_action( 'wxr_importer.process_already_imported.post', array( $this, 'already_imported_post' ), 10, 2 );
|
119 |
-
add_action( 'wxr_importer.process_skipped.post', array( $this, 'already_imported_post' ), 10, 2 );
|
120 |
-
add_action( 'wxr_importer.processed.comment', array( $this, 'imported_comment' ) );
|
121 |
-
add_action( 'wxr_importer.process_already_imported.comment', array( $this, 'imported_comment' ) );
|
122 |
-
add_action( 'wxr_importer.processed.term', array( $this, 'imported_term' ) );
|
123 |
-
add_action( 'wxr_importer.process_failed.term', array( $this, 'imported_term' ) );
|
124 |
-
add_action( 'wxr_importer.process_already_imported.term', array( $this, 'imported_term' ) );
|
125 |
-
add_action( 'wxr_importer.processed.user', array( $this, 'imported_user' ) );
|
126 |
-
add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
|
127 |
-
// Flush once more.
|
128 |
-
flush();
|
129 |
-
|
130 |
-
$importer = $this->get_importer();
|
131 |
-
$response = $importer->import( $xml_url );
|
132 |
-
|
133 |
-
// Let the browser know we're done.
|
134 |
-
$complete = array(
|
135 |
-
'action' => 'complete',
|
136 |
-
'error' => false,
|
137 |
-
);
|
138 |
-
if ( is_wp_error( $response ) ) {
|
139 |
-
$complete['error'] = $response->get_error_message();
|
140 |
-
}
|
141 |
-
|
142 |
-
$this->emit_sse_message( $complete );
|
143 |
-
exit;
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Add .xml files as supported format in the uploader.
|
148 |
-
*
|
149 |
-
* @since 1.1.5 Added SVG file support.
|
150 |
-
*
|
151 |
-
* @since 1.0.0
|
152 |
-
*
|
153 |
-
* @param array $mimes Already supported mime types.
|
154 |
-
*/
|
155 |
-
public function custom_upload_mimes( $mimes ) {
|
156 |
-
|
157 |
-
// Allow SVG files.
|
158 |
-
$mimes['svg'] = 'image/svg+xml';
|
159 |
-
$mimes['svgz'] = 'image/svg+xml';
|
160 |
-
|
161 |
-
// Allow XML files.
|
162 |
-
$mimes['xml'] = 'application/xml';
|
163 |
-
|
164 |
-
return $mimes;
|
165 |
-
}
|
166 |
-
|
167 |
-
/**
|
168 |
-
* Start the xml import.
|
169 |
-
*
|
170 |
-
* @since 1.0.0
|
171 |
-
*
|
172 |
-
* @param (String) $path Absolute path to the XML file.
|
173 |
-
*/
|
174 |
-
public function get_xml_data( $path ) {
|
175 |
-
|
176 |
-
$args = array(
|
177 |
-
'action' => 'astra-wxr-import',
|
178 |
-
'id' => '1',
|
179 |
-
'xml_url' => $path,
|
180 |
-
);
|
181 |
-
$url = add_query_arg( urlencode_deep( $args ), admin_url( 'admin-ajax.php' ) );
|
182 |
-
|
183 |
-
$data = $this->get_data( $path );
|
184 |
-
|
185 |
-
return array(
|
186 |
-
'count' => array(
|
187 |
-
'posts' => $data->post_count,
|
188 |
-
'media' => $data->media_count,
|
189 |
-
'users' => count( $data->users ),
|
190 |
-
'comments' => $data->comment_count,
|
191 |
-
'terms' => $data->term_count,
|
192 |
-
),
|
193 |
-
'url' => $url,
|
194 |
-
'strings' => array(
|
195 |
-
'complete' => __( 'Import complete!', 'astra-sites' ),
|
196 |
-
),
|
197 |
-
);
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* Get XML data.
|
202 |
-
*
|
203 |
-
* @since 1.1.0
|
204 |
-
* @param string $url Downloaded XML file absolute URL.
|
205 |
-
* @return array XML file data.
|
206 |
-
*/
|
207 |
-
function get_data( $url ) {
|
208 |
-
$importer = $this->get_importer();
|
209 |
-
$data = $importer->get_preliminary_information( $url );
|
210 |
-
if ( is_wp_error( $data ) ) {
|
211 |
-
return $data;
|
212 |
-
}
|
213 |
-
return $data;
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Get Importer
|
218 |
-
*
|
219 |
-
* @since 1.1.0
|
220 |
-
* @return object Importer object.
|
221 |
-
*/
|
222 |
-
public function get_importer() {
|
223 |
-
$options = apply_filters(
|
224 |
-
'astra_sites_xml_import_options', array(
|
225 |
-
'fetch_attachments' => true,
|
226 |
-
'default_author' => get_current_user_id(),
|
227 |
-
)
|
228 |
-
);
|
229 |
-
$importer = new WXR_Importer( $options );
|
230 |
-
$logger = new WP_Importer_Logger_ServerSentEvents();
|
231 |
-
|
232 |
-
$importer->set_logger( $logger );
|
233 |
-
return $importer;
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Send message when a post has been imported.
|
238 |
-
*
|
239 |
-
* @since 1.1.0
|
240 |
-
* @param int $id Post ID.
|
241 |
-
* @param array $data Post data saved to the DB.
|
242 |
-
*/
|
243 |
-
public function imported_post( $id, $data ) {
|
244 |
-
$this->emit_sse_message(
|
245 |
-
array(
|
246 |
-
'action' => 'updateDelta',
|
247 |
-
'type' => ( 'attachment' === $data['post_type'] ) ? 'media' : 'posts',
|
248 |
-
'delta' => 1,
|
249 |
-
)
|
250 |
-
);
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Send message when a post is marked as already imported.
|
255 |
-
*
|
256 |
-
* @since 1.1.0
|
257 |
-
* @param array $data Post data saved to the DB.
|
258 |
-
*/
|
259 |
-
public function already_imported_post( $data ) {
|
260 |
-
$this->emit_sse_message(
|
261 |
-
array(
|
262 |
-
'action' => 'updateDelta',
|
263 |
-
'type' => ( 'attachment' === $data['post_type'] ) ? 'media' : 'posts',
|
264 |
-
'delta' => 1,
|
265 |
-
)
|
266 |
-
);
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* Send message when a comment has been imported.
|
271 |
-
*
|
272 |
-
* @since 1.1.0
|
273 |
-
*/
|
274 |
-
public function imported_comment() {
|
275 |
-
$this->emit_sse_message(
|
276 |
-
array(
|
277 |
-
'action' => 'updateDelta',
|
278 |
-
'type' => 'comments',
|
279 |
-
'delta' => 1,
|
280 |
-
)
|
281 |
-
);
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Send message when a term has been imported.
|
286 |
-
*
|
287 |
-
* @since 1.1.0
|
288 |
-
*/
|
289 |
-
public function imported_term() {
|
290 |
-
$this->emit_sse_message(
|
291 |
-
array(
|
292 |
-
'action' => 'updateDelta',
|
293 |
-
'type' => 'terms',
|
294 |
-
'delta' => 1,
|
295 |
-
)
|
296 |
-
);
|
297 |
-
}
|
298 |
-
|
299 |
-
/**
|
300 |
-
* Send message when a user has been imported.
|
301 |
-
*
|
302 |
-
* @since 1.1.0
|
303 |
-
*/
|
304 |
-
public function imported_user() {
|
305 |
-
$this->emit_sse_message(
|
306 |
-
array(
|
307 |
-
'action' => 'updateDelta',
|
308 |
-
'type' => 'users',
|
309 |
-
'delta' => 1,
|
310 |
-
)
|
311 |
-
);
|
312 |
-
}
|
313 |
-
|
314 |
-
/**
|
315 |
-
* Emit a Server-Sent Events message.
|
316 |
-
*
|
317 |
-
* @since 1.1.0
|
318 |
-
* @param mixed $data Data to be JSON-encoded and sent in the message.
|
319 |
-
*/
|
320 |
-
public function emit_sse_message( $data ) {
|
321 |
-
echo "event: message\n";
|
322 |
-
echo 'data: ' . wp_json_encode( $data ) . "\n\n";
|
323 |
-
|
324 |
-
// Extra padding.
|
325 |
-
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
326 |
-
|
327 |
-
flush();
|
328 |
-
}
|
329 |
-
|
330 |
-
}
|
331 |
-
|
332 |
-
Astra_WXR_Importer::instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Astra WXR Importer
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package Astra Addon
|
7 |
+
*/
|
8 |
+
|
9 |
+
defined( 'ABSPATH' ) or exit;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class Astra WXR Importer
|
13 |
+
*
|
14 |
+
* @since 1.0.0
|
15 |
+
*/
|
16 |
+
class Astra_WXR_Importer {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Instance of Astra_WXR_Importer
|
20 |
+
*
|
21 |
+
* @since 1.0.0
|
22 |
+
* @var Astra_WXR_Importer
|
23 |
+
*/
|
24 |
+
private static $_instance = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Instantiate Astra_WXR_Importer
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
* @return (Object) Astra_WXR_Importer.
|
31 |
+
*/
|
32 |
+
public static function instance() {
|
33 |
+
if ( ! isset( self::$_instance ) ) {
|
34 |
+
self::$_instance = new self();
|
35 |
+
}
|
36 |
+
|
37 |
+
return self::$_instance;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Constructor.
|
42 |
+
*
|
43 |
+
* @since 1.0.0
|
44 |
+
*/
|
45 |
+
private function __construct() {
|
46 |
+
|
47 |
+
if ( ! class_exists( 'WP_Importer' ) ) {
|
48 |
+
defined( 'WP_LOAD_IMPORTERS' ) || define( 'WP_LOAD_IMPORTERS', true );
|
49 |
+
require ABSPATH . '/wp-admin/includes/class-wp-importer.php';
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( ! class_exists( 'WP_Importer_Logger' ) ) {
|
53 |
+
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-logger.php';
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) ) {
|
57 |
+
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php';
|
58 |
+
}
|
59 |
+
|
60 |
+
if ( ! class_exists( 'WXR_Importer' ) ) {
|
61 |
+
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-importer.php';
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( ! class_exists( 'WXR_Import_Info' ) ) {
|
65 |
+
require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-import-info.php';
|
66 |
+
}
|
67 |
+
|
68 |
+
add_filter( 'upload_mimes', array( $this, 'custom_upload_mimes' ) );
|
69 |
+
add_action( 'wp_ajax_astra-wxr-import', array( $this, 'sse_import' ) );
|
70 |
+
add_filter( 'wxr_importer.pre_process.user', '__return_null' );
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Constructor.
|
76 |
+
*
|
77 |
+
* @since 1.1.0
|
78 |
+
*/
|
79 |
+
function sse_import() {
|
80 |
+
|
81 |
+
// Start the event stream.
|
82 |
+
header( 'Content-Type: text/event-stream' );
|
83 |
+
|
84 |
+
// Turn off PHP output compression.
|
85 |
+
$previous = error_reporting( error_reporting() ^ E_WARNING );
|
86 |
+
ini_set( 'output_buffering', 'off' );
|
87 |
+
ini_set( 'zlib.output_compression', false );
|
88 |
+
error_reporting( $previous );
|
89 |
+
|
90 |
+
if ( $GLOBALS['is_nginx'] ) {
|
91 |
+
// Setting this header instructs Nginx to disable fastcgi_buffering
|
92 |
+
// and disable gzip for this request.
|
93 |
+
header( 'X-Accel-Buffering: no' );
|
94 |
+
header( 'Content-Encoding: none' );
|
95 |
+
}
|
96 |
+
|
97 |
+
$xml_url = urldecode( $_REQUEST['xml_url'] );
|
98 |
+
if ( empty( $xml_url ) ) {
|
99 |
+
exit;
|
100 |
+
}
|
101 |
+
|
102 |
+
// 2KB padding for IE
|
103 |
+
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
104 |
+
|
105 |
+
// Time to run the import!
|
106 |
+
set_time_limit( 0 );
|
107 |
+
|
108 |
+
// Ensure we're not buffered.
|
109 |
+
wp_ob_end_flush_all();
|
110 |
+
flush();
|
111 |
+
|
112 |
+
// Are we allowed to create users?
|
113 |
+
add_filter( 'wxr_importer.pre_process.user', '__return_null' );
|
114 |
+
|
115 |
+
// Keep track of our progress.
|
116 |
+
add_action( 'wxr_importer.processed.post', array( $this, 'imported_post' ), 10, 2 );
|
117 |
+
add_action( 'wxr_importer.process_failed.post', array( $this, 'imported_post' ), 10, 2 );
|
118 |
+
add_action( 'wxr_importer.process_already_imported.post', array( $this, 'already_imported_post' ), 10, 2 );
|
119 |
+
add_action( 'wxr_importer.process_skipped.post', array( $this, 'already_imported_post' ), 10, 2 );
|
120 |
+
add_action( 'wxr_importer.processed.comment', array( $this, 'imported_comment' ) );
|
121 |
+
add_action( 'wxr_importer.process_already_imported.comment', array( $this, 'imported_comment' ) );
|
122 |
+
add_action( 'wxr_importer.processed.term', array( $this, 'imported_term' ) );
|
123 |
+
add_action( 'wxr_importer.process_failed.term', array( $this, 'imported_term' ) );
|
124 |
+
add_action( 'wxr_importer.process_already_imported.term', array( $this, 'imported_term' ) );
|
125 |
+
add_action( 'wxr_importer.processed.user', array( $this, 'imported_user' ) );
|
126 |
+
add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
|
127 |
+
// Flush once more.
|
128 |
+
flush();
|
129 |
+
|
130 |
+
$importer = $this->get_importer();
|
131 |
+
$response = $importer->import( $xml_url );
|
132 |
+
|
133 |
+
// Let the browser know we're done.
|
134 |
+
$complete = array(
|
135 |
+
'action' => 'complete',
|
136 |
+
'error' => false,
|
137 |
+
);
|
138 |
+
if ( is_wp_error( $response ) ) {
|
139 |
+
$complete['error'] = $response->get_error_message();
|
140 |
+
}
|
141 |
+
|
142 |
+
$this->emit_sse_message( $complete );
|
143 |
+
exit;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Add .xml files as supported format in the uploader.
|
148 |
+
*
|
149 |
+
* @since 1.1.5 Added SVG file support.
|
150 |
+
*
|
151 |
+
* @since 1.0.0
|
152 |
+
*
|
153 |
+
* @param array $mimes Already supported mime types.
|
154 |
+
*/
|
155 |
+
public function custom_upload_mimes( $mimes ) {
|
156 |
+
|
157 |
+
// Allow SVG files.
|
158 |
+
$mimes['svg'] = 'image/svg+xml';
|
159 |
+
$mimes['svgz'] = 'image/svg+xml';
|
160 |
+
|
161 |
+
// Allow XML files.
|
162 |
+
$mimes['xml'] = 'application/xml';
|
163 |
+
|
164 |
+
return $mimes;
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Start the xml import.
|
169 |
+
*
|
170 |
+
* @since 1.0.0
|
171 |
+
*
|
172 |
+
* @param (String) $path Absolute path to the XML file.
|
173 |
+
*/
|
174 |
+
public function get_xml_data( $path ) {
|
175 |
+
|
176 |
+
$args = array(
|
177 |
+
'action' => 'astra-wxr-import',
|
178 |
+
'id' => '1',
|
179 |
+
'xml_url' => $path,
|
180 |
+
);
|
181 |
+
$url = add_query_arg( urlencode_deep( $args ), admin_url( 'admin-ajax.php' ) );
|
182 |
+
|
183 |
+
$data = $this->get_data( $path );
|
184 |
+
|
185 |
+
return array(
|
186 |
+
'count' => array(
|
187 |
+
'posts' => $data->post_count,
|
188 |
+
'media' => $data->media_count,
|
189 |
+
'users' => count( $data->users ),
|
190 |
+
'comments' => $data->comment_count,
|
191 |
+
'terms' => $data->term_count,
|
192 |
+
),
|
193 |
+
'url' => $url,
|
194 |
+
'strings' => array(
|
195 |
+
'complete' => __( 'Import complete!', 'astra-sites' ),
|
196 |
+
),
|
197 |
+
);
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Get XML data.
|
202 |
+
*
|
203 |
+
* @since 1.1.0
|
204 |
+
* @param string $url Downloaded XML file absolute URL.
|
205 |
+
* @return array XML file data.
|
206 |
+
*/
|
207 |
+
function get_data( $url ) {
|
208 |
+
$importer = $this->get_importer();
|
209 |
+
$data = $importer->get_preliminary_information( $url );
|
210 |
+
if ( is_wp_error( $data ) ) {
|
211 |
+
return $data;
|
212 |
+
}
|
213 |
+
return $data;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Get Importer
|
218 |
+
*
|
219 |
+
* @since 1.1.0
|
220 |
+
* @return object Importer object.
|
221 |
+
*/
|
222 |
+
public function get_importer() {
|
223 |
+
$options = apply_filters(
|
224 |
+
'astra_sites_xml_import_options', array(
|
225 |
+
'fetch_attachments' => true,
|
226 |
+
'default_author' => get_current_user_id(),
|
227 |
+
)
|
228 |
+
);
|
229 |
+
$importer = new WXR_Importer( $options );
|
230 |
+
$logger = new WP_Importer_Logger_ServerSentEvents();
|
231 |
+
|
232 |
+
$importer->set_logger( $logger );
|
233 |
+
return $importer;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Send message when a post has been imported.
|
238 |
+
*
|
239 |
+
* @since 1.1.0
|
240 |
+
* @param int $id Post ID.
|
241 |
+
* @param array $data Post data saved to the DB.
|
242 |
+
*/
|
243 |
+
public function imported_post( $id, $data ) {
|
244 |
+
$this->emit_sse_message(
|
245 |
+
array(
|
246 |
+
'action' => 'updateDelta',
|
247 |
+
'type' => ( 'attachment' === $data['post_type'] ) ? 'media' : 'posts',
|
248 |
+
'delta' => 1,
|
249 |
+
)
|
250 |
+
);
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Send message when a post is marked as already imported.
|
255 |
+
*
|
256 |
+
* @since 1.1.0
|
257 |
+
* @param array $data Post data saved to the DB.
|
258 |
+
*/
|
259 |
+
public function already_imported_post( $data ) {
|
260 |
+
$this->emit_sse_message(
|
261 |
+
array(
|
262 |
+
'action' => 'updateDelta',
|
263 |
+
'type' => ( 'attachment' === $data['post_type'] ) ? 'media' : 'posts',
|
264 |
+
'delta' => 1,
|
265 |
+
)
|
266 |
+
);
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Send message when a comment has been imported.
|
271 |
+
*
|
272 |
+
* @since 1.1.0
|
273 |
+
*/
|
274 |
+
public function imported_comment() {
|
275 |
+
$this->emit_sse_message(
|
276 |
+
array(
|
277 |
+
'action' => 'updateDelta',
|
278 |
+
'type' => 'comments',
|
279 |
+
'delta' => 1,
|
280 |
+
)
|
281 |
+
);
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Send message when a term has been imported.
|
286 |
+
*
|
287 |
+
* @since 1.1.0
|
288 |
+
*/
|
289 |
+
public function imported_term() {
|
290 |
+
$this->emit_sse_message(
|
291 |
+
array(
|
292 |
+
'action' => 'updateDelta',
|
293 |
+
'type' => 'terms',
|
294 |
+
'delta' => 1,
|
295 |
+
)
|
296 |
+
);
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Send message when a user has been imported.
|
301 |
+
*
|
302 |
+
* @since 1.1.0
|
303 |
+
*/
|
304 |
+
public function imported_user() {
|
305 |
+
$this->emit_sse_message(
|
306 |
+
array(
|
307 |
+
'action' => 'updateDelta',
|
308 |
+
'type' => 'users',
|
309 |
+
'delta' => 1,
|
310 |
+
)
|
311 |
+
);
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Emit a Server-Sent Events message.
|
316 |
+
*
|
317 |
+
* @since 1.1.0
|
318 |
+
* @param mixed $data Data to be JSON-encoded and sent in the message.
|
319 |
+
*/
|
320 |
+
public function emit_sse_message( $data ) {
|
321 |
+
echo "event: message\n";
|
322 |
+
echo 'data: ' . wp_json_encode( $data ) . "\n\n";
|
323 |
+
|
324 |
+
// Extra padding.
|
325 |
+
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
326 |
+
|
327 |
+
flush();
|
328 |
+
}
|
329 |
+
|
330 |
+
}
|
331 |
+
|
332 |
+
Astra_WXR_Importer::instance();
|
inc/includes/admin-page.php
CHANGED
@@ -1,295 +1,299 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Shortcode Markup
|
4 |
-
*
|
5 |
-
* TMPL - Single Demo Preview
|
6 |
-
* TMPL - No more demos
|
7 |
-
* TMPL - Filters
|
8 |
-
* TMPL - List
|
9 |
-
*
|
10 |
-
* @package Astra Sites
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
|
14 |
-
defined( 'ABSPATH' ) or exit;
|
15 |
-
|
16 |
-
?>
|
17 |
-
|
18 |
-
<div class="wrap" id="astra-sites-admin">
|
19 |
-
|
20 |
-
<div id="astra-sites-filters"
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
<div class="
|
56 |
-
<
|
57 |
-
</div>
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
</div>
|
62 |
-
|
63 |
-
<?php
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
</
|
79 |
-
|
80 |
-
<?php
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
data-demo-
|
94 |
-
data-demo-
|
95 |
-
data-
|
96 |
-
data-
|
97 |
-
data-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
<
|
103 |
-
<
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
<
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
{{{data.
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
<#
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
data-demo-
|
231 |
-
data-demo-
|
232 |
-
data-
|
233 |
-
data-
|
234 |
-
data-
|
235 |
-
data-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
<# if ( data.items[ key ]
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
<
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode Markup
|
4 |
+
*
|
5 |
+
* TMPL - Single Demo Preview
|
6 |
+
* TMPL - No more demos
|
7 |
+
* TMPL - Filters
|
8 |
+
* TMPL - List
|
9 |
+
*
|
10 |
+
* @package Astra Sites
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
|
14 |
+
defined( 'ABSPATH' ) or exit;
|
15 |
+
|
16 |
+
?>
|
17 |
+
|
18 |
+
<div class="wrap" id="astra-sites-admin">
|
19 |
+
|
20 |
+
<div id="astra-sites-filters">
|
21 |
+
|
22 |
+
<?php if ( apply_filters( 'astra_sites_show_filters', true ) ) { ?>
|
23 |
+
<div class="wp-filter hide-if-no-js">
|
24 |
+
<div class="section-left">
|
25 |
+
|
26 |
+
<!-- All Filters -->
|
27 |
+
<div class="filter-count">
|
28 |
+
<span class="count"></span>
|
29 |
+
</div>
|
30 |
+
<div class="filters-wrap">
|
31 |
+
<div id="astra-site-page-builder"></div>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="section-right">
|
37 |
+
|
38 |
+
<div class="filters-wrap">
|
39 |
+
<div id="astra-site-category"></div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="search-form">
|
43 |
+
<label class="screen-reader-text" for="wp-filter-search-input"><?php _e( 'Search Sites', 'astra-sites' ); ?> </label>
|
44 |
+
<input placeholder="<?php _e( 'Search Sites...', 'astra-sites' ); ?>" type="search" aria-describedby="live-search-desc" id="wp-filter-search-input" class="wp-filter-search">
|
45 |
+
</div>
|
46 |
+
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
<?php } ?>
|
50 |
+
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<?php do_action( 'astra_sites_before_site_grid' ); ?>
|
54 |
+
|
55 |
+
<div class="theme-browser rendered">
|
56 |
+
<div id="astra-sites" class="themes wp-clearfix"></div>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
<div class="spinner-wrap">
|
60 |
+
<span class="spinner"></span>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<?php do_action( 'astra_sites_after_site_grid' ); ?>
|
64 |
+
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<?php
|
68 |
+
/**
|
69 |
+
* TMPL - Single Demo Preview
|
70 |
+
*/
|
71 |
+
?>
|
72 |
+
<script type="text/template" id="tmpl-astra-site-select-page-builder">
|
73 |
+
<div class="select-page-builder">
|
74 |
+
<div class="note-wrap">
|
75 |
+
<h3>
|
76 |
+
<span class="up-arrow dashicons dashicons-editor-break"></span>
|
77 |
+
<div class="note"><?php _e( 'Select Your Favorite Page Builder', 'astra-sites' ); ?></div>
|
78 |
+
</h3>
|
79 |
+
</div>
|
80 |
+
<img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/sites-screenshot.jpg' ); ?>" alt="<?php _e( 'Sites List..', 'astra-sites' ); ?>" title="<?php _e( 'Sites List..', 'astra-sites' ); ?>" />
|
81 |
+
</div>
|
82 |
+
</script>
|
83 |
+
|
84 |
+
<?php
|
85 |
+
/**
|
86 |
+
* TMPL - Single Demo Preview
|
87 |
+
*/
|
88 |
+
?>
|
89 |
+
<script type="text/template" id="tmpl-astra-site-preview">
|
90 |
+
<div class="astra-sites-preview theme-install-overlay wp-full-overlay expanded">
|
91 |
+
<div class="wp-full-overlay-sidebar">
|
92 |
+
<div class="wp-full-overlay-header"
|
93 |
+
data-demo-id="{{{data.id}}}"
|
94 |
+
data-demo-type="{{{data.astra_demo_type}}}"
|
95 |
+
data-demo-url="{{{data.astra_demo_url}}}"
|
96 |
+
data-demo-api="{{{data.demo_api}}}"
|
97 |
+
data-demo-name="{{{data.demo_name}}}"
|
98 |
+
data-demo-slug="{{{data.slug}}}"
|
99 |
+
data-screenshot="{{{data.screenshot}}}"
|
100 |
+
data-content="{{{data.content}}}"
|
101 |
+
data-required-plugins="{{data.required_plugins}}">
|
102 |
+
<input type="hidden" class="astra-site-options" value="{{data.astra_site_options}}" >
|
103 |
+
<input type="hidden" class="astra-enabled-extensions" value="{{data.astra_enabled_extensions}}" >
|
104 |
+
<button class="close-full-overlay"><span class="screen-reader-text"><?php esc_html_e( 'Close', 'astra-sites' ); ?></span></button>
|
105 |
+
<button class="previous-theme"><span class="screen-reader-text"><?php esc_html_e( 'Previous', 'astra-sites' ); ?></span></button>
|
106 |
+
<button class="next-theme"><span class="screen-reader-text"><?php esc_html_e( 'Next', 'astra-sites' ); ?></span></button>
|
107 |
+
<a class="button hide-if-no-customize astra-demo-import" href="#" data-import="disabled"><?php esc_html_e( 'Install Plugins', 'astra-sites' ); ?></a>
|
108 |
+
|
109 |
+
</div>
|
110 |
+
<div class="wp-full-overlay-sidebar-content">
|
111 |
+
<div class="install-theme-info">
|
112 |
+
|
113 |
+
<span class="site-type {{{data.astra_demo_type}}}">{{{data.astra_demo_type}}}</span>
|
114 |
+
<h3 class="theme-name">{{{data.demo_name}}}</h3>
|
115 |
+
|
116 |
+
<# if ( data.screenshot.length ) { #>
|
117 |
+
<img class="theme-screenshot" src="{{{data.screenshot}}}" alt="">
|
118 |
+
<# } #>
|
119 |
+
|
120 |
+
<div class="theme-details">
|
121 |
+
{{{data.content}}}
|
122 |
+
</div>
|
123 |
+
<a href="#" class="theme-details-read-more"><?php _e( 'Read more', 'astra-sites' ); ?> …</a>
|
124 |
+
|
125 |
+
<div class="required-plugins-wrap">
|
126 |
+
<h4><?php _e( 'Required Plugins', 'astra-sites' ); ?> </h4>
|
127 |
+
<div class="required-plugins"></div>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="wp-full-overlay-footer">
|
133 |
+
<div class="footer-import-button-wrap">
|
134 |
+
<a class="button button-hero hide-if-no-customize astra-demo-import" href="#" data-import="disabled">
|
135 |
+
<?php esc_html_e( 'Install Plugins', 'astra-sites' ); ?>
|
136 |
+
</a>
|
137 |
+
</div>
|
138 |
+
<button type="button" class="collapse-sidebar button" aria-expanded="true"
|
139 |
+
aria-label="Collapse Sidebar">
|
140 |
+
<span class="collapse-sidebar-arrow"></span>
|
141 |
+
<span class="collapse-sidebar-label"><?php esc_html_e( 'Collapse', 'astra-sites' ); ?></span>
|
142 |
+
</button>
|
143 |
+
|
144 |
+
<div class="devices-wrapper">
|
145 |
+
<div class="devices">
|
146 |
+
<button type="button" class="preview-desktop active" aria-pressed="true" data-device="desktop">
|
147 |
+
<span class="screen-reader-text"><?php _e( 'Enter desktop preview mode', 'astra-sites' ); ?></span>
|
148 |
+
</button>
|
149 |
+
<button type="button" class="preview-tablet" aria-pressed="false" data-device="tablet">
|
150 |
+
<span class="screen-reader-text"><?php _e( 'Enter tablet preview mode', 'astra-sites' ); ?></span>
|
151 |
+
</button>
|
152 |
+
<button type="button" class="preview-mobile" aria-pressed="false" data-device="mobile">
|
153 |
+
<span class="screen-reader-text"><?php _e( 'Enter mobile preview mode', 'astra-sites' ); ?></span>
|
154 |
+
</button>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
<div class="wp-full-overlay-main">
|
161 |
+
<iframe src="{{{data.astra_demo_url}}}" title="<?php esc_attr_e( 'Preview', 'astra-sites' ); ?>"></iframe>
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</script>
|
165 |
+
|
166 |
+
<?php
|
167 |
+
/**
|
168 |
+
* TMPL - No more demos
|
169 |
+
*/
|
170 |
+
?>
|
171 |
+
<script type="text/template" id="tmpl-astra-site-api-request-failed">
|
172 |
+
<div class="no-themes">
|
173 |
+
<?php
|
174 |
+
|
175 |
+
/* translators: %1$s & %2$s are a Demo API URL */
|
176 |
+
printf( __( '<p> It seems the demo data server, <i><a href="%1$s">%2$s</a></i> is unreachable from your site.</p>', 'astra-sites' ), esc_url( Astra_Sites::$api_url ), esc_url( Astra_Sites::$api_url ) );
|
177 |
+
|
178 |
+
_e( '<p class="left-margin"> 1. Sometimes, simple page reload fixes any temporary issues. No kidding!</p>', 'astra-sites' );
|
179 |
+
|
180 |
+
_e( '<p class="left-margin"> 2. If that does not work, you will need to talk to your server administrator and check if demo server is being blocked by the firewall!</p>', 'astra-sites' );
|
181 |
+
|
182 |
+
/* translators: %1$s is a support link */
|
183 |
+
printf( __( '<p>If that does not help, please open up a <a href="%1$s" target="_blank">Support Ticket</a> and we will be glad take a closer look for you.</p>', 'astra-sites' ), esc_url( 'https://wpastra.com/support/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=api-request-failed' ) );
|
184 |
+
?>
|
185 |
+
</div>
|
186 |
+
</script>
|
187 |
+
|
188 |
+
<?php
|
189 |
+
/**
|
190 |
+
* TMPL - Filters
|
191 |
+
*/
|
192 |
+
?>
|
193 |
+
<script type="text/template" id="tmpl-astra-site-filters">
|
194 |
+
|
195 |
+
<# if ( data ) { #>
|
196 |
+
|
197 |
+
<ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
|
198 |
+
|
199 |
+
<# if ( data.args.show_all ) { #>
|
200 |
+
<li>
|
201 |
+
<a href="#" data-group="all"> All </a>
|
202 |
+
</li>
|
203 |
+
<# } #>
|
204 |
+
|
205 |
+
<# for ( key in data.items ) { #>
|
206 |
+
<# if ( data.items[ key ].count ) { #>
|
207 |
+
<li>
|
208 |
+
<a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}">
|
209 |
+
{{ data.items[ key ].name }}
|
210 |
+
</a>
|
211 |
+
</li>
|
212 |
+
<# } #>
|
213 |
+
<# } #>
|
214 |
+
|
215 |
+
</ul>
|
216 |
+
<# } #>
|
217 |
+
</script>
|
218 |
+
|
219 |
+
<?php
|
220 |
+
/**
|
221 |
+
* TMPL - List
|
222 |
+
*/
|
223 |
+
?>
|
224 |
+
<script type="text/template" id="tmpl-astra-sites-list">
|
225 |
+
|
226 |
+
<# if ( data.items.length ) { #>
|
227 |
+
<# for ( key in data.items ) { #>
|
228 |
+
|
229 |
+
<div class="theme astra-theme site-single {{ data.items[ key ].status }}" tabindex="0" aria-describedby="astra-theme-action astra-theme-name"
|
230 |
+
data-demo-id="{{{ data.items[ key ].id }}}"
|
231 |
+
data-demo-type="{{{ data.items[ key ]['astra-site-type'] }}}"
|
232 |
+
data-demo-url="{{{ data.items[ key ]['astra-site-url'] }}}"
|
233 |
+
data-demo-api="{{{ data.items[ key ]['_links']['self'][0]['href'] }}}"
|
234 |
+
data-demo-name="{{{ data.items[ key ].title.rendered }}}"
|
235 |
+
data-demo-slug="{{{ data.items[ key ].slug }}}"
|
236 |
+
data-screenshot="{{{ data.items[ key ]['featured-image-url'] }}}"
|
237 |
+
data-content="{{{ data.items[ key ].content.rendered }}}"
|
238 |
+
data-required-plugins="{{ JSON.stringify( data.items[ key ]['required-plugins'] ) }}"
|
239 |
+
data-groups=["{{ data.items[ key ].tags }}"]>
|
240 |
+
<input type="hidden" class="astra-site-options" value="{{ JSON.stringify(data.items[ key ]['astra-site-options-data'] ) }}" />
|
241 |
+
<input type="hidden" class="astra-enabled-extensions" value="{{ JSON.stringify(data.items[ key ]['astra-enabled-extensions'] ) }}" />
|
242 |
+
|
243 |
+
<div class="inner">
|
244 |
+
<span class="site-preview" data-href="{{ data.items[ key ]['astra-site-url'] }}?TB_iframe=true&width=600&height=550" data-title="{{ data.items[ key ].title.rendered }}">
|
245 |
+
<div class="theme-screenshot">
|
246 |
+
<# if( '' !== data.items[ key ]['featured-image-url'] ) { #>
|
247 |
+
<img src="{{ data.items[ key ]['featured-image-url'] }}" />
|
248 |
+
<# } #>
|
249 |
+
</div>
|
250 |
+
</span>
|
251 |
+
<span class="more-details"> <?php esc_html_e( 'Details & Preview', 'astra-sites' ); ?> </span>
|
252 |
+
<# if ( data.items[ key ]['astra-site-type'] ) { #>
|
253 |
+
<# var type = ( data.items[ key ]['astra-site-type'] !== 'premium' ) ? ( data.items[ key ]['astra-site-type'] ) : 'agency'; #>
|
254 |
+
<span class="site-type {{data.items[ key ]['astra-site-type']}}">{{ type }}</span>
|
255 |
+
<# } #>
|
256 |
+
<# if ( data.items[ key ].status ) { #>
|
257 |
+
<span class="status {{data.items[ key ].status}}">{{data.items[ key ].status}}</span>
|
258 |
+
<# } #>
|
259 |
+
<div class="theme-id-container">
|
260 |
+
<h3 class="theme-name" id="astra-theme-name"> {{{ data.items[ key ].title.rendered }}} </h3>
|
261 |
+
<div class="theme-actions">
|
262 |
+
<button class="button preview install-theme-preview"><?php esc_html_e( 'Preview', 'astra-sites' ); ?></button>
|
263 |
+
</div>
|
264 |
+
</div>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
<# } #>
|
268 |
+
<# } else { #>
|
269 |
+
<p class="no-themes" style="display:block;">
|
270 |
+
<?php _e( 'No Demos found, Try a different search.', 'astra-sites' ); ?>
|
271 |
+
<span class="description">
|
272 |
+
<?php
|
273 |
+
/* translators: %1$s External Link */
|
274 |
+
printf( __( 'Don\'t see a site that you would like to import?<br><a target="_blank" href="%1$s">Please suggest us!</a>', 'astra-sites' ), esc_url( 'https://wpastra.com/sites-suggestions/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=suggestions' ) );
|
275 |
+
?>
|
276 |
+
</span>
|
277 |
+
</p>
|
278 |
+
<# } #>
|
279 |
+
</script>
|
280 |
+
|
281 |
+
<?php
|
282 |
+
/**
|
283 |
+
* TMPL - List
|
284 |
+
*/
|
285 |
+
?>
|
286 |
+
<script type="text/template" id="tmpl-astra-sites-suggestions">
|
287 |
+
<div class="theme astra-theme site-single astra-sites-suggestions">
|
288 |
+
<div class="inner">
|
289 |
+
<p>
|
290 |
+
<?php
|
291 |
+
/* translators: %1$s External Link */
|
292 |
+
printf( __( 'Don\'t see a site that you would like to import?<br><a target="_blank" href="%1$s">Please suggest us!</a>', 'astra-sites' ), esc_url( 'https://wpastra.com/sites-suggestions/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=suggestions' ) );
|
293 |
+
?>
|
294 |
+
</p>
|
295 |
+
</div>
|
296 |
+
</div>
|
297 |
+
</script>
|
298 |
+
<?php
|
299 |
+
wp_print_admin_notice_templates();
|
languages/astra-sites.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Astra Starter Sites package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Astra Starter Sites 1.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
7 |
-
"POT-Creation-Date: 2018-07-09
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -100,73 +100,73 @@ msgstr ""
|
|
100 |
msgid "Categories"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: inc/classes/class-astra-sites.php:
|
104 |
msgid "Purchase"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: inc/classes/class-astra-sites.php:
|
108 |
msgid "Upgrade"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: inc/classes/class-astra-sites.php:
|
112 |
msgid ""
|
113 |
"Warning! Astra Site Import process is not complete. Don't close the window "
|
114 |
"until import process complete. Do you still want to leave the window?"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: inc/classes/class-astra-sites.php:
|
118 |
msgid "Error!"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: inc/classes/class-astra-sites.php:
|
122 |
msgid "Error! Read Possibilities."
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: inc/classes/class-astra-sites.php:
|
126 |
msgid "Done! View Site"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: inc/classes/class-astra-sites.php:
|
130 |
msgid "Activating"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: inc/classes/class-astra-sites.php:
|
134 |
msgid "Active"
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: inc/classes/class-astra-sites.php:
|
138 |
msgid "Import failed."
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: inc/classes/class-astra-sites.php:
|
142 |
msgid "Import failed. See error log."
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: inc/classes/class-astra-sites.php:
|
146 |
msgid "Import This Site"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: inc/classes/class-astra-sites.php:
|
150 |
msgid "Importing.."
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: inc/classes/class-astra-sites.php:
|
154 |
msgid "Read more"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: inc/classes/class-astra-sites.php:
|
158 |
msgid "Hide"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: inc/classes/class-astra-sites.php:
|
162 |
msgid "There was a problem receiving a response from server."
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: inc/classes/class-astra-sites.php:
|
166 |
msgid "No Demos found, Try a different search."
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: inc/classes/class-astra-sites.php:
|
170 |
msgid ""
|
171 |
"Executing Demo Import will make your site similar as ours. Please bear in "
|
172 |
"mind -\n"
|
@@ -180,131 +180,131 @@ msgid ""
|
|
180 |
"placeholders."
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: inc/classes/class-astra-sites.php:
|
184 |
msgid "Installing plugin "
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: inc/classes/class-astra-sites.php:
|
188 |
msgid "Successfully plugin installed!"
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: inc/classes/class-astra-sites.php:
|
192 |
msgid "Activating plugin "
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: inc/classes/class-astra-sites.php:
|
196 |
msgid "Successfully plugin activated "
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: inc/classes/class-astra-sites.php:
|
200 |
msgid "Bulk plugin activation..."
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: inc/classes/class-astra-sites.php:
|
204 |
msgid "Successfully plugin activate - "
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: inc/classes/class-astra-sites.php:
|
208 |
msgid "Error! While activating plugin - "
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: inc/classes/class-astra-sites.php:
|
212 |
msgid "Bulk plugin installation..."
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: inc/classes/class-astra-sites.php:
|
216 |
msgid "Site API "
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: inc/classes/class-astra-sites.php:
|
220 |
msgid "Processing requests..."
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: inc/classes/class-astra-sites.php:
|
224 |
msgid "1) Importing \"Customizer Settings\"..."
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: inc/classes/class-astra-sites.php:
|
228 |
msgid "Successfully imported customizer settings!"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: inc/classes/class-astra-sites.php:
|
232 |
msgid "2) Preparing \"XML\" Data..."
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: inc/classes/class-astra-sites.php:
|
236 |
msgid "Successfully set XML data!"
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: inc/classes/class-astra-sites.php:
|
240 |
msgid "3) Importing \"XML\"..."
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: inc/classes/class-astra-sites.php:
|
244 |
msgid "Successfully imported XML!"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: inc/classes/class-astra-sites.php:
|
248 |
msgid "4) Importing \"Options\"..."
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: inc/classes/class-astra-sites.php:
|
252 |
msgid "Successfully imported Options!"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: inc/classes/class-astra-sites.php:
|
256 |
msgid "5) Importing \"Widgets\"..."
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: inc/classes/class-astra-sites.php:
|
260 |
msgid "Successfully imported Widgets!"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: inc/classes/class-astra-sites.php:
|
264 |
msgid "Site imported successfully! visit : "
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: inc/classes/class-astra-sites.php:
|
268 |
msgid "Getting Site Information.."
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: inc/classes/class-astra-sites.php:
|
272 |
msgid "Importing Customizer Settings.."
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: inc/classes/class-astra-sites.php:
|
276 |
msgid "Setting up import data.."
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: inc/classes/class-astra-sites.php:
|
280 |
msgid "Importing Pages, Posts & Media.."
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: inc/classes/class-astra-sites.php:
|
284 |
msgid "Importing Site Options.."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: inc/classes/class-astra-sites.php:
|
288 |
msgid "Importing Widgets.."
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: inc/classes/class-astra-sites.php:
|
292 |
msgid "Import Complete.."
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: inc/classes/class-astra-sites.php:
|
296 |
msgid "Previewing "
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: inc/classes/class-astra-sites.php:
|
300 |
msgid "See Error Log →"
|
301 |
msgstr ""
|
302 |
|
303 |
-
#: inc/classes/class-astra-sites.php:
|
304 |
msgid "No plugin specified"
|
305 |
msgstr ""
|
306 |
|
307 |
-
#: inc/classes/class-astra-sites.php:
|
308 |
msgid "Plugin Successfully Activated"
|
309 |
msgstr ""
|
310 |
|
@@ -496,83 +496,83 @@ msgstr ""
|
|
496 |
msgid "Could not update comment #%d with mapped data"
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: inc/includes/admin-page.php:
|
500 |
msgid "Search Sites"
|
501 |
msgstr ""
|
502 |
|
503 |
-
#: inc/includes/admin-page.php:
|
504 |
msgid "Search Sites..."
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: inc/includes/admin-page.php:
|
508 |
msgid "Select Your Favorite Page Builder"
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: inc/includes/admin-page.php:
|
512 |
msgid "Sites List.."
|
513 |
msgstr ""
|
514 |
|
515 |
-
#: inc/includes/admin-page.php:
|
516 |
msgid "Close"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: inc/includes/admin-page.php:
|
520 |
msgid "Previous"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: inc/includes/admin-page.php:
|
524 |
msgid "Next"
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: inc/includes/admin-page.php:
|
528 |
msgid "Install Plugins"
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: inc/includes/admin-page.php:
|
532 |
msgid "Required Plugins"
|
533 |
msgstr ""
|
534 |
|
535 |
-
#: inc/includes/admin-page.php:
|
536 |
msgid "Collapse"
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: inc/includes/admin-page.php:
|
540 |
msgid "Enter desktop preview mode"
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: inc/includes/admin-page.php:
|
544 |
msgid "Enter tablet preview mode"
|
545 |
msgstr ""
|
546 |
|
547 |
-
#: inc/includes/admin-page.php:
|
548 |
msgid "Enter mobile preview mode"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: inc/includes/admin-page.php:
|
552 |
msgid "Preview"
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: inc/includes/admin-page.php:
|
556 |
#. translators: %1$s & %2$s are a Demo API URL
|
557 |
msgid ""
|
558 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
559 |
"unreachable from your site.</p>"
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: inc/includes/admin-page.php:
|
563 |
msgid ""
|
564 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
565 |
"temporary issues. No kidding!</p>"
|
566 |
msgstr ""
|
567 |
|
568 |
-
#: inc/includes/admin-page.php:
|
569 |
msgid ""
|
570 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
571 |
"to your server administrator and check if demo server is being blocked by "
|
572 |
"the firewall!</p>"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: inc/includes/admin-page.php:
|
576 |
#. translators: %1$s is a support link
|
577 |
msgid ""
|
578 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
@@ -580,11 +580,11 @@ msgid ""
|
|
580 |
"for you.</p>"
|
581 |
msgstr ""
|
582 |
|
583 |
-
#: inc/includes/admin-page.php:
|
584 |
msgid "Details & Preview"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: inc/includes/admin-page.php:
|
588 |
#. translators: %1$s External Link
|
589 |
msgid ""
|
590 |
"Don't see a site that you would like to import?<br><a target=\"_blank\" "
|
2 |
# This file is distributed under the same license as the Astra Starter Sites package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Astra Starter Sites 1.2.7\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
7 |
+
"POT-Creation-Date: 2018-07-12 09:29:35+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
100 |
msgid "Categories"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: inc/classes/class-astra-sites.php:212
|
104 |
msgid "Purchase"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: inc/classes/class-astra-sites.php:214
|
108 |
msgid "Upgrade"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: inc/classes/class-astra-sites.php:219
|
112 |
msgid ""
|
113 |
"Warning! Astra Site Import process is not complete. Don't close the window "
|
114 |
"until import process complete. Do you still want to leave the window?"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: inc/classes/class-astra-sites.php:220
|
118 |
msgid "Error!"
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: inc/classes/class-astra-sites.php:221
|
122 |
msgid "Error! Read Possibilities."
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: inc/classes/class-astra-sites.php:223
|
126 |
msgid "Done! View Site"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: inc/classes/class-astra-sites.php:224
|
130 |
msgid "Activating"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: inc/classes/class-astra-sites.php:225
|
134 |
msgid "Active"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: inc/classes/class-astra-sites.php:226
|
138 |
msgid "Import failed."
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: inc/classes/class-astra-sites.php:227
|
142 |
msgid "Import failed. See error log."
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: inc/classes/class-astra-sites.php:228
|
146 |
msgid "Import This Site"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: inc/classes/class-astra-sites.php:229 inc/classes/class-astra-sites.php:246
|
150 |
msgid "Importing.."
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: inc/classes/class-astra-sites.php:230 inc/includes/admin-page.php:123
|
154 |
msgid "Read more"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: inc/classes/class-astra-sites.php:231
|
158 |
msgid "Hide"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: inc/classes/class-astra-sites.php:232
|
162 |
msgid "There was a problem receiving a response from server."
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: inc/classes/class-astra-sites.php:233 inc/includes/admin-page.php:270
|
166 |
msgid "No Demos found, Try a different search."
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: inc/classes/class-astra-sites.php:234
|
170 |
msgid ""
|
171 |
"Executing Demo Import will make your site similar as ours. Please bear in "
|
172 |
"mind -\n"
|
180 |
"placeholders."
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: inc/classes/class-astra-sites.php:237
|
184 |
msgid "Installing plugin "
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: inc/classes/class-astra-sites.php:238
|
188 |
msgid "Successfully plugin installed!"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: inc/classes/class-astra-sites.php:239
|
192 |
msgid "Activating plugin "
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: inc/classes/class-astra-sites.php:240
|
196 |
msgid "Successfully plugin activated "
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: inc/classes/class-astra-sites.php:241
|
200 |
msgid "Bulk plugin activation..."
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: inc/classes/class-astra-sites.php:242
|
204 |
msgid "Successfully plugin activate - "
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: inc/classes/class-astra-sites.php:243
|
208 |
msgid "Error! While activating plugin - "
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: inc/classes/class-astra-sites.php:244
|
212 |
msgid "Bulk plugin installation..."
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: inc/classes/class-astra-sites.php:245
|
216 |
msgid "Site API "
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: inc/classes/class-astra-sites.php:247
|
220 |
msgid "Processing requests..."
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: inc/classes/class-astra-sites.php:248
|
224 |
msgid "1) Importing \"Customizer Settings\"..."
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: inc/classes/class-astra-sites.php:249
|
228 |
msgid "Successfully imported customizer settings!"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: inc/classes/class-astra-sites.php:250
|
232 |
msgid "2) Preparing \"XML\" Data..."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: inc/classes/class-astra-sites.php:251
|
236 |
msgid "Successfully set XML data!"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: inc/classes/class-astra-sites.php:252
|
240 |
msgid "3) Importing \"XML\"..."
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: inc/classes/class-astra-sites.php:253
|
244 |
msgid "Successfully imported XML!"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: inc/classes/class-astra-sites.php:254
|
248 |
msgid "4) Importing \"Options\"..."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: inc/classes/class-astra-sites.php:255
|
252 |
msgid "Successfully imported Options!"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: inc/classes/class-astra-sites.php:256
|
256 |
msgid "5) Importing \"Widgets\"..."
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: inc/classes/class-astra-sites.php:257
|
260 |
msgid "Successfully imported Widgets!"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: inc/classes/class-astra-sites.php:259
|
264 |
msgid "Site imported successfully! visit : "
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: inc/classes/class-astra-sites.php:260
|
268 |
msgid "Getting Site Information.."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: inc/classes/class-astra-sites.php:261
|
272 |
msgid "Importing Customizer Settings.."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: inc/classes/class-astra-sites.php:262
|
276 |
msgid "Setting up import data.."
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: inc/classes/class-astra-sites.php:263
|
280 |
msgid "Importing Pages, Posts & Media.."
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: inc/classes/class-astra-sites.php:264
|
284 |
msgid "Importing Site Options.."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: inc/classes/class-astra-sites.php:265
|
288 |
msgid "Importing Widgets.."
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: inc/classes/class-astra-sites.php:266
|
292 |
msgid "Import Complete.."
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: inc/classes/class-astra-sites.php:267
|
296 |
msgid "Previewing "
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: inc/classes/class-astra-sites.php:268
|
300 |
msgid "See Error Log →"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: inc/classes/class-astra-sites.php:303
|
304 |
msgid "No plugin specified"
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: inc/classes/class-astra-sites.php:332
|
308 |
msgid "Plugin Successfully Activated"
|
309 |
msgstr ""
|
310 |
|
496 |
msgid "Could not update comment #%d with mapped data"
|
497 |
msgstr ""
|
498 |
|
499 |
+
#: inc/includes/admin-page.php:43
|
500 |
msgid "Search Sites"
|
501 |
msgstr ""
|
502 |
|
503 |
+
#: inc/includes/admin-page.php:44
|
504 |
msgid "Search Sites..."
|
505 |
msgstr ""
|
506 |
|
507 |
+
#: inc/includes/admin-page.php:77
|
508 |
msgid "Select Your Favorite Page Builder"
|
509 |
msgstr ""
|
510 |
|
511 |
+
#: inc/includes/admin-page.php:80
|
512 |
msgid "Sites List.."
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: inc/includes/admin-page.php:104
|
516 |
msgid "Close"
|
517 |
msgstr ""
|
518 |
|
519 |
+
#: inc/includes/admin-page.php:105
|
520 |
msgid "Previous"
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: inc/includes/admin-page.php:106
|
524 |
msgid "Next"
|
525 |
msgstr ""
|
526 |
|
527 |
+
#: inc/includes/admin-page.php:107 inc/includes/admin-page.php:135
|
528 |
msgid "Install Plugins"
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: inc/includes/admin-page.php:126
|
532 |
msgid "Required Plugins"
|
533 |
msgstr ""
|
534 |
|
535 |
+
#: inc/includes/admin-page.php:141
|
536 |
msgid "Collapse"
|
537 |
msgstr ""
|
538 |
|
539 |
+
#: inc/includes/admin-page.php:147
|
540 |
msgid "Enter desktop preview mode"
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: inc/includes/admin-page.php:150
|
544 |
msgid "Enter tablet preview mode"
|
545 |
msgstr ""
|
546 |
|
547 |
+
#: inc/includes/admin-page.php:153
|
548 |
msgid "Enter mobile preview mode"
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: inc/includes/admin-page.php:161 inc/includes/admin-page.php:262
|
552 |
msgid "Preview"
|
553 |
msgstr ""
|
554 |
|
555 |
+
#: inc/includes/admin-page.php:176
|
556 |
#. translators: %1$s & %2$s are a Demo API URL
|
557 |
msgid ""
|
558 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
559 |
"unreachable from your site.</p>"
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: inc/includes/admin-page.php:178
|
563 |
msgid ""
|
564 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
565 |
"temporary issues. No kidding!</p>"
|
566 |
msgstr ""
|
567 |
|
568 |
+
#: inc/includes/admin-page.php:180
|
569 |
msgid ""
|
570 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
571 |
"to your server administrator and check if demo server is being blocked by "
|
572 |
"the firewall!</p>"
|
573 |
msgstr ""
|
574 |
|
575 |
+
#: inc/includes/admin-page.php:183
|
576 |
#. translators: %1$s is a support link
|
577 |
msgid ""
|
578 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
580 |
"for you.</p>"
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: inc/includes/admin-page.php:251
|
584 |
msgid "Details & Preview"
|
585 |
msgstr ""
|
586 |
|
587 |
+
#: inc/includes/admin-page.php:274 inc/includes/admin-page.php:292
|
588 |
#. translators: %1$s External Link
|
589 |
msgid ""
|
590 |
"Don't see a site that you would like to import?<br><a target=\"_blank\" "
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: demo, theme demos, one click import
|
|
5 |
Requires at least: 4.4
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 4.9.7
|
8 |
-
Stable tag: 1.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -57,6 +57,10 @@ https://wpastra.com/sites-suggestions/
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
|
|
60 |
v1.2.6 - 9-July-2018
|
61 |
* Fix: We have added `wp_slash` to normalize the Elementor post meta. Elementor have also normalize it. So, We have avoided `wp_slash` while importing sites.
|
62 |
|
5 |
Requires at least: 4.4
|
6 |
Requires PHP: 5.3
|
7 |
Tested up to: 4.9.7
|
8 |
+
Stable tag: 1.2.7
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
v1.2.7 - 12-July-2018
|
61 |
+
* Improvement: Added page builder and category filter support to show selected page builder with selected categories.
|
62 |
+
* Improvement: Added filter `astra_sites_show_filters` to enable/disable the filter list from admin page.
|
63 |
+
|
64 |
v1.2.6 - 9-July-2018
|
65 |
* Fix: We have added `wp_slash` to normalize the Elementor post meta. Elementor have also normalize it. So, We have avoided `wp_slash` while importing sites.
|
66 |
|