YITH WooCommerce Ajax Search - Version 1.6.5

Version Description

  • Released: Apr 23, 2019 = Update: Plugin Core 3.1.29
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Search
Version 1.6.5
Comparing to
See all releases

Code changes from version 1.6.4 to 1.6.5

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 4.0.0
6
  Tested up to: 5.0
7
- Stable tag: 1.6.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,9 @@ If you have created your own language pack for YITH WooCommerce Ajax Search, or
138
  2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
 
140
  == Changelog ==
 
 
 
141
  = 1.6.4 - Released: Apr 09, 2019 =
142
  New: Support to WooCommerce 3.6.0 RC1
143
  Update: Plugin Core 3.1.28
4
  Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
  Requires at least: 4.0.0
6
  Tested up to: 5.0
7
+ Stable tag: 1.6.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
138
  2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
 
140
  == Changelog ==
141
+ = 1.6.5 - Released: Apr 23, 2019 =
142
+ Update: Plugin Core 3.1.29
143
+
144
  = 1.6.4 - Released: Apr 09, 2019 =
145
  New: Support to WooCommerce 3.6.0 RC1
146
  Update: Plugin Core 3.1.28
class.yith-wcas-admin.php CHANGED
@@ -246,7 +246,7 @@ YITH WooCommerce Ajax Search renovates with new available options, discover the'
246
  * @return string The premium landing link
247
  */
248
  public function get_premium_landing_uri(){
249
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
250
  }
251
 
252
  }
246
  * @return string The premium landing link
247
  */
248
  public function get_premium_landing_uri(){
249
+ return $this->_premium_landing;
250
  }
251
 
252
  }
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-ajax-search/
5
  * Description: <code><strong>YITH WooCommerce Ajax Search</strong></code> is the plugin that allows you to search for a specific product by inserting a few characters. Thanks to <strong>Ajax Search</strong>, users can quickly find the contents they are interested in without wasting time among site pages. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 1.6.4
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
@@ -67,7 +67,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
67
  if ( defined( 'YITH_WCAS_VERSION' ) ){
68
  return;
69
  }else{
70
- define( 'YITH_WCAS_VERSION', '1.6.4' );
71
  }
72
 
73
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-ajax-search/
5
  * Description: <code><strong>YITH WooCommerce Ajax Search</strong></code> is the plugin that allows you to search for a specific product by inserting a few characters. Thanks to <strong>Ajax Search</strong>, users can quickly find the contents they are interested in without wasting time among site pages. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 1.6.5
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
67
  if ( defined( 'YITH_WCAS_VERSION' ) ){
68
  return;
69
  }else{
70
+ define( 'YITH_WCAS_VERSION', '1.6.5' );
71
  }
72
 
