YITH WooCommerce Compare - Version 2.3.10

Version Description

Released on Apr 23, 2019

  • New: Support to WooCommerce 3.6.1
  • Update: Plugin Core
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Compare
Version 2.3.10
Comparing to
See all releases

Code changes from version 2.3.9 to 2.3.10

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: yith, woocommerce compare, compare products, product compare, product comparison
5
  Requires at least: 4.0
6
  Tested up to: 5.1
7
- Stable tag: 2.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -66,6 +66,11 @@ yith-woocommerce-compare-<WORDPRESS LOCALE >.mo
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 2.3.9 = Released on Apr 09, 2019
70
 
71
  * New: Support to WooCommerce 3.6.0 RC1
@@ -330,7 +335,7 @@ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woo
330
 
331
  == Upgrade notice ==
332
 
333
- = 2.3.9 = Released on Apr 09, 2019
334
 
335
- * New: Support to WooCommerce 3.6.0 RC1
336
  * Update: Plugin Core
4
  Tags: yith, woocommerce compare, compare products, product compare, product comparison
5
  Requires at least: 4.0
6
  Tested up to: 5.1
7
+ Stable tag: 2.3.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
66
 
67
  == Changelog ==
68
 
69
+ = 2.3.10 = Released on Apr 23, 2019
70
+
71
+ * New: Support to WooCommerce 3.6.1
72
+ * Update: Plugin Core
73
+
74
  = 2.3.9 = Released on Apr 09, 2019
75
 
76
  * New: Support to WooCommerce 3.6.0 RC1
335
 
336
  == Upgrade notice ==
337
 
338
+ = 2.3.10 = Released on Apr 23, 2019
339
 
340
+ * New: Support to WooCommerce 3.6.1
341
  * Update: Plugin Core
includes/class.yith-woocompare-admin.php CHANGED
@@ -268,7 +268,7 @@ if ( ! class_exists( 'YITH_Woocompare_Admin' ) ) {
268
  * @return string The premium landing link
269
  */
270
  public function get_premium_landing_uri() {
271
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing.'?refer_id=1030585';
272
  }
273
 
274
  /**
268
  * @return string The premium landing link
269
  */
270
  public function get_premium_landing_uri() {
271
+ return $this->_premium_landing;
272
  }
273
 
274
  /**
init.php CHANGED
@@ -3,17 +3,17 @@
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 2.3.9
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 3.6.0
13
  *
14
  * @author YITH
15
  * @package YITH WooCommerce Compare
16
- * @version 2.3.9
17
  */
18
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
@@ -58,7 +58,7 @@ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
58
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
59
 
60
  if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
61
- define( 'YITH_WOOCOMPARE_VERSION', '2.3.9' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Compare
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/
5
  * Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 2.3.10
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-compare
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
+ * WC tested up to: 3.6
13
  *
14
  * @author YITH
15
  * @package YITH WooCommerce Compare
16
+ * @version 2.3.10
17
  */
18
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
58
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
59
 
60
  if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
61
+ define( 'YITH_WOOCOMPARE_VERSION', '2.3.10' );
62
  }
63
  if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
64
  define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
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
  }