Version Description
Released on 22th October, 2018 =
Update: Plugin Core Framework
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Ajax Product Filter |
Version | 3.6.1 |
Comparing to | |
See all releases |
Code changes from version 3.6.0 to 3.6.1
- README.txt +5 -1
- init.php +3 -3
- plugin-fw/assets/css/admin.css +13 -0
- plugin-fw/assets/js/yith-promo.js +20 -0
- plugin-fw/assets/js/yith-promo.min.js +1 -0
- plugin-fw/init.php +1 -1
- plugin-fw/lib/promo/yith-promo.php +141 -0
- plugin-fw/lib/yit-upgrade.php +1 -1
- plugin-fw/yit-plugin.php +2 -1
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.9
|
7 |
-
Stable tag: 3.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -159,6 +159,10 @@ If you want to see a demonstration version of the premium plugin, you can see it
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
|
|
162 |
= 3.6.0 - Released on 11th October, 2018 =
|
163 |
|
164 |
* New: Support for WooCommerce 3.5
|
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.9
|
7 |
+
Stable tag: 3.6.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 3.6.1 - Released on 22th October, 2018 =
|
163 |
+
|
164 |
+
* Update: Plugin Core Framework
|
165 |
+
|
166 |
= 3.6.0 - Released on 11th October, 2018 =
|
167 |
|
168 |
* New: Support for WooCommerce 3.5
|
init.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/**
|
3 |
* Plugin Name: YITH WooCommerce Ajax Product Filter
|
4 |
* Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
|
5 |
-
* Description:<code>YITH WooCommerce AJAX Product Filter</code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products, improve the user experience and give the impression of being in a big and reliable store. <a href="https://yithemes.com/" target="_blank">Find new awesome plugins by <strong>YITH</strong></a>
|
6 |
-
* Version: 3.
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-ajax-navigation
|
@@ -67,7 +67,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
|
|
67 |
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
|
68 |
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
|
69 |
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
|
70 |
-
! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.6.
|
71 |
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
|
72 |
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
|
73 |
|
2 |
/**
|
3 |
* Plugin Name: YITH WooCommerce Ajax Product Filter
|
4 |
* Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
|
5 |
+
* Description:<code><strong>YITH WooCommerce AJAX Product Filter</strong></code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products, improve the user experience and give the impression of being in a big and reliable store. <a href="https://yithemes.com/" target="_blank">Find new awesome plugins by <strong>YITH</strong></a>
|
6 |
+
* Version: 3.6.1
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-ajax-navigation
|
67 |
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
|
68 |
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
|
69 |
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
|
70 |
+
! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.6.1' );
|
71 |
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
|
72 |
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
|
73 |
|
plugin-fw/assets/css/admin.css
CHANGED
@@ -33,6 +33,19 @@
|
|
33 |
line-height : 1.5em;
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
/*-----------------------
|
37 |
YITH Plugins Columns
|
38 |
------------------------*/
|
33 |
line-height : 1.5em;
|
34 |
}
|
35 |
|
36 |
+
.notice-yith{
|
37 |
+
border-left-color: #acc327;
|
38 |
+
}
|
39 |
+
|
40 |
+
.notice-yith.notice-alt{
|
41 |
+
background-color: #ecf7ed;
|
42 |
+
}
|
43 |
+
|
44 |
+
.yith-promo-banner-image{
|
45 |
+
max-width: 100%;
|
46 |
+
padding-bottom: 15px;
|
47 |
+
}
|
48 |
+
|
49 |
/*-----------------------
|
50 |
YITH Plugins Columns
|
51 |
------------------------*/
|
plugin-fw/assets/js/yith-promo.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function ($) {
|
2 |
+
$(document).on('click', '.notice-dismiss', function () {
|
3 |
+
var t = $(this),
|
4 |
+
promo_wrapper = t.parent('div.yith-notice-is-dismissible'),
|
5 |
+
promo_id = promo_wrapper.attr('id');
|
6 |
+
|
7 |
+
if (typeof promo_id != 'undefined') {
|
8 |
+
var cname = 'hide_' + promo_id,
|
9 |
+
cvalue = 'yes',
|
10 |
+
expiry = promo_wrapper.data('expiry'),
|
11 |
+
expiry_date = new Date(expiry);
|
12 |
+
|
13 |
+
expiry_date.setUTCHours( 23 );
|
14 |
+
expiry_date.setUTCMinutes( 59 );
|
15 |
+
expiry_date.setUTCSeconds( 59 );
|
16 |
+
|
17 |
+
document.cookie = cname + "=" + cvalue + ";" + 'expires=' + expiry_date.toUTCString() + ";path=/";
|
18 |
+
}
|
19 |
+
});
|
20 |
+
})(jQuery);
|
plugin-fw/assets/js/yith-promo.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(c){c(document).on("click",".notice-dismiss",function(){var a=c(this).parent("div.yith-notice-is-dismissible"),b=a.attr("id");"undefined"!=typeof b&&(b="hide_"+b,a=a.data("expiry"),a=new Date(a),a.setUTCHours(23),a.setUTCMinutes(59),a.setUTCSeconds(59),document.cookie=b+"=yes;expires="+a.toUTCString()+";path=/")})})(jQuery);
|
plugin-fw/init.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
-
* Version: 3.0.
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.0.28
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
plugin-fw/lib/promo/yith-promo.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
if( apply_filters( 'yith_plugin_fw_notice', true ) ){
|
12 |
+
add_action( 'admin_notices', 'yith_plugin_fw_promo_notices', 15 );
|
13 |
+
add_action( 'admin_enqueue_scripts', 'yith_plugin_fw_notice_dismiss', 20 );
|
14 |
+
|
15 |
+
if( ! function_exists( 'yith_plugin_fw_promo_notices' ) ){
|
16 |
+
function yith_plugin_fw_promo_notices(){
|
17 |
+
$base_url = apply_filters( 'yith_plugin_fw_promo_base_url', 'https://update.yithemes.com/promo/' );;
|
18 |
+
$xml = apply_filters( 'yith_plugin_fw_promo_xml_url', $base_url . 'yith-promo.xml' );
|
19 |
+
$transient = "yith_promo_message";
|
20 |
+
$remote_data = get_site_transient( $transient );
|
21 |
+
$regenerate_promo_transient = isset( $_GET['yith_regenerate_promo_transient'] ) && 'yes' == $_GET['yith_regenerate_promo_transient'] ? $_GET['yith_regenerate_promo_transient'] : '';
|
22 |
+
$promo_data = false;
|
23 |
+
$create_transient = false;
|
24 |
+
|
25 |
+
if( false === $remote_data || apply_filters( 'yith_plugin_fw_force_regenerate_promo_transient', false ) || 'yes' == $regenerate_promo_transient ){
|
26 |
+
$remote_data = wp_remote_get( $xml );
|
27 |
+
$create_transient = true;
|
28 |
+
}
|
29 |
+
|
30 |
+
if ( ! is_wp_error( $remote_data ) && isset( $remote_data['response']['code'] ) && '200' == $remote_data['response']['code'] ) {
|
31 |
+
$promo_data = @simplexml_load_string( $remote_data['body'] );
|
32 |
+
|
33 |
+
if( true === $create_transient ){
|
34 |
+
$xml_expiry_date = ! empty( $promo_data->expiry_date ) ? $promo_data->expiry_date : '';
|
35 |
+
//Set Site Transient
|
36 |
+
set_site_transient( $transient, $remote_data, yith_plugin_fw_get_promo_transient_expiry_date( $xml_expiry_date ) );
|
37 |
+
}
|
38 |
+
|
39 |
+
if ( $promo_data && ! empty( $promo_data->promo ) ) {
|
40 |
+
$now = strtotime( current_time( 'Y-m-d' ), 1 );
|
41 |
+
foreach ($promo_data as $promo ){
|
42 |
+
$start_date = isset( $promo->start_date ) ? $promo->start_date : '';
|
43 |
+
$end_date = isset( $promo->end_date ) ? $promo->end_date : '';
|
44 |
+
|
45 |
+
if( ! empty( $start_date ) && ! empty( $end_date ) ){
|
46 |
+
$start_date = strtotime( $start_date );
|
47 |
+
$end_date = strtotime( $end_date );
|
48 |
+
|
49 |
+
if( $end_date >= $start_date && $now >= $start_date && $now <= $end_date ){
|
50 |
+
//is valid promo
|
51 |
+
$title = isset( $promo->title ) ? $promo->title : '';
|
52 |
+
$description = isset( $promo->description ) ? $promo->description : '';
|
53 |
+
$url = isset( $promo->link->url ) ? $promo->link->url : '';
|
54 |
+
$url_label = isset( $promo->link->label ) ? $promo->link->label : '';
|
55 |
+
$border_color = isset( $promo->style->border_color ) ? $promo->style->border_color : '';
|
56 |
+
$background_color = isset( $promo->style->background_color ) ? $promo->style->background_color : '';
|
57 |
+
$promo_id = isset( $promo->promo_id ) ? $promo->promo_id : '';
|
58 |
+
$banner = isset( $promo->banner ) ? $promo->banner : '';
|
59 |
+
$style = $link = '';
|
60 |
+
$show_notice = false;
|
61 |
+
|
62 |
+
if( ! empty( $border_color ) ){
|
63 |
+
$style .= "border-left-color: {$border_color};";
|
64 |
+
}
|
65 |
+
|
66 |
+
if( ! empty( $background_color ) ){
|
67 |
+
$style .= "background-color: {$background_color};";
|
68 |
+
}
|
69 |
+
|
70 |
+
if( ! empty( $title ) ) {
|
71 |
+
$promo_id .= $title;
|
72 |
+
$title = sprintf( '<strong>%s</strong>: ', $title );
|
73 |
+
$show_notice = true;
|
74 |
+
}
|
75 |
+
|
76 |
+
if( ! empty( $description ) ) {
|
77 |
+
$promo_id .= $description;
|
78 |
+
$description = sprintf( '%s', $description );
|
79 |
+
$show_notice = true;
|
80 |
+
}
|
81 |
+
|
82 |
+
if( ! empty( $url ) && ! empty( $url_label )) {
|
83 |
+
$promo_id .= $url . $url_label;
|
84 |
+
$link = sprintf( '<a href="%s" target="_blank">%s</a>', $url, $url_label );
|
85 |
+
$show_notice = true;
|
86 |
+
}
|
87 |
+
|
88 |
+
if( ! empty( $banner ) ){
|
89 |
+
$banner = sprintf( '<img src="%s" class="yith-promo-banner-image">', $base_url . $banner );
|
90 |
+
|
91 |
+
if( ! empty( $url ) ){
|
92 |
+
$banner = sprintf( '<a href="%s" target="_blank">%s</a>', $url, $banner);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
$unique_promo_id = "yith-notice-" . md5 ( $promo_id );
|
97 |
+
|
98 |
+
if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
|
99 |
+
$show_notice = false;
|
100 |
+
}
|
101 |
+
|
102 |
+
if ( true === $show_notice ) :
|
103 |
+
?>
|
104 |
+
<div id="<?php echo $unique_promo_id; ?>" class="yith-notice-is-dismissible notice notice-yith notice-alt is-dismissible" style="<?php echo $style; ?>" data-expiry= <?php echo $promo->end_date; ?>>
|
105 |
+
<p>
|
106 |
+
<?php if( ! empty( $banner ) ) { printf( '%s', $banner ); } ?>
|
107 |
+
<?php printf( "%s %s %s", $title, $description, $link ); ?>
|
108 |
+
</p>
|
109 |
+
</div>
|
110 |
+
<?php endif;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
|
120 |
+
function yith_plugin_fw_notice_dismiss(){
|
121 |
+
$script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
|
122 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
123 |
+
wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
|
124 |
+
wp_enqueue_script( 'yith-promo' );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
|
129 |
+
function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
|
130 |
+
$xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+6 hours';
|
131 |
+
$current = strtotime( current_time( 'Y-m-d H:i:s', 1 ) );
|
132 |
+
$expiry_date = strtotime( $xml_expiry_date, $current );
|
133 |
+
|
134 |
+
if( $expiry_date <= $current ){
|
135 |
+
$expiry_date = strtotime( '+24 hours', $current );
|
136 |
+
}
|
137 |
+
|
138 |
+
return $expiry_date;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
plugin-fw/lib/yit-upgrade.php
CHANGED
@@ -620,7 +620,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
|
|
620 |
//Get license for YITH Plugins
|
621 |
$enabled_license = YIT_Plugin_Licence()->get_licence();
|
622 |
|
623 |
-
if( false !== $enabled_license[ $slug ]['activated'] ){
|
624 |
if( isset( $enabled_license[ $slug ]['licence_key'] ) ){
|
625 |
$license = $enabled_license[ $slug ]['licence_key'];
|
626 |
}
|
620 |
//Get license for YITH Plugins
|
621 |
$enabled_license = YIT_Plugin_Licence()->get_licence();
|
622 |
|
623 |
+
if( isset( $enabled_license[ $slug ]['activated'] ) && false !== $enabled_license[ $slug ]['activated'] ){
|
624 |
if( isset( $enabled_license[ $slug ]['licence_key'] ) ){
|
625 |
$license = $enabled_license[ $slug ]['licence_key'];
|
626 |
}
|
plugin-fw/yit-plugin.php
CHANGED
@@ -39,6 +39,7 @@ include_once( 'lib/yit-assets.php');
|
|
39 |
include_once( 'lib/yit-debug.php');
|
40 |
include_once( 'lib/privacy/yit-privacy.php' );
|
41 |
include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
|
|
|
42 |
|
43 |
// load from theme folder...
|
44 |
load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
|
@@ -144,7 +145,7 @@ if( ! function_exists( 'yit_plugin_fw_row_meta' ) ){
|
|
144 |
|
145 |
else{
|
146 |
if( isset( $base_uri[ $field ] ) ) {
|
147 |
-
$url = $base_uri[ $field ] . $slug;
|
148 |
}
|
149 |
}
|
150 |
}
|
39 |
include_once( 'lib/yit-debug.php');
|
40 |
include_once( 'lib/privacy/yit-privacy.php' );
|
41 |
include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
|
42 |
+
include_once ( 'lib/promo/yith-promo.php' );
|
43 |
|
44 |
// load from theme folder...
|
45 |
load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
|
145 |
|
146 |
else{
|
147 |
if( isset( $base_uri[ $field ] ) ) {
|
148 |
+
$url = apply_filters( "yith_plugin_row_meta_{$field}_url", $base_uri[ $field ] . $slug, $field, $slug, $base_uri );
|
149 |
}
|
150 |
}
|
151 |
}
|