YITH WooCommerce Zoom Magnifier - Version 1.3.9

Version Description

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.3.9
Comparing to
See all releases

Code changes from version 1.3.8 to 1.3.9

README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
  Requires at least: 4.0
6
- Tested up to: 5.1.0
7
- Stable tag: 1.3.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
@@ -52,6 +52,11 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
52
 
53
  == Changelog ==
54
 
 
 
 
 
 
55
  = Version 1.3.8 - Released: Feb 28, 2018 =
56
 
57
  * Update: plugin framework
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
  Requires at least: 4.0
6
+ Tested up to: 5.1.1
7
+ Stable tag: 1.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
52
 
53
  == Changelog ==
54
 
55
+ = Version 1.3.9 - Released: Apr 23, 2019 =
56
+
57
+ * Update: plugin framework
58
+ * Dev: updating the function get_premium_landing_uri
59
+
60
  = Version 1.3.8 - Released: Feb 28, 2018 =
61
 
62
  * Update: plugin framework
init.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: <code><strong>YITH WooCommerce Zoom Magnifier</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 1.3.8
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.3.0
12
- * WC tested up to: 3.5.x
13
  **/
14
 
15
  /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
@@ -78,7 +78,7 @@ register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
78
 
79
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
80
  defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
81
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.8' );
82
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
83
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
84
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: <code><strong>YITH WooCommerce Zoom Magnifier</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 1.3.9
7
  * Author: YITH
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.3.0
12
+ * WC tested up to: 3.6.x
13
  **/
14
 
15
  /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
78
 
79
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
80
  defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
81
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.9' );
82
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
83
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
84
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
lib/class.yith-ywzm-plugin-fw-loader.php CHANGED
@@ -200,8 +200,8 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
200
  * @return string The premium landing link
201
  */
202
  public function get_premium_landing_uri() {
203
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
204
- }
205
 
206
  //region **** licence related methods ****
207
 
200
  * @return string The premium landing link
201
  */
202
  public function get_premium_landing_uri() {
203
+ return $this->_premium_landing ;
204
+ }
205
 
206
  //region **** licence related methods ****
207
 
plugin-fw/assets/css/admin.css CHANGED
@@ -53,6 +53,27 @@
53
  display: block;
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  /*-----------------------
57
  YITH Plugins Columns
58
  ------------------------*/
53
  display: block;
54
  }
55
 
56
+ /*-----------------------
57
+ YITH FEEDS
58
+ ------------------------*/
59
+
60
+ .yith-feeds-logo{
61
+ display: table-cell;
62
+ background: #005b7c;
63
+ padding: 5px;
64
+ border-radius: 50%;
65
+ margin-right: 10px;
66
+ vertical-align: text-bottom;
67
+ width: 18px;
68
+ height: auto;
69
+ vertical-align: middle;
70
+ }
71
+
72
+ .yith-feeds-plugin-name{
73
+ display: table-cell;
74
+ vertical-align: middle;
75
+ }
76
+
77
  /*-----------------------
78
  YITH Plugins Columns
79
  ------------------------*/
