Version Description
Download this release
Release Info
Developer | yithemes |
Plugin | 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 +5 -1
- assets/js/frontend.js +1 -1
- class.yith-wcmg-admin.php +1 -10
- class.yith-wcmg-frontend.php +38 -31
- class.yith-wcmg.php +3 -9
- functions.yith-wcmg.php +56 -53
- init.php +121 -122
- lib/class.yith-woocommerce-zoom-magnifier.php +2 -9
- plugin-fw/lib/yit-plugin-panel.php +2 -1
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.
|
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.
|
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(
|
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 (
|
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',
|
104 |
-
'jquery',
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
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(
|
48 |
} else {
|
49 |
-
$this->obj = new YITH_WCMG_Frontend(
|
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
|
6 |
* @package YITH WooCommerce Zoom Magnifier
|
7 |
* @version 1.1.2
|
8 |
*/
|
9 |
|
10 |
-
if ( ! defined( 'YITH_WCMG' ) ) {
|
11 |
-
|
12 |
} // Exit if accessed directly
|
13 |
|
14 |
-
if ( ! function_exists( 'yith_wcmg_is_enabled' ) ) {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
if ( wp_is_mobile() ) {
|
26 |
-
return ( 'yes' == get_option( 'yith_wcmg_enable_mobile' ) );
|
27 |
-
}
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
}
|
32 |
}
|
33 |
|
34 |
-
if ( ! function_exists( 'yit_shop_single_w' ) ) {
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
$size = yit_get_image_size( 'shop_single' );
|
44 |
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
|
49 |
-
if ( ! function_exists( 'yit_shop_thumbnail_w' ) ) {
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$size = yit_get_image_size( 'shop_thumbnail' );
|
59 |
|
60 |
-
|
61 |
-
|
62 |
}
|
63 |
|
64 |
/* FIX TO WOOCOMMERCE 2.1 */
|
65 |
-
if ( ! function_exists( 'yit_get_image_size' ) ) {
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
|
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.
|
7 |
* Author: Yithemes
|
8 |
* Author URI: http://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-zoom-magnifier
|
10 |
* Domain Path: /languages/
|
11 |
*
|
12 |
-
* @author
|
13 |
* @package YITH WooCommerce Magnifier
|
14 |
-
* @version 1.2.
|
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 |
-
|
34 |
} // Exit if accessed directly
|
35 |
|
36 |
-
if ( ! function_exists( 'is_plugin_active' ) ) {
|
37 |
-
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
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 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(
|
55 |
} else {
|
56 |
-
$this->obj = new YITH_WCMG_Frontend(
|
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 |
-
|
|
|
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 |
}
|