YITH WooCommerce Ajax Product Filter - Version 3.0.7

Version Description

  • Released: Jul 29, 2016 =

  • Added: yith_wcan_get_list_html_terms hook

  • Fixed: Filter doesn't work with WooCommerce 2.6.x

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 3.0.7
Comparing to
See all releases

Code changes from version 3.0.6 to 3.0.7

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.5.3
7
- Stable tag: 3.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -159,6 +159,11 @@ If you want to see a demonstration version of the premium plugin, you can see it
159
 
160
  == Changelog ==
161
 
 
 
 
 
 
162
  = 3.0.6 - Released: Jul 21, 2016 =
163
 
164
  * Fixed: Reset button doesn't show after click on a filter
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.5.3
7
+ Stable tag: 3.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.0.7 - Released: Jul 29, 2016 =
163
+
164
+ * Added: yith_wcan_get_list_html_terms hook
165
+ * Fixed: Filter doesn't work with WooCommerce 2.6.x
166
+
167
  = 3.0.6 - Released: Jul 21, 2016 =
168
 
169
  * Fixed: Reset button doesn't show after click on a filter
includes/class.yith-wcan-frontend.php CHANGED
@@ -50,7 +50,7 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
50
  )
51
  );
52
 
53
- if( in_array( strtolower( wp_get_theme()->name ), $theme_support ) ){
54
  add_filter( 'yith_wcan_use_wp_the_query_object', '__return_true' );
55
  }
56
 
@@ -158,6 +158,17 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
158
  'wc_query' => 'get_products_in_view'
159
  )
160
  );
 
 
 
 
 
 
 
 
 
 
 
161
  $this->unfiltered_product_ids = get_posts( $unfiltered_args );
162
  $this->filtered_product_ids = $queried_post_ids;
163
 
50
  )
51
  );
52
 
53
+ if( in_array( strtolower( wp_get_theme()->name ), $theme_support ) || class_exists( 'QTX_Translator' ) ){
54
  add_filter( 'yith_wcan_use_wp_the_query_object', '__return_true' );
55
  }
56
 
158
  'wc_query' => 'get_products_in_view'
159
  )
160
  );
161
+
162
+ $hide_out_of_stock_items = apply_filters( 'yith_wcan_hide_out_of_stock_items', 'yes' == get_option( 'woocommerce_hide_out_of_stock_items' ) ? true : false );
163
+
164
+ if( $hide_out_of_stock_items ){
165
+ $unfiltered_args['meta_query'][] = array(
166
+ 'key' => '_stock_status',
167
+ 'value' => 'instock',
168
+ 'compare' => 'AND'
169
+ );
170
+ }
171
+
172
  $this->unfiltered_product_ids = get_posts( $unfiltered_args );
173
  $this->filtered_product_ids = $queried_post_ids;
174
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 3.0.6
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
@@ -64,7 +64,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
64
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.6' );
68
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
 
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 3.0.7
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
64
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.7' );
68
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
 
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -78,6 +78,17 @@
78
  input.change();
79
  });
80
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  //slider
83
  $('.plugin-option .slider_container .ui-slider-horizontal').each(function () {
78
  input.change();
79
  });
80
 
81
+ //colorpicker
82
+ $('.plugin-option .panel-colorpicker').wpColorPicker({
83
+ onInit: function(){ },
84
+ change: function(event, ui){
85
+ },
86
+ clear: function(){
87
+ var input = $(this);
88
+ input.val(input.data('default-color'));
89
+ input.change();
90
+ }
91
+ });
92
 
93
  //slider