plugin-fw/assets/js/yith-dashboard.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ // bind a button or a link to open the dialog
3
+ $('.yith-last-changelog').click(function(e) {
4
+ e.preventDefault();
5
+ var inlineId = $( this ).data( 'changelogid' ),
6
+ inlineModal = $('#' + inlineId),
7
+ plugininfo = $( this ).data( 'plugininfo' ),
8
+ b = {},
9
+ close_function = function() { $( this ).dialog( "close" ); };
10
+
11
+ b[yith_dashboard.buttons.close] = close_function;
12
+
13
+ // initalise the dialog
14
+ inlineModal.dialog({
15
+ title: plugininfo,
16
+ dialogClass: 'wp-dialog',
17
+ autoOpen: false,
18
+ draggable: false,
19
+ width: 'auto',
20
+ modal: true,
21
+ resizable: false,
22
+ closeOnEscape: true,
23
+ position: {
24
+ my: "center",
25
+ at: "center",
26
+ of: window
27
+ },
28
+ buttons: b,
29
+ show: {
30
+ effect: "blind",
31
+ duration: 1000
32
+ },
33
+ open: function () {
34
+ // close dialog by clicking the overlay behind it
35
+ $('.ui-widget-overlay').bind('click', function(){
36
+ inlineModal.dialog('close');
37
+ })
38
+ },
39
+ create: function () {
40
+ // style fix for WordPress admin
41
+ $('.ui-dialog-titlebar-close').addClass('ui-button');
42
+ },
43
+ });
44
+
45
+ inlineModal.dialog('open');
46
+ });
47
+ })(jQuery);
plugin-fw/assets/js/yith-dashboard.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (function(a){a(".yith-last-changelog").click(function(b){b.preventDefault();b=a(this).data("changelogid");var c=a("#"+b);b=a(this).data("plugininfo");var d={};d[yith_dashboard.buttons.close]=function(){a(this).dialog("close")};c.dialog({title:b,dialogClass:"wp-dialog",autoOpen:!1,draggable:!1,width:"auto",modal:!0,resizable:!1,closeOnEscape:!0,position:{my:"center",at:"center",of:window},buttons:d,show:{effect:"blind",duration:1E3},open:function(){a(".ui-widget-overlay").bind("click",function(){c.dialog("close")})},
2
+ create:function(){a(".ui-dialog-titlebar-close").addClass("ui-button")}});c.dialog("open")})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.1.23
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.1.21
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
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/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.1.26
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/promo/yith-promo.php DELETED
@@ -1,188 +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
-
36
- if( true === $create_transient ){
37
- $is_membership_user = false;
38
- $license = YIT_Plugin_Licence()->get_licence();
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
-
106
- if( ! empty( $border_color ) ){
107
- $style .= "border-left-color: {$border_color};";
108
- }
109
-
110
- if( ! empty( $background_color ) ){
111
- $style .= "background-color: {$background_color};";
112
- }
113
-
114
- if( ! empty( $image_bg_color ) ){
115
- $image_bg_color = "background-color: {$image_bg_color};";
116
- }
117
-
118
- if( ! empty( $title ) ) {
119
- $promo_id .= $title;
120
- $title = sprintf( '%s: ', $title );
121
- $show_notice = true;
122
- }
123
-
124
- if( ! empty( $description ) ) {
125
- $promo_id .= $description;
126
- $description = sprintf( '%s', $description );
127
- $show_notice = true;
128
- }
129
-
130
- if( ! empty( $url ) && ! empty( $url_label )) {
131
- $promo_id .= $url . $url_label;
132
- $link = sprintf( '<a href="%s" target="_blank">%s</a>', $url, $url_label );
133
- $show_notice = true;
134
- }
135
-
136
- if( ! empty( $banner ) ){
137
- $banner = sprintf( '<img src="%s" class="yith-promo-banner-image">', $base_url . $banner );
138
-
139
- if( ! empty( $url ) ){
140
- $banner = sprintf( '<a class="yith-promo-banner-image-link" href="%s" target="_blank" style="%s">%s</a>', $url, $image_bg_color, $banner);
141
- }
142
- }
143
-
144
- $unique_promo_id = "yith-notice-" . md5 ( $promo_id );
145
-
146
- if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
147
- $show_notice = false;
148
- }
149
-
150
- if ( true === $show_notice ) :
151
- wp_enqueue_script( 'yith-promo' );
152
- ?>
153
- <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; ?>>
154
- <p>
155
- <?php if( ! empty( $banner ) ) { printf( '%s', $banner ); } ?>
156
- <?php printf( "%s %s %s", $title, $description, $link ); ?>
157
- </p>
158
- </div>
159
- <?php endif;
160
- }
161
- }
162
- }
163
- }
164
- }
165
- }
166
- }
167
-
168
- if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
169
- function yith_plugin_fw_notice_dismiss(){
170
- $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
171
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
172
- wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
173
- }
174
- }
175
-
176
- if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
177
- function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
178
- $xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+24 hours';
179
- $current = strtotime( current_time( 'Y-m-d H:i:s' ) );
180
- $expiry_date = strtotime( $xml_expiry_date, $current );
181
-
182
- if( $expiry_date <= $current ){
183
- $expiry_date = strtotime( '+24 hours', $current );
184
- }
185
-
186
- return $expiry_date;
187
- }
188
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -140,7 +140,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
140
 
141
  $error = false;
