Advanced Import : One Click Import for WordPress or Theme Demo Data - Version 1.2.0

Version Description

  • 2020-03-12 =
  • Added : Premium demo support
  • Added : Readme documentation
  • Added : Extra layer of security
  • Updated : Example File
Download this release

Release Info

Developer addonspress
Plugin Icon 128x128 Advanced Import : One Click Import for WordPress or Theme Demo Data
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.0.8 to 1.2.0

admin/class-advanced-import-admin.php CHANGED
@@ -409,7 +409,7 @@ class Advanced_Import_Admin {
409
  */
410
  function upload_zip() {
411
  if ( isset( $_FILES[ 'ai-upload-zip-archive' ][ 'name' ] ) && ! empty( $_FILES[ 'ai-upload-zip-archive' ][ 'name' ] ) ) {
412
- /*check for security*/
413
  if ( ! current_user_can( 'upload_files' ) ) {
414
  wp_send_json_error(
415
  array(
@@ -482,6 +482,7 @@ class Advanced_Import_Admin {
482
  * @return mixed
483
  */
484
  function demo_download_and_unzip() {
 
485
  /*check for security*/
486
  if ( ! current_user_can( 'upload_files' ) ) {
487
  wp_send_json_error(
@@ -730,31 +731,35 @@ class Advanced_Import_Admin {
730
  foreach ( $demo_lists as $key => $demo_list ){
731
 
732
  /*Check for required fields*/
733
- if( !isset( $demo_list['title'] ) || !isset( $demo_list['template_url'] ) || !isset( $demo_list['screenshot_url'] ) || !isset( $demo_list['demo_url']) ){
734
  continue;
735
  }
736
 
737
- $template_url = $demo_list['template_url'];
738
  if( is_array( $template_url )){
739
  $data_template = 'data-template_url="'.esc_attr(json_encode($template_url)).'"';
740
  $data_template_type = 'data-template_type="array"';
 
 
 
 
 
 
 
 
 
741
  }
742
  else{
743
- $data_template = 'data-template_url="'.esc_attr($template_url).'"';
744
- if ( is_file( $template_url ) && filesize( $template_url ) > 0 ) {
745
- $data_template_type = 'data-template_type="file"';
746
- }
747
- else{
748
- $data_template_type = 'data-template_type="url"';
749
- }
750
  }
751
  ?>
752
  <div aria-label="<?php echo esc_attr( $demo_list['title'])?>"
753
- class="<?php
754
- echo isset( $demo_list['categories'] )?esc_attr(implode(" ",$demo_list['categories'])):'';?>
755
- ai-item <?php echo isset( $demo_list['type'] )?esc_attr($demo_list['type']):'';?>"
756
- <?php echo $data_template.' '.$data_template_type;?>
757
- <?php echo $this->is_template_available($demo_list)?'':'ai-pro-item'?>
758
  >
759
  <?php
760
  wp_nonce_field( 'advanced-import' );
@@ -875,6 +880,15 @@ class Advanced_Import_Admin {
875
  */
876
  public function plugin_screen() {
877
 
 
 
 
 
 
 
 
 
 
878
  check_admin_referer( 'advanced-import' );
879
 
880
  /*delete_transient(); for safety*/
@@ -1023,6 +1037,15 @@ class Advanced_Import_Admin {
1023
  * Page setup
1024
  */
1025
  public function content_screen() {
 
 
 
 
 
 
 
 
 
1026
  check_admin_referer( 'advanced-import' );
1027
 
1028
  $this->current_template_url = is_array( $_POST['template_url'] )? (array) $_POST['template_url'] : sanitize_text_field( $_POST['template_url'] );
@@ -1083,13 +1106,25 @@ class Advanced_Import_Admin {
1083
  * return JSON
1084
  */
1085
  public function import_content() {
 
 
 
 
 
 
 
 
 
 
1086
  $this->current_template_url = is_array( $_POST['template_url'] )? (array) $_POST['template_url'] : sanitize_text_field( $_POST['template_url'] );
1087
  $this->current_template_type = sanitize_text_field ( $_POST['template_type'] );
1088
 
1089
  $content_slug = isset( $_POST['content'] )? sanitize_title( $_POST['content'] ): '';
1090
 
1091
  $content = $this->advanced_import_setup_content_steps();
1092
- if ( ! check_ajax_referer( 'advanced_import_nonce', 'wpnonce' ) || empty( $content_slug ) || !isset( $content[ $content_slug ] ) ) {
 
 
1093
  wp_send_json_error(
1094
  array(
1095
  'error' => 1,
@@ -2140,6 +2175,16 @@ class Advanced_Import_Admin {
2140
  * Show Completed Message
2141
  * */
2142
  public function complete_screen() {
 
 
 
 
 
 
 
 
 
 
2143
  require_once( ABSPATH . 'wp-admin/includes/file.php' );
2144
  WP_Filesystem();
2145
  global $wp_filesystem;
@@ -2165,9 +2210,18 @@ class Advanced_Import_Admin {
2165
  exit;
2166
  }
2167
 
2168
- /*test*/
2169
 
 
 
 
2170
  function install_plugin() {
 
 
 
 
 
 
 
2171
  if ( empty( $_POST['plugin'] ) || empty( $_POST['slug'] ) ) {
2172
  wp_send_json_error(
2173
  array(
@@ -2191,11 +2245,6 @@ class Advanced_Import_Admin {
2191
  'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
2192
  );
2193
 
2194
- if ( ! current_user_can( 'install_plugins' ) ) {
2195
- $status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.', 'advanced-import' );
2196
- wp_send_json_error( $status );
2197
- }
2198
-
2199
  include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
2200
  include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
2201
 
409
  */
410
  function upload_zip() {
411
  if ( isset( $_FILES[ 'ai-upload-zip-archive' ][ 'name' ] ) && ! empty( $_FILES[ 'ai-upload-zip-archive' ][ 'name' ] ) ) {
412
+ /*check for security*/
413
  if ( ! current_user_can( 'upload_files' ) ) {
414
  wp_send_json_error(
415
  array(
482
  * @return mixed
483
  */
484
  function demo_download_and_unzip() {
485
+
486
  /*check for security*/
487
  if ( ! current_user_can( 'upload_files' ) ) {
488
  wp_send_json_error(
731
  foreach ( $demo_lists as $key => $demo_list ){
732
 
733
  /*Check for required fields*/
734
+ if( !isset( $demo_list['title'] ) || !isset( $demo_list['screenshot_url'] ) || !isset( $demo_list['demo_url']) ){
735
  continue;
736
  }
737
 
738
+ $template_url = isset( $demo_list['template_url'] )?$demo_list['template_url']:'';
739
  if( is_array( $template_url )){
740
  $data_template = 'data-template_url="'.esc_attr(json_encode($template_url)).'"';
741
  $data_template_type = 'data-template_type="array"';
742
+ }
743
+ elseif ($template_url){
744
+ $data_template = 'data-template_url="'.esc_attr($template_url).'"';
745
+ if ( is_file( $template_url ) && filesize( $template_url ) > 0 ) {
746
+ $data_template_type = 'data-template_type="file"';
747
+ }
748
+ else{
749
+ $data_template_type = 'data-template_type="url"';
750
+ }
751
  }
752
  else{
753
+ $data_template = 'data-template_url="'.esc_attr(json_encode($template_url)).'"';
754
+ $data_template_type = 'data-template_type="array"';
 
 
 
 
 
755
  }
756
  ?>
757
  <div aria-label="<?php echo esc_attr( $demo_list['title'])?>"
758
+ class="ai-item <?php
759
+ echo isset( $demo_list['categories'] )?esc_attr(implode(" ",$demo_list['categories'])):'';
760
+ echo isset( $demo_list['type'] )?' '.esc_attr($demo_list['type']):'';
761
+ echo $this->is_template_available($demo_list)?'':' ai-pro-item'?>"
762
+ <?php echo $this->is_template_available($demo_list)?$data_template.' '.$data_template_type:'';?>
763
  >
764
  <?php
765
  wp_nonce_field( 'advanced-import' );
880
  */
881
  public function plugin_screen() {
882
 
883
+ /*check for security*/
884
+ if ( ! current_user_can( 'upload_files' ) ) {
885
+ wp_send_json_error(
886
+ array(
887
+ 'message' => esc_html__( 'Sorry, you are not allowed to install demo on this site.','advanced-import' )
888
+ )
889
+ );
890
+ }
891
+
892
  check_admin_referer( 'advanced-import' );
893
 
894
  /*delete_transient(); for safety*/
1037
  * Page setup
1038
  */
1039
  public function content_screen() {
1040
+
1041
+ /*check for security*/
1042
+ if ( ! current_user_can( 'upload_files' ) ) {
1043
+ wp_send_json_error(
1044
+ array(
1045
+ 'message' => esc_html__( 'Sorry, you are not allowed to install demo on this site.','advanced-import' )
1046
+ )
1047
+ );
1048
+ }
1049
  check_admin_referer( 'advanced-import' );
1050
 
1051
  $this->current_template_url = is_array( $_POST['template_url'] )? (array) $_POST['template_url'] : sanitize_text_field( $_POST['template_url'] );
1106
  * return JSON
1107
  */
1108
  public function import_content() {
1109
+
1110
+ /*check for security*/
1111
+ if ( ! current_user_can( 'upload_files' ) ) {
1112
+ wp_send_json_error(
1113
+ array(
1114
+ 'message' => esc_html__( 'Sorry, you are not allowed to install demo on this site.','advanced-import' )
1115
+ )
1116
+ );
1117
+ }
1118
+
1119
  $this->current_template_url = is_array( $_POST['template_url'] )? (array) $_POST['template_url'] : sanitize_text_field( $_POST['template_url'] );
1120
  $this->current_template_type = sanitize_text_field ( $_POST['template_type'] );
1121
 
1122
  $content_slug = isset( $_POST['content'] )? sanitize_title( $_POST['content'] ): '';
1123
 
1124
  $content = $this->advanced_import_setup_content_steps();
1125
+
1126
+ /*check for security again*/
1127
+ if ( ! check_ajax_referer( 'advanced_import_nonce', 'wpnonce' ) || empty( $content_slug ) || !isset( $content[ $content_slug ] ) ) {
1128
  wp_send_json_error(
1129
  array(
1130
  'error' => 1,
2175
  * Show Completed Message
2176
  * */
2177
  public function complete_screen() {
2178
+
2179
+ /*check for security*/
2180
+ if ( ! current_user_can( 'upload_files' ) ) {
2181
+ wp_send_json_error(
2182
+ array(
2183
+ 'message' => esc_html__( 'Sorry, you are not allowed to install demo on this site.','advanced-import' )
2184
+ )
2185
+ );
2186
+ }
2187
+
2188
  require_once( ABSPATH . 'wp-admin/includes/file.php' );
2189
  WP_Filesystem();
2190
  global $wp_filesystem;
2210
  exit;
2211
  }
2212
 
 
2213
 
2214
+ /* callback function for wp_ajax_install_plugin
2215
+ * Install plugin
2216
+ * */
2217
  function install_plugin() {
2218
+
2219
+ /*check for security*/
2220
+ if ( ! current_user_can( 'install_plugins' ) ) {
2221
+ $status['errorMessage'] = __( 'Sorry, you are not allowed to install plugins on this site.', 'advanced-import' );
2222
+ wp_send_json_error( $status );
2223
+ }
2224
+
2225
  if ( empty( $_POST['plugin'] ) || empty( $_POST['slug'] ) ) {
2226
  wp_send_json_error(
2227
  array(
2245
  'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
2246
  );
2247
 
 
 
 
 
 
2248
  include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
2249
  include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
2250
 
admin/class-reset.php CHANGED
@@ -53,7 +53,8 @@ class Advanced_Import_Reset_WordPress {
53
  */
54
  public function hide_reset_notice() {
55
  if ( isset( $_GET['advanced-import-hide-notice'] ) && isset( $_GET['_advanced_import_notice_nonce'] ) ) {
56
- if ( ! wp_verify_nonce( $_GET['_advanced_import_notice_nonce'], 'advanced_import_hide_notice_nonce' ) ) {
 
57
  wp_die( __( 'Action failed. Please refresh the page and retry.', 'advanced-import' ) );
58
  }
59
 
@@ -76,12 +77,14 @@ class Advanced_Import_Reset_WordPress {
76
  global $wpdb, $current_user;
77
 
78
  if ( ! empty( $_GET['ai_reset_wordpress'] ) && !empty($_GET['ai_reset_wordpress_nonce'] )) {
 
79
  if ( ! wp_verify_nonce( wp_unslash( $_GET['ai_reset_wordpress_nonce'] ), 'ai_reset_wordpress' ) ) { // WPCS: input var ok, sanitization ok.
80
  wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'advanced-import' ) );
81
  }
82
  if ( ! current_user_can( 'manage_options' ) ) {
83
  wp_die( esc_html__( 'No permission to reset WordPress', 'advanced-import' ) );
84
  }
 
85
  require_once ABSPATH . '/wp-admin/includes/upgrade.php';
86
 
87
  $template = get_option( 'template' );
@@ -154,7 +157,6 @@ class Advanced_Import_Reset_WordPress {
154
  */
155
  public function reset_wizard_notice() {
156
 
157
-
158
  $screen = get_current_screen();
159
  if (!in_array( $screen->base, advanced_import_admin()->hook_suffix )){
160
  return;
53
  */
54
  public function hide_reset_notice() {
55
  if ( isset( $_GET['advanced-import-hide-notice'] ) && isset( $_GET['_advanced_import_notice_nonce'] ) ) {
56
+ /*Security*/
57
+ if ( ! wp_verify_nonce( $_GET['_advanced_import_notice_nonce'], 'advanced_import_hide_notice_nonce' ) ) {
58
  wp_die( __( 'Action failed. Please refresh the page and retry.', 'advanced-import' ) );
59
  }
60
 
77
  global $wpdb, $current_user;
78
 
79
  if ( ! empty( $_GET['ai_reset_wordpress'] ) && !empty($_GET['ai_reset_wordpress_nonce'] )) {
80
+ /*Security*/
81
  if ( ! wp_verify_nonce( wp_unslash( $_GET['ai_reset_wordpress_nonce'] ), 'ai_reset_wordpress' ) ) { // WPCS: input var ok, sanitization ok.
82
  wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'advanced-import' ) );
83
  }
84
  if ( ! current_user_can( 'manage_options' ) ) {
85
  wp_die( esc_html__( 'No permission to reset WordPress', 'advanced-import' ) );
86
  }
87
+
88
  require_once ABSPATH . '/wp-admin/includes/upgrade.php';
89
 
90
  $template = get_option( 'template' );
157
  */
158
  public function reset_wizard_notice() {
159
 
 
160
  $screen = get_current_screen();
161
  if (!in_array( $screen->base, advanced_import_admin()->hook_suffix )){
162
  return;
advanced-import.php CHANGED
@@ -13,8 +13,8 @@ if ( ! defined( 'WPINC' ) ) {
13
  * @wordpress-plugin
14
  * Plugin Name: Advanced Import
15
  * Plugin URI: https://addonspress.com/item/advanced-import
16
- * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
17
- * Version: 1.0.8
18
  * Author: AddonsPress
19
  * Author URI: https://addonspress.com/
20
  * License: GPL-2.0+
@@ -24,7 +24,7 @@ if ( ! defined( 'WPINC' ) ) {
24
  */
25
 
26
  /*Define Constants for this plugin*/
27
- define( 'ADVANCED_IMPORT_VERSION', '1.0.8' );
28
  define( 'ADVANCED_IMPORT_PLUGIN_NAME', 'advanced-import' );
29
  define( 'ADVANCED_IMPORT_PATH', plugin_dir_path( __FILE__ ) );
30
  define( 'ADVANCED_IMPORT_URL', plugin_dir_url( __FILE__ ) );
13
  * @wordpress-plugin
14
  * Plugin Name: Advanced Import
15
  * Plugin URI: https://addonspress.com/item/advanced-import
16
+ * Description: Easily import demo data starter site packages or Migrate your site data
17
+ * Version: 1.2.0
18
  * Author: AddonsPress
19
  * Author URI: https://addonspress.com/
20
  * License: GPL-2.0+
24
  */
25
 
26
  /*Define Constants for this plugin*/
27
+ define( 'ADVANCED_IMPORT_VERSION', '1.2.0' );
28
  define( 'ADVANCED_IMPORT_PLUGIN_NAME', 'advanced-import' );
29
  define( 'ADVANCED_IMPORT_PATH', plugin_dir_path( __FILE__ ) );
30
  define( 'ADVANCED_IMPORT_URL', plugin_dir_url( __FILE__ ) );
example.php CHANGED
@@ -2,198 +2,78 @@
2
  function prefix_demo_import_lists(){
3
  $demo_lists = array(
4
  'demo1' =>array(
5
- 'title' => __( 'Title', 'text-domain' ),/*Title*/
6
- 'is_pro' => true,/*Premium*/
7
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
8
- 'author' => __( 'Gutentor', 'gutentor' ),/*Author Name*/
9
- 'keywords' => array( 'about-block', 'about 3' ),/*Search keyword*/
10
- 'categories' => array( 'about' ),/*Categories*/
11
- 'template_url' => 'https://github.com/addonspress/advanced-import/blob/master/online-shop-data.zip?raw=true',/*Json file url */
12
- 'screenshot_url' => '//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',/*Screenshot of block*/
13
- 'demo_url' => 'https://www.demo-doamin.com/',/*Demo Url*/
14
- /**/
 
 
 
 
15
  'plugins' => array(
16
  array(
17
- 'name' => 'Gutentor',
18
  'slug' => 'gutentor',
19
  ),
20
- array(
21
- 'name' => 'WooCommerce',
22
- 'slug' => 'woocommerce',
23
- ),
24
- array(
25
- 'name' => 'YITH WooCommerce Wishlist',
26
- 'slug' => 'yith-woocommerce-wishlist',
27
- 'main_file' => 'init.php',
28
- ),
29
  )
30
-
31
- ),
32
- 'demo2' =>array(
33
- 'title' =>esc_html__('Demo 2', 'text-domain'),
34
- 'type' => 'elementor',/*Optional eg gutentor, elementor or other page builders*/
35
- 'categories' => array('medical'),
36
- 'template_url' => array(
37
- 'content' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/content.json',
38
- 'options' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/options.json',
39
- 'widgets' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/widgets.json'
40
- ),
41
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',
42
- 'demo_url' =>'http://demo.domain.com/demo2/',
43
- 'plugins' => array(
44
- array(
45
- 'name' => 'Gutentor',
46
- 'slug' => 'gutentor',
47
- ),
48
- array(
49
- 'name' => 'WooCommerce',
50
- 'slug' => 'woocommerce',
51
- ),
52
- array(
53
- 'name' => 'YITH WooCommerce Wishlist',
54
- 'slug' => 'yith-woocommerce-wishlist',
55
- 'main_file' => 'init.php',
56
- ),
57
- )
58
-
59
- ),
60
- 'demo3' =>array(
61
- 'title' =>esc_html__('Demo 3', 'text-domain'),
62
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
63
- 'categories' => array('education'),
64
- 'template_url' => get_template_directory().'/index.php',
65
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentyseventeen/screenshot.png?ver=1.6',
66
- 'demo_url' =>'http://demo.domain.com/medical-circle/'
67
- ),
68
- 'demo4' =>array(
69
- 'title' => __( 'Title', 'text-domain' ),/*Title*/
70
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
71
- 'author' => __( 'Gutentor', 'gutentor' ),/*Author Name*/
72
- 'keywords' => array( 'about-block', 'about 3' ),/*Search keyword*/
73
- 'categories' => array( 'about' ),/*Categories*/
74
- 'template_url' => 'https://github.com/addonspress/advanced-import/blob/master/online-shop-data.zip?raw=true',/*Json file url */
75
- 'screenshot_url' => '//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',/*Screenshot of block*/
76
- 'demo_url' => 'https://www.demo-doamin.com/',/*Demo Url*/
77
- /**/
78
- 'plugins' => array(
79
- array(
80
- 'name' => 'Gutentor',
81
- 'slug' => 'gutentor',
82
- ),
83
- array(
84
- 'name' => 'WooCommerce',
85
- 'slug' => 'woocommerce',
86
- ),
87
- array(
88
- 'name' => 'YITH WooCommerce Wishlist',
89
- 'slug' => 'yith-woocommerce-wishlist',
90
- 'main_file' => 'init.php',
91
- ),
92
- )
93
-
94
- ),
95
- 'demo5' =>array(
96
- 'title' =>esc_html__('Demo 2', 'text-domain'),
97
- 'type' => 'elementor',/*Optional eg gutentor, elementor or other page builders*/
98
- 'categories' => array('medical'),
99
- 'template_url' => array(
100
- 'content' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/content.json',
101
- 'options' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/options.json',
102
- 'widgets' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/widgets.json'
103
- ),
104
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',
105
- 'demo_url' =>'http://demo.domain.com/demo2/',
106
- 'plugins' => array(
107
- array(
108
- 'name' => 'Gutentor',
109
- 'slug' => 'gutentor',
110
- ),
111
- array(
112
- 'name' => 'WooCommerce',
113
- 'slug' => 'woocommerce',
114
- ),
115
- array(
116
- 'name' => 'YITH WooCommerce Wishlist',
117
- 'slug' => 'yith-woocommerce-wishlist',
118
- 'main_file' => 'init.php',
119
- ),
120
- )
121
-
122
- ),
123
- 'demo6' =>array(
124
- 'title' =>esc_html__('Demo 3', 'text-domain'),
125
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
126
- 'categories' => array('education'),
127
- 'template_url' => get_template_directory().'/index.php',
128
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentyseventeen/screenshot.png?ver=1.6',
129
- 'demo_url' =>'http://demo.domain.com/medical-circle/'
130
- ),
131
- 'demo7' =>array(
132
- 'title' => __( 'Title', 'text-domain' ),/*Title*/
133
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
134
- 'author' => __( 'Gutentor', 'gutentor' ),/*Author Name*/
135
- 'keywords' => array( 'about-block', 'about 3' ),/*Search keyword*/
136
- 'categories' => array( 'about' ),/*Categories*/
137
- 'template_url' => 'https://github.com/addonspress/advanced-import/blob/master/online-shop-data.zip?raw=true',/*Json file url */
138
- 'screenshot_url' => '//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',/*Screenshot of block*/
139
- 'demo_url' => 'https://www.demo-doamin.com/',/*Demo Url*/
140
- /**/
141
- 'plugins' => array(
142
- array(
143
- 'name' => 'Gutentor',
144
- 'slug' => 'gutentor',
145
- ),
146
- array(
147
- 'name' => 'WooCommerce',
148
- 'slug' => 'woocommerce',
149
- ),
150
- array(
151
- 'name' => 'YITH WooCommerce Wishlist',
152
- 'slug' => 'yith-woocommerce-wishlist',
153
- 'main_file' => 'init.php',
154
- ),
155
- )
156
-
157
- ),
158
- 'demo8' =>array(
159
- 'title' =>esc_html__('Demo 2', 'text-domain'),
160
- 'type' => 'elementor',/*Optional eg gutentor, elementor or other page builders*/
161
- 'categories' => array('medical'),
162
- 'template_url' => array(
163
- 'content' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/content.json',
164
- 'options' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/options.json',
165
- 'widgets' => 'https://raw.githubusercontent.com/addonspress/advanced-import/master/widgets.json'
166
- ),
167
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentysixteen/screenshot.png?ver=1.6',
168
- 'demo_url' =>'http://demo.domain.com/demo2/',
169
- 'plugins' => array(
170
- array(
171
- 'name' => 'Gutentor',
172
- 'slug' => 'gutentor',
173
- ),
174
- array(
175
- 'name' => 'WooCommerce',
176
- 'slug' => 'woocommerce',
177
- ),
178
- array(
179
- 'name' => 'YITH WooCommerce Wishlist',
180
- 'slug' => 'yith-woocommerce-wishlist',
181
- 'main_file' => 'init.php',
182
- ),
183
- )
184
-
185
- ),
186
- 'demo9' =>array(
187
- 'title' =>esc_html__('Demo 3', 'text-domain'),
188
- 'is_pro' => true,/*Premium*/
189
- 'pro_url' => 'https://www.cosmoswp.com/pricing/',/*Premium Url*/
190
- 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders*/
191
- 'categories' => array('education'),
192
- 'template_url' => get_template_directory().'/index.php',
193
- 'screenshot_url' =>'//ts.w.org/wp-content/themes/twentyseventeen/screenshot.png?ver=1.6',
194
- 'demo_url' =>'http://demo.domain.com/medical-circle/'
195
  ),
196
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  );
198
  return $demo_lists;
199
  }
2
  function prefix_demo_import_lists(){
3
  $demo_lists = array(
4
  'demo1' =>array(
5
+ 'title' => __( 'Title 1', 'text-domain' ),/*Title*/
6
+ 'is_pro' => false,/*Is Premium*/
7
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
8
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
9
+ 'keywords' => array( 'medical', 'multipurpose' ),/*Search keyword*/
10
+ 'categories' => array( 'medical','multipurpose' ),/*Categories*/
11
+ 'template_url' => array(
12
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
13
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
14
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
15
+ ),
16
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
17
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
18
+ /* Recommended plugin for this demo */
19
  'plugins' => array(
20
  array(
21
+ 'name' => __( 'Gutentor', 'text-domain' ),
22
  'slug' => 'gutentor',
23
  ),
 
 
 
 
 
 
 
 
 
24
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ),
26
+ 'demo2' =>array(
27
+ 'title' => __( 'Title 2', 'text-domain' ),/*Title*/
28
+ 'is_pro' => false,/*Is Premium*/
29
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
30
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
31
+ 'keywords' => array( 'about-block', 'about 3' ),/*Search keyword*/
32
+ 'categories' => array( 'contact','multipurpose','woocommerce' ),/*Categories*/
33
+ 'template_url' => array(
34
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
35
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
36
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
37
+ ),
38
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
39
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
40
+ /* Recommended plugin for this demo */
41
+ 'plugins' => array(
42
+ array(
43
+ 'name' => __( 'Gutentor', 'text-domain' ),
44
+ 'slug' => 'gutentor',
45
+ ),
46
+ array(
47
+ 'name' => __( 'Contact Form 7', 'text-domain' ),
48
+ 'slug' => 'contact-form-7',
49
+ 'main_file' => 'wp-contact-form-7.php',/*the main plugin file of contact form 7 is different from plugin slug */
50
+ ),
51
+ )
52
+ ),
53
+ 'demo3' =>array(
54
+ 'title' => __( 'Title 1', 'text-domain' ),/*Title*/
55
+ 'is_pro' => true,/*Is Premium : Support Premium Version*/
56
+ 'pro_url' => 'https://www.cosmoswp.com/pricing/',/*Premium version/Pricing Url*/
57
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
58
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
59
+ 'keywords' => array( 'woocommerce', 'shop' ),/*Search keyword*/
60
+ 'categories' => array( 'woocommerce','multipurpose' ),/*Categories*/
61
+ 'template_url' => array(/* Optional for premium theme, you can add your own logic by hook*/
62
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
63
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
64
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
65
+ ),
66
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
67
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
68
+ /* Recommended plugin for this demo */
69
+ 'plugins' => array(
70
+ array(
71
+ 'name' => __( 'Gutentor', 'text-domain' ),
72
+ 'slug' => 'gutentor',
73
+ ),
74
+ )
75
+ ),
76
+ /*and so on ............................*/
77
  );
78
  return $demo_lists;
79
  }
readme.txt CHANGED
@@ -4,26 +4,27 @@ Contributors: addonspress
4
  Donate link: https://addonspress.com/
5
  Tags: import, advanced import, demo import, theme import, widget import, customizer import
6
  Requires at least: 4.5
7
- Tested up to: 5.3.2
8
  Requires PHP: 5.6.20
9
- Stable tag: 1.0.8
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
- Advanced Import is very flexible plugin which convenient user to import site data( posts, page, media and even widget and customizer option ).
14
 
15
  == Description ==
16
 
17
  Import Data or Demo Content which is exported by [Advanced Export](https://wordpress.org/plugins/advanced-export/)
18
 
19
- Advanced Import is one of the best and powerful data importer plugin. It has number of features which make more manageable and convenient to WordPress user to import their WordPress site data from another website.
20
 
21
- It is designed specially for theme developer who want to provide demo data to their customer but it can be also use for migration purpose too.
22
 
23
- While you use Demo Import features of themes, Advanced Import may fetches screenshots, images and templates(demo) JSON files from respective theme site. This helps you to import your site with a single click. You must accept terms and privacy of the themes you are using to use Demo Import ( Starter Sites Template Library ) Features.
24
 
25
  Some listed features of Advanced Import are given below :
26
 
 
27
  * Import widget
28
  * Import option
29
  * Import media,
@@ -32,6 +33,18 @@ Some listed features of Advanced Import are given below :
32
  * Import custom post type
33
  * Import actual media files
34
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  == Dashboard Location ==
36
 
37
  = Theme Demo Import Screen =
@@ -44,20 +57,160 @@ Dashboard -> Tool -> Advanced Import
44
 
45
  == Installation ==
46
  There are two ways to install any Advanced Import Plugin:-
47
- 1.Upload zip file from Dashboard->Plugin->Add New "upload plugin".
48
- 2.Exact Advanced Import and placed it to the "/wp-content/plugins/" directory.
49
  - Activate the plugin through the "Plugins" menu in WordPress.
50
 
51
 
52
  == Frequently Asked Questions ==
53
 
54
- = Is Advanced Import is free plugin ? =
55
-
56
- Yes, it is free plugin.
57
-
58
- = Why my demo zip file is not importing ? =
59
-
60
- Please make sure it is exported using [Advanced Export](https://wordpress.org/plugins/advanced-export/) plugin
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  == Screenshots ==
63
 
@@ -65,11 +218,17 @@ Please make sure it is exported using [Advanced Export](https://wordpress.org/pl
65
  2. Import Start Popup Message
66
  3. Import Complete Popup Message
67
  4. Import Via File
68
- 5. Frontend of CosmosWP after Import
69
- 6. Frontend of Opus Blog after Import
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
 
73
  = 1.0.8 - 2020-02-19 =
74
  * Fixed : Secure reset function
75
 
@@ -99,4 +258,4 @@ Please make sure it is exported using [Advanced Export](https://wordpress.org/pl
99
  * Fixed : Minor Changes
100
 
101
  = 1.0.0 =
102
- * Initial release.
4
  Donate link: https://addonspress.com/
5
  Tags: import, advanced import, demo import, theme import, widget import, customizer import
6
  Requires at least: 4.5
7
+ Tested up to: 5.4
8
  Requires PHP: 5.6.20
9
+ Stable tag: 1.2.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
+ Advanced Import is a very flexible plugin which convenient user to import site data( posts, page, media and even widget and customizer option ).
14
 
15
  == Description ==
16
 
17
  Import Data or Demo Content which is exported by [Advanced Export](https://wordpress.org/plugins/advanced-export/)
18
 
19
+ Advanced Import is one of the best and powerful data importer plugin. It has several features which make more manageable and convenient to WordPress user to import their WordPress site data from another website.
20
 
21
+ It is designed specially for theme developer who wants to provide demo data to their customer but it can be used for migration purpose too.
22
 
23
+ While you use Demo Import features of themes, Advanced Import may fetches screenshots, images and templates(demo) JSON files from a respective theme site. This helps you to import your site with a single click. You must accept the terms and privacy of the themes you are using to use Demo Import ( Starter Sites Template Library ) Features.
24
 
25
  Some listed features of Advanced Import are given below :
26
 
27
+ * Import demo starter sites very easily
28
  * Import widget
29
  * Import option
30
  * Import media,
33
  * Import custom post type
34
  * Import actual media files
35
 
36
+ == Features for Theme Author ==
37
+
38
+ * Code/Plugin example available
39
+ * Support for the premium version or premium plugin of the free theme
40
+ * Install separate dependent plugin/s for each demo starter packages of the theme
41
+ * Categorized available demo import starter packages to type and categories
42
+ * Search filter keywords for demo starter packages
43
+ * Sufficient hooks to customize the plugin design and functionality
44
+ * Add demo URL
45
+ * Add pro URL
46
+ * Better experience for the user
47
+
48
  == Dashboard Location ==
49
 
50
  = Theme Demo Import Screen =
57
 
58
  == Installation ==
59
  There are two ways to install any Advanced Import Plugin:-
60
+ 1. Upload zip file from Dashboard->Plugin->Add New "upload plugin".
61
+ 2. Extract Advanced Import and placed it to the "/wp-content/plugins/" directory.
62
  - Activate the plugin through the "Plugins" menu in WordPress.
63
 
64
 
65
  == Frequently Asked Questions ==
66
 
67
+ = Is Advanced Import is a free plugin? =
68
+
69
+ Yes, it is a free plugin.
70
+
71
+ = Why my demo zip file is not importing? =
72
+
73
+ Please make sure it is exported using the [Advanced Export](https://wordpress.org/plugins/advanced-export/) plugin
74
+
75
+ = I have activated the plugin. Where is the "Demo Import"? =
76
+
77
+ Login to your WordPress dashboard, go to Appearance -> Demo Import.
78
+ You can also find Import zip options on WordPress dashboard -> Tools -> Advanced Import.
79
+
80
+ = Do I need to check to include media while Export? =
81
+
82
+ If you are providing starter content- NO, but if you are migrating site - Yes. As long as the exported site is live on the internet it is not necessary but if you are migrating the site from local to live you should check it.
83
+ Technically, if you check to include media, the zip files content media files. Huge media files may cause other issues. Generally not recommended to check but you can check media as your requirements.
84
+
85
+ = I am a theme author, how can I use this plugin for my theme? =
86
+
87
+ First of all, you need to Export your theme demo data from your live demo site using [Advanced Export](https://wordpress.org/plugins/advanced-export/) plugin.
88
+ Export the zip file, it should contain 3 files content.json, options.json and widgets.json.
89
+ If you are submitting theme on WordPress dot org, you have to create a separate plugin for your theme/company. We would like to highly recommend to create a single plugin for your all themes. For other platforms, you may add code on your theme.
90
+ Code Example :
91
+ `
92
+ function prefix_demo_import_lists(){
93
+ $demo_lists = array(
94
+ 'demo1' =>array(
95
+ 'title' => __( 'Title 1', 'text-domain' ),/*Title*/
96
+ 'is_pro' => false,/*Is Premium*/
97
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
98
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
99
+ 'keywords' => array( 'medical', 'multipurpose' ),/*Search keyword*/
100
+ 'categories' => array( 'medical','multipurpose' ),/*Categories*/
101
+ 'template_url' => array(
102
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
103
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
104
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
105
+ ),
106
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
107
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
108
+ /* Recommended plugin for this demo */
109
+ 'plugins' => array(
110
+ array(
111
+ 'name' => __( 'Gutentor', 'text-domain' ),
112
+ 'slug' => 'gutentor',
113
+ ),
114
+ )
115
+ ),
116
+ 'demo2' =>array(
117
+ 'title' => __( 'Title 2', 'text-domain' ),/*Title*/
118
+ 'is_pro' => false,/*Is Premium*/
119
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
120
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
121
+ 'keywords' => array( 'about-block', 'about 3' ),/*Search keyword*/
122
+ 'categories' => array( 'contact','multipurpose','woocommerce' ),/*Categories*/
123
+ 'template_url' => array(
124
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
125
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
126
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
127
+ ),
128
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
129
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
130
+ /* Recommended plugin for this demo */
131
+ 'plugins' => array(
132
+ array(
133
+ 'name' => __( 'Gutentor', 'text-domain' ),
134
+ 'slug' => 'gutentor',
135
+ ),
136
+ array(
137
+ 'name' => __( 'Contact Form 7', 'text-domain' ),
138
+ 'slug' => 'contact-form-7',
139
+ 'main_file' => 'wp-contact-form-7.php',/*the main plugin file of contact form 7 is different from plugin slug */
140
+ ),
141
+ )
142
+ ),
143
+ 'demo3' =>array(
144
+ 'title' => __( 'Title 1', 'text-domain' ),/*Title*/
145
+ 'is_pro' => true,/*Is Premium : Support Premium Version*/
146
+ 'pro_url' => 'https://www.cosmoswp.com/pricing/',/*Premium version/Pricing Url*/
147
+ 'type' => 'gutentor',/*Optional eg gutentor, elementor or other page builders or type*/
148
+ 'author' => __( 'Gutentor', 'text-domain' ),/*Author Name*/
149
+ 'keywords' => array( 'woocommerce', 'shop' ),/*Search keyword*/
150
+ 'categories' => array( 'woocommerce','multipurpose' ),/*Categories*/
151
+ 'template_url' => array(/* Optional for premium theme, you can add your own logic by hook*/
152
+ 'content' => 'full-url-path/content.json',/*Full URL Path to content.json*/
153
+ 'options' => 'full-url-path/master/options.json',/*Full URL Path to options.json*/
154
+ 'widgets' => 'full-url-path/widgets.json'/*Full URL Path to widgets.json*/
155
+ ),
156
+ 'screenshot_url' => 'full-url-path/screenshot.png?ver=1.6',/*Full URL Path to demo screenshot image*/
157
+ 'demo_url' => 'https://www.demo.cosmoswp.com/',/*Full URL Path to Live Demo*/
158
+ /* Recommended plugin for this demo */
159
+ 'plugins' => array(
160
+ array(
161
+ 'name' => __( 'Gutentor', 'text-domain' ),
162
+ 'slug' => 'gutentor',
163
+ ),
164
+ )
165
+ ),
166
+ /*and so on ............................*/
167
+ );
168
+ return $demo_lists;
169
+ }
170
+ add_filter('advanced_import_demo_lists','prefix_demo_import_lists');
171
+ `
172
+ = Do I need to assign "Front page", "Posts page" and "Menu Locations" after the importer is done or do they automatically assign? =
173
+
174
+ You don't need to assign them manually, they will be automatically assigned. Theme author also doesn't have to write additional code for it.
175
+
176
+ = I am a theme author and I would like to customize it for my theme, Can you list hooks available on Advanced Import plugin? =
177
+
178
+ Here are some important list of filter hooks:
179
+
180
+ - advanced_import_is_template_available
181
+ - advanced_import_template_import_button
182
+ - advanced_import_welcome_message
183
+ - advanced_import_demo_lists
184
+ - advanced_import_is_pro_active
185
+ - 'advanced_import_post_data'
186
+ - 'advanced_import_replace_post_ids'
187
+ - 'advanced_import_replace_term_ids'
188
+ - 'advanced_import_new_options'
189
+ - 'advanced_import_sidebars_widgets'
190
+ - 'advanced_import_complete_message'
191
+
192
+ Here are some important list of action hooks:
193
+
194
+ - advanced_import_before_demo_import_screen
195
+ - advanced_import_after_demo_import_screen
196
+ - advanced_import_before_plugin_screen
197
+ - advanced_import_after_plugin_screen
198
+ - advanced_import_before_content_screen
199
+ - advanced_import_after_content_screen
200
+ - advanced_import_before_complete_screen
201
+ - advanced_import_after_complete_screen
202
+
203
+ = I would like to develop a companion/starter sites/toolset plugin for my theme/company, Do you have any starter plugin? =
204
+
205
+ We don't have any starter plugin but we have developed a plugin for [Acme Themes](https://www.acmethemes.com/). The plugin name is [Acme Demo Setup](https://wordpress.org/plugins/acme-demo-setup/), you can download and view the code of the plugin and develop one for yourself.
206
+
207
+ = Are there any themes using these plugin? =
208
+
209
+ Yes, many themes are using this plugin, for an example, you can look on [CosmosWP Theme](https://cosmoswp.com/)
210
+
211
+ = Can I deactivate this plugin? =
212
+
213
+ Advanced Import is generally one-time use plugin, it is meant to be used for Demo Import or Site Migrate, once you complete your task you can safely deactivate it.
214
 
215
  == Screenshots ==
216
 
218
  2. Import Start Popup Message
219
  3. Import Complete Popup Message
220
  4. Import Via File
221
+ 5. The frontend of CosmosWP after Import
222
+ 6. The frontend of Opus Blog after Import
223
 
224
  == Changelog ==
225
 
226
+ = 1.2.0 - 2020-03-12 =
227
+ * Added : Premium demo support
228
+ * Added : Readme documentation
229
+ * Added : Extra layer of security
230
+ * Updated : Example File
231
+
232
  = 1.0.8 - 2020-02-19 =
233
  * Fixed : Secure reset function
234
 
258
  * Fixed : Minor Changes
259
 
260
  = 1.0.0 =
261
+ * Initial release.