94
  $('.plugin-option .slider_container .ui-slider-horizontal').each(function () {
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,10 +1 @@
1
- (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
- "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .onoff_container span").on("click",
3
- function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
- a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
- var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a("#"+d+"-yith-attachment-id")&&a("#"+d+"-yith-attachment-id").val(b.id);a(".plugin-option .upload_img_url").trigger("change")}));
6
- c.open()}),a(document).on("click",".plugin-option .upload_button_reset",function(b){var c=a(this);b=c.attr("id");c=c.attr("id").replace(/-button_reset$/,"");b=a("#"+b).data("default");a("#"+c).val(b);a(".plugin-option .upload_img_url").trigger("change")}));a(".plugin-option .add_media").on("click",function(){});a("[data-field]").each(function(){var b=a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==
7
- b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,
8
- "\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(b,d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});
9
- a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";
10
- e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
1
+ !function(t){function e(e,i,n){var a=!0;if("string"==typeof i){":radio"==i.substr(0,6)&&(i+=":checked");for(var n=n.split(","),o=0;o<n.length;o++){if(t(i).val()==n[o]){a=!0;break}a=!1}}a?t(e+"-container").closest("tr").show():t(e+"-container").closest("tr").hide()}var i=function(){var e="";t(this).attr("multiple")?(t(this).children("option:selected").each(function(i,n){0!=i&&(e+=", "),e+=t(n).text()}),""==e&&t(this).children().children("option:selected").each(function(i,n){0!=i&&(e+=", "),e+=t(n).text()})):(e=t(this).children("option:selected").text(),""==e&&(e=t(this).children().children("option:selected").text())),t(this).parent().find("span").length<=0&&t(this).before("<span></span>"),t(this).parent().children("span").replaceWith("<span>"+e+"</span>")};if(t(".plugin-option .select_wrapper select").not(".chosen").each(i).change(i),t(".plugin-option .select_wrapper").click(function(e){e.stopPropagation(),t(this).find("select[multiple]").not(".chosen").toggle()}),t(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(t){t.stopPropagation()}),t(window).click(function(){t(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()}),t(".plugin-option .chosen .select_wrapper select").chosen(),t(".plugin-option .onoff_container span").on("click",function(){var e=t(this).prev("input"),i=e.prop("checked");i?e.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):e.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),e.change()}),t(".plugin-option .panel-colorpicker").wpColorPicker({onInit:function(){},change:function(t,e){},clear:function(){var e=t(this);e.val(e.data("default-color")),e.change()}}),t(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var e=t(this).data("val"),i=t(this).data("min"),n=t(this).data("max"),a=t(this).data("step"),o=t(this).data("labels");t(this).slider({value:e,min:i,max:n,range:"min",step:a,slide:function(e,i){t(this).find("input").val(i.value),t(this).siblings(".feedback").find("strong").text(i.value+o)}})}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media){var n=!0;wp.media.editor.send.attachment;t(".plugin-option .upload_img_url").change(function(){var e=t(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),n=t(this).parents().siblings(".upload_img_preview");i.test(e)?n.html('<img src="'+e+'" style="max-width:600px; max-height:300px;" />'):n.html("")}).trigger("change"),t(document).on("click",".plugin-option .upload_button",function(e){e.preventDefault();var i,n=t(this),a=n.attr("id").replace(/-button$/,"");if(i)return void i.open();var o=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:o}),i.on("select",function(){var e=i.state().get("selection").first().toJSON();t("#"+a).val(e.url),t("#"+a+"-yith-attachment-id")&&t("#"+a+"-yith-attachment-id").val(e.id),t(".plugin-option .upload_img_url").trigger("change")}),i.open()}),t(document).on("click",".plugin-option .upload_button_reset",function(e){var i=t(this),n=i.attr("id"),a=i.attr("id").replace(/-button_reset$/,""),o=t("#"+n).data("default");t("#"+a).val(o),t(".plugin-option .upload_img_url").trigger("change")})}t(".plugin-option .add_media").on("click",function(){n=!1}),t("[data-field]").each(function(){var i=t(this),n="#"+i.data("field"),a="#"+i.data("dep"),o=i.data("value");t(a).on("change",function(){e(n,a,o.toString())}).change()}),t(".rm_connectedlist").each(function(){var e=t(this).find("ul"),i=t(this).find(":hidden");e.sortable({connectWith:e,update:function(n,a){var o={};e.each(function(){var e={};t(this).children().each(function(){e[t(this).data("option")]=t(this).text()}),o[t(this).data("list")]=e}),i.val(JSON.stringify(o).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}),t(document).ready(function(){t(".yith-video-link").click(function(e){e.preventDefault();var i=t(this).data("video-id");t("."+i).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(e,i){t(this).css("maxWidth","853px")},open:function(e,i){t(".ui-widget-overlay").bind("click",function(){t(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}}),t(".ui-dialog :button").blur()})}),t(document).ready(function(){t(".codemirror").each(function(e,i){var n=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});t(i).data("codemirrorInstance",n)})}),t(document).ready(function(){t(".google-analytic-generate").click(function(){var e=t("#"+t(this).data("textarea")).data("codemirrorInstance"),i=t("#"+t(this).data("input")).val(),n=t(this).data("basename"),a="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";a+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",a+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",a+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",a+="ga('create', '"+i+"', '"+n+"');\n",a+="ga('send', 'pageview');\n",e.replaceRange(a,e.getCursor("start"),e.getCursor("end"))})})}(jQuery);
 
 
 
 
 
 
 
 
 
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.34
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 2.9.35
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/yit-plugin-panel-sidebar.php CHANGED
@@ -166,6 +166,10 @@ if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
166
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
167
  */
168
  public function get_remote_widgets() {
 
 
 
 
169
  $remote_widgets = get_transient( self::$transient_remote_widgets );
170
  $updated = get_transient( self::$transient_updated_remote_widgets );
171
  $is_debug = defined( 'YIT_FW_REMOTE_WIDGETS_DEBUG' ) && YIT_FW_REMOTE_WIDGETS_DEBUG;
@@ -209,11 +213,11 @@ if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
209
  if ( !isset( $xml_widget->id ) )
210
  continue;
211
 
212
- $widget_id = (string)$xml_widget->id;
213
  $widget_array = array();
214
  foreach ( $enabled_args as $key ) {
215
  if ( isset( $xml_widget->$key ) ) {
216
- $widget_array[ $key ] = (string)$xml_widget->$key;
217
  } else {
218
  if ( $key == 'priority' ) {
219
  $widget_array[ $key ] = $last_remote_priority;
@@ -224,7 +228,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
224
  $remote_widgets[ $widget_id ] = $widget_array;
225
  }
226
 
227
- $xml_expiration = isset( $xml_data->expiration ) ? (string)$xml_data->expiration : '';
228
  if ( !empty( $xml_expiration ) ) {
229
  $expiration = strtotime( $xml_expiration ) - strtotime( 'now' );
230
  // if the XML is expired removes widgets
@@ -253,8 +257,7 @@ if ( !class_exists( 'YIT_Plugin_Panel_Sidebar' ) ) {
253
  if ( $expiration < 1 ) {
254
  $expiration = 1 * DAY_IN_SECONDS + $four_days_random;
255
  }
256
- }
257
- catch ( Exception $e ) {
258
 
259
  }
260
 
166
  * @author Leanza Francesco <leanzafrancesco@gmail.com>
167
  */
168
  public function get_remote_widgets() {
169
+ $load_remote_widgets = apply_filters( 'yit_panel_sidebar_load_remote_widgets', true );
170
+ if ( !$load_remote_widgets )
171
+ return array();
172
+
173
  $remote_widgets = get_transient( self::$transient_remote_widgets );
174
  $updated = get_transient( self::$transient_updated_remote_widgets );
175
  $is_debug = defined( 'YIT_FW_REMOTE_WIDGETS_DEBUG' ) && YIT_FW_REMOTE_WIDGETS_DEBUG;
213
  if ( !isset( $xml_widget->id ) )
214
  continue;
215
 
216
+ $widget_id = (string) $xml_widget->id;
217
  $widget_array = array();
218
  foreach ( $enabled_args as $key ) {
219
  if ( isset( $xml_widget->$key ) ) {
220
+ $widget_array[ $key ] = (string) $xml_widget->$key;
221
  } else {
222
  if ( $key == 'priority' ) {
223
  $widget_array[ $key ] = $last_remote_priority;
228
  $remote_widgets[ $widget_id ] = $widget_array;
229
  }
230
 
231
+ $xml_expiration = isset( $xml_data->expiration ) ? (string) $xml_data->expiration : '';
232
  if ( !empty( $xml_expiration ) ) {
233
  $expiration = strtotime( $xml_expiration ) - strtotime( 'now' );
234
  // if the XML is expired removes widgets
257
  if ( $expiration < 1 ) {
258
  $expiration = 1 * DAY_IN_SECONDS + $four_days_random;
259
  }
260
+ } catch ( Exception $e ) {
 
261
 
262
  }
263
 
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -152,7 +152,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
152
  wp_enqueue_script( 'jquery-ui-slider' );
153
  wp_enqueue_script( 'jquery-ui-dialog' );
154
  wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
155
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
156
  wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
157
  wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
158
  wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
@@ -168,7 +168,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
168
  wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
169
  wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
170
  wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
171
-
172
  if( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) || apply_filters( 'yit_plugin_panel_asset_loading', false ) ){
173
  wp_enqueue_style( 'yit-plugin-style' );
174
  wp_enqueue_script( 'yit-plugin-panel' );
152
  wp_enqueue_script( 'jquery-ui-slider' );
153
  wp_enqueue_script( 'jquery-ui-dialog' );
154
  wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
155
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen','wp-color-picker'), $this->version, true );
156
  wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
157
  wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
158
  wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
168
  wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
169
  wp_register_style( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/css/colorbox.css', array(), $this->version );
170
  wp_register_style( 'yit-upgrade-to-pro', YIT_CORE_PLUGIN_URL . '/assets/css/yit-upgrade-to-pro.css', array( 'colorbox' ), $this->version );
171
+
172
  if( ( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yith-plugins_page' ) !== false ) || apply_filters( 'yit_plugin_panel_asset_loading', false ) ){
173
  wp_enqueue_style( 'yit-plugin-style' );
174
  wp_enqueue_script( 'yit-plugin-panel' );
plugin-fw/lib/yit-pointers.php CHANGED
@@ -68,8 +68,8 @@ if ( ! class_exists( 'YIT_Pointers' ) ) {
68
  'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
69
  <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
70
  __( 'Plugins Activated', 'yith-plugin-fw' ),
71
- __( 'From now on, you can find all plugin options in YIT Plugin menu.
72
- For each plugin installed, customization settings will be available as a new entry in YIT Plugin menu.', 'yith-plugin-fw' ),
73
  __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
74
  __( 'and', 'yith-plugin-fw' )
75
  ),
@@ -82,10 +82,10 @@ if ( ! class_exists( 'YIT_Pointers' ) ) {
82
  'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
83
  <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
84
  __( 'Plugins Upgraded', 'yith-plugin-fw' ),
85
- __( 'From now on, you can find all options of your plugins in YIT Plugin menu.
86
- Any time one of our plugins is updated, a new entry will be added to this menu.
87
  For example, after the update, plugin options (such as for YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search, etc.)
88
- will be moved from previous location to YIT Plugin tab.', 'yith-plugin-fw' ),
89
  __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
90
  __( 'and', 'yith-plugin-fw' )
91
  ),
68
  'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
69
  <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
70
  __( 'Plugins Activated', 'yith-plugin-fw' ),
71
+ __( 'From now on, you can find all plugin options in YITH Plugins menu.
72
+ Plugin customization settings will be available as a new entry in YITH Plugins menu.', 'yith-plugin-fw' ),
73
  __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
74
  __( 'and', 'yith-plugin-fw' )
75
  ),
82
  'content' => sprintf( '<h3> %s </h3> <p> %s </p> <p> %s <a href="http://yithemes.com/product-category/plugins/" target="_blank">Yithemes.com</a> %s
83
  <a href="https://profiles.wordpress.org/yithemes/" target="_blank">Wordpress.org</a></p>',
84
  __( 'Plugins Upgraded', 'yith-plugin-fw' ),
85
+ __( 'From now on, you can find the option panel of YITH plugins in YITH Plugins menu.
86
+ Every time one of our plugins is added, a new entry will be added to this menu.
87
  For example, after the update, plugin options (such as for YITH WooCommerce Wishlist, YITH WooCommerce Ajax Search, etc.)
88
+ will be moved from previous location to YITH Plugins tab.', 'yith-plugin-fw' ),
89
  __( 'Discover all our plugins available on:', 'yith-plugin-fw' ),
90
  __( 'and', 'yith-plugin-fw' )
91
  ),
plugin-fw/templates/panel/types/colorpicker.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ /**
12
+ * Text Plugin Admin View
13
+ *
14
+ * @package Yithemes
15
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
+ * @since 1.0.0
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ } // Exit if accessed directly
22
+
23
+ wp_enqueue_style('wp-color-picker');
24
+
25
+ $id = $this->get_id_field( $option['id'] );
26
+ $name = $this->get_name_field( $option['id'] );
27
+
28
+ ?>
29
+ <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_colorpicker">
30
+ <div class="option">
31
+ <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php if( isset( $std ) ) : ?>data-default-color="<?php echo $std ?>"<?php endif ?> class="panel-colorpicker"/>
32
+
33
+ </div>
34
+ <span class="description"><?php echo $option['desc'] ?></span>
35
+
36
+ <div class="clear"></div>
37
+ </div>
38
+
plugin-fw/templates/panel/types/number.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ /**
12
+ * Number Plugin Admin View
13
+ *
14
+ * @package Yithemes
15
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
16
+ * @since 1.0.0
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ } // Exit if accessed directly
22
+
23
+ $id = $this->get_id_field( $option['id'] );
24
+ $name = $this->get_name_field( $option['id'] );
25
+
26
+ ?>
27
+ <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
+ <div class="option">
29
+ <input type="number" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php echo $custom_attributes ?> />
30
+ </div>
31
+ <span class="description"><?php echo $option['desc'] ?></span>
32
+
33
+ <div class="clear"></div>
34
+ </div>
35
+
plugin-fw/templates/panel/types/upload.php CHANGED
@@ -38,7 +38,7 @@ $name = $this->get_name_field( $option['id'] );
38
  <?php
39
  $file = $db_value;
40
  if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
41
- echo "<img src=\"" . $this->settings['plugin-url'] . "/plugin-fw/assets/images/sleep.png\" data-src=\"$file\" />";
42
  }
43
  ?>
44
  </div>
38
  <?php
39
  $file = $db_value;
40
  if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
41
+ echo isset( $this->settings['plugin-url'] ) ? "<img src=\"" . $this->settings['plugin-url'] . "/plugin-fw/assets/images/sleep.png\" data-src=\"$file\" />" : '';
42
  }
43
  ?>
44
  </div>
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -859,7 +859,8 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
859
 
860
  public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
861
  $_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
862
- $in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
 
863
  foreach ( $terms as $parent_id => $term_ids ) {
864
  $term = get_term_by( 'id', $parent_id, $taxonomy );
865
 
859
 
860
  public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
861
  $_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
862
+ $in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
863
+ $terms = apply_filters( 'yith_wcan_get_list_html_terms', $terms, $taxonomy, $instance );
864
  foreach ( $terms as $parent_id => $term_ids ) {
865
  $term = get_term_by( 'id', $parent_id, $taxonomy );
866