142
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
143
- $plugin_remote_info = @simplexml_load_string( $remote_xml['body'] );
144
  if ( $plugin_remote_info ) {
145
  $info['Latest'] = (string) $plugin_remote_info->latest;
146
  $info['changelog'] = (string) $plugin_remote_info->changelog;
@@ -471,7 +471,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
471
 
472
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
473
 
474
- $plugin_remote_info = @simplexml_load_string( $remote_xml['body'] );
475
 
476
  if ( $plugin_remote_info ) {
477
  $wrong_current_version_check = version_compare( $plugin['info']['Version'], $plugin_remote_info->latest, '>' );
140
 
141
  $error = false;
142
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
143
+ $plugin_remote_info = function_exists( 'simplexml_load_string' ) ? @simplexml_load_string( $remote_xml['body'] ) : false;
144
  if ( $plugin_remote_info ) {
145
  $info['Latest'] = (string) $plugin_remote_info->latest;
146
  $info['changelog'] = (string) $plugin_remote_info->changelog;
471
 
472
  if ( ! is_wp_error( $remote_xml ) && isset( $remote_xml['response']['code'] ) && '200' == $remote_xml['response']['code'] ) {
473
 
474
+ $plugin_remote_info = function_exists( 'simplexml_load_string' ) ? @simplexml_load_string( $remote_xml['body'] ) : false;
475
 
476
  if ( $plugin_remote_info ) {
477
  $wrong_current_version_check = version_compare( $plugin['info']['Version'], $plugin_remote_info->latest, '>' );
plugin-fw/lib/yith-dashboard.php CHANGED
@@ -26,7 +26,7 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
26
  * @access protected
27
  * @since 1.0.0
28
  */
29
- static protected $_products_feed = 'https://yithemes.com/feed/?post_type=product';
30
  static protected $_blog_feed = 'https://yithemes.com/feed/';
31
 
32
  /**
@@ -37,8 +37,8 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
37
  * @access public
38
  */
39
  public static function dashboard_widget_setup() {
40
- wp_add_dashboard_widget( 'yith_dashboard_products_news', __( 'New YITH products' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_products_news' );
41
- wp_add_dashboard_widget( 'yith_dashboard_blog_news', __( 'News from the YITH Blog' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_blog_news' );
42
  }
43
 
44
 
@@ -50,10 +50,67 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
50
  * @access public
51
  */
52
  public static function dashboard_products_news() {
53
- $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
54
- wp_widget_rss_output( static::$_products_feed, $args );
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
 
 
 
 
57
 
58
  /**
59
  * Blog news Widget
@@ -64,11 +121,36 @@ if( ! class_exists( 'YITH_Dashboard' ) ){
64
  */
65
  public static function dashboard_blog_news() {
66
  $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
67
- wp_widget_rss_output( static::$_blog_feed, $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
  }
 
70
  if( apply_filters( 'yith_plugin_fw_show_dashboard_widgets', true ) ){
71
  add_action( 'wp_dashboard_setup', 'YITH_Dashboard::dashboard_widget_setup' );
 
72
  }
73
  }
74
 
26
  * @access protected
27
  * @since 1.0.0
28
  */
29
+ static protected $_products_feed = 'https://yithemes.com/latest-updates/feeds/';
30
  static protected $_blog_feed = 'https://yithemes.com/feed/';
31
 
32
  /**
37
  * @access public
38
  */
39
  public static function dashboard_widget_setup() {
40
+ wp_add_dashboard_widget( 'yith_dashboard_products_news', __( 'YITH Latest Updates' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_products_news' );
41
+ wp_add_dashboard_widget( 'yith_dashboard_blog_news', __( 'Latest news from YITH Blog' , 'yith-plugin-fw' ), 'YITH_Dashboard::dashboard_blog_news' );
42
  }
43
 
44
 
50
  * @access public
51
  */
52
  public static function dashboard_products_news() {
53
+ $items = 10;
54
+ $rss = static::$_products_feed;
55
+ if ( is_string( $rss ) ) {
56
+ $rss = fetch_feed( $rss );
57
+ } elseif ( is_array( $rss ) && isset( $rss['url'] ) ) {
58
+ $rss = fetch_feed( $rss['url'] );
59
+ } elseif ( ! is_object( $rss ) ) {
60
+ return;
61
+ }
62
+
63
+ if ( is_wp_error( $rss ) ) {
64
+ if ( is_admin() || current_user_can( 'manage_options' ) ) {
65
+ echo '<p><strong>' . __( 'RSS Error:', 'yith-plugin-fw' ) . '</strong> ' . $rss->get_error_message() . '</p>';
66
+ }
67
+ return;
68
+ }
69
+
70
+ if ( ! $rss->get_item_quantity() ) {
71
+ echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.', 'yith-plugin-fw' ) . '</li></ul>';
72
+ $rss->__destruct();
73
+ unset( $rss );
74
+ return;
75
+ }
76
+
77
+ $last_updates = $rss->get_items( 0, $items );
78
+ $html_classes = 'rsswidget yith-update-feeds';
79
+ $output = '';
80
+
81
+ if( count( $last_updates ) > 0 ){
82
+ $output = '<ul class="yith-update-feeds">';
83
+ }
84
+
85
+ foreach ( $last_updates as $last_update ) {
86
+ /**
87
+ * @var $last_update \SimplePie_Item
88
+ */
89
+ $output .= '<li class="yith-update-feed">';
90
+ $date = $last_update->get_date( 'U' );
91
+ $date_i18n = ! empty( $date ) ? date_i18n( get_option( 'date_format' ), $date ) : '';
92
+ $html_date = ! empty( $date_i18n ) ? ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>' : '';
93
+ $output .= sprintf( '<a target="_blank" href="%s" class="%s">%s</a> %s', $last_update->get_permalink(), $html_classes, $last_update->get_title(), $html_date );
94
+ $changelog = $last_update->get_description();
95
+
96
+ if( ! empty( $changelog ) ){
97
+ //add_thickbox();
98
+ $output .= ' - ';
99
+ $output .= sprintf( '<a class="yith-last-changelog" href="#" data-changelogid="%s" data-plugininfo="%s">%s</a>', $last_update->get_id( true ), $last_update->get_title(), _x( 'View Changelog', 'Plugin FW', 'yith-plugin-fw' ) );
100
+ $output .= sprintf( '<div style="display: none;" id="%s"><div style="display: table;"><img class="yith-feeds-logo" src="%s" /><h3 class="yith-feeds-plugin-name"><span style="font-weight: normal;">%s</span> %s</h3></div><p>%s</p></div>', $last_update->get_id( true ), yith_plugin_fw_get_default_logo(), _x( 'Latest update released on', 'Plugin FW', 'yith-plugin-fw' ), $date_i18n, $changelog );
101
+ }
102
+
103
+ $output .= '</li>';
104
+ }
105
+
106
+ if( ! empty( $output ) ){
107
+ $output .= '</ul>';
108
+ }
109
 
110
+ echo $output;
111
+ $rss->__destruct();
112
+ unset( $rss );
113
+ }
114
 
115
  /**
116
  * Blog news Widget
121
  */
122
  public static function dashboard_blog_news() {
123
  $args = array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 1, 'items'=> 3 );
124
+ $feed = static::$_blog_feed;
125
+ wp_widget_rss_output( $feed, $args );
126
+ }
127
+
128
+ /**
129
+ * Enqueue Styles and Scripts for View Last Changelog widget
130
+ *
131
+ * @return void
132
+ * @since 1.0.0
133
+ * @access public
134
+ */
135
+ public static function enqueue_scripts(){
136
+ if( function_exists( 'get_current_screen' ) && 'dashboard' == get_current_screen()->id ){
137
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
138
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
139
+ wp_enqueue_script( 'yith-dashboard', $script_path . '/assets/js/yith-dashboard' . $suffix . '.js', array( 'jquery-ui-dialog' ), '1.0.0', true );
140
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
141
+ $l10n = array(
142
+ 'buttons' => array(
143
+ 'close' => _x( 'Close', 'Button label', 'yith-plugin-fw' )
144
+ )
145
+ );
146
+ wp_localize_script( 'yith-dashboard', 'yith_dashboard', $l10n );
147
+ }
148
  }
149
  }
150
+
151
  if( apply_filters( 'yith_plugin_fw_show_dashboard_widgets', true ) ){
152
  add_action( 'wp_dashboard_setup', 'YITH_Dashboard::dashboard_widget_setup' );
153
+ add_action( 'admin_enqueue_scripts', 'YITH_Dashboard::enqueue_scripts', 20 );
154
  }
155
  }
156
 
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
  }