YITH WooCommerce Zoom Magnifier - Version 1.2.25

Version Description

Download this release

Release Info

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

Code changes from version 1.2.24 to 1.2.25

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
  Tested up to: 4.7.2
7
- Stable tag: 1.2.24
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -51,6 +51,11 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
54
  = Version 1.2.24 - Released: Mar 06, 2017 =
55
 
56
  * New: Support to WooCommerce 2.7.0-RC1
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
  Tested up to: 4.7.2
7
+ Stable tag: 1.2.25
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
51
 
52
  == Changelog ==
53
 
54
+ = Version 1.2.25 - Released: Mar 08, 2017 =
55
+
56
+ * Fix: removed unused class.yith-wcmg.php file
57
+ * Fix: removed hook 'admin_print_footer_scripts' in class.yith-wcmg-admin.php
58
+
59
  = Version 1.2.24 - Released: Mar 06, 2017 =
60
 
61
  * New: Support to WooCommerce 2.7.0-RC1
class.yith-wcmg-admin.php CHANGED
@@ -53,7 +53,6 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
53
  add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
54
 
55
  add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
56
- add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
57
 
58
  add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
59
 
@@ -99,56 +98,6 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
99
  return $settings;
100
  }
101
 
102
- /**
103
- * Create new Woocommerce admin field: image deps
104
- *
105
- * @access public
106
- *
107
- * @param array $value
108
- *
109
- * @return void
110
- * @since 1.0.0
111
- */
112
- public function admin_fields_image_deps( $value ) {
113
- global $woocommerce;
114
-
115
- $force = get_option( 'yith_wcmg_force_sizes' ) == 'yes';
116
-
117
- if ( $force ) {
118
- $value['desc'] = 'These values ??are automatically calculated based on the values ??of the Single product. If you\'d like to customize yourself the values, please disable the "Forcing Zoom Image sizes" in "Magnifier" tab.';
119
- }
120
-
121
- if ( $force && isset( $_GET['page'] ) && isset( $_GET['tab'] ) && ( $_GET['page'] == 'woocommerce_settings' || $_GET['page'] == 'wc-settings' ) && $_GET['tab'] == 'catalog' ): ?>
122
- <script>
123
- jQuery(document).ready(function ($) {
124
- $('#woocommerce_magnifier_image-width, #woocommerce_magnifier_image-height, #woocommerce_magnifier_image-crop').attr('disabled', 'disabled');
125
-
126
- $('#shop_single_image_size-width, #shop_single_image_size-height').on('keyup', function () {
127
- var value = parseInt($(this).val());
128
- var input = (this.id).indexOf('width') >= 0 ? 'width' : 'height';
129
-
130
- if (!isNaN(value)) {
131
- $('#woocommerce_magnifier_image-' + input).val(value * 2);
132
- }
133
- });
134
-
135
- $('#shop_single_image_size-crop').on('change', function () {
136
- if ($(this).is(':checked')) {
137
- $('#woocommerce_magnifier_image-crop').attr('checked', 'checked');
138
- } else {
139
- $('#woocommerce_magnifier_image-crop').removeAttr('checked');
140
- }
141
- });
142
-
143
- $('#mainform').on('submit', function () {
144
- $(':disabled').removeAttr('disabled');
145
- });
146
- });
147
- </script>
148
- <?php endif;
149
- }
150
-
151
-
152
  /**
153
  * Enqueue admin styles and scripts
154
  *
@@ -165,4 +114,4 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
165
  wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css' );
166
  }
167
  }
168
- }
53
  add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
54
 
55
  add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
 
56
 
57
  add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
58
 
98
  return $settings;
99
  }
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  /**
102
  * Enqueue admin styles and scripts
103
  *
114
  wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css' );
115
  }
116
  }
117
+ }
class.yith-wcmg.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.1.2
8
- */
9
-
10
- if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
11
-
12
- if( !class_exists( 'YITH_WCMG' ) ) {
13
- /**
14
- * WooCommerce Magnifier
15
- *
16
- * @since 1.0.0
17
- */
18
- class YITH_WCMG {
19
-
20
-
21
- /**
22
- * Plugin object
23
- *
24
- * @var string
25
- * @since 1.0.0
26
- */
27
- public $obj = null;
28
-
29
- /**
30
- * Constructor
31
- *
32
- * @return mixed|YITH_WCMG_Admin|YITH_WCMG_Frontend
33
- * @since 1.0.0
34
- */
35
- public function __construct() {
36
-
37
- // actions
38
- add_action( 'init', array( $this, 'init' ) );
39
-
40
- if( is_admin() ) {
41
- $this->obj = new YITH_WCMG_Admin( );
42
- } else {
43
- $this->obj = new YITH_WCMG_Frontend( );
44
- }
45
-
46
- return $this->obj;
47
- }
48
-
49
-
50
- /**
51
- * Init method:
52
- * - default options
53
- *
54
- * @access public
55
- * @since 1.0.0
56
- */
57
- public function init() {
58
- $this->_image_sizes();
59
- }
60
-
61
-
62
- /**
63
- * Add image sizes
64
- *
65
- * Init images
66
- *
67
- * @access protected
68
- * @return void
69
- * @since 1.0.0
70
- */
71
- protected function _image_sizes() {
72
- $size = get_option('woocommerce_magnifier_image');
73
- $width = $size['width'];
74
- $height = $size['height'];
75
- $crop = isset( $size['crop'] ) ? true : false;
76
-
77
- add_image_size( 'shop_magnifier', $width, $height, $crop );
78
- }
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.2.24
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.24
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -76,7 +76,7 @@ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
76
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
77
 
78
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
79
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.2.24' );
80
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
81
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
82
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.2.25
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.25
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
76
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
77
 
78
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
79
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.2.25' );
80
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
81
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
82
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.51
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.52
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/yit-plugin.php CHANGED
@@ -42,12 +42,17 @@ load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/y
42
  // ...or from plugin folder
43
  || load_textdomain( 'yith-plugin-fw', dirname(__FILE__) . '/languages/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' );
44
 
45
- if( apply_filters( 'yit_fw_wc_update_message_hook', true ) || ( function_exists( 'WC' ) && ! version_compare( WC()->version, '2.7', '>=' ) ) ){
 
 
 
 
46
  add_action( 'admin_notices', 'yit_fw_wc_update_message', 15 );
47
 
48
  if( ! function_exists( 'yit_fw_wc_update_message' ) ){
49
- function yit_fw_wc_update_message(){ ?>
50
- <div class="notice notice-error is-dismissible">
 
51
  <?php $message = 'the new WooCommerce version 2.7 will be soon released. <strong>Before</strong> proceeding with the update, please verify the plugins you are using are already compatible. You can check the compatibility status of YITH products'; ?>
52
  <?php $url = 'https://support.yithemes.com/hc/en-us/articles/215945378-Theme-and-Plugin-compatibility-with-WordPress-and-WooCommerce'; ?>
53
  <p><?php printf( '<strong>%s</strong> - %s <a href="%s" target="_blank">HERE</a>.', 'Please note', $message, $url ); ?></p>
@@ -55,4 +60,20 @@ if( apply_filters( 'yit_fw_wc_update_message_hook', true ) || ( function_exists(
55
  <?php
56
  }
57
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
42
  // ...or from plugin folder
43
  || load_textdomain( 'yith-plugin-fw', dirname(__FILE__) . '/languages/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' );
44
 
45
+ if( apply_filters( 'yit_fw_wc_update_message_hook', true )
46
+ &&
47
+ ( function_exists( 'WC' ) && ! version_compare( WC()->version, '2.7', '>=' ) )
48
+ && ! isset( $_COOKIE['yith_wc_2_7_notice'] )
49
+ ){
50
  add_action( 'admin_notices', 'yit_fw_wc_update_message', 15 );
51
 
52
  if( ! function_exists( 'yit_fw_wc_update_message' ) ){
53
+ function yit_fw_wc_update_message(){
54
+ ?>
55
+ <div id="yith-notice-is-dismissable" class="yith-wc-update-message notice notice-error is-dismissible">
56
  <?php $message = 'the new WooCommerce version 2.7 will be soon released. <strong>Before</strong> proceeding with the update, please verify the plugins you are using are already compatible. You can check the compatibility status of YITH products'; ?>
57
  <?php $url = 'https://support.yithemes.com/hc/en-us/articles/215945378-Theme-and-Plugin-compatibility-with-WordPress-and-WooCommerce'; ?>
58
  <p><?php printf( '<strong>%s</strong> - %s <a href="%s" target="_blank">HERE</a>.', 'Please note', $message, $url ); ?></p>
60
  <?php
61
  }
62
  }
63
+
64
+ add_action( 'admin_enqueue_scripts', 'yit_plugin_fw_dismissable_notice', 20 );
65
+
66
+ if( ! function_exists( 'yit_plugin_fw_dismissable_notice' ) ){
67
+ function yit_plugin_fw_dismissable_notice(){
68
+ $assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';
69
+ wp_enqueue_script( 'jquery-cookie', $assets_path . 'js/jquery-cookie/jquery.cookie.min.js', array( 'jquery' ), '1.4.1', true);
70
+ $js = "jQuery( document ).ready( function(){
71
+ jQuery( '#yith-notice-is-dismissable' ).find('.notice-dismiss').on( 'click', function(){
72
+ jQuery.cookie('yith_wc_2_7_notice', 'dismiss', { path: '/' });
73
+ } );
74
+ } ); ";
75
+
76
+ wp_add_inline_script( 'jquery-cookie', $js );
77
+ }
78
+ }
79
  }