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

Version Description

  • 2021-01-27 =
  • Added : Filter list tab active design
  • Updated : is_pro check more strictly
Download this release

Release Info

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

Code changes from version 1.3.0 to 1.3.1

admin/class-advanced-import-admin.php CHANGED
@@ -197,6 +197,22 @@ class Advanced_Import_Admin {
197
  return (bool) apply_filters( 'advanced_import_is_template_available', $is_available, $item );
198
  }
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  /**
201
  * Return Template Button
202
  *
@@ -667,7 +683,7 @@ class Advanced_Import_Admin {
667
  <div class="ai-filter-header">
668
  <div class="ai-filter-tabs">
669
  <ul class="ai-types ai-filter-group" data-filter-group="secondary">
670
- <li class="ai-filter-btn-active ai-filter-btn" data-filter="*">
671
  <?php esc_html_e( 'All', 'advanced-import' ); ?>
672
  <span class="ai-count"></span>
673
  </li>
@@ -676,7 +692,7 @@ class Advanced_Import_Admin {
676
  $unique_types = array_unique( $types );
677
  foreach ( $unique_types as $cat_index => $single_type ) {
678
  ?>
679
- <li class="ai-filter-btn" data-filter=".<?php echo strtolower( esc_attr( $single_type ) ); ?>">
680
  <?php echo ucfirst( esc_html( $single_type ) ); ?>
681
  <span class="ai-count"></span>
682
 
@@ -765,7 +781,7 @@ class Advanced_Import_Admin {
765
  <?php
766
  echo isset( $demo_list['categories'] ) ? esc_attr( implode( ' ', $demo_list['categories'] ) ) : '';
767
  echo isset( $demo_list['type'] ) ? ' ' . esc_attr( $demo_list['type'] ) : '';
768
- echo isset( $demo_list['is_pro'] ) ? ' ai-fp-filter-pro' : ' ai-fp-filter-free';
769
  echo $this->is_template_available( $demo_list ) ? '' : ' ai-pro-item'
770
  ?>
771
  "
@@ -782,7 +798,7 @@ class Advanced_Import_Admin {
782
  <h4 class="ai-author-info"><?php esc_html_e( 'Author: ', 'advanced-import' ); ?><?php echo esc_html( isset( $demo_list['author'] ) ? $demo_list['author'] : wp_get_theme()->get( 'Author' ) ); ?></h4>
783
  <div class="ai-details"><?php esc_html_e( 'Details', 'advanced-import' ); ?></div>
784
  <?php
785
- if ( isset( $demo_list['is_pro'] ) && $demo_list['is_pro'] ) {
786
  ?>
787
  <span class="ai-premium-label"><?php esc_html_e( 'Premium', 'advanced-import' ); ?></span>
788
  <?php
197
  return (bool) apply_filters( 'advanced_import_is_template_available', $is_available, $item );
198
  }
199
 
200
+ /**
201
+ * Check if template is available to import
202
+ *
203
+ * @since 1.0.8
204
+ * @param array $item current array of demo list.
205
+ * @return boolean
206
+ */
207
+ public function is_pro( $item ) {
208
+ $is_pro = false;
209
+ if ( isset( $item['is_pro'] ) && $item['is_pro'] ) {
210
+ $is_pro = true;
211
+ }
212
+
213
+ return (bool) apply_filters( 'advanced_import_is_pro', $is_pro, $item );
214
+ }
215
+
216
  /**
217
  * Return Template Button
218
  *
683
  <div class="ai-filter-header">
684
  <div class="ai-filter-tabs">
685
  <ul class="ai-types ai-filter-group" data-filter-group="secondary">
686
+ <li class="ai-filter-btn-active ai-filter-btn ai-type-filter" data-filter="*">
687
  <?php esc_html_e( 'All', 'advanced-import' ); ?>
688
  <span class="ai-count"></span>
689
  </li>
692
  $unique_types = array_unique( $types );
693
  foreach ( $unique_types as $cat_index => $single_type ) {
694
  ?>
695
+ <li class="ai-filter-btn ai-type-filter" data-filter=".<?php echo strtolower( esc_attr( $single_type ) ); ?>">
696
  <?php echo ucfirst( esc_html( $single_type ) ); ?>
697
  <span class="ai-count"></span>
698
 
781
  <?php
782
  echo isset( $demo_list['categories'] ) ? esc_attr( implode( ' ', $demo_list['categories'] ) ) : '';
783
  echo isset( $demo_list['type'] ) ? ' ' . esc_attr( $demo_list['type'] ) : '';
784
+ echo $this->is_pro($demo_list) ? ' ai-fp-filter-pro' : ' ai-fp-filter-free';
785
  echo $this->is_template_available( $demo_list ) ? '' : ' ai-pro-item'
786
  ?>
787
  "
798
  <h4 class="ai-author-info"><?php esc_html_e( 'Author: ', 'advanced-import' ); ?><?php echo esc_html( isset( $demo_list['author'] ) ? $demo_list['author'] : wp_get_theme()->get( 'Author' ) ); ?></h4>
799
  <div class="ai-details"><?php esc_html_e( 'Details', 'advanced-import' ); ?></div>
800
  <?php
801
+ if ( $this->is_pro($demo_list)) {
802
  ?>
803
  <span class="ai-premium-label"><?php esc_html_e( 'Premium', 'advanced-import' ); ?></span>
804
  <?php
advanced-import.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'WPINC' ) ) {
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.3.0
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.3.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__ ) );
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.3.1
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.3.1' );
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__ ) );
assets/css/advanced-import-admin.min.css CHANGED
@@ -1 +1 @@
1
- .ai-body{margin:40px 15px 0}.ai-body img{max-width:100%;height:auto}.ai-header{margin-bottom:30px;padding:20px;background:#fff;border-left-color:#46b450;border-width:0 0 0 4px;border-style:solid;box-shadow:0 1px 1px rgba(0,0,0,.04)}.ai-header h1{margin-top:0}.ai-header p{margin-bottom:0}.ai-filter-tabs{display:flex;align-items:center;background:#fff;padding:10px 20px;margin-bottom:20px;margin-top:20px;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5}.ai-filter-tabs ul{margin-top:0;margin-bottom:0}.ai-filter-tabs ul li{font-size:14px;cursor:pointer;font-weight:600}.ai-count{background:#ca4a1f;display:inline-block;padding:2px 10px;border-radius:50px;margin-left:5px;color:#fff;font-size:12px}.ai-types{display:flex}.ai-types li{margin:0 5px;padding:5px}.ai-form-file-import{cursor:pointer;background:#efefef;padding:8px 25px;margin:0;border-radius:3px;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.ai-form-file-import:focus,.ai-form-file-import:hover{background:#0073aa;border-color:#006799}.ai-filter-content{background:#f8f8f8;display:flex}.ai-filter-content.hidden{display:none}.ai-sidebar{flex-basis:250px;min-width:270px;background:#f9f9f9;color:#999;padding-top:30px;border-right:1px solid #ddd;box-shadow:10px 0 10px -3px rgba(0,0,0,.1)}.ai-import-available-categories{margin-top:20px;overflow-y:auto;overflow-x:hidden;max-height:calc(100% - 23px)}.ai-import-available-categories h3{padding-left:30px;padding-right:30px}.ai-import-available-categories ul{margin-top:20px}.ai-import-available-categories ul li{cursor:pointer;font-weight:600;font-size:14px;padding:15px 30px;position:relative;z-index:1;margin:0;border-bottom:1px solid #f1f1f1}.ai-import-available-categories ul li:after{position:absolute;left:0;top:0;background:#f1f1f1;width:0;content:'';height:100%;z-index:-1;transition:all .5s ease-in-out 0s}.ai-import-available-categories ul li:focus,.ai-import-available-categories ul li:hover{border-color:#f1f1f1;color:#444}.ai-import-available-categories ul li span{float:right}.ai-import-available-categories ul li.ai-filter-btn-active{color:#444;border-color:#f1f1f1}.ai-import-available-categories ul li.ai-filter-btn-active:focus,.ai-import-available-categories ul li.ai-filter-btn-active:hover{border-color:#f1f1f1}.ai-import-available-categories ul li.ai-filter-btn-active:focus:after,.ai-import-available-categories ul li.ai-filter-btn-active:hover:after{width:100%}.ai-import-available-categories ul li.ai-filter-btn-active:after{width:100%;transition:all .5s ease-in-out 0s}.ai-import-available-categories ul.ai-import-fp-lists{border-bottom:1px solid #ddd;text-align:center}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter{display:inline-block;border:1px solid transparent;margin-bottom:-2px;padding:10px 24px;border-radius:2px 2px 0 0}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter.ai-filter-btn-active{background:#fff;border-width:1px 1px 0 1px;border-style:solid;border-color:#ddd;color:#444}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter.ai-filter-btn-active::after{display:none}.ai-search-control{margin-left:auto;margin-right:20px;width:200px}.ai-search-control .ai-search-filter{padding-left:10px;padding-right:10px}.ai-search-filter{height:36px;width:100%}.ai-filter-content-wrapper{flex-basis:calc(100% - 250px);padding:15px}.ai-item-preview{position:relative;z-index:1;line-height:0;border-top-right-radius:4px;border-top-left-radius:4px;background:#fff}.ai-item-preview:after{content:'';width:100%;height:100%;position:absolute;left:0;top:0;box-shadow:0 -130px 70px -42px rgba(0,0,0,.8) inset;z-index:2;opacity:0;visibility:hidden;transition:all .5s ease-in-out 0s}.ai-item-preview .ai-item-screenshot{border-top-right-radius:4px;border-top-left-radius:4px;overflow:hidden}.ai-item-preview .ai-author-info{position:absolute;left:0;right:0;bottom:-100px;width:100%;z-index:3;margin:0;padding:20px;color:#fff;font-size:16px;opacity:0;visibility:hidden;transition:opacity .5s ease-in-out 0s,visibility .9s ease-in-out 0s}.ai-item-preview .ai-details{position:absolute;left:0;right:0;margin:0 auto;top:50%;width:130px;margin:0 auto;background:rgba(0,0,0,.8);height:40px;line-height:40px;text-align:center;z-index:5;font-size:15px;font-weight:600;color:#fff;opacity:0;visibility:hidden;transition:all .5s ease-in-out 0s;transform:translateY(-50%)}.ai-item-preview .ai-premium-label{position:absolute;right:-10px;top:20px;background:#ca4a1f;display:block;z-index:3;line-height:16px;padding:10px 20px;height:16px;font-weight:600;color:#fff}.ai-item-preview .ai-premium-label:before{position:absolute;left:-18px;top:0;height:0;width:0;content:"";border-top:18px solid #ca4a1f;border-left:18px solid transparent;border-bottom:18px solid #ca4a1f}.ai-item-preview .ai-premium-label:after{position:absolute;right:0;content:"";bottom:-10px;width:0;height:0;border-top:10px solid #ca4a1f;border-right:10px solid transparent}.ai-item{display:inline-block;max-width:calc(100% / 3 - 40px);margin:15px;box-shadow:0 2px 15px -3px rgba(0,0,0,.2)}@media (min-width:1600px){.ai-item{max-width:calc(100% / 4 - 40px)}}.ai-item:hover .ai-item-preview:after{visibility:visible;opacity:1}.ai-item:hover .ai-author-info{bottom:10px;visibility:visible;opacity:1}.ai-item:hover .ai-details,.ai-item:hover .ai-item-footer-actions{visibility:visible;opacity:1}.ai-item-footer{padding:20px;background:#fff;position:relative;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.ai-item-footer .theme-name{margin:0;white-space:nowrap;width:98%;overflow:hidden;text-overflow:ellipsis;line-height:24px}.ai-item-footer-actions{position:absolute;right:0;text-align:center;z-index:4;top:0;height:calc(100% - 22px);background:red;padding:11px;opacity:0;transition:all .1s ease-in-out;visibility:hidden;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.ai-item-footer-actions .button{line-height:32px;height:35px}.ai-item-footer-actions .button .dashicons:not(.dashicons-update){width:10px;height:10px;font-size:14px;vertical-align:middle;margin-right:10px;margin-top:-5px}.ai-item-footer-actions .button .dashicons.ai-update{animation:dashicons-spin 1s linear infinite;margin:17px 0 0 10px;width:auto;height:auto;font-size:16px}.ai-item-footer-actions .button .dashicons.dashicons-visibility{font-size:12px}.ai-form{padding:40px;background:#fff}.ai-form .media-title{margin-top:0}.ai-form .input-file{padding:100px;border:1px dashed #cdcdcd;margin:40px 0;background:#f8f8f8;text-align:center;clear:both}.ai-item.ai-action-importing .ai-item-preview:after{visibility:visible;opacity:1}.ai-item.ai-action-importing .ai-author-info{bottom:10px}.ai-item.ai-action-importing .ai-item-footer-actions{top:50%;transform:translateY(-50%)}.ai-item.ai-action-importing .ai-demo-import{padding-right:0}.ai-item.ai-action-importing .ai-item-footer-actions{opacity:1;visibility:visible}@keyframes dashicons-spin{0%{transform:translate3d(-50%,-50%,0) rotate(0)}100%{transform:translate3d(-50%,-50%,0) rotate(360deg)}}.ai-confirm-import-content #swal2-content{text-align:left!important;margin-top:20px}.swal2-actions{width:auto!important}#swal2-content p{padding-left:20px;padding-right:13px}
1
+ .ai-body{margin:40px 15px 0}.ai-body img{max-width:100%;height:auto}.ai-header{margin-bottom:30px;padding:20px;background:#fff;border-left-color:#46b450;border-width:0 0 0 4px;border-style:solid;box-shadow:0 1px 1px rgba(0,0,0,.04)}.ai-header h1{margin-top:0}.ai-header p{margin-bottom:0}.ai-filter-tabs{display:flex;align-items:center;background:#fff;padding:10px 20px;margin-bottom:20px;margin-top:20px;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5}.ai-filter-tabs ul{margin-top:0;margin-bottom:0}.ai-filter-tabs ul li{font-size:14px;cursor:pointer;font-weight:600;padding:10px 20px}.ai-filter-tabs ul li.ai-filter-btn-active{background:#dfdfdf;border-radius:50px}.ai-count{background:#ca4a1f;display:inline-block;padding:2px 10px;border-radius:50px;margin-left:5px;color:#fff;font-size:12px}.ai-types{display:flex}.ai-types li{margin:0 5px;padding:5px}.ai-form-file-import{cursor:pointer;background:#efefef;padding:8px 25px;margin:0;border-radius:3px;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.ai-form-file-import:focus,.ai-form-file-import:hover{background:#0073aa;border-color:#006799}.ai-filter-content{background:#f8f8f8;display:flex}.ai-filter-content.hidden{display:none}.ai-sidebar{flex-basis:250px;min-width:270px;background:#f9f9f9;color:#999;padding-top:30px;border-right:1px solid #ddd;box-shadow:10px 0 10px -3px rgba(0,0,0,.1)}.ai-import-available-categories{margin-top:20px;overflow-y:auto;overflow-x:hidden;max-height:calc(100% - 23px)}.ai-import-available-categories h3{padding-left:30px;padding-right:30px}.ai-import-available-categories ul{margin-top:20px}.ai-import-available-categories ul li{cursor:pointer;font-weight:600;font-size:14px;padding:15px 30px;position:relative;z-index:1;margin:0;border-bottom:1px solid #f1f1f1}.ai-import-available-categories ul li:after{position:absolute;left:0;top:0;background:#f1f1f1;width:0;content:'';height:100%;z-index:-1;transition:all .5s ease-in-out 0s}.ai-import-available-categories ul li:focus,.ai-import-available-categories ul li:hover{border-color:#f1f1f1;color:#444}.ai-import-available-categories ul li span{float:right}.ai-import-available-categories ul li.ai-filter-btn-active{color:#444;border-color:#f1f1f1}.ai-import-available-categories ul li.ai-filter-btn-active:focus,.ai-import-available-categories ul li.ai-filter-btn-active:hover{border-color:#f1f1f1}.ai-import-available-categories ul li.ai-filter-btn-active:focus:after,.ai-import-available-categories ul li.ai-filter-btn-active:hover:after{width:100%}.ai-import-available-categories ul li.ai-filter-btn-active:after{width:100%;transition:all .5s ease-in-out 0s}.ai-import-available-categories ul.ai-import-fp-lists{border-bottom:1px solid #ddd;text-align:center}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter{display:inline-block;border:1px solid transparent;margin-bottom:-2px;padding:10px 24px;border-radius:2px 2px 0 0}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter.ai-filter-btn-active{background:#fff;border-width:1px 1px 0 1px;border-style:solid;border-color:#ddd;color:#444}.ai-import-available-categories ul.ai-import-fp-lists li.ai-fp-filter.ai-filter-btn-active::after{display:none}.ai-search-control{margin-left:auto;margin-right:20px;width:200px}.ai-search-control .ai-search-filter{padding-left:10px;padding-right:10px}.ai-search-filter{height:36px;width:100%}.ai-filter-content-wrapper{flex-basis:calc(100% - 250px);padding:15px}.ai-item-preview{position:relative;z-index:1;line-height:0;border-top-right-radius:4px;border-top-left-radius:4px;background:#fff}.ai-item-preview:after{content:'';width:100%;height:100%;position:absolute;left:0;top:0;box-shadow:0 -130px 70px -42px rgba(0,0,0,.8) inset;z-index:2;opacity:0;visibility:hidden;transition:all .5s ease-in-out 0s}.ai-item-preview .ai-item-screenshot{border-top-right-radius:4px;border-top-left-radius:4px;overflow:hidden}.ai-item-preview .ai-author-info{position:absolute;left:0;right:0;bottom:-100px;width:100%;z-index:3;margin:0;padding:20px;color:#fff;font-size:16px;opacity:0;visibility:hidden;transition:opacity .5s ease-in-out 0s,visibility .9s ease-in-out 0s}.ai-item-preview .ai-details{position:absolute;left:0;right:0;margin:0 auto;top:50%;width:130px;margin:0 auto;background:rgba(0,0,0,.8);height:40px;line-height:40px;text-align:center;z-index:5;font-size:15px;font-weight:600;color:#fff;opacity:0;visibility:hidden;transition:all .5s ease-in-out 0s;transform:translateY(-50%)}.ai-item-preview .ai-premium-label{position:absolute;right:-10px;top:20px;background:#ca4a1f;display:block;z-index:3;line-height:16px;padding:10px 20px;height:16px;font-weight:600;color:#fff}.ai-item-preview .ai-premium-label:before{position:absolute;left:-18px;top:0;height:0;width:0;content:"";border-top:18px solid #ca4a1f;border-left:18px solid transparent;border-bottom:18px solid #ca4a1f}.ai-item-preview .ai-premium-label:after{position:absolute;right:0;content:"";bottom:-10px;width:0;height:0;border-top:10px solid #ca4a1f;border-right:10px solid transparent}.ai-item{display:inline-block;max-width:calc(100% / 3 - 40px);margin:15px;box-shadow:0 2px 15px -3px rgba(0,0,0,.2)}@media (min-width:1600px){.ai-item{max-width:calc(100% / 4 - 40px)}}.ai-item:hover .ai-item-preview:after{visibility:visible;opacity:1}.ai-item:hover .ai-author-info{bottom:10px;visibility:visible;opacity:1}.ai-item:hover .ai-details,.ai-item:hover .ai-item-footer-actions{visibility:visible;opacity:1}.ai-item-footer{padding:20px;background:#fff;position:relative;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.ai-item-footer .theme-name{margin:0;white-space:nowrap;width:98%;overflow:hidden;text-overflow:ellipsis;line-height:24px}.ai-item-footer-actions{position:absolute;right:0;text-align:center;z-index:4;top:0;height:calc(100% - 22px);background:red;padding:11px;opacity:0;transition:all .1s ease-in-out;visibility:hidden;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.ai-item-footer-actions .button{line-height:32px;height:35px}.ai-item-footer-actions .button .dashicons:not(.dashicons-update){width:10px;height:10px;font-size:14px;vertical-align:middle;margin-right:10px;margin-top:-5px}.ai-item-footer-actions .button .dashicons.ai-update{animation:dashicons-spin 1s linear infinite;margin:17px 0 0 10px;width:auto;height:auto;font-size:16px}.ai-item-footer-actions .button .dashicons.dashicons-visibility{font-size:12px}.ai-form{padding:40px;background:#fff}.ai-form .media-title{margin-top:0}.ai-form .input-file{padding:100px;border:1px dashed #cdcdcd;margin:40px 0;background:#f8f8f8;text-align:center;clear:both}.ai-item.ai-action-importing .ai-item-preview:after{visibility:visible;opacity:1}.ai-item.ai-action-importing .ai-author-info{bottom:10px}.ai-item.ai-action-importing .ai-item-footer-actions{top:50%;transform:translateY(-50%)}.ai-item.ai-action-importing .ai-demo-import{padding-right:0}.ai-item.ai-action-importing .ai-item-footer-actions{opacity:1;visibility:visible}@keyframes dashicons-spin{0%{transform:translate3d(-50%,-50%,0) rotate(0)}100%{transform:translate3d(-50%,-50%,0) rotate(360deg)}}.ai-confirm-import-content #swal2-content{text-align:left!important;margin-top:20px}.swal2-actions{width:auto!important}#swal2-content p{padding-left:20px;padding-right:13px}
assets/js/advanced-import-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){let e,n,i,o,a=t(document),r=!1,c=!1;const l=function(t){let e,n,i=window.location.search.substring(1).split("&");for(n=0;n<i.length;n++)if((e=i[n].split("="))[0]===t)return void 0===e[1]||decodeURIComponent(e[1])},u=Swal.mixin({position:"bottom-end",showConfirmButton:!1,allowOutsideClick:!1,allowEscapeKey:!1,toast:!0}),d=function(e){t("#ai-demo-popup").html(e),u.fire({type:"info",html:t("#ai-demo-popup .ai-notification-title").html()}),u.showLoading()},p=function(t=null,e=null,n=null,i=null){let o=advanced_import_object.text.failedImport.text;o+=t||e||n||i?"<br/>"+advanced_import_object.text.failedImport.code:"",o+=t||"",o+=e||"",o+=n||"",o+=i||"",u.fire({type:"error",html:o}),f()},s=function(e=!1){u.fire({type:"info",html:t(".ai-notification-title").html()}),u.showLoading(),r=!0,m(e)},f=function(){r=!1,_()},m=function(t){return!!t&&(!c&&((c=t).append('<span class="ai-update dashicons dashicons-update"></span>'),c.attr("disabled",!0),void c.closest(".ai-item").addClass("ai-action-importing")))},_=function(){if(!c)return!1;c.children(".ai-update").remove(),c.attr("disabled",!1),c.closest(".ai-item").removeClass("ai-action-importing"),c=!1};function h(){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"content_screen",_wpnonce:e.val(),_wp_http_referer:n.val(),template_url:o,template_type:i}}).done(function(e){d(e),(new function(){let e,n=0,a="",r="";function c(n){"object"==typeof n&&void 0!==n.message?(e.find("span").text(n.message),void 0!==n.url?n.hash===r?(e.find("span").text(advanced_import_object.text.failed),l()):(r=n.hash,t.ajax({type:"POST",url:n.url,data:n}).done(c).fail(c)):(n.done,l())):(e.find("span").text(advanced_import_object.text.error),l())}function l(){e&&(e.data("done-item")||(n++,e.attr("data-done-item",1)),e.find(".spinner").remove());let r=!1,u=t("tr.ai-available-content");u.each(function(){let n=t(this);""===a||r?(a=n.data("content"),e=n,function(){if(a){let n=e.find("input:checkbox");n.is(":checked")?t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"import_content",wpnonce:advanced_import_object.wpnonce,content:a,template_url:o,template_type:i}}).done(c).fail(c):(e.find("span").text(advanced_import_object.text.skip),setTimeout(l,300))}}(),r=!1):n.data("content")===a&&(r=!0)}),n>=u.length&&complete()}return{init:function(){let e=t(".ai-pages");e.addClass("installing"),e.find("input").prop("disabled",!0),complete=function(){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"complete_screen"}}).done(function(e){return t("#ai-demo-popup").html(e),Swal.fire({title:"Success",html:t("#ai-demo-popup .ai-notification-title").html(),type:"success",allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.successImport.confirmButtonText,cancelButtonText:advanced_import_object.text.successImport.cancelButtonText}).then(e=>{e.value&&window.open(t("#ai-demo-popup .ai-actions-buttons a").attr("href"),"_blank")}),f(),!1}).fail(function(t,e,n){console.log(t+" :: "+e+" :: "+n)}),!1},l()}}}).init()}).fail(function(t,e,n){return p("",t,e,n),!1}),!1}function v(i){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"plugin_screen",_wpnonce:e.val(),_wp_http_referer:n.val(),recommendedPlugins:i}}).done(function(i){d(i),u.showLoading(),t("#ai-demo-popup .ai-plugins-wrap").find("li").each(function(){return function i(o){if("ai-no-recommended-plugins"===o.attr("id"))return h(),!1;t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"install_plugin",_wpnonce:e.val(),_wp_http_referer:n.val(),slug:o.data("slug"),plugin:o.data("slug")+"/"+o.data("main_file")}}).done(function(t){if("object"==typeof t&&void 0!==t.success){if(o.attr("data-completed",1),!o.next("li").length)return h(),!1;setTimeout(i(o.next("li")),1e3)}else setTimeout(i(o),1e3)}).fail(function(t,e,n){return p("",t,e,n),!1})}(t(this)),!1})}).fail(function(t,e,n){return p("",t,e,n),!1}),!1}a.ready(function(){a.on("submit","#ai-upload-zip-form",function(i){if(i.preventDefault(),r)return!1;!function(i){if(void 0===window.FormData)return!0;let o=new FormData,a=i.find("#ai-upload-zip-archive"),r=t("#ai-empty-file");if(!a.val())return r.show(),p(r.html()),!1;r.hide(),s();let c=a[0].files[0];e=i.find("input[name=_wpnonce]"),n=i.find("input[name=_wp_http_referer]"),o.append("ai-upload-zip-archive",c),o.append("action","advanced_import_ajax_setup"),o.append("_wpnonce",e.val()),o.append("_wp_http_referer",n.val()),a.val(""),t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:o,cache:!1,contentType:!1,processData:!1}).done(function(t){return"object"!=typeof t&&(t=JSON.parse(t)),t.success?(h(),!1):(p(t.data.message),!1)}).fail(function(t,e,n){return p("",t,e,n),!1})}(t(this))}),a.on("click",".ai-item .ai-demo-import",function(a){if(a.preventDefault(),r)return!1;let c=t(this),l=t(this).data("plugins");Swal.fire({title:advanced_import_object.text.confirmImport.title,html:advanced_import_object.text.confirmImport.html,width:"64rem",customClass:{content:"ai-confirm-import-content"},allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.confirmImport.confirmButtonText,cancelButtonText:advanced_import_object.text.confirmImport.cancelButtonText}).then(a=>{a.value&&(s(c),function(a,r){let c=a.closest(".ai-item");i=c.data("template_type"),o=c.data("template_url"),e=c.find("input[name=_wpnonce]"),n=c.find("input[name=_wp_http_referer]"),"array"===i?v(r):t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"demo_download_and_unzip",_wpnonce:e.val(),_wp_http_referer:n.val(),demo_file:o,demo_file_type:i}}).done(function(t){return t.success?(v(r),!1):(p("",jqXHR,textStatus,errorThrown),!1)}).fail(function(t,e,n){return p("",t,e,n),!1})}(c,l))})}),a.on("click",".ai-wp-reset",function(e){e.preventDefault(),Swal.fire({title:advanced_import_object.text.confirmReset.title,text:advanced_import_object.text.confirmReset.text,type:"warning",allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.confirmReset.confirmButtonText,cancelButtonText:advanced_import_object.text.confirmReset.cancelButtonText}).then(e=>{e.value&&(window.location.href=t(".ai-wp-reset").attr("href"))})}),a.on("click",".ai-filter-tabs li",function(e){if(e.preventDefault(),r)return!1;t(this).hasClass("ai-form-file-import")?(t(".ai-filter-content").addClass("hidden"),t(".ai-form").removeClass("hidden")):(t(".ai-form").addClass("hidden"),t(".ai-filter-content").removeClass("hidden"))});let c,u,d={};setTimeout(function(){let e=t(".ai-filter-content-wrapper").isotope({itemSelector:".ai-item",filter:function(){let e=t(this),n=!u||e.text().match(u),i=!c||e.is(c);return n&&i}});function n(){let n=e.isotope("getFilteredItemElements"),i=t(n);t(".ai-filter-btn").each(function(e,n){let o=t(n),a=o.attr("data-filter");if(!a)return;let r=i.filter(a).length;o.find(".ai-count").text(r)})}e.imagesLoaded().progress(function(){e.isotope("layout")}),n(),t(".ai-filter-group").on("click",".ai-filter-btn",function(){let i=t(this),o=i.parents(".ai-filter-group").attr("data-filter-group");i.siblings().removeClass("ai-filter-btn-active"),i.addClass("ai-filter-btn-active"),d[o]=i.attr("data-filter"),c=function(t){let e="";for(let n in t)e+=t[n];return e}(d),setTimeout(function(){e.isotope(),i.hasClass("ai-fp-filter")&&n()},300)});let i=t(".ai-search-filter").keyup(function(t,e){let n;return e=e||100,function(){clearTimeout(n);let i=arguments,o=this;n=setTimeout(function(){t.apply(o,i)},e)}}(function(){u=new RegExp(i.val(),"gi"),e.isotope(),n()}))},1),function(){let t=l("reset"),e=l("from");"true"===t&&"ai-reset-wp"===e&&Swal.fire({title:advanced_import_object.text.resetSuccess.title,type:"success",allowOutsideClick:!1,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.resetSuccess.confirmButtonText})}()})}(jQuery);
1
+ !function(t){let e,n,i,o,a=t(document),r=!1,c=!1;const l=function(t){let e,n,i=window.location.search.substring(1).split("&");for(n=0;n<i.length;n++)if((e=i[n].split("="))[0]===t)return void 0===e[1]||decodeURIComponent(e[1])},u=Swal.mixin({position:"bottom-end",showConfirmButton:!1,allowOutsideClick:!1,allowEscapeKey:!1,toast:!0}),d=function(e){t("#ai-demo-popup").html(e),u.fire({type:"info",html:t("#ai-demo-popup .ai-notification-title").html()}),u.showLoading()},p=function(t=null,e=null,n=null,i=null){let o=advanced_import_object.text.failedImport.text;o+=t||e||n||i?"<br/>"+advanced_import_object.text.failedImport.code:"",o+=t||"",o+=e||"",o+=n||"",o+=i||"",u.fire({type:"error",html:o}),f()},s=function(e=!1){u.fire({type:"info",html:t(".ai-notification-title").html()}),u.showLoading(),r=!0,m(e)},f=function(){r=!1,_()},m=function(t){return!!t&&(!c&&((c=t).append('<span class="ai-update dashicons dashicons-update"></span>'),c.attr("disabled",!0),void c.closest(".ai-item").addClass("ai-action-importing")))},_=function(){if(!c)return!1;c.children(".ai-update").remove(),c.attr("disabled",!1),c.closest(".ai-item").removeClass("ai-action-importing"),c=!1};function h(){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"content_screen",_wpnonce:e.val(),_wp_http_referer:n.val(),template_url:o,template_type:i}}).done(function(e){d(e),(new function(){let e,n=0,a="",r="";function c(n){"object"==typeof n&&void 0!==n.message?(e.find("span").text(n.message),void 0!==n.url?n.hash===r?(e.find("span").text(advanced_import_object.text.failed),l()):(r=n.hash,t.ajax({type:"POST",url:n.url,data:n}).done(c).fail(c)):(n.done,l())):(e.find("span").text(advanced_import_object.text.error),l())}function l(){e&&(e.data("done-item")||(n++,e.attr("data-done-item",1)),e.find(".spinner").remove());let r=!1,u=t("tr.ai-available-content");u.each(function(){let n=t(this);""===a||r?(a=n.data("content"),e=n,function(){if(a){let n=e.find("input:checkbox");n.is(":checked")?t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"import_content",wpnonce:advanced_import_object.wpnonce,content:a,template_url:o,template_type:i}}).done(c).fail(c):(e.find("span").text(advanced_import_object.text.skip),setTimeout(l,300))}}(),r=!1):n.data("content")===a&&(r=!0)}),n>=u.length&&complete()}return{init:function(){let e=t(".ai-pages");e.addClass("installing"),e.find("input").prop("disabled",!0),complete=function(){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"complete_screen"}}).done(function(e){return t("#ai-demo-popup").html(e),Swal.fire({title:"Success",html:t("#ai-demo-popup .ai-notification-title").html(),type:"success",allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.successImport.confirmButtonText,cancelButtonText:advanced_import_object.text.successImport.cancelButtonText}).then(e=>{e.value&&window.open(t("#ai-demo-popup .ai-actions-buttons a").attr("href"),"_blank")}),f(),!1}).fail(function(t,e,n){console.log(t+" :: "+e+" :: "+n)}),!1},l()}}}).init()}).fail(function(t,e,n){return p("",t,e,n),!1}),!1}function v(i){return t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"plugin_screen",_wpnonce:e.val(),_wp_http_referer:n.val(),recommendedPlugins:i}}).done(function(i){d(i),u.showLoading(),t("#ai-demo-popup .ai-plugins-wrap").find("li").each(function(){return function i(o){if("ai-no-recommended-plugins"===o.attr("id"))return h(),!1;t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"install_plugin",_wpnonce:e.val(),_wp_http_referer:n.val(),slug:o.data("slug"),plugin:o.data("slug")+"/"+o.data("main_file")}}).done(function(t){if("object"==typeof t&&void 0!==t.success){if(o.attr("data-completed",1),!o.next("li").length)return h(),!1;setTimeout(i(o.next("li")),1e3)}else setTimeout(i(o),1e3)}).fail(function(t,e,n){return p("",t,e,n),!1})}(t(this)),!1})}).fail(function(t,e,n){return p("",t,e,n),!1}),!1}a.ready(function(){a.on("submit","#ai-upload-zip-form",function(i){if(i.preventDefault(),r)return!1;!function(i){if(void 0===window.FormData)return!0;let o=new FormData,a=i.find("#ai-upload-zip-archive"),r=t("#ai-empty-file");if(!a.val())return r.show(),p(r.html()),!1;r.hide(),s();let c=a[0].files[0];e=i.find("input[name=_wpnonce]"),n=i.find("input[name=_wp_http_referer]"),o.append("ai-upload-zip-archive",c),o.append("action","advanced_import_ajax_setup"),o.append("_wpnonce",e.val()),o.append("_wp_http_referer",n.val()),a.val(""),t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:o,cache:!1,contentType:!1,processData:!1}).done(function(t){return"object"!=typeof t&&(t=JSON.parse(t)),t.success?(h(),!1):(p(t.data.message),!1)}).fail(function(t,e,n){return p("",t,e,n),!1})}(t(this))}),a.on("click",".ai-item .ai-demo-import",function(a){if(a.preventDefault(),r)return!1;let c=t(this),l=t(this).data("plugins");Swal.fire({title:advanced_import_object.text.confirmImport.title,html:advanced_import_object.text.confirmImport.html,width:"64rem",customClass:{content:"ai-confirm-import-content"},allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.confirmImport.confirmButtonText,cancelButtonText:advanced_import_object.text.confirmImport.cancelButtonText}).then(a=>{a.value&&(s(c),function(a,r){let c=a.closest(".ai-item");i=c.data("template_type"),o=c.data("template_url"),e=c.find("input[name=_wpnonce]"),n=c.find("input[name=_wp_http_referer]"),"array"===i?v(r):t.ajax({type:"POST",url:advanced_import_object.ajaxurl,data:{action:"demo_download_and_unzip",_wpnonce:e.val(),_wp_http_referer:n.val(),demo_file:o,demo_file_type:i}}).done(function(t){return t.success?(v(r),!1):(p("",jqXHR,textStatus,errorThrown),!1)}).fail(function(t,e,n){return p("",t,e,n),!1})}(c,l))})}),a.on("click",".ai-wp-reset",function(e){e.preventDefault(),Swal.fire({title:advanced_import_object.text.confirmReset.title,text:advanced_import_object.text.confirmReset.text,type:"warning",allowOutsideClick:!1,showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.confirmReset.confirmButtonText,cancelButtonText:advanced_import_object.text.confirmReset.cancelButtonText}).then(e=>{e.value&&(window.location.href=t(".ai-wp-reset").attr("href"))})}),a.on("click",".ai-filter-tabs li",function(e){if(e.preventDefault(),r)return!1;t(this).hasClass("ai-form-file-import")?(t(".ai-filter-content").addClass("hidden"),t(".ai-form").removeClass("hidden")):(t(".ai-form").addClass("hidden"),t(".ai-filter-content").removeClass("hidden"))});let c,u,d={};setTimeout(function(){let e=t(".ai-filter-content-wrapper").isotope({itemSelector:".ai-item",filter:function(){let e=t(this),n=!u||e.text().match(u),i=!c||e.is(c);return n&&i}});function n(){let n=e.isotope("getFilteredItemElements"),i=t(n);t(".ai-filter-btn").each(function(e,n){let o=t(n),a=o.attr("data-filter");if(!a)return;let r=i.filter(a).length;o.find(".ai-count").text(r)})}e.imagesLoaded().progress(function(){e.isotope("layout")}),n(),t(".ai-filter-group").on("click",".ai-filter-btn",function(){let i=t(this),o=i.parents(".ai-filter-group").attr("data-filter-group");i.siblings().removeClass("ai-filter-btn-active"),i.addClass("ai-filter-btn-active"),d[o]=i.attr("data-filter"),c=function(t){let e="";for(let n in t)e+=t[n];return e}(d),setTimeout(function(){e.isotope(),(i.hasClass("ai-fp-filter")||i.hasClass("ai-type-filter"))&&n()},300)});let i=t(".ai-search-filter").keyup(function(t,e){let n;return e=e||100,function(){clearTimeout(n);let i=arguments,o=this;n=setTimeout(function(){t.apply(o,i)},e)}}(function(){u=new RegExp(i.val(),"gi"),e.isotope(),n()}))},1),function(){let t=l("reset"),e=l("from");"true"===t&&"ai-reset-wp"===e&&Swal.fire({title:advanced_import_object.text.resetSuccess.title,type:"success",allowOutsideClick:!1,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:advanced_import_object.text.resetSuccess.confirmButtonText})}()})}(jQuery);
readme.txt CHANGED
@@ -3,10 +3,10 @@
3
  Contributors: addonspress, codersantosh, acmeit
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.6
8
  Requires PHP: 5.6.20
9
- Stable tag: 1.3.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -225,6 +225,10 @@ Advanced Import is generally one-time use plugin, it is meant to be used for Dem
225
 
226
  == Changelog ==
227
 
 
 
 
 
228
  = 1.3.0 - 2021-01-26 =
229
  * Added : All, Free and Pro Tab
230
  * Updated : Tested up to 5.6 WordPress
3
  Contributors: addonspress, codersantosh, acmeit
4
  Donate link: https://addonspress.com/
5
  Tags: import, advanced import, demo import, theme import, widget import, customizer import
6
+ Requires at least: 5.0
7
  Tested up to: 5.6
8
  Requires PHP: 5.6.20
9
+ Stable tag: 1.3.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
225
 
226
  == Changelog ==
227
 
228
+ = 1.3.1 - 2021-01-27 =
229
+ * Added : Filter list tab active design
230
+ * Updated : is_pro check more strictly
231
+
232
  = 1.3.0 - 2021-01-26 =
233
  * Added : All, Free and Pro Tab
234
  * Updated : Tested up to 5.6 WordPress