73
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.1.28
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.1.29
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/promo/yith-promo.php DELETED
@@ -1,189 +0,0 @@
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( ! function_exists( 'simplexml_load_string' ) ){
12
- return false;
13
- }
14
-
15
- add_action( 'admin_notices', 'yith_plugin_fw_promo_notices', 15 );
16
- add_action( 'admin_enqueue_scripts', 'yith_plugin_fw_notice_dismiss', 20 );
17
-
18
- if( ! function_exists( 'yith_plugin_fw_promo_notices' ) ){
19
- function yith_plugin_fw_promo_notices(){
20
- $base_url = apply_filters( 'yith_plugin_fw_promo_base_url', 'https://update.yithemes.com/promo/hotlink-ok/' );
21
- $xml = apply_filters( 'yith_plugin_fw_promo_xml_url', $base_url . 'yith-promo.xml' );
22
- $transient = "yith_promo_message";
23
- $remote_data = get_site_transient( $transient );
24
- $regenerate_promo_transient = isset( $_GET['yith_regenerate_promo_transient'] ) && 'yes' == $_GET['yith_regenerate_promo_transient'] ? $_GET['yith_regenerate_promo_transient'] : '';
25
- $promo_data = false;
26
- $create_transient = false;
27
-
28
- if( false === $remote_data || apply_filters( 'yith_plugin_fw_force_regenerate_promo_transient', false ) || 'yes' == $regenerate_promo_transient ){
29
- $remote_data = wp_remote_get( $xml );
30
- $create_transient = true;
31
- }
32
-
33
- if ( ! is_wp_error( $remote_data ) && isset( $remote_data['response']['code'] ) && '200' == $remote_data['response']['code'] ) {
34
- $promo_data = @simplexml_load_string( $remote_data['body'] );
35
- $license = YIT_Plugin_Licence()->get_licence();
36
-
37
- if( true === $create_transient ){
38
- $is_membership_user = false;
39
- $xml_expiry_date = '';
40
-
41
- if( is_array( $license ) && apply_filters( 'yith_plugin_fw_check_for_membership_user', true ) ){
42
- /* === Check is the user have the YITH Club === */
43
- foreach( $license as $plugin => $data ){
44
- if( ! empty( $data['is_membership'] ) ){
45
- $is_membership_user = true;
46
- $xml_expiry_date = $data['licence_expires'];
47
- $remote_data = $promo_data = array();
48
- break;
49
- }
50
- }
51
- }
52
-
53
- if( empty( $is_membership_user ) && ! empty( $promo_data->expiry_date ) ){
54
- $xml_expiry_date = $promo_data->expiry_date;
55
- }
56
-
57
- //Set Site Transient
58
- set_site_transient( $transient, $remote_data, yith_plugin_fw_get_promo_transient_expiry_date( $xml_expiry_date ) );
59
- }
60
-
61
- if ( $promo_data && ! empty( $promo_data->promo ) ) {
62
- $now = strtotime( current_time( 'mysql' ) );
63
-
64
- foreach ($promo_data->promo as $promo ){
65
- $show_promo = true;
66
- /* === Check for Special Promo === */
67
- if ( ! empty( $promo->show_promo_in ) ) {
68
- $show_promo_in = explode( ',', $promo->show_promo_in );
69
- $show_promo_in = array_map( 'trim', $show_promo_in );
70
- if ( ! empty( $show_promo_in ) ) {
71
- $show_promo = false;
72
- foreach ( $show_promo_in as $plugin ) {
73
- if ( defined( $plugin ) ) {
74
- $plugin_slug = constant( $plugin );
75
- $plugin_is_activated = ! empty( $license[ $plugin_slug ]['activated'] );
76
- if ( defined( $plugin ) && ! apply_filters( 'yith_plugin_fw_promo_plugin_is_activated', $plugin_is_activated ) ) {
77
- $show_promo = true;
78
- break;
79
- }
80
- }
81
- }
82
- }
83
- }
84
-
85
- $start_date = isset( $promo->start_date ) ? $promo->start_date : '';
86
- $end_date = isset( $promo->end_date ) ? $promo->end_date : '';
87
-
88
- if( $show_promo && ! empty( $start_date ) && ! empty( $end_date ) ){
89
- $start_date = strtotime( $start_date );
90
- $end_date = strtotime( $end_date );
91
-
92
- if( $end_date >= $start_date && $now >= $start_date && $now <= $end_date ){
93
- //is valid promo
94
- $title = isset( $promo->title ) ? $promo->title : '';
95
- $description = isset( $promo->description ) ? $promo->description : '';
96
- $url = isset( $promo->link->url ) ? $promo->link->url : '';
97
- $url_label = isset( $promo->link->label ) ? $promo->link->label : '';
98
- $image_bg_color = isset( $promo->style->image_bg_color ) ? $promo->style->image_bg_color : '';
99
- $border_color = isset( $promo->style->border_color ) ? $promo->style->border_color : '';
100
- $background_color = isset( $promo->style->background_color ) ? $promo->style->background_color : '';
101
- $promo_id = isset( $promo->promo_id ) ? $promo->promo_id : '';
102
- $banner = isset( $promo->banner ) ? $promo->banner : '';
103
- $style = $link = '';
104
- $show_notice = false;
105
- $original_promo_id = $promo_id;
106
-
107
- if( ! empty( $border_color ) ){
108
- $style .= "border-left-color: {$border_color};";
109
- }
110
-
111
- if( ! empty( $background_color ) ){
112
- $style .= "background-color: {$background_color};";
113
- }
114
-
115
- if( ! empty( $image_bg_color ) ){
116
- $image_bg_color = "background-color: {$image_bg_color};";
117
- }
118
-
119
- if( ! empty( $title ) ) {
120
- $promo_id .= $title;
121
- $title = sprintf( '%s: ', $title );
122
- $show_notice = true;
123
- }
124
-
125
- if( ! empty( $description ) ) {
126
- $promo_id .= $description;
127
- $description = sprintf( '%s', $description );
128
- $show_notice = true;
129
- }
130
-
131
- if( ! empty( $url ) && ! empty( $url_label )) {
132
- $promo_id .= $url . $url_label;
133
- $link = sprintf( '<a class="yith-promo-url" href="%s" target="_blank">%s</a>', $url, $url_label );
134
- $show_notice = true;
135
- }
136
-
137
- if( ! empty( $banner ) ){
138
- $banner = sprintf( '<img src="%s" class="yith-promo-banner-image">', $base_url . $banner );
139
-
140
- if( ! empty( $url ) ){
141
- $banner = sprintf( '<a class="yith-promo-banner-image-link" href="%s" target="_blank" style="%s">%s</a>', $url, $image_bg_color, $banner);
142
- }
143
- }
144
-
145
- $unique_promo_id = "yith-notice-" . md5 ( $promo_id );
146
-
147
- if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
148
- $show_notice = false;
149
- }
150
-
151
- if ( true === $show_notice ) :
152
- wp_enqueue_script( 'yith-promo' );
153
- ?>
154
- <div id="<?php echo $unique_promo_id; ?>" class="yith-notice-is-dismissible notice notice-yith notice-alt is-dismissible <?php echo $original_promo_id;?>" style="<?php echo $style; ?>" data-expiry="<?php echo $promo->end_date; ?>">
155
- <p>
156
- <?php if( ! empty( $banner ) ) { printf( '%s', $banner ); } ?>
157
- <?php printf( "%s %s %s", $title, $description, $link ); ?>
158
- </p>
159
- </div>
160
- <?php endif;
161
- }
162
- }
163
- }
164
- }
165
- }
166
- }
167
- }
168
-
169
- if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
170
- function yith_plugin_fw_notice_dismiss(){
171
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
172
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
173
- wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
174
- }
175
- }
176
-
177
- if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
178
- function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
179
- $xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+24 hours';
180
- $current = strtotime( current_time( 'Y-m-d H:i:s' ) );
181
- $expiry_date = strtotime( $xml_expiry_date, $current );
182
-
183
- if( $expiry_date <= $current ){
184
- $expiry_date = strtotime( '+24 hours', $current );
185
- }
186
-
187
- return $expiry_date;
188
- }
189
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/templates/fields/custom.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5
+ * that is bundled with this package in the file LICENSE.txt.
6
+ * It is also available through the world-wide-web at this URL:
7
+ * http://www.gnu.org/licenses/gpl-3.0.txt
8
+ *
9
+ * @var array $field
10
+ */
11
+
12
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
13
+
14
+ if ( isset( $field[ 'action' ] ) ) {
15
+ do_action( $field[ 'action' ], $field );
16
+ }
plugin-fw/yit-plugin.php CHANGED
@@ -40,7 +40,6 @@ include_once( 'lib/yit-debug.php');
40
  include_once( 'lib/yith-dashboard.php' );
41
  include_once( 'lib/privacy/yit-privacy.php' );
42
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
43
- include_once( 'lib/promo/yith-promo.php' );
44
 
45
  /* === Gutenberg Support === */
46
  if( class_exists( 'WP_Block_Type_Registry' ) ){
@@ -157,11 +156,6 @@ if( ! function_exists( 'yit_plugin_fw_row_meta' ) ){
157
  }
158
  }
159
 
160
- //Add YITH Refer ID
161
- if( ! empty( $url ) && defined( 'YITH_REFER_ID' ) ){
162
- $url = add_query_arg( array( 'refer_id', YITH_REFER_ID ), $url );
163
- }
164
-
165
  if( ! empty( $url ) && ! empty( $label ) ){
166
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
167
  }
40
  include_once( 'lib/yith-dashboard.php' );
41
  include_once( 'lib/privacy/yit-privacy.php' );
42
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
 
43
 
44
  /* === Gutenberg Support === */
45
  if( class_exists( 'WP_Block_Type_Registry' ) ){
156
  }
157
  }
158
 
 
 
 
 
 
159
  if( ! empty( $url ) && ! empty( $label ) ){
160
  $plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
161
  }