Version Description
Download this release
Release Info
Developer | Nikschavan |
Plugin | Astra Starter Sites |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- admin/view-astra-sites.php +6 -54
- assets/js/admin.js +64 -11
- astra-sites.php +2 -2
- classes/class-astra-sites.php +13 -24
- importers/class-astra-site-options-import.php +80 -36
- languages/astra-sites.pot +39 -32
- readme.txt +30 -2
admin/view-astra-sites.php
CHANGED
@@ -11,12 +11,7 @@ defined( 'ABSPATH' ) or exit;
|
|
11 |
wp_enqueue_script( 'astra-sites-admin' );
|
12 |
wp_enqueue_style( 'astra-sites-admin' );
|
13 |
|
14 |
-
|
15 |
-
$all_demos = Astra_Sites::get_astra_all_demos();
|
16 |
-
|
17 |
-
do_action( 'astra_sites_before_site_grid', $all_demos );
|
18 |
-
|
19 |
-
if ( count( $all_demos ) > 0 ) {
|
20 |
|
21 |
/**
|
22 |
* Initial Demo List
|
@@ -53,45 +48,7 @@ if ( count( $all_demos ) > 0 ) {
|
|
53 |
<span class="spinner"></span>
|
54 |
|
55 |
<div class="theme-browser rendered">
|
56 |
-
<div class="themes wp-clearfix">
|
57 |
-
|
58 |
-
<?php foreach ( $all_demos as $key => $demo ) { ?>
|
59 |
-
|
60 |
-
<div class="theme astra-theme" tabindex="0" aria-describedby="astra-theme-action astra-theme-name"
|
61 |
-
data-demo-id="<?php echo esc_attr( $demo['id'] ); ?>"
|
62 |
-
data-demo-type="<?php echo esc_attr( $demo['astra_demo_type'] ); ?>"
|
63 |
-
data-demo-url="<?php echo esc_url( $demo['astra_demo_url'] ); ?>"
|
64 |
-
data-demo-api="<?php echo esc_url( $demo['demo_api'] ); ?>"
|
65 |
-
data-screenshot="<?php echo esc_url( $demo['featured_image_url'] ); ?>"
|
66 |
-
data-demo-name="<?php echo esc_attr( $demo['title'] ); ?>"
|
67 |
-
data-demo-slug="<?php echo esc_attr( $demo['slug'] ); ?>"
|
68 |
-
data-content="<?php echo esc_attr( $demo['content'] ); ?>"
|
69 |
-
data-required-plugins="<?php echo esc_attr( $demo['required_plugins'] ); ?>">
|
70 |
-
<input type="hidden" class="astra-site-options" value="<?php echo esc_attr( $demo['astra_site_options'] ); ?>" >
|
71 |
-
|
72 |
-
<?php if ( 'premium' === $demo['astra_demo_type'] ) { ?>
|
73 |
-
<span class="demo-type <?php echo esc_attr( $demo['astra_demo_type'] ); ?>"><?php echo esc_attr( $demo['astra_demo_type'] ); ?></span>
|
74 |
-
<?php } ?>
|
75 |
-
|
76 |
-
<div class="theme-screenshot">
|
77 |
-
<?php if ( ! empty( $demo['featured_image_url'] ) ) { ?>
|
78 |
-
<img src="<?php echo esc_attr( $demo['featured_image_url'] ); ?>" alt="">
|
79 |
-
<?php } ?>
|
80 |
-
</div>
|
81 |
-
|
82 |
-
<a href="<?php echo esc_url( $demo['astra_demo_url'] ); ?>" target="_blank">
|
83 |
-
<span class="more-details" id="astra-theme-action"><?php esc_html_e( 'Details & Preview', 'astra-sites' ); ?></span>
|
84 |
-
</a>
|
85 |
-
|
86 |
-
<h3 class="theme-name" id="astra-theme-name"><?php echo esc_attr( $demo['title'] ); ?></h3>
|
87 |
-
<div class="theme-actions">
|
88 |
-
<button class="button preview install-theme-preview"><?php esc_html_e( 'Preview', 'astra-sites' ); ?></button>
|
89 |
-
</div>
|
90 |
-
</div>
|
91 |
-
|
92 |
-
<?php } ?>
|
93 |
-
|
94 |
-
</div>
|
95 |
</div>
|
96 |
|
97 |
</div>
|
@@ -204,11 +161,7 @@ if ( count( $all_demos ) > 0 ) {
|
|
204 |
</div>
|
205 |
</script>
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
// Load demo importer welcome.
|
210 |
-
} else {
|
211 |
-
?>
|
212 |
<div class="no-themes">
|
213 |
<?php
|
214 |
|
@@ -222,10 +175,9 @@ if ( count( $all_demos ) > 0 ) {
|
|
222 |
/* translators: %1$s is a support link */
|
223 |
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/' ) );
|
224 |
?>
|
|
|
|
|
225 |
|
226 |
-
</div>
|
227 |
-
</p>
|
228 |
<?php
|
229 |
-
}// End if().
|
230 |
|
231 |
-
do_action( 'astra_sites_after_site_grid'
|
11 |
wp_enqueue_script( 'astra-sites-admin' );
|
12 |
wp_enqueue_style( 'astra-sites-admin' );
|
13 |
|
14 |
+
do_action( 'astra_sites_before_site_grid' );
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
/**
|
17 |
* Initial Demo List
|
48 |
<span class="spinner"></span>
|
49 |
|
50 |
<div class="theme-browser rendered">
|
51 |
+
<div class="themes wp-clearfix"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
</div>
|
53 |
|
54 |
</div>
|
161 |
</div>
|
162 |
</script>
|
163 |
|
164 |
+
<script type="text/template" id="tmpl-astra-no-demos">
|
|
|
|
|
|
|
|
|
165 |
<div class="no-themes">
|
166 |
<?php
|
167 |
|
175 |
/* translators: %1$s is a support link */
|
176 |
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/' ) );
|
177 |
?>
|
178 |
+
</div>
|
179 |
+
</script>
|
180 |
|
|
|
|
|
181 |
<?php
|
|
|
182 |
|
183 |
+
do_action( 'astra_sites_after_site_grid' );
|
assets/js/admin.js
CHANGED
@@ -1,7 +1,45 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
2 |
resetPagedCount();
|
|
|
|
|
3 |
});
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* Enable Demo Import Button.
|
7 |
*/
|
@@ -124,7 +162,7 @@ jQuery(document).on('click', '.next-theme', function (event) {
|
|
124 |
event.preventDefault();
|
125 |
currentDemo = jQuery('.theme-preview-on')
|
126 |
currentDemo.removeClass('theme-preview-on');
|
127 |
-
nextDemo = currentDemo.
|
128 |
nextDemo.addClass('theme-preview-on');
|
129 |
|
130 |
renderDemoPreview( nextDemo );
|
@@ -136,7 +174,7 @@ jQuery(document).on('click', '.previous-theme', function (event) {
|
|
136 |
|
137 |
currentDemo = jQuery('.theme-preview-on');
|
138 |
currentDemo.removeClass('theme-preview-on');
|
139 |
-
prevDemo = currentDemo.
|
140 |
prevDemo.addClass('theme-preview-on');
|
141 |
|
142 |
renderDemoPreview(prevDemo);
|
@@ -536,7 +574,7 @@ jQuery(document).on('click', '.filter-links li a', function (event) {
|
|
536 |
})
|
537 |
.fail(function () {
|
538 |
jQuery('body').removeClass('loading-content');
|
539 |
-
|
540 |
});
|
541 |
|
542 |
});
|
@@ -685,14 +723,29 @@ jQuery(document).on('click', '.astra-demo-import', function (event) {
|
|
685 |
})
|
686 |
.done(function ( demos ) {
|
687 |
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
})
|
697 |
.fail(function ( demos ) {
|
698 |
jQuery('.astra-demo-import').removeClass('updating-message installing').text('Error.');
|
1 |
jQuery(document).ready(function ($) {
|
2 |
resetPagedCount();
|
3 |
+
|
4 |
+
initial_load_demos();
|
5 |
});
|
6 |
|
7 |
+
function initial_load_demos() {
|
8 |
+
|
9 |
+
jQuery('body').addClass('loading-content');
|
10 |
+
|
11 |
+
jQuery.ajax({
|
12 |
+
url: astraDemo.ajaxurl,
|
13 |
+
type: 'POST',
|
14 |
+
dataType: 'json',
|
15 |
+
data: {
|
16 |
+
action : 'astra-list-sites',
|
17 |
+
category : 'all',
|
18 |
+
id : 'all',
|
19 |
+
paged : '1',
|
20 |
+
},
|
21 |
+
})
|
22 |
+
.done(function (demos) {
|
23 |
+
jQuery('body').removeClass('loading-content');
|
24 |
+
|
25 |
+
// Has sites?
|
26 |
+
if( demos.length ) {
|
27 |
+
renderDemoGrid( demos );
|
28 |
+
|
29 |
+
// Something is wrong in API request.
|
30 |
+
} else {
|
31 |
+
var template = wp.template('astra-no-demos');
|
32 |
+
|
33 |
+
jQuery('.themes').append( template );
|
34 |
+
}
|
35 |
+
})
|
36 |
+
.fail(function () {
|
37 |
+
jQuery('body').removeClass('loading-content');
|
38 |
+
jQuery('.spinner').after('<p class="no-themes" style="display:block;">'+astraDemo.strings.responseError+'</p>');
|
39 |
+
});
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
/**
|
44 |
* Enable Demo Import Button.
|
45 |
*/
|
162 |
event.preventDefault();
|
163 |
currentDemo = jQuery('.theme-preview-on')
|
164 |
currentDemo.removeClass('theme-preview-on');
|
165 |
+
nextDemo = currentDemo.next('.theme');
|
166 |
nextDemo.addClass('theme-preview-on');
|
167 |
|
168 |
renderDemoPreview( nextDemo );
|
174 |
|
175 |
currentDemo = jQuery('.theme-preview-on');
|
176 |
currentDemo.removeClass('theme-preview-on');
|
177 |
+
prevDemo = currentDemo.prev('.theme');
|
178 |
prevDemo.addClass('theme-preview-on');
|
179 |
|
180 |
renderDemoPreview(prevDemo);
|
574 |
})
|
575 |
.fail(function () {
|
576 |
jQuery('body').removeClass('loading-content');
|
577 |
+
jQuery('.spinner').after('<p class="no-themes" style="display:block;">'+astraDemo.strings.responseError+'</p>');
|
578 |
});
|
579 |
|
580 |
});
|
723 |
})
|
724 |
.done(function ( demos ) {
|
725 |
|
726 |
+
if( demos.success ) {
|
727 |
+
jQuery('.astra-demo-import').removeClass('updating-message installing')
|
728 |
+
.removeAttr('data-import')
|
729 |
+
.addClass('view-site')
|
730 |
+
.removeClass('astra-demo-import')
|
731 |
+
.text( astraDemo.strings.viewSite )
|
732 |
+
.attr('target', '_blank')
|
733 |
+
.append('<i class="dashicons dashicons-external"></i>')
|
734 |
+
.attr('href', astraDemo.siteURL );
|
735 |
+
} else {
|
736 |
+
|
737 |
+
jQuery('.astra-demo-import').removeClass('updating-message installing')
|
738 |
+
.removeAttr('data-import')
|
739 |
+
.addClass('view-site')
|
740 |
+
.removeClass('astra-demo-import')
|
741 |
+
.attr('target', '_blank')
|
742 |
+
.attr('href', astraDemo.strings.importFailedURL );
|
743 |
+
|
744 |
+
jQuery('.wp-full-overlay-header .view-site').text( astraDemo.strings.importFailedBtnSmall ).append('<i class="dashicons dashicons-external"></i>');
|
745 |
+
jQuery('.footer-import-button-wrap .view-site').text( astraDemo.strings.importFailedBtnLarge ).append('<i class="dashicons dashicons-external"></i>');
|
746 |
+
|
747 |
+
}
|
748 |
+
|
749 |
})
|
750 |
.fail(function ( demos ) {
|
751 |
jQuery('.astra-demo-import').removeClass('updating-message installing').text('Error.');
|
astra-sites.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Astra Sites
|
4 |
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
* Description: Import sites build with Astra theme.
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: http://www.brainstormforce.com
|
9 |
* Text Domain: astra-sites
|
@@ -14,7 +14,7 @@
|
|
14 |
/**
|
15 |
* Set constants.
|
16 |
*/
|
17 |
-
define( 'ASTRA_SITES_VER', '1.0.
|
18 |
define( 'ASTRA_SITES_FILE', __FILE__ );
|
19 |
define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
|
20 |
define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
|
3 |
* Plugin Name: Astra Sites
|
4 |
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
* Description: Import sites build with Astra theme.
|
6 |
+
* Version: 1.0.2
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: http://www.brainstormforce.com
|
9 |
* Text Domain: astra-sites
|
14 |
/**
|
15 |
* Set constants.
|
16 |
*/
|
17 |
+
define( 'ASTRA_SITES_VER', '1.0.2' );
|
18 |
define( 'ASTRA_SITES_FILE', __FILE__ );
|
19 |
define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
|
20 |
define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
|
classes/class-astra-sites.php
CHANGED
@@ -204,15 +204,18 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
204 |
'_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
|
205 |
'requiredPluginsCount' => 0,
|
206 |
'strings' => array(
|
207 |
-
'
|
208 |
-
'
|
209 |
-
'
|
210 |
-
'
|
211 |
-
'
|
212 |
-
'
|
213 |
-
'
|
214 |
-
'
|
215 |
-
'
|
|
|
|
|
|
|
216 |
),
|
217 |
)
|
218 |
);
|
@@ -403,7 +406,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
403 |
$demo_api_uri = isset( $_POST['api_url'] ) ? esc_url( $_POST['api_url'] ) : '';
|
404 |
$this->import_demo( $demo_api_uri );
|
405 |
|
406 |
-
|
407 |
}
|
408 |
|
409 |
/**
|
@@ -427,20 +430,6 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
|
|
427 |
return wp_send_json( self::get_astra_demos( $args, $paged ) );
|
428 |
}
|
429 |
|
430 |
-
/**
|
431 |
-
* Get the list of demos.
|
432 |
-
*
|
433 |
-
* @since 1.0.0
|
434 |
-
* @see admin/view-astra-sites.php
|
435 |
-
* @return (Array) Demos.
|
436 |
-
*/
|
437 |
-
public static function get_astra_all_demos() {
|
438 |
-
$args = new stdClass();
|
439 |
-
$args->id = 'all';
|
440 |
-
|
441 |
-
return self::get_astra_demos( $args );
|
442 |
-
}
|
443 |
-
|
444 |
/**
|
445 |
* Import the demo.
|
446 |
*
|
204 |
'_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
|
205 |
'requiredPluginsCount' => 0,
|
206 |
'strings' => array(
|
207 |
+
'importFailedBtnSmall' => __( 'Error!', 'astra-sites' ),
|
208 |
+
'importFailedBtnLarge' => __( 'Error! Read Possibilities.', 'astra-sites' ),
|
209 |
+
'importFailedURL' => esc_url( 'https://wpastra.com/docs/?p=1314' ),
|
210 |
+
'viewSite' => __( 'Done! View Site', 'astra-sites' ),
|
211 |
+
'btnActivating' => __( 'Activating', 'astra-sites' ) . '…',
|
212 |
+
'btnActive' => __( 'Active', 'astra-sites' ),
|
213 |
+
'importDemo' => __( 'Import This Site', 'astra-sites' ),
|
214 |
+
'DescExpand' => __( 'Read more', 'astra-sites' ) . '…',
|
215 |
+
'DescCollapse' => __( 'Hide', 'astra-sites' ),
|
216 |
+
'responseError' => __( 'There was a problem receiving a response from server.', 'astra-sites' ),
|
217 |
+
'searchNoFound' => __( 'No Demos found, Try a different search.', 'astra-sites' ),
|
218 |
+
'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' ),
|
219 |
),
|
220 |
)
|
221 |
);
|
406 |
$demo_api_uri = isset( $_POST['api_url'] ) ? esc_url( $_POST['api_url'] ) : '';
|
407 |
$this->import_demo( $demo_api_uri );
|
408 |
|
409 |
+
wp_send_json_success( 'success' );
|
410 |
}
|
411 |
|
412 |
/**
|
430 |
return wp_send_json( self::get_astra_demos( $args, $paged ) );
|
431 |
}
|
432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
/**
|
434 |
* Import the demo.
|
435 |
*
|
importers/class-astra-site-options-import.php
CHANGED
@@ -37,55 +37,99 @@ class Astra_Site_Options_Import {
|
|
37 |
return self::$_instance;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Import site options.
|
42 |
*
|
|
|
|
|
43 |
* @since 1.0.0
|
44 |
*
|
45 |
* @param (Array) $options Array of site options to be imported from the demo.
|
46 |
*/
|
47 |
public function import_options( $options ) {
|
48 |
|
49 |
-
|
50 |
-
if ( isset( $options['show_on_front'] ) ) {
|
51 |
-
update_option( 'show_on_front', $options['show_on_front'] );
|
52 |
-
}
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
$page_on_front = get_page_by_title( $options['page_on_front'] );
|
57 |
-
if ( is_object( $page_on_front ) ) {
|
58 |
-
update_option( 'page_on_front', $page_on_front->ID );
|
59 |
-
}
|
60 |
-
}
|
61 |
|
62 |
-
|
63 |
-
if ( isset( $options['page_for_posts'] ) ) {
|
64 |
-
$page_for_posts = get_page_by_title( $options['page_for_posts'] );
|
65 |
-
if ( is_object( $page_for_posts ) ) {
|
66 |
-
update_option( 'page_for_posts', $page_for_posts->ID );
|
67 |
-
}
|
68 |
-
}
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
}
|
91 |
|
@@ -97,7 +141,7 @@ class Astra_Site_Options_Import {
|
|
97 |
* @since 1.0.0
|
98 |
* @param array $nav_menu_locations Array of nav menu locations.
|
99 |
*/
|
100 |
-
function set_nav_menu_locations( $nav_menu_locations = array() ) {
|
101 |
|
102 |
$menu_locations = array();
|
103 |
|
@@ -125,7 +169,7 @@ class Astra_Site_Options_Import {
|
|
125 |
* @param string $image_url Logo URL.
|
126 |
* @return void
|
127 |
*/
|
128 |
-
function insert_logo( $image_url = '' ) {
|
129 |
|
130 |
// Download Site Logo Image.
|
131 |
$response = Astra_Sites_Helper::download_file( $image_url );
|
37 |
return self::$_instance;
|
38 |
}
|
39 |
|
40 |
+
/**
|
41 |
+
* Site Options
|
42 |
+
*
|
43 |
+
* @since 1.0.2
|
44 |
+
*
|
45 |
+
* @return array List of defined array.
|
46 |
+
*/
|
47 |
+
private static function site_options() {
|
48 |
+
return array(
|
49 |
+
'custom_logo',
|
50 |
+
'nav_menu_locations',
|
51 |
+
'show_on_front',
|
52 |
+
'page_on_front',
|
53 |
+
'page_for_posts',
|
54 |
+
|
55 |
+
// Plugin Name: SiteOrigin Widgets Bundle.
|
56 |
+
'siteorigin_widgets_active',
|
57 |
+
|
58 |
+
// Plugin Name: Elementor.
|
59 |
+
'elementor_container_width',
|
60 |
+
'elementor_cpt_support',
|
61 |
+
'elementor_css_print_method',
|
62 |
+
'elementor_default_generic_fonts',
|
63 |
+
'elementor_disable_color_schemes',
|
64 |
+
'elementor_disable_typography_schemes',
|
65 |
+
'elementor_editor_break_lines',
|
66 |
+
'elementor_exclude_user_roles',
|
67 |
+
'elementor_global_image_lightbox',
|
68 |
+
'elementor_page_title_selector',
|
69 |
+
'elementor_scheme_color',
|
70 |
+
'elementor_scheme_color-picker',
|
71 |
+
'elementor_scheme_typography',
|
72 |
+
'elementor_space_between_widgets',
|
73 |
+
'elementor_stretched_section_container',
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
/**
|
78 |
* Import site options.
|
79 |
*
|
80 |
+
* @since 1.0.2 Updated option if exist in defined option array 'site_options()'.
|
81 |
+
*
|
82 |
* @since 1.0.0
|
83 |
*
|
84 |
* @param (Array) $options Array of site options to be imported from the demo.
|
85 |
*/
|
86 |
public function import_options( $options ) {
|
87 |
|
88 |
+
foreach ( $options as $option_name => $option_value ) {
|
|
|
|
|
|
|
89 |
|
90 |
+
// Is option exist in defined array site_options()?
|
91 |
+
if ( in_array( $option_name, self::site_options() ) ) {
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
+
switch ( $option_name ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
+
// page on front.
|
96 |
+
// page on front.
|
97 |
+
case 'page_for_posts':
|
98 |
+
case 'page_on_front':
|
99 |
+
$this->update_page_id_by_option_value( $option_name, $option_value );
|
100 |
+
break;
|
101 |
|
102 |
+
// nav menu locations.
|
103 |
+
case 'nav_menu_locations':
|
104 |
+
$this->set_nav_menu_locations( $option_value );
|
105 |
+
break;
|
106 |
|
107 |
+
// insert logo.
|
108 |
+
case 'custom_logo':
|
109 |
+
$this->insert_logo( $option_value );
|
110 |
+
break;
|
111 |
+
|
112 |
+
default:
|
113 |
+
update_option( $option_name, $option_value );
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
}
|
117 |
}
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Update Page ID
|
122 |
+
*
|
123 |
+
* @since 1.0.2
|
124 |
+
*
|
125 |
+
* @param string $option_name Option name.
|
126 |
+
* @param mixed $option_value Option value.
|
127 |
+
* @return void
|
128 |
+
*/
|
129 |
+
private function update_page_id_by_option_value( $option_name, $option_value ) {
|
130 |
+
$page = get_page_by_title( $option_value );
|
131 |
+
if ( is_object( $page ) ) {
|
132 |
+
update_option( $option_name, $page->ID );
|
133 |
}
|
134 |
}
|
135 |
|
141 |
* @since 1.0.0
|
142 |
* @param array $nav_menu_locations Array of nav menu locations.
|
143 |
*/
|
144 |
+
private function set_nav_menu_locations( $nav_menu_locations = array() ) {
|
145 |
|
146 |
$menu_locations = array();
|
147 |
|
169 |
* @param string $image_url Logo URL.
|
170 |
* @return void
|
171 |
*/
|
172 |
+
private function insert_logo( $image_url = '' ) {
|
173 |
|
174 |
// Download Site Logo Image.
|
175 |
$response = Astra_Sites_Helper::download_file( $image_url );
|
languages/astra-sites.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Astra Sites package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Astra Sites 1.0.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
7 |
-
"POT-Creation-Date: 2017-08-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -28,76 +28,75 @@ msgstr ""
|
|
28 |
msgid "Astra Sites"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: admin/view-astra-sites.php:
|
32 |
msgid "All"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: admin/view-astra-sites.php:
|
36 |
msgid "Search Sites"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: admin/view-astra-sites.php:
|
40 |
msgid "Search Sites..."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: admin/view-astra-sites.php:
|
44 |
msgid "Details & Preview"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: admin/view-astra-sites.php:
|
48 |
-
#: admin/view-astra-sites.php:202
|
49 |
msgid "Preview"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: admin/view-astra-sites.php:
|
53 |
msgid "Close"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: admin/view-astra-sites.php:
|
57 |
msgid "Previous"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: admin/view-astra-sites.php:
|
61 |
msgid "Next"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: admin/view-astra-sites.php:
|
65 |
msgid "Install Plugins"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: admin/view-astra-sites.php:
|
69 |
msgid "Read more"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: admin/view-astra-sites.php:
|
73 |
msgid "Required Plugins"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: admin/view-astra-sites.php:
|
77 |
msgid "Collapse"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: admin/view-astra-sites.php:
|
81 |
#. translators: %1$s & %2$s are a Demo API URL
|
82 |
msgid ""
|
83 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
84 |
"unreachable from your site.</p>"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: admin/view-astra-sites.php:
|
88 |
msgid ""
|
89 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
90 |
"temporary issues. No kidding!</p>"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin/view-astra-sites.php:
|
94 |
msgid ""
|
95 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
96 |
"to your server administrator and check if demo server is being blocked by "
|
97 |
"the firewall!</p>"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: admin/view-astra-sites.php:
|
101 |
#. translators: %1$s is a support link
|
102 |
msgid ""
|
103 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
@@ -105,50 +104,58 @@ msgid ""
|
|
105 |
"for you.</p>"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: classes/class-astra-sites.php:
|
109 |
#. translators: 1: theme.php file
|
110 |
msgid ""
|
111 |
"Astra Theme needs to be active for you to use currently installed \"Astra "
|
112 |
"Sites\" plugin. <a href=\"%1$s\">Install & Activate Now</a>"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: classes/class-astra-sites.php:
|
116 |
msgid "See Library"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: classes/class-astra-sites.php:
|
120 |
msgid "Purchase"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: classes/class-astra-sites.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
msgid "Done! View Site"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: classes/class-astra-sites.php:
|
128 |
msgid "Activating"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: classes/class-astra-sites.php:
|
132 |
msgid "Active"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: classes/class-astra-sites.php:
|
136 |
msgid "Import This Site"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: classes/class-astra-sites.php:
|
140 |
msgid "Hide"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: classes/class-astra-sites.php:
|
144 |
msgid "There was a problem receiving a response from server."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: classes/class-astra-sites.php:
|
148 |
msgid "No Demos found, Try a different search."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: classes/class-astra-sites.php:
|
152 |
msgid ""
|
153 |
"Executing Demo Import will make your site similar as ours. Please bear in "
|
154 |
"mind -\n"
|
@@ -162,11 +169,11 @@ msgid ""
|
|
162 |
"placeholders."
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: classes/class-astra-sites.php:
|
166 |
msgid "No plugin specified"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: classes/class-astra-sites.php:
|
170 |
msgid "Plugin Successfully Activated"
|
171 |
msgstr ""
|
172 |
|
2 |
# This file is distributed under the same license as the Astra Sites package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Astra Sites 1.0.2\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-sites\n"
|
7 |
+
"POT-Creation-Date: 2017-08-09 14:51:40+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
28 |
msgid "Astra Sites"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: admin/view-astra-sites.php:28
|
32 |
msgid "All"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: admin/view-astra-sites.php:42
|
36 |
msgid "Search Sites"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: admin/view-astra-sites.php:43
|
40 |
msgid "Search Sites..."
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: admin/view-astra-sites.php:85
|
44 |
msgid "Details & Preview"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: admin/view-astra-sites.php:91 admin/view-astra-sites.php:159
|
|
|
48 |
msgid "Preview"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: admin/view-astra-sites.php:117
|
52 |
msgid "Close"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: admin/view-astra-sites.php:118
|
56 |
msgid "Previous"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: admin/view-astra-sites.php:119
|
60 |
msgid "Next"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: admin/view-astra-sites.php:120 admin/view-astra-sites.php:148
|
64 |
msgid "Install Plugins"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: admin/view-astra-sites.php:136 classes/class-astra-sites.php:214
|
68 |
msgid "Read more"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: admin/view-astra-sites.php:139
|
72 |
msgid "Required Plugins"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: admin/view-astra-sites.php:154
|
76 |
msgid "Collapse"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: admin/view-astra-sites.php:169
|
80 |
#. translators: %1$s & %2$s are a Demo API URL
|
81 |
msgid ""
|
82 |
"<p> It seems the demo data server, <i><a href=\"%1$s\">%2$s</a></i> is "
|
83 |
"unreachable from your site.</p>"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: admin/view-astra-sites.php:171
|
87 |
msgid ""
|
88 |
"<p class=\"left-margin\"> 1. Sometimes, simple page reload fixes any "
|
89 |
"temporary issues. No kidding!</p>"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: admin/view-astra-sites.php:173
|
93 |
msgid ""
|
94 |
"<p class=\"left-margin\"> 2. If that does not work, you will need to talk "
|
95 |
"to your server administrator and check if demo server is being blocked by "
|
96 |
"the firewall!</p>"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: admin/view-astra-sites.php:176
|
100 |
#. translators: %1$s is a support link
|
101 |
msgid ""
|
102 |
"<p>If that does not help, please open up a <a href=\"%1$s\" "
|
104 |
"for you.</p>"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: classes/class-astra-sites.php:95
|
108 |
#. translators: 1: theme.php file
|
109 |
msgid ""
|
110 |
"Astra Theme needs to be active for you to use currently installed \"Astra "
|
111 |
"Sites\" plugin. <a href=\"%1$s\">Install & Activate Now</a>"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: classes/class-astra-sites.php:116
|
115 |
msgid "See Library"
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: classes/class-astra-sites.php:202
|
119 |
msgid "Purchase"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: classes/class-astra-sites.php:207
|
123 |
+
msgid "Error!"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: classes/class-astra-sites.php:208
|
127 |
+
msgid "Error! Read Possibilities."
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: classes/class-astra-sites.php:210
|
131 |
msgid "Done! View Site"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: classes/class-astra-sites.php:211
|
135 |
msgid "Activating"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: classes/class-astra-sites.php:212
|
139 |
msgid "Active"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: classes/class-astra-sites.php:213
|
143 |
msgid "Import This Site"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: classes/class-astra-sites.php:215
|
147 |
msgid "Hide"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: classes/class-astra-sites.php:216
|
151 |
msgid "There was a problem receiving a response from server."
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: classes/class-astra-sites.php:217
|
155 |
msgid "No Demos found, Try a different search."
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: classes/class-astra-sites.php:218
|
159 |
msgid ""
|
160 |
"Executing Demo Import will make your site similar as ours. Please bear in "
|
161 |
"mind -\n"
|
169 |
"placeholders."
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: classes/class-astra-sites.php:254
|
173 |
msgid "No plugin specified"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: classes/class-astra-sites.php:279
|
177 |
msgid "Plugin Successfully Activated"
|
178 |
msgstr ""
|
179 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpastra.com/pro/
|
|
4 |
Tags: demo, theme demos, one click import
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 4.8.1
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,7 +12,26 @@ Import Astra sites with just one click.
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
== Installation ==
|
18 |
|
@@ -20,8 +39,17 @@ Import Astra sites with just one click.
|
|
20 |
1. Activate the plugin through the 'Plugins' screen in WordPress
|
21 |
1. Use the Appearance->Astra-> Astra Sites to select the page to be displayed as header and footer.
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
== Changelog ==
|
24 |
|
|
|
|
|
|
|
|
|
25 |
v1.0.1 - 04-Aug-2017
|
26 |
* New: Added Elementor plugin options support.
|
27 |
* New: Added Customizer CSS support.
|
4 |
Tags: demo, theme demos, one click import
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 4.8.1
|
7 |
+
Stable tag: 1.0.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
This plugin is an add-on for the Astra WordPress Theme. It offers a library of ready sites that can be imported for your website easily. Here is how it works:
|
16 |
+
|
17 |
+
1. Browse through the library of ready sites right from your WordPress backend.
|
18 |
+
2. Pick a site you like.
|
19 |
+
3. Install required plugins in one click
|
20 |
+
4. Import the site data.
|
21 |
+
5. Done!
|
22 |
+
|
23 |
+
Use this imported site as a base for your project and don't waste time starting from scratch.
|
24 |
+
|
25 |
+
Some of the currently available sites for import:
|
26 |
+
|
27 |
+
https://sites.wpastra.com/gardener-free/
|
28 |
+
https://sites.wpastra.com/hotel-free/
|
29 |
+
https://sites.wpastra.com/agency-free/
|
30 |
+
https://sites.wpastra.com/restaurant-free/
|
31 |
+
https://sites.wpastra.com/construction-free/
|
32 |
+
https://sites.wpastra.com/makeup-artist-free/
|
33 |
+
https://sites.wpastra.com/electrician-free
|
34 |
+
https://sites.wpastra.com/law-free/
|
35 |
|
36 |
== Installation ==
|
37 |
|
39 |
1. Activate the plugin through the 'Plugins' screen in WordPress
|
40 |
1. Use the Appearance->Astra-> Astra Sites to select the page to be displayed as header and footer.
|
41 |
|
42 |
+
== Screenshots ==
|
43 |
+
1. Select the demo you want to import.
|
44 |
+
1. Install and activate the required plugins.
|
45 |
+
1. Import the demo.
|
46 |
+
|
47 |
== Changelog ==
|
48 |
|
49 |
+
v1.0.2 - 09-Aug-2017
|
50 |
+
* Fix: Listing appropriate next and previous Astra sites.
|
51 |
+
* Enhancement: Listing Astra sites though AJAX API call.
|
52 |
+
|
53 |
v1.0.1 - 04-Aug-2017
|
54 |
* New: Added Elementor plugin options support.
|
55 |
* New: Added Customizer CSS support.
|