YITH WooCommerce Zoom Magnifier - Version 1.2.15

Version Description

Download this release

Release Info

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

Code changes from version 1.2.14 to 1.2.15

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.4
7
- Stable tag: 1.2.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
59
 
60
  == Changelog ==
61
 
 
 
 
 
62
  = Version 1.2.14 - RELEASED: DEC 29, 2015 =
63
 
64
  * Added: Compatibility with YIT WooCommerce Featured Audio & Video Content
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.4
7
+ Stable tag: 1.2.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = Version 1.2.15 - RELEASED: JAN 04, 2016 =
63
+
64
+ * Fixed: Cannot redeclare yith_ywzm_install_woocommerce_admin_notice() when the plugin is loaded from YITH Essential Kit
65
+
66
  = Version 1.2.14 - RELEASED: DEC 29, 2015 =
67
 
68
  * Added: Compatibility with YIT WooCommerce Featured Audio & Video Content
assets/js/frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.2.14
7
  */
8
  jQuery(document).ready(function ($) {
9
 
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.2.15
7
  */
8
  jQuery(document).ready(function ($) {
9
 
class.yith-wcmg-admin.php CHANGED
@@ -28,14 +28,6 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
28
  */
29
  public $options = array();
30
 
31
- /**
32
- * Plugin version
33
- *
34
- * @var string
35
- * @since 1.0.0
36
- */
37
- public $version;
38
-
39
  /**
40
  * Various links
41
  *
@@ -53,8 +45,7 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
53
  * @access public
54
  * @since 1.0.0
55
  */
56
- public function __construct( $version ) {
57
- $this->version = $version;
58
 
59
  //Actions
60
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
28
  */
29
  public $options = array();
30
 
 
 
 
 
 
 
 
 
31
  /**
32
  * Various links
33
  *
45
  * @access public
46
  * @since 1.0.0
47
  */
48
+ public function __construct( ) {
 
49
 
50
  //Actions
51
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
class.yith-wcmg-frontend.php CHANGED
@@ -19,13 +19,7 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
19
  * @since 1.0.0
20
  */
21
  class YITH_WCMG_Frontend {
22
- /**
23
- * Plugin version
24
- *
25
- * @var string
26
- * @since 1.0.0
27
- */
28
- public $version;
29
 
30
  /**
31
  * Constructor
@@ -33,15 +27,14 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
33
  * @access public
34
  * @since 1.0.0
35
  */
36
- public function __construct ( $version ) {
37
- $this->version = $version;
38
 
39
  // add the action only when the loop is initializate
40
  add_action ( 'template_redirect', array ( $this, 'render' ) );
41
  }
42
 
43
  public function render () {
44
- if ( yith_wcmg_is_enabled () && ! apply_filters( 'yith_wczm_featured_video_enabled', false ) ) {
45
  //change the templates
46
  remove_action ( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
47
  remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
@@ -100,15 +93,29 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
100
 
101
  $suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
102
 
103
- wp_register_script ( 'yith-magnifier-slider', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix . '.js', array (
104
- 'jquery',
105
- 'jquery-migrate',
106
- ), '6.2.1', true );
107
- wp_register_script ( 'yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js', array ( 'jquery' ), $this->version, true );
108
- wp_register_script ( 'yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js', array (
109
- 'jquery',
110
- 'yith-magnifier',
111
- ), $this->version, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  wp_register_style ( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
114
 
@@ -121,18 +128,18 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
121
 
122
  $css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
123
  wp_enqueue_style ( 'yith_wcmg_frontend', $css );
124
- /*
125
- $append_text_css = '.yith_magnifier_zoom_wrap::after {
126
- content: "' . __ ( "Roll over image to zoom in", "yith-woocommerce-zoom-magnifier" ) . '";
127
- margin: 0 auto;
128
- display: inline-block;
129
- text-align:center;
130
- font-size: 10px;
131
- }
132
- ';
133
-
134
- wp_add_inline_style ( 'yith_wcmg_frontend', $append_text_css );
135
- */
136
  }
137
  }
138
 
19
  * @since 1.0.0
20
  */
21
  class YITH_WCMG_Frontend {
22
+
 
 
 
 
 
 
23
 
24
  /**
25
  * Constructor
27
  * @access public
28
  * @since 1.0.0
29
  */
30
+ public function __construct ( ) {
 
31
 
32
  // add the action only when the loop is initializate
33
  add_action ( 'template_redirect', array ( $this, 'render' ) );
34
  }
35
 
36
  public function render () {
37
+ if ( yith_wcmg_is_enabled () && ! apply_filters ( 'yith_wczm_featured_video_enabled', false ) ) {
38
  //change the templates
39
  remove_action ( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
40
  remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
93
 
94
  $suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
95
 
96
+ wp_register_script ( 'yith-magnifier-slider',
97
+ YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix . '.js',
98
+ array (
99
+ 'jquery',
100
+ 'jquery-migrate',
101
+ ),
102
+ YITH_YWZM_VERSION,
103
+ true );
104
+
105
+ wp_register_script ( 'yith-magnifier',
106
+ YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js',
107
+ array ( 'jquery' ),
108
+ YITH_YWZM_VERSION,
109
+ true );
110
+
111
+ wp_register_script ( 'yith_wcmg_frontend',
112
+ YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js',
113
+ array (
114
+ 'jquery',
115
+ 'yith-magnifier',
116
+ ),
117
+ YITH_YWZM_VERSION,
118
+ true );
119
 
120
  wp_register_style ( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
121
 
128
 
129
  $css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
130
  wp_enqueue_style ( 'yith_wcmg_frontend', $css );
131
+ /*
132
+ $append_text_css = '.yith_magnifier_zoom_wrap::after {
133
+ content: "' . __ ( "Roll over image to zoom in", "yith-woocommerce-zoom-magnifier" ) . '";
134
+ margin: 0 auto;
135
+ display: inline-block;
136
+ text-align:center;
137
+ font-size: 10px;
138
+ }
139
+ ';
140
+
141
+ wp_add_inline_style ( 'yith_wcmg_frontend', $append_text_css );
142
+ */
143
  }
144
  }
145
 
class.yith-wcmg.php CHANGED
@@ -16,13 +16,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
16
  * @since 1.0.0
17
  */
18
  class YITH_WCMG {
19
- /**
20
- * Plugin version
21
- *
22
- * @var string
23
- * @since 1.0.0
24
- */
25
- public $version = '1.2.14';
26
 
27
  /**
28
  * Plugin object
@@ -44,9 +38,9 @@ if( !class_exists( 'YITH_WCMG' ) ) {
44
  add_action( 'init', array( $this, 'init' ) );
45
 
46
  if( is_admin() ) {
47
- $this->obj = new YITH_WCMG_Admin( $this->version );
48
  } else {
49
- $this->obj = new YITH_WCMG_Frontend( $this->version );
50
  }
51
 
52
  return $this->obj;
16
  * @since 1.0.0
17
  */
18
  class YITH_WCMG {
19
+
 
 
 
 
 
 
20
 
21
  /**
22
  * Plugin object
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;
functions.yith-wcmg.php CHANGED
@@ -2,74 +2,77 @@
2
  /**
3
  * Functions
4
  *
5
- * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
  * @version 1.1.2
8
  */
9
 
10
- if ( ! defined( 'YITH_WCMG' ) ) {
11
- exit;
12
  } // Exit if accessed directly
13
 
14
- if ( ! function_exists( 'yith_wcmg_is_enabled' ) ) {
15
- /**
16
- * Check if the plugin is enabled for the current context
17
- *
18
- * @param string $path
19
- * @param array $var
20
- *
21
- * @return void
22
- * @since 1.0.0
23
- */
24
- function yith_wcmg_is_enabled() {
25
- if ( wp_is_mobile() ) {
26
- return ( 'yes' == get_option( 'yith_wcmg_enable_mobile' ) );
27
- }
28
 
29
- return get_option( 'yith_wcmg_enable_plugin' ) == 'yes';
30
-
31
- }
32
  }
33
 
34
- if ( ! function_exists( 'yit_shop_single_w' ) ) {
35
- /**
36
- * Return the shop_single image width
37
- *
38
- * @return integer
39
- * @since 1.0.0
40
- */
41
- function yit_shop_single_w() {
42
- global $woocommerce;
43
- $size = yit_get_image_size( 'shop_single' );
44
 
45
- return $size['width'];
46
- }
47
  }
48
 
49
- if ( ! function_exists( 'yit_shop_thumbnail_w' ) ) {
50
- /**
51
- * Return the shop_thumbnail image width
52
- *
53
- * @return integer
54
- * @since 1.0.0
55
- */
56
- function yit_shop_thumbnail_w() {
57
- global $woocommerce;
58
- $size = yit_get_image_size( 'shop_thumbnail' );
59
 
60
- return $size['width'];
61
- }
62
  }
63
 
64
  /* FIX TO WOOCOMMERCE 2.1 */
65
- if ( ! function_exists( 'yit_get_image_size' ) ) {
66
- function yit_get_image_size( $size ) {
67
- if ( function_exists( 'wc_get_image_size' ) ) {
68
- return wc_get_image_size( $size );
69
- } else {
70
- global $woocommerce;
 
 
 
 
 
 
 
 
 
71
 
72
- return $woocommerce->get_image_size( $size );
73
- }
74
- }
75
  }
2
  /**
3
  * Functions
4
  *
5
+ * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
  * @version 1.1.2
8
  */
9
 
10
+ if ( ! defined ( 'YITH_WCMG' ) ) {
11
+ exit;
12
  } // Exit if accessed directly
13
 
14
+ if ( ! function_exists ( 'yith_wcmg_is_enabled' ) ) {
15
+ /**
16
+ * Check if the plugin is enabled for the current context
17
+ *
18
+ * @return bool
19
+ * @since 1.0.0
20
+ */
21
+ function yith_wcmg_is_enabled () {
22
+ if ( wp_is_mobile () ) {
23
+ return ( 'yes' == get_option ( 'yith_wcmg_enable_mobile' ) );
24
+ }
 
 
 
25
 
26
+ return get_option ( 'yith_wcmg_enable_plugin' ) == 'yes';
27
+ }
 
28
  }
29
 
30
+ if ( ! function_exists ( 'yit_shop_single_w' ) ) {
31
+ /**
32
+ * Return the shop_single image width
33
+ *
34
+ * @return integer
35
+ * @since 1.0.0
36
+ */
37
+ function yit_shop_single_w () {
38
+ $size = yit_get_image_size ( 'shop_single' );
 
39
 
40
+ return $size[ 'width' ];
41
+ }
42
  }
43
 
44
+ if ( ! function_exists ( 'yit_shop_thumbnail_w' ) ) {
45
+ /**
46
+ * Return the shop_thumbnail image width
47
+ *
48
+ * @return integer
49
+ * @since 1.0.0
50
+ */
51
+ function yit_shop_thumbnail_w () {
52
+ $size = yit_get_image_size ( 'shop_thumbnail' );
 
53
 
54
+ return $size[ 'width' ];
55
+ }
56
  }
57
 
58
  /* FIX TO WOOCOMMERCE 2.1 */
59
+ if ( ! function_exists ( 'yit_get_image_size' ) ) {
60
+ /**
61
+ * Get default image size
62
+ *
63
+ * @param array $size current size
64
+ *
65
+ * @return array
66
+ * @author Lorenzo Giuffrida
67
+ * @since 1.0.0
68
+ */
69
+ function yit_get_image_size ( $size ) {
70
+ if ( function_exists ( 'wc_get_image_size' ) ) {
71
+ return wc_get_image_size ( $size );
72
+ } else {
73
+ global $woocommerce;
74
 
75
+ return $woocommerce->get_image_size ( $size );
76
+ }
77
+ }
78
  }
init.php CHANGED
@@ -3,15 +3,15 @@
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.14
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  *
12
- * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.14
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -29,74 +29,60 @@
29
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
  */
31
 
32
- if ( ! defined( 'ABSPATH' ) ) {
33
- exit;
34
  } // Exit if accessed directly
35
 
36
- if ( ! function_exists( 'is_plugin_active' ) ) {
37
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
38
- }
39
-
40
- function yith_ywzm_install_woocommerce_admin_notice() {
41
- ?>
42
- <div class="error">
43
- <p><?php _e( 'YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
44
- </div>
45
- <?php
46
- }
47
-
48
-
49
- function yith_ywzm_install_free_admin_notice() {
50
- ?>
51
- <div class="error">
52
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Zoom Magnifier while you are using the premium one.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
53
- </div>
54
- <?php
55
- }
56
-
57
- if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
58
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
59
- }
60
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
61
-
62
- //region **** Define constants
63
- if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
64
- define( 'YITH_YWZM_FREE_INIT', plugin_basename( __FILE__ ) );
65
- }
66
-
67
- if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
- define( 'YITH_YWZM_VERSION', '1.2.14' );
69
- }
70
-
71
- if ( ! defined( 'YITH_YWZM_FILE' ) ) {
72
- define( 'YITH_YWZM_FILE', __FILE__ );
73
- }
74
-
75
- if ( ! defined( 'YITH_YWZM_DIR' ) ) {
76
- define( 'YITH_YWZM_DIR', plugin_dir_path( __FILE__ ) );
77
- }
78
-
79
- if ( ! defined( 'YITH_YWZM_URL' ) ) {
80
- define( 'YITH_YWZM_URL', plugins_url( '/', __FILE__ ) );
81
- }
82
-
83
- if ( ! defined( 'YITH_YWZM_ASSETS_URL' ) ) {
84
- define( 'YITH_YWZM_ASSETS_URL', YITH_YWZM_URL . 'assets' );
85
- }
86
-
87
- if ( ! defined( 'YITH_YWZM_TEMPLATE_DIR' ) ) {
88
- define( 'YITH_YWZM_TEMPLATE_DIR', YITH_YWZM_DIR . 'templates' );
89
- }
90
-
91
- if ( ! defined( 'YITH_YWZM_ASSETS_IMAGES_URL' ) ) {
92
- define( 'YITH_YWZM_ASSETS_IMAGES_URL', YITH_YWZM_ASSETS_URL . '/images/' );
93
- }
94
-
95
- if ( ! defined( 'YITH_YWZM_LIB_DIR' ) ) {
96
- define( 'YITH_YWZM_LIB_DIR', YITH_YWZM_DIR . 'lib/' );
97
- }
98
-
99
- //endregion
100
 
101
  /* Plugin Framework Version Check */
102
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) && file_exists ( YITH_YWZM_DIR . 'plugin-fw/init.php' ) ) {
@@ -104,56 +90,69 @@ if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) && file_exists ( YITH_YW
104
  }
105
  yit_maybe_plugin_fw_loader ( YITH_YWZM_DIR );
106
 
107
-
108
- function yith_ywzm_init() {
109
-
110
- /**
111
- * Required functions
112
- */
113
- if ( ! defined( 'YITH_FUNCTIONS' ) ) {
114
- require_once( 'yit-common/yit-functions.php' );
115
- }
116
-
117
- /**
118
- * Load text domain and start plugin
119
- */
120
- load_plugin_textdomain( 'yith-woocommerce-zoom-magnifier', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
121
-
122
- add_option( 'yith_wcmg_slider_direction', apply_filters( 'yith_wcmg_slider_direction', 'left' ) );
123
-
124
- define( 'YITH_WCMG', true );
125
- define( 'YITH_WCMG_URL', plugin_dir_url( __FILE__ ) );
126
-
127
- // Load required classes and functions
128
- require_once( 'functions.yith-wcmg.php' );
129
- require_once( 'class.yith-wcmg-admin.php' );
130
- require_once( 'class.yith-wcmg-frontend.php' );
131
-
132
- require_once( YITH_YWZM_LIB_DIR . 'class.yith-woocommerce-zoom-magnifier.php' );
133
- require_once( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-plugin-fw-loader.php' );
134
- require_once( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-custom-types.php' );
135
-
136
- YITH_YWZM_Plugin_FW_Loader::get_instance();
137
-
138
- // Let's start the game!
139
- global $yith_wcmg;
140
-
141
- $yith_wcmg = new YITH_WooCommerce_Zoom_Magnifier();
142
- }
143
-
144
- add_action( 'yith_ywzm_init', 'yith_ywzm_init' );
145
-
146
-
147
- function yith_ywzm_install() {
148
-
149
- if ( ! function_exists( 'WC' ) ) {
150
- add_action( 'admin_notices', 'yith_ywzm_install_woocommerce_admin_notice' );
151
- } elseif ( defined( 'YITH_YWZM_PREMIUM' ) ) {
152
- add_action( 'admin_notices', 'yith_ywzm_install_free_admin_notice' );
153
- deactivate_plugins( plugin_basename( __FILE__ ) );
154
- } else {
155
- do_action( 'yith_ywzm_init' );
156
- }
157
- }
158
-
159
- add_action( 'plugins_loaded', 'yith_ywzm_install', 11 );
 
 
 
 
 
 
 
 
 
 
 
 
 
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.15
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  *
12
+ * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.15
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
29
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
  */
31
 
32
+ if ( ! defined ( 'ABSPATH' ) ) {
33
+ exit;
34
  } // Exit if accessed directly
35
 
36
+ if ( ! function_exists ( 'is_plugin_active' ) ) {
37
+ require_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
38
+ }
39
+
40
+ if ( ! function_exists ( 'yith_ywzm_install_woocommerce_admin_notice' ) ) {
41
+ /**
42
+ * WooCommerce is not enabled, the plugin will not be effective
43
+ *
44
+ * @author Lorenzo Giuffrida
45
+ * @since 1.0.0
46
+ */
47
+ function yith_ywzm_install_woocommerce_admin_notice () {
48
+ ?>
49
+ <div class="error">
50
+ <p><?php _e ( 'YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
51
+ </div>
52
+ <?php
53
+ }
54
+ }
55
+
56
+ if ( ! function_exists ( 'yith_ywzm_install_free_admin_notice' ) ) {
57
+ /**
58
+ * Unable to activate the free version while the premium version is active
59
+ *
60
+ * @author Lorenzo Giuffrida
61
+ * @since 1.0.0
62
+ */
63
+ function yith_ywzm_install_free_admin_notice () {
64
+ ?>
65
+ <div class="error">
66
+ <p><?php _e ( 'You can\'t activate the free version of YITH WooCommerce Zoom Magnifier while you are using the premium one.', 'yith-woocommerce-zoom-magnifier' ); ?></p>
67
+ </div>
68
+ <?php
69
+ }
70
+ }
71
+
72
+ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
73
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
74
+ }
75
+ register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
76
+
77
+ defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
78
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.2.15' );
79
+ defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
80
+ defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
81
+ defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
82
+ defined ( 'YITH_YWZM_ASSETS_URL' ) || define ( 'YITH_YWZM_ASSETS_URL', YITH_YWZM_URL . 'assets' );
83
+ defined ( 'YITH_YWZM_TEMPLATE_DIR' ) || define ( 'YITH_YWZM_TEMPLATE_DIR', YITH_YWZM_DIR . 'templates' );
84
+ defined ( 'YITH_YWZM_ASSETS_IMAGES_URL' ) || define ( 'YITH_YWZM_ASSETS_IMAGES_URL', YITH_YWZM_ASSETS_URL . '/images/' );
85
+ defined ( 'YITH_YWZM_LIB_DIR' ) || define ( 'YITH_YWZM_LIB_DIR', YITH_YWZM_DIR . 'lib/' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  /* Plugin Framework Version Check */
88
  if ( ! function_exists ( 'yit_maybe_plugin_fw_loader' ) && file_exists ( YITH_YWZM_DIR . 'plugin-fw/init.php' ) ) {
90
  }
91
  yit_maybe_plugin_fw_loader ( YITH_YWZM_DIR );
92
 
93
+ if ( ! function_exists ( 'yith_ywzm_init' ) ) {
94
+ /**
95
+ * Init the plugin
96
+ *
97
+ * @author Lorenzo Giuffrida
98
+ * @since 1.0.0
99
+ */
100
+ function yith_ywzm_init () {
101
+
102
+ /**
103
+ * Required functions
104
+ */
105
+ if ( ! defined ( 'YITH_FUNCTIONS' ) ) {
106
+ require_once ( 'yit-common/yit-functions.php' );
107
+ }
108
+
109
+ /**
110
+ * Load text domain and start plugin
111
+ */
112
+ load_plugin_textdomain ( 'yith-woocommerce-zoom-magnifier', false, dirname ( plugin_basename ( __FILE__ ) ) . '/languages/' );
113
+
114
+ add_option ( 'yith_wcmg_slider_direction', apply_filters ( 'yith_wcmg_slider_direction', 'left' ) );
115
+
116
+ define ( 'YITH_WCMG', true );
117
+ define ( 'YITH_WCMG_URL', plugin_dir_url ( __FILE__ ) );
118
+
119
+ // Load required classes and functions
120
+ require_once ( 'functions.yith-wcmg.php' );
121
+ require_once ( 'class.yith-wcmg-admin.php' );
122
+ require_once ( 'class.yith-wcmg-frontend.php' );
123
+
124
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-woocommerce-zoom-magnifier.php' );
125
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-plugin-fw-loader.php' );
126
+ require_once ( YITH_YWZM_LIB_DIR . 'class.yith-ywzm-custom-types.php' );
127
+
128
+ YITH_YWZM_Plugin_FW_Loader::get_instance ();
129
+
130
+ // Let's start the game!
131
+ global $yith_wcmg;
132
+
133
+ $yith_wcmg = new YITH_WooCommerce_Zoom_Magnifier();
134
+ }
135
+ }
136
+ add_action ( 'yith_ywzm_init', 'yith_ywzm_init' );
137
+
138
+ if ( ! function_exists ( 'yith_ywzm_install' ) ) {
139
+ /**
140
+ * install the plugin
141
+ *
142
+ * @author Lorenzo Giuffrida
143
+ * @since 1.0.0
144
+ */
145
+ function yith_ywzm_install () {
146
+
147
+ if ( ! function_exists ( 'WC' ) ) {
148
+ add_action ( 'admin_notices', 'yith_ywzm_install_woocommerce_admin_notice' );
149
+ } elseif ( defined ( 'YITH_YWZM_PREMIUM' ) ) {
150
+ add_action ( 'admin_notices', 'yith_ywzm_install_free_admin_notice' );
151
+ deactivate_plugins ( plugin_basename ( __FILE__ ) );
152
+ } else {
153
+ do_action ( 'yith_ywzm_init' );
154
+ }
155
+ }
156
+ }
157
+
158
+ add_action ( 'plugins_loaded', 'yith_ywzm_install', 11 );
lib/class.yith-woocommerce-zoom-magnifier.php CHANGED
@@ -19,13 +19,6 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
19
  * @since 1.0.0
20
  */
21
  class YITH_WooCommerce_Zoom_Magnifier {
22
- /**
23
- * Plugin version
24
- *
25
- * @var string
26
- * @since 1.0.0
27
- */
28
- public $version = '1.2.14';
29
 
30
  /**
31
  * Plugin object
@@ -51,9 +44,9 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
51
  add_action( 'init', array( $this, 'init' ) );
52
 
53
  if ( is_admin() && ( ! isset( $_REQUEST['action'] ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] != 'yith_load_product_quick_view' ) ) ) {
54
- $this->obj = new YITH_WCMG_Admin( $this->version );
55
  } else {
56
- $this->obj = new YITH_WCMG_Frontend( $this->version );
57
  }
58
 
59
  return $this->obj;
19
  * @since 1.0.0
20
  */
21
  class YITH_WooCommerce_Zoom_Magnifier {
 
 
 
 
 
 
 
22
 
23
  /**
24
  * Plugin object
44
  add_action( 'init', array( $this, 'init' ) );
45
 
46
  if ( is_admin() && ( ! isset( $_REQUEST['action'] ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] != 'yith_load_product_quick_view' ) ) ) {
47
+ $this->obj = new YITH_WCMG_Admin( );
48
  } else {
49
+ $this->obj = new YITH_WCMG_Frontend( );
50
  }
51
 
52
  return $this->obj;
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -147,7 +147,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
147
  wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
148
  wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
149
 
150
- if( 'admin.php' == $pagenow && strpos('yit-plugins_page',get_current_screen()->id ) !== false ){
 
151
  wp_enqueue_style( 'yit-plugin-style' );
152
  wp_enqueue_script( 'yit-plugin-panel' );
153
  }
147
  wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
148
  wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
149
 
150
+
151
+ if( 'admin.php' == $pagenow && strpos( get_current_screen()->id, 'yit-plugins_page' ) !== false ){
152
  wp_enqueue_style( 'yit-plugin-style' );
153
  wp_enqueue_script( 'yit-plugin-panel' );
154
  }