Woocommerce Products Slider - Version 1.13.14

Version Description

  • 2020-07-01 remove - remove import layout notice.
    • 2020-07-02 add - free and pro layouts filter at import layout page.
    • 2020-07-02 add - Search by keyword added at import layout page.
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Woocommerce Products Slider
Version 1.13.14
Comparing to
See all releases

Code changes from version 1.13.13 to 1.13.14

includes/class-admin-notices.php CHANGED
@@ -5,39 +5,7 @@ class class_wcps_notices{
5
 
6
  public function __construct(){
7
  //add_action('admin_notices', array( $this, 'woocommerce_plugin_missing' ));
8
- add_action('admin_notices', array( $this, 'data_upgrade' ));
9
- add_action('admin_notices', array( $this, 'import_layouts' ));
10
-
11
- }
12
-
13
-
14
- public function import_layouts(){
15
-
16
- if (!is_plugin_active('woocommerce-products-slider/woocommerce-products-slider.php')) return;
17
-
18
-
19
- $wcps_plugin_info = get_option('wcps_plugin_info');
20
- $import_layouts = isset($wcps_plugin_info['import_layouts']) ? $wcps_plugin_info['import_layouts'] : '';
21
-
22
-
23
- $actionurl = admin_url().'edit.php?post_type=wcps&page=import_layouts';
24
- $actionurl = wp_nonce_url( $actionurl, 'wcps_nonce' );
25
-
26
-
27
-
28
-
29
- if(empty($import_layouts)){
30
-
31
- ?>
32
- <div class="update-nag">
33
- <?php
34
- echo sprintf(__('Import layouts for <b>PickPlugins Product Slider</b> plugin, please <a class="button button-primary" href="%s">read details</a> here.', 'woocommerce-products-slider'), $actionurl);
35
- ?>
36
- </div>
37
- <?php
38
-
39
-
40
- }
41
 
42
  }
43
 
@@ -47,6 +15,7 @@ class class_wcps_notices{
47
 
48
  if (!is_plugin_active('woocommerce-products-slider/woocommerce-products-slider.php')) return;
49
 
 
50
 
51
  $wcps_plugin_info = get_option('wcps_plugin_info');
52
  $wcps_upgrade = isset($wcps_plugin_info['wcps_upgrade']) ? $wcps_plugin_info['wcps_upgrade'] : '';
5
 
6
  public function __construct(){
7
  //add_action('admin_notices', array( $this, 'woocommerce_plugin_missing' ));
8
+ //add_action('admin_notices', array( $this, 'data_upgrade' ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  }
11
 
15
 
16
  if (!is_plugin_active('woocommerce-products-slider/woocommerce-products-slider.php')) return;
17
 
18
+ //delete_option('wcps_plugin_info');
19
 
20
  $wcps_plugin_info = get_option('wcps_plugin_info');
21
  $wcps_upgrade = isset($wcps_plugin_info['wcps_upgrade']) ? $wcps_plugin_info['wcps_upgrade'] : '';
includes/class-metabox-wcps-hook.php CHANGED
@@ -414,7 +414,7 @@ function wcps_metabox_content_layouts($post_id){
414
  <?php
415
  if($import_layouts != 'done'):
416
  ?>
417
- <p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=wcps_layout'; ?>"><?php echo __('Import layouts','woocommerce-products-slider'); ?></a> </p>
418
  <?php
419
  endif;
420
 
414
  <?php
415
  if($import_layouts != 'done'):
416
  ?>
417
+ <p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=wcps&page=import_layouts'; ?>"><?php echo __('Import layouts','woocommerce-products-slider'); ?></a> </p>
418
  <?php
419
  endif;
420
 
includes/functions-layout-api.php CHANGED
@@ -27,7 +27,7 @@ function wcps_ajax_fetch_block_hub_by_id(){
27
 
28
  $html = '';
29
  $api_params = array(
30
- 'block_hub_remote_action' => 'blockSearchByID',
31
  'post_id' => $post_id,
32
  'license_key' => $license_key,
33
 
@@ -45,7 +45,7 @@ function wcps_ajax_fetch_block_hub_by_id(){
45
  *
46
  * */
47
  if (is_wp_error($server_response)){
48
- $responses['error'] = __('There is a server error', 'wp-block-hub');
49
  }
50
  else{
51
 
27
 
28
  $html = '';
29
  $api_params = array(
30
+ 'wcps_remote_action' => 'layoutSearchByID',
31
  'post_id' => $post_id,
32
  'license_key' => $license_key,
33
 
45
  *
46
  * */
47
  if (is_wp_error($server_response)){
48
+ $responses['error'] = __('There is a server error', 'woocommerce-products-slider');
49
  }
50
  else{
51
 
includes/menu/import-layouts.php CHANGED
@@ -7,10 +7,8 @@ $keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
7
  $paged = isset($_GET['paged']) ? sanitize_text_field($_GET['paged']) : '';
8
  $tabs = isset($_GET['tabs']) ? sanitize_text_field($_GET['tabs']) : 'latest';
9
 
10
- $active_plugins = get_option('active_plugins');
11
- $wpblockhub_block_hub_ids = get_option('wpblockhub_block_hub_ids', array());
12
-
13
- //$domain = (is_multisite()) ? site_url() : get_bloginfo('url');
14
 
15
  $max_num_pages = 0;
16
 
@@ -21,17 +19,16 @@ wp_enqueue_script('wcps_js');
21
 
22
  ?>
23
  <div class="wrap">
24
- <h2><?php _e('Import Layouts', 'wp-block-hub'); ?></h2>
25
 
26
  <div class="wpblockhub-search">
27
 
28
  <div class="wp-filter">
29
  <ul class="filter-links">
30
- <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=latest" class="<?php if($tabs == 'latest') echo 'current'; ?>" aria-current="page"><?php _e('Latest', 'wp-block-hub'); ?></a> </li>
31
- <!-- <li class=""><a href="--><?php //echo $_SERVER['REQUEST_URI']; ?><!--&tabs=popular" class="--><?php //if($tabs == 'popular') echo 'current'; ?><!--" aria-current="page">--><?php //_e('Popular', 'wp-block-hub'); ?><!--</a> </li>-->
32
- <!-- <li class=""><a href="--><?php //echo $_SERVER['REQUEST_URI']; ?><!--&tabs=top_rate" class="--><?php //if($tabs == 'top_rate') echo 'current'; ?><!--" aria-current="page">--><?php //_e('Top Rated', 'wp-block-hub'); ?><!--</a> </li>-->
33
  </ul>
34
-
35
  <form class="block-search-form">
36
  <span class="loading"></span>
37
  <input id="block-keyword" type="search" placeholder="<?php _e('Start typing...', 'wp-block-hub'); ?>"
@@ -42,11 +39,10 @@ wp_enqueue_script('wcps_js');
42
  <?php
43
 
44
  $api_params = array(
45
- 'block_hub_remote_action' => 'blockSearch',
46
  'keyword' => $keyword,
47
  'paged' => $paged,
48
  'tabs' => $tabs,
49
-
50
  );
51
 
52
  // Send query to the license manager server
@@ -64,8 +60,8 @@ wp_enqueue_script('wcps_js');
64
  ?>
65
  <div class="return-empty">
66
  <ul>
67
- <li><?php echo __("Unexpected Error! The query returned with an error.", 'wp-block-hub'); ?></li>
68
- <li><?php echo __("Make sure your internet connection is up.", 'wp-block-hub'); ?></li>
69
  </ul>
70
  </div>
71
  <?php
@@ -96,11 +92,13 @@ wp_enqueue_script('wcps_js');
96
  //var_dump($item);
97
 
98
  $post_id = isset($item->post_id) ? $item->post_id : '';
99
- $block_title = isset($item->title) ? $item->title : __('No title', 'wp-block-hub');
100
  $post_url = isset($item->post_url) ? $item->post_url : '';
 
 
101
  $layout_options = isset($item->layout_options) ? unserialize($item->layout_options) : '';
 
102
 
103
- $is_pro = isset($layout_options['is_pro']) ? $layout_options['is_pro'] : 'yes';
104
  $layout_preview_img = isset($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : '';
105
 
106
 
@@ -125,15 +123,26 @@ wp_enqueue_script('wcps_js');
125
  </div>
126
  <div class="actions">
127
 
128
- <span class="button import-layout" title="Enter license key to import" post_id="<?php echo $post_id; ?>"><i class="fas fa-download"></i> Import</span>
 
 
 
 
 
 
 
 
 
 
129
 
130
  <?php if($is_pro == 'yes'): ?>
131
- <span class="is_pro button"><i class="fas fa-crown"></i> Pro</span>
132
  <?php else: ?>
133
  <span class="is_free button"><i class="far fa-lightbulb"></i> Free</span>
134
  <?php endif; ?>
135
 
136
 
 
137
  </div>
138
  </div>
139
  <div class="clear"></div>
@@ -184,17 +193,50 @@ wp_enqueue_script('wcps_js');
184
 
185
  </div>
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
  <style type="text/css">
189
 
190
- .wpblockhub-search{}
191
  .block-search-form{
192
  float: right;
193
  padding: 10px;
194
  }
195
  .block-search-form input[type="search"]{
196
  width: 225px;
197
- padding: 5px;
198
  }
199
  .block-list-items{}
200
  .block-list-items a{ text-decoration: none}
7
  $paged = isset($_GET['paged']) ? sanitize_text_field($_GET['paged']) : '';
8
  $tabs = isset($_GET['tabs']) ? sanitize_text_field($_GET['tabs']) : 'latest';
9
 
10
+ $wcps_settings = get_option('wcps_settings');
11
+ $license_key = isset($wcps_settings['license_key']) ? $wcps_settings['license_key'] : '';
 
 
12
 
13
  $max_num_pages = 0;
14
 
19
 
20
  ?>
21
  <div class="wrap">
22
+ <h2><?php _e('PickPlugins Product Slider - Import Layouts', 'woocommerce-products-slider'); ?></h2>
23
 
24
  <div class="wpblockhub-search">
25
 
26
  <div class="wp-filter">
27
  <ul class="filter-links">
28
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=latest" class="<?php if($tabs == 'latest') echo 'current'; ?>" aria-current="page"><?php _e('Latest', 'woocommerce-products-slider'); ?></a> </li>
29
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=free" class="<?php if($tabs == 'free') echo 'current'; ?>" aria-current="page"><?php _e('Free', 'woocommerce-products-slider'); ?></a> </li>
30
+ <li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=pro" class="<?php if($tabs == 'pro') echo 'current'; ?>" aria-current="page"><?php _e('Premium', 'woocommerce-products-slider'); ?></a> </li>
31
  </ul>
 
32
  <form class="block-search-form">
33
  <span class="loading"></span>
34
  <input id="block-keyword" type="search" placeholder="<?php _e('Start typing...', 'wp-block-hub'); ?>"
39
  <?php
40
 
41
  $api_params = array(
42
+ 'wcps_remote_action' => 'layoutSearch',
43
  'keyword' => $keyword,
44
  'paged' => $paged,
45
  'tabs' => $tabs,
 
46
  );
47
 
48
  // Send query to the license manager server
60
  ?>
61
  <div class="return-empty">
62
  <ul>
63
+ <li><?php echo __("Unexpected Error! The query returned with an error.", 'woocommerce-products-slider'); ?></li>
64
+ <li><?php echo __("Make sure your internet connection is up.", 'woocommerce-products-slider'); ?></li>
65
  </ul>
66
  </div>
67
  <?php
92
  //var_dump($item);
93
 
94
  $post_id = isset($item->post_id) ? $item->post_id : '';
95
+ $block_title = isset($item->title) ? $item->title : __('No title', 'woocommerce-products-slider');
96
  $post_url = isset($item->post_url) ? $item->post_url : '';
97
+ $download_count = isset($item->download_count) ? $item->download_count : 0;
98
+
99
  $layout_options = isset($item->layout_options) ? unserialize($item->layout_options) : '';
100
+ $is_pro = isset($item->is_pro) ? $item->is_pro : '';
101
 
 
102
  $layout_preview_img = isset($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : '';
103
 
104
 
123
  </div>
124
  <div class="actions">
125
 
126
+ <?php
127
+ if ($is_pro == 'yes' && empty($license_key)) {
128
+
129
+ }else{
130
+ ?>
131
+ <span class="button import-layout" post_id="<?php echo $post_id; ?>"><i class="fas fa-download"></i> Import (<?php echo $download_count; ?>)</span>
132
+ <?php
133
+ }
134
+
135
+ ?>
136
+
137
 
138
  <?php if($is_pro == 'yes'): ?>
139
+ <span title="Enter license key to import" class="is_pro button"><i class="fas fa-crown"></i> Pro</span>
140
  <?php else: ?>
141
  <span class="is_free button"><i class="far fa-lightbulb"></i> Free</span>
142
  <?php endif; ?>
143
 
144
 
145
+
146
  </div>
147
  </div>
148
  <div class="clear"></div>
193
 
194
  </div>
195
 
196
+ <script>
197
+ jQuery(document).ready(function($) {
198
+
199
+ var delay = (function(){
200
+ var timer = 0;
201
+ return function(callback, ms){
202
+ clearTimeout (timer);
203
+ timer = setTimeout(callback, ms);
204
+ };
205
+ })();
206
+
207
+
208
+ $(document).on('keyup','#block-keyword',function(){
209
+ _this = this;
210
+ keyword = $(this).val();
211
+
212
+ url = window.location.href
213
+ //console.log();
214
+ var url = new URL(url);
215
+
216
+
217
+ delay(function(){
218
+ $(_this).parent().children('.loading').addClass('button updating-message');
219
+
220
+ url.searchParams.append('keyword', keyword);
221
+ url.searchParams.delete('paged');
222
+ window.location.href = url.href;
223
+
224
+ }, 1000 );
225
+
226
+
227
+ })
228
+ })
229
+ </script>
230
 
231
  <style type="text/css">
232
 
 
233
  .block-search-form{
234
  float: right;
235
  padding: 10px;
236
  }
237
  .block-search-form input[type="search"]{
238
  width: 225px;
239
+ padding: 0 10px;
240
  }
241
  .block-list-items{}
242
  .block-list-items a{ text-decoration: none}
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
  Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
- Stable tag: 1.13.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -141,6 +141,11 @@ then paste this shortcode anywhere in your page to display slider<br />
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
144
 
145
  = 1.13.13 =
146
  * 2020-07-01 add - added layouts library.
4
  Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
5
  Requires at least: 3.8
6
  Tested up to: 5.4
7
+ Stable tag: 1.13.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
141
 
142
  == Changelog ==
143
 
144
+ = 1.13.14 =
145
+ * 2020-07-01 remove - remove import layout notice.
146
+ * 2020-07-02 add - free and pro layouts filter at import layout page.
147
+ * 2020-07-02 add - Search by keyword added at import layout page.
148
+
149
 
150
  = 1.13.13 =
151
  * 2020-07-01 add - added layouts library.
woocommerce-products-slider.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: PickPlugins Product Slider for WooCommerce
4
  Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
  Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
- Version: 1.13.13
7
  WC requires at least: 3.0.0
8
  WC tested up to: 4.2
9
  Author: PickPlugins
@@ -23,8 +23,11 @@ class WoocommerceProductsSlider{
23
  define('wcps_plugin_url', plugins_url('/', __FILE__) );
24
  define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
25
  define('wcps_plugin_name', 'PickPlugins Product Slider' );
26
- define('wcps_plugin_version', '1.13.13' );
27
  define('wcps_server_url', 'https://www.pickplugins.com/demo/woocommerce-products-slider/');
 
 
 
28
 
29
  require_once( wcps_plugin_dir . 'includes/class-post-types.php');
30
  require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
3
  Plugin Name: PickPlugins Product Slider for WooCommerce
4
  Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
  Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
+ Version: 1.13.14
7
  WC requires at least: 3.0.0
8
  WC tested up to: 4.2
9
  Author: PickPlugins
23
  define('wcps_plugin_url', plugins_url('/', __FILE__) );
24
  define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
25
  define('wcps_plugin_name', 'PickPlugins Product Slider' );
26
+ define('wcps_plugin_version', '1.13.14' );
27
  define('wcps_server_url', 'https://www.pickplugins.com/demo/woocommerce-products-slider/');
28
+ //define('wcps_server_url', 'http://localhost/wp/');
29
+
30
+
31
 
32
  require_once( wcps_plugin_dir . 'includes/class-post-types.php');
33
  require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');