Version Description
- 29/03/2018
- Fix: Allow the default WooCommerce lightbox along with the zoom
- Fix: WC3 with the "Remove Lightbox" option disabled showed a lingering image after closing the lightbox.
- Fix: check the option name against an array of allowed values
- Tweak: update the list of themes that add a whole page wrapper with the z-index higher than the zoom
Download this release
Release Info
Developer | diana_burduja |
Plugin | WP Image Zoom |
Version | 1.24 |
Comparing to | |
See all releases |
Code changes from version 1.23 to 1.24
- assets/js/image_zoom-init.js +10 -0
- image-zoooom.php +34 -23
- includes/image-zoom-warnings.php +121 -174
- includes/settings.php +1 -1
- readme.txt +8 -1
assets/js/image_zoom-init.js
CHANGED
@@ -192,6 +192,16 @@ jQuery(document).ready(function( $ ){
|
|
192 |
old_value = event.newValue;
|
193 |
}
|
194 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
// Resize the zoom windows when resizing the page
|
197 |
$(window).bind('resize', function(e) {
|
192 |
old_value = event.newValue;
|
193 |
}
|
194 |
});
|
195 |
+
$(".pswp").attrchange({
|
196 |
+
trackValues: true,
|
197 |
+
callback: function(event) {
|
198 |
+
if ( event.newValue != old_value ) {
|
199 |
+
$(".zoomContainer").remove();
|
200 |
+
}
|
201 |
+
}
|
202 |
+
});
|
203 |
+
|
204 |
+
|
205 |
|
206 |
// Resize the zoom windows when resizing the page
|
207 |
$(window).bind('resize', function(e) {
|
image-zoooom.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP Image Zoom
|
4 |
* Plugin URI: https://wordpress.org/plugins/wp-image-zoooom/
|
5 |
* Description: Add zoom effect over the an image, whether it is an image in a post/page or the featured image of a product in a WooCommerce shop
|
6 |
-
* Version: 1.
|
7 |
* Author: SilkyPress
|
8 |
* Author URI: https://www.silkypress.com
|
9 |
* License: GPL2
|
@@ -98,7 +98,7 @@ final class ImageZoooom {
|
|
98 |
// Adjust the zoom to WooCommerce 3.0.+
|
99 |
if ( $general['enable_woocommerce'] && class_exists('woocommerce') && version_compare( WC_VERSION, '3.0', '>') ) {
|
100 |
remove_theme_support( 'wc-product-gallery-zoom' );
|
101 |
-
remove_theme_support( 'wc-product-gallery-lightbox' );
|
102 |
add_theme_support( 'wc-product-gallery-slider' );
|
103 |
|
104 |
if ($this->theme('kiddy') || $this->theme('flatsome')) {
|
@@ -257,33 +257,44 @@ final class ImageZoooom {
|
|
257 |
* wp_head compatibilities
|
258 |
*/
|
259 |
function wp_head_compatibilities() {
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
);
|
272 |
-
foreach( $
|
273 |
-
if ($
|
274 |
-
<style type="text/css"> .
|
275 |
-
<?php
|
276 |
}
|
277 |
}
|
278 |
|
279 |
-
if ($this->theme('dorianwp')) {
|
280 |
-
echo '<style type="text/css">.edgtf-side-menu-slide-from-right .edgtf-wrapper {z-index: 20;}</style>' . PHP_EOL;
|
281 |
-
}
|
282 |
-
|
283 |
if ( defined('LP_PLUGIN_FILE')) {
|
284 |
echo '<style type="text/css">body.content-item-only .learn-press-content-item-only { z-index: 990; } .single-lp_course #wpadminbar{z-index:900;}</style>' . PHP_EOL;
|
285 |
}
|
286 |
-
|
287 |
}
|
288 |
|
289 |
|
@@ -503,7 +514,7 @@ function wp_image_zoooom_plugin_action_links( $links ) {
|
|
503 |
return array_merge( array( $settings_link), $links );
|
504 |
|
505 |
}
|
506 |
-
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__),
|
507 |
|
508 |
if ( ! function_exists( 'x_disable_wp_image_srcset' ) ) :
|
509 |
function x_disable_wp_image_srcset() {
|
3 |
* Plugin Name: WP Image Zoom
|
4 |
* Plugin URI: https://wordpress.org/plugins/wp-image-zoooom/
|
5 |
* Description: Add zoom effect over the an image, whether it is an image in a post/page or the featured image of a product in a WooCommerce shop
|
6 |
+
* Version: 1.24
|
7 |
* Author: SilkyPress
|
8 |
* Author URI: https://www.silkypress.com
|
9 |
* License: GPL2
|
98 |
// Adjust the zoom to WooCommerce 3.0.+
|
99 |
if ( $general['enable_woocommerce'] && class_exists('woocommerce') && version_compare( WC_VERSION, '3.0', '>') ) {
|
100 |
remove_theme_support( 'wc-product-gallery-zoom' );
|
101 |
+
//remove_theme_support( 'wc-product-gallery-lightbox' );
|
102 |
add_theme_support( 'wc-product-gallery-slider' );
|
103 |
|
104 |
if ($this->theme('kiddy') || $this->theme('flatsome')) {
|
257 |
* wp_head compatibilities
|
258 |
*/
|
259 |
function wp_head_compatibilities() {
|
260 |
+
$theme = get_template();
|
261 |
+
|
262 |
+
// These themes add a wrapper on the whole page with index higher than the zoom
|
263 |
+
$wrapper_themes = array(
|
264 |
+
array(
|
265 |
+
'rule' => '.wrapper { z-index: 40 !important; }',
|
266 |
+
'themes' => array('bridge', 'nouveau', 'stockholm', 'tactile', 'vigor', 'homa', 'hudsonwp', ),
|
267 |
+
),
|
268 |
+
array(
|
269 |
+
'rule' => '.qodef-wrapper { z-index: 200 !important; }',
|
270 |
+
'themes' => array('kloe', 'startit', 'kudos', 'moments', 'ayro', 'suprema', 'ultima', 'geko', 'target', 'coney', 'aton', 'ukiyo', 'zenit', 'mixtape', 'scribbler', 'alecta', 'cityrama', 'bazaar'),
|
271 |
+
),
|
272 |
+
array(
|
273 |
+
'rule' => '.edgtf-wrapper { z-index: 40 !important; }',
|
274 |
+
'themes' => array('quadric', 'oxides', 'kvadrat', 'magazinevibe', 'kolumn', 'skyetheme', 'conall', 'dorianwp', 'node', 'ratio', 'escher', 'fair', 'assemble', 'any', 'walker', 'freestyle', 'shuffle', 'vangard', 'fuzion', 'crimson', 'cozy', 'xpo', 'onschedule', 'illustrator', 'oberon', 'fluid', 'barista', 'kamera', 'revolver', 'baker', 'rebellion', 'goodwish', 'maison', 'silverscreen', 'sovereign', 'atmosphere', 'dekko', 'objektiv', 'okami', 'coyote', 'bumblebee', 'blaze', 'mediadesk', 'penumbra', 'pxlz', 'gastrobar', 'aalto', 'dishup', 'voevod', 'orkan', 'fierce'),
|
275 |
+
),
|
276 |
+
array(
|
277 |
+
'rule' => '.edge-wrapper { z-index: 40 !important; }',
|
278 |
+
'themes' => array('dieter', 'anders', 'adorn'),
|
279 |
+
),
|
280 |
+
array(
|
281 |
+
'rule' => '.edgt-wrapper { z-index: 40 !important; }',
|
282 |
+
'themes' => array('shade', 'eldritch', 'morsel', 'educator'),
|
283 |
+
),
|
284 |
+
array(
|
285 |
+
'rule' => '.sidebar-menu-push { z-index: 40 !important; }',
|
286 |
+
'themes' => array('artcore'),
|
287 |
+
),
|
288 |
);
|
289 |
+
foreach( $wrapper_themes as $_v ) {
|
290 |
+
if ( in_array($theme, $_v['themes'] ) ) {
|
291 |
+
echo '<style type="text/css">' . $_v['rule'] . '</style>'. PHP_EOL;
|
|
|
292 |
}
|
293 |
}
|
294 |
|
|
|
|
|
|
|
|
|
295 |
if ( defined('LP_PLUGIN_FILE')) {
|
296 |
echo '<style type="text/css">body.content-item-only .learn-press-content-item-only { z-index: 990; } .single-lp_course #wpadminbar{z-index:900;}</style>' . PHP_EOL;
|
297 |
}
|
|
|
298 |
}
|
299 |
|
300 |
|
514 |
return array_merge( array( $settings_link), $links );
|
515 |
|
516 |
}
|
517 |
+
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'wp_image_zoooom_plugin_action_links' );
|
518 |
|
519 |
if ( ! function_exists( 'x_disable_wp_image_srcset' ) ) :
|
520 |
function x_disable_wp_image_srcset() {
|
includes/image-zoom-warnings.php
CHANGED
@@ -9,6 +9,17 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
9 |
*/
|
10 |
class ImageZoooom_Warnings {
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Constructor
|
14 |
*/
|
@@ -25,14 +36,31 @@ class ImageZoooom_Warnings {
|
|
25 |
return;
|
26 |
}
|
27 |
|
28 |
-
$this->
|
29 |
-
|
30 |
-
|
31 |
-
$this->
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
|
|
36 |
/**
|
37 |
* Warning about AJAX product filter plugins
|
38 |
*/
|
@@ -43,7 +71,7 @@ class ImageZoooom_Warnings {
|
|
43 |
if ( isset($_POST['tab'] )) {
|
44 |
$general['woo_cat'] = (isset($_POST['woo_cat'])) ? true : false;
|
45 |
}
|
46 |
-
if ( ! isset($general['woo_cat']) || $general['woo_cat'] != true ) return;
|
47 |
|
48 |
if ( is_plugin_active( 'woocommerce-ajax-filters/woocommerce-filters.php' ) ) $continue = true;
|
49 |
if ( is_plugin_active( 'load-more-products-for-woocommerce/load-more-products.php' ) ) $continue = true;
|
@@ -51,233 +79,148 @@ class ImageZoooom_Warnings {
|
|
51 |
|
52 |
if ( !$continue ) return false;
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
if ( !empty( $option ) ) {
|
57 |
-
return;
|
58 |
-
}
|
59 |
-
|
60 |
-
add_action( 'admin_notices', array( $this, 'check_ajax_product_filters_notice' ) );
|
61 |
-
}
|
62 |
|
63 |
-
/**
|
64 |
-
* Show a warning about the AJAX product filter plugins
|
65 |
-
*/
|
66 |
-
function check_ajax_product_filters_notice() {
|
67 |
-
$id = 'iz_dismiss_ajax_product_filters';
|
68 |
-
$class = 'notice notice-error is-dismissible';
|
69 |
$article_url = 'https://www.silkypress.com/wp-image-zoom/zoom-woocommerce-category-page-ajax/';
|
70 |
-
$
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
|
|
76 |
}
|
77 |
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
/**
|
83 |
-
*
|
84 |
*/
|
85 |
-
function
|
86 |
-
|
87 |
-
if ( ! is_plugin_active( 'wooswipe/wooswipe.php' ) ) return false;
|
88 |
|
89 |
-
|
90 |
|
91 |
-
if ( !empty(
|
92 |
-
return;
|
93 |
-
}
|
94 |
|
95 |
-
|
|
|
|
|
|
|
96 |
|
|
|
97 |
}
|
98 |
|
99 |
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Warning about BWF settings
|
103 |
-
*/
|
104 |
-
function check_bwf_minify() {
|
105 |
-
|
106 |
-
if ( ! is_plugin_active( 'bwp-minify/bwp-minify.php' ) ) return false;
|
107 |
-
|
108 |
-
$option = get_option( 'iz_dismiss_bwp_minify', '' );
|
109 |
-
|
110 |
-
if ( !empty( $option ) ) {
|
111 |
-
return;
|
112 |
-
}
|
113 |
-
|
114 |
-
add_action( 'admin_notices', array( $this, 'check_bwf_notice' ) );
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Show a warning about the BWF Minify Settings
|
120 |
-
*/
|
121 |
-
function check_bwf_notice() {
|
122 |
-
$id = 'iz_dismiss_bwp_minify';
|
123 |
-
$class = 'notice notice-warning is-dismissible';
|
124 |
-
$url = 'https://www.silkypress.com/wp-content/uploads/2016/09/image-zoom-bwp.png';
|
125 |
-
$message = sprintf(__( '<b>If the zoom does not show up</b> on your website, it could be because you need to add the “image_zoooom-init” and the “image_zoooom” to the “Scripts to NOT minify” option in the BWP Minify settings, as shown in <a href="%1$s" target="_blank">this screenshot</a>.', 'wp-image-zoooom' ), $url);;
|
126 |
-
|
127 |
-
printf( '<div class="%1$s" id="%2$s"><p>%3$s</p></div>', $class, $id, $message );
|
128 |
-
|
129 |
-
$this->dismiss_js( $id );
|
130 |
-
|
131 |
-
}
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
/**
|
138 |
* Check if the Avada theme is active
|
139 |
*/
|
140 |
function check_avada() {
|
141 |
if ( get_template() != 'Avada' ) return false;
|
142 |
|
143 |
-
|
144 |
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
|
145 |
|
146 |
-
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
153 |
|
|
|
154 |
}
|
155 |
|
156 |
|
157 |
-
|
158 |
/**
|
159 |
* Check if for the Shopkeeper theme
|
160 |
*/
|
161 |
function check_shopkeeper() {
|
162 |
-
if ( get_template() != '
|
163 |
-
|
164 |
|
165 |
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
if ( !empty( $option ) ) {
|
170 |
-
return;
|
171 |
-
}
|
172 |
-
|
173 |
-
add_action( 'admin_notices', array( $this, 'check_shopkeeper_notice' ) );
|
174 |
-
|
175 |
-
}
|
176 |
|
177 |
-
/**
|
178 |
-
* Show a warning about the WooSwipe plugin
|
179 |
-
*/
|
180 |
-
function check_wooswipe_notice() {
|
181 |
-
$id = 'iz_dismiss_wooswipe';
|
182 |
-
$class = 'notice notice-warning is-dismissible';
|
183 |
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
184 |
-
$
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
|
|
|
190 |
}
|
191 |
|
192 |
|
193 |
/**
|
194 |
-
*
|
195 |
*/
|
196 |
-
function
|
197 |
-
$id = 'iz_dismiss_avada';
|
198 |
-
$class = 'notice notice-warning is-dismissible';
|
199 |
-
$flexslider_url = 'https://woocommerce.com/flexslider/';
|
200 |
-
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
201 |
-
$message = sprintf( __( 'The WP Image Zoom plugin <b>will not work</b> on the WooCommerce products gallery with the Avada theme. The Avada theme changes entirely the default WooCommerce gallery with the <a href="%1$s" target="_blank">Flexslider gallery</a> and the zoom plugin does not support the Flexslider gallery. Please check the <a href="%2$s" target="_blank">PRO version</a> of the plugin for compatibility with the Flexslider gallery.', 'wp-image-zoooom' ), $flexslider_url, $pro_url );
|
202 |
-
|
203 |
-
printf( '<div class="%1$s" id="%2$s"><p>%3$s</p></div>', $class, $id, $message );
|
204 |
-
|
205 |
-
$this->dismiss_js( $id );
|
206 |
-
|
207 |
-
}
|
208 |
-
|
209 |
|
210 |
-
|
211 |
-
* Show a warning about the Shopkeeper theme
|
212 |
-
*/
|
213 |
-
function check_shopkeeper_notice() {
|
214 |
-
$id = 'iz_dismiss_shopkeeper';
|
215 |
-
$class = 'notice notice-warning is-dismissible';
|
216 |
-
$class = 'updated settings-error notice is-dismissible';
|
217 |
-
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
218 |
-
$message = sprintf( __( 'The WP Image Zoom plugin <b>will not work</b> on the WooCommerce products gallery with the Shopkeeper theme. The Shopkeeper theme changes entirely the default WooCommerce gallery with a custom made gallery not supported by the free version of the WP Image Zoom plugin. Please check the <a href="%1$s" target="_blank">PRO version</a> of the plugin for compatibility with the Shopkeeper\'s gallery.', 'wp-image-zoooom' ), $pro_url );
|
219 |
|
220 |
-
|
221 |
|
222 |
-
$
|
|
|
|
|
|
|
|
|
223 |
|
|
|
224 |
}
|
225 |
|
226 |
|
227 |
/**
|
228 |
-
*
|
229 |
*/
|
230 |
-
function
|
231 |
-
if ( ! defined('JETPACK__VERSION' ) ) {
|
232 |
-
return;
|
233 |
-
}
|
234 |
|
235 |
-
if ( !
|
236 |
-
return;
|
237 |
-
}
|
238 |
|
239 |
-
|
240 |
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
244 |
|
245 |
-
|
246 |
}
|
247 |
|
248 |
-
/**
|
249 |
-
* Show a warning about Jetpack Photon module
|
250 |
-
*/
|
251 |
-
function check_jetpack_notice() {
|
252 |
-
$id = 'iz_dismiss_jetpack';
|
253 |
-
$class = 'notice notice-warning is-dismissible';
|
254 |
-
$message = __( 'WP Image Zoom plugin is not compatible with the <a href="admin.php?page=jetpack">Jetpack Photon</a> module. If you find that the zoom is not working, try to deactivate the Photon module and see if that solves it.', 'wp-image-zoooom' );
|
255 |
-
|
256 |
-
printf( '<div class="%1$s" id="%2$s"><p>%3$s</p></div>', $class, $id, $message );
|
257 |
-
|
258 |
-
$this->dismiss_js( $id );
|
259 |
-
|
260 |
-
}
|
261 |
|
262 |
/**
|
263 |
-
*
|
264 |
-
*/
|
265 |
-
function
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
$(
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
}
|
282 |
|
283 |
|
@@ -288,6 +231,10 @@ class ImageZoooom_Warnings {
|
|
288 |
|
289 |
$option = $_POST['option'];
|
290 |
|
|
|
|
|
|
|
|
|
291 |
update_option( $option, 1 );
|
292 |
|
293 |
wp_die();
|
9 |
*/
|
10 |
class ImageZoooom_Warnings {
|
11 |
|
12 |
+
var $allowed_actions = array(
|
13 |
+
'iz_dismiss_ajax_product_filters',
|
14 |
+
'iz_dismiss_jetpack',
|
15 |
+
'iz_dismiss_avada',
|
16 |
+
'iz_dismiss_shopkeeper',
|
17 |
+
'iz_dismiss_bwp_minify',
|
18 |
+
'iz_dismiss_wooswipe',
|
19 |
+
);
|
20 |
+
|
21 |
+
var $notices = array();
|
22 |
+
|
23 |
/**
|
24 |
* Constructor
|
25 |
*/
|
36 |
return;
|
37 |
}
|
38 |
|
39 |
+
if ( $this_notice = $this->check_ajax_product_filters() ) {
|
40 |
+
$this->notices[] = $this_notice;
|
41 |
+
}
|
42 |
+
if ( $this_notice = $this->check_jetpack() ) {
|
43 |
+
$this->notices[] = $this_notice;
|
44 |
+
}
|
45 |
+
if ( $this_notice = $this->check_avada() ) {
|
46 |
+
$this->notices[] = $this_notice;
|
47 |
+
}
|
48 |
+
if ( $this_notice = $this->check_shopkeeper() ) {
|
49 |
+
$this->notices[] = $this_notice;
|
50 |
+
}
|
51 |
+
if ( $this_notice = $this->check_bwf_minify() ) {
|
52 |
+
$this->notices[] = $this_notice;
|
53 |
+
}
|
54 |
+
if ( $this_notice = $this->check_woo_swipe() ) {
|
55 |
+
$this->notices[] = $this_notice;
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( is_array($this->notices) && count($this->notices) > 0 ) {
|
59 |
+
add_action( 'admin_notices', array($this, 'show_admin_notice') );
|
60 |
+
}
|
61 |
}
|
62 |
|
63 |
+
|
64 |
/**
|
65 |
* Warning about AJAX product filter plugins
|
66 |
*/
|
71 |
if ( isset($_POST['tab'] )) {
|
72 |
$general['woo_cat'] = (isset($_POST['woo_cat'])) ? true : false;
|
73 |
}
|
74 |
+
if ( ! isset($general['woo_cat']) || $general['woo_cat'] != true ) return false;
|
75 |
|
76 |
if ( is_plugin_active( 'woocommerce-ajax-filters/woocommerce-filters.php' ) ) $continue = true;
|
77 |
if ( is_plugin_active( 'load-more-products-for-woocommerce/load-more-products.php' ) ) $continue = true;
|
79 |
|
80 |
if ( !$continue ) return false;
|
81 |
|
82 |
+
if ( !empty( get_option( 'iz_dismiss_ajax_product_filters', '' ) ) ) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$article_url = 'https://www.silkypress.com/wp-image-zoom/zoom-woocommerce-category-page-ajax/';
|
85 |
+
$notice = array(
|
86 |
+
'id' => 'iz_dismiss_ajax_product_filters',
|
87 |
+
'class' => 'notice notice-error is-dismissible',
|
88 |
+
'message' => sprintf(__( 'You are using the zoom on WooCommerce shop pages in combination with a plugin that loads more products with AJAX (a product filter plugin or a "load more" products plugin). You\'ll notice that the zoom isn\'t applied after new products are loaded with AJAX. Please read <a href="%1$s" target="_blank">this article for a solution</a>.', 'wp-image-zoooom' ), $article_url),
|
89 |
+
);
|
90 |
|
91 |
+
return $notice;
|
92 |
}
|
93 |
|
94 |
|
|
|
|
|
|
|
95 |
/**
|
96 |
+
* Check if Jetpack Photon module is active
|
97 |
*/
|
98 |
+
function check_jetpack() {
|
99 |
+
if ( ! defined('JETPACK__VERSION' ) ) return false;
|
|
|
100 |
|
101 |
+
if ( ! Jetpack::is_module_active( 'photon' ) ) return false;
|
102 |
|
103 |
+
if ( !empty( get_option( 'iz_dismiss_jetpack', '' ) ) ) return false;
|
|
|
|
|
104 |
|
105 |
+
$notice = array(
|
106 |
+
'id' => 'iz_dismiss_jetpack',
|
107 |
+
'message' => __( 'WP Image Zoom plugin is not compatible with the <a href="admin.php?page=jetpack">Jetpack Photon</a> module. If you find that the zoom is not working, try to deactivate the Photon module and see if that solves it.', 'wp-image-zoooom' ),
|
108 |
+
);
|
109 |
|
110 |
+
return $notice;
|
111 |
}
|
112 |
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
/**
|
115 |
* Check if the Avada theme is active
|
116 |
*/
|
117 |
function check_avada() {
|
118 |
if ( get_template() != 'Avada' ) return false;
|
119 |
|
|
|
120 |
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
|
121 |
|
122 |
+
if ( !empty( get_option( 'iz_dismiss_avada', '' ) ) ) return false;
|
123 |
|
124 |
+
$flexslider_url = 'https://woocommerce.com/flexslider/';
|
125 |
+
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
126 |
+
$notice = array(
|
127 |
+
'id' => 'iz_dismiss_avada',
|
128 |
+
'message' => sprintf( __( 'The WP Image Zoom plugin <b>will not work</b> on the WooCommerce products gallery with the Avada theme. The Avada theme changes entirely the default WooCommerce gallery with the <a href="%1$s" target="_blank">Flexslider gallery</a> and the zoom plugin does not support the Flexslider gallery. Please check the <a href="%2$s" target="_blank">PRO version</a> of the plugin for compatibility with the Flexslider gallery.', 'wp-image-zoooom' ), $flexslider_url, $pro_url ),
|
129 |
+
);
|
130 |
|
131 |
+
return $notice;
|
132 |
}
|
133 |
|
134 |
|
|
|
135 |
/**
|
136 |
* Check if for the Shopkeeper theme
|
137 |
*/
|
138 |
function check_shopkeeper() {
|
139 |
+
if ( get_template() != 'shopkeeper' ) return false;
|
|
|
140 |
|
141 |
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
|
142 |
|
143 |
+
if ( !empty( get_option( 'iz_dismiss_shopkeeper', '' ) ) ) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
146 |
+
$notice = array(
|
147 |
+
'id' => 'iz_dismiss_shopkeeper',
|
148 |
+
'class' => 'updated settings-error notice is-dismissible',
|
149 |
+
'message' => sprintf( __( 'The WP Image Zoom plugin <b>will not work</b> on the WooCommerce products gallery with the Shopkeeper theme. The Shopkeeper theme changes entirely the default WooCommerce gallery with a custom made gallery not supported by the free version of the WP Image Zoom plugin. Please check the <a href="%1$s" target="_blank">PRO version</a> of the plugin for compatibility with the Shopkeeper\'s gallery.', 'wp-image-zoooom' ), $pro_url ),
|
150 |
+
);
|
151 |
|
152 |
+
return $notice;
|
153 |
}
|
154 |
|
155 |
|
156 |
/**
|
157 |
+
* Warning about BWF Minify settings
|
158 |
*/
|
159 |
+
function check_bwf_minify() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
+
if ( ! is_plugin_active( 'bwp-minify/bwp-minify.php' ) ) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
+
if ( !empty( get_option( 'iz_dismiss_bwp_minify', '' ) ) ) return false;
|
164 |
|
165 |
+
$url = 'https://www.silkypress.com/wp-content/uploads/2016/09/image-zoom-bwp.png';
|
166 |
+
$notice = array(
|
167 |
+
'id' => 'iz_dismiss_bwp_minify',
|
168 |
+
'message' => sprintf(__( '<b>If the zoom does not show up</b> on your website, it could be because you need to add the “image_zoooom-init” and the “image_zoooom” to the “Scripts to NOT minify” option in the BWP Minify settings, as shown in <a href="%1$s" target="_blank">this screenshot</a>.', 'wp-image-zoooom' ), $url),
|
169 |
+
);
|
170 |
|
171 |
+
return $notice;
|
172 |
}
|
173 |
|
174 |
|
175 |
/**
|
176 |
+
* Warning about WooSwipe plugin
|
177 |
*/
|
178 |
+
function check_woo_swipe() {
|
|
|
|
|
|
|
179 |
|
180 |
+
if ( ! is_plugin_active( 'wooswipe/wooswipe.php' ) ) return false;
|
|
|
|
|
181 |
|
182 |
+
if ( !empty( get_option( 'iz_dismiss_wooswipe', '' ) ) ) return false;
|
183 |
|
184 |
+
$pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
|
185 |
+
$wooswipe_url = 'https://wordpress.org/plugins/wooswipe/';
|
186 |
+
$notice = array(
|
187 |
+
'id' => 'iz_dismiss_wooswipe',
|
188 |
+
'message' => sprintf( __( 'WP Image Zoom plugin is <b>not compatible with the <a href="%1$s">WooSwipe WooCommerce Gallery</a> plugin</b>. You can try the zoom plugin with the default WooCommerce gallery by deactivating the WooSwipe plugin. Alternatively, you can upgrade to the WP Image Zoom Pro version, where the issue with the WooSwipe plugin is fixed.' ), $wooswipe_url, $pro_url),
|
189 |
+
);
|
190 |
|
191 |
+
return $notice;
|
192 |
}
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
/**
|
196 |
+
* Show the admin notices
|
197 |
+
* */
|
198 |
+
function show_admin_notice() {
|
199 |
+
if ( !is_array($this->notices) || count($this->notices) == 0 ) return;
|
200 |
+
|
201 |
+
foreach( $this->notices as $_n ) {
|
202 |
+
$nonce = wp_create_nonce( $_n['id'] );
|
203 |
+
if ( !isset($_n['class'])) $_n['class'] = 'notice notice-warning is-dismissible';
|
204 |
+
$_n['class'] .= ' iz-notice-dismiss';
|
205 |
+
printf( '<div class="%1$s" id="%2$s" data-nonce="%3$s"><p>%4$s</p></div>', $_n['class'], $_n['id'], $nonce, $_n['message'] );
|
206 |
+
}
|
207 |
+
?>
|
208 |
+
<script type='text/javascript'>
|
209 |
+
jQuery(function($){
|
210 |
+
$(document).on( 'click', '.iz-notice-dismiss', function() {
|
211 |
+
var id = $(this).attr('id');
|
212 |
+
var data = {
|
213 |
+
action: 'iz_dismiss',
|
214 |
+
option: id,
|
215 |
+
nonce: $(this).data('nonce'),
|
216 |
+
};
|
217 |
+
$.post(ajaxurl, data, function(response ) {
|
218 |
+
$('#'+id).fadeOut('slow');
|
219 |
+
});
|
220 |
+
});
|
221 |
+
});
|
222 |
+
</script>
|
223 |
+
<?php
|
224 |
}
|
225 |
|
226 |
|
231 |
|
232 |
$option = $_POST['option'];
|
233 |
|
234 |
+
if ( ! in_array($option, $this->allowed_actions ) ) return;
|
235 |
+
|
236 |
+
check_ajax_referer( $option, 'nonce' );
|
237 |
+
|
238 |
update_option( $option, 1 );
|
239 |
|
240 |
wp_die();
|
includes/settings.php
CHANGED
@@ -6,7 +6,7 @@ function wp_image_zoooom_settings($type) {
|
|
6 |
$l = 'wp-image-zoooom';
|
7 |
|
8 |
$plugin = array(
|
9 |
-
'version' => '1.
|
10 |
'plugin_name' => 'WP Image Zoom',
|
11 |
'plugin_file' => str_replace('includes/settings.php', 'image-zoooom.php', __FILE__),
|
12 |
'plugin_server' => 'https://www.silkypress.com',
|
6 |
$l = 'wp-image-zoooom';
|
7 |
|
8 |
$plugin = array(
|
9 |
+
'version' => '1.24',
|
10 |
'plugin_name' => 'WP Image Zoom',
|
11 |
'plugin_file' => str_replace('includes/settings.php', 'image-zoooom.php', __FILE__),
|
12 |
'plugin_server' => 'https://www.silkypress.com',
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Email: diana@burduja.eu
|
|
5 |
Tags: e-commerce, featured image, hover over image zoom, image, image zoom, image zoom plugin, image magnification, image magnifier, jquery picture zoom, magnifier, magnify image, magnifying glass, mouse over image zoom, panorama, picture zoom, product image, product zoom, product magnification, product magnifier, responsive, woocommerce product zoom, woocommerce zoom, woocommerce magnifying glass, zoom, zoom image, zoom plugin, woocommerce image zoom, woocommerce product image zoom, woocommerce zoom magnifier
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 4.9
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -144,6 +144,13 @@ Alternatively you can upgrade to the Pro version, as there the zoom lens is buil
|
|
144 |
|
145 |
== Changelog ==
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
= 1.23 =
|
148 |
* 08/02/2018
|
149 |
* Fix: on window resize, show zoom on WooCommerce gallery only if the option is enabled (https://wordpress.org/support/topic/disabling-the-zoom-not-working/)
|
5 |
Tags: e-commerce, featured image, hover over image zoom, image, image zoom, image zoom plugin, image magnification, image magnifier, jquery picture zoom, magnifier, magnify image, magnifying glass, mouse over image zoom, panorama, picture zoom, product image, product zoom, product magnification, product magnifier, responsive, woocommerce product zoom, woocommerce zoom, woocommerce magnifying glass, zoom, zoom image, zoom plugin, woocommerce image zoom, woocommerce product image zoom, woocommerce zoom magnifier
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 4.9
|
8 |
+
Stable tag: 1.24
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
144 |
|
145 |
== Changelog ==
|
146 |
|
147 |
+
= 1.24 =
|
148 |
+
* 29/03/2018
|
149 |
+
* Fix: Allow the default WooCommerce lightbox along with the zoom
|
150 |
+
* Fix: WC3 with the "Remove Lightbox" option disabled showed a lingering image after closing the lightbox.
|
151 |
+
* Fix: check the option name against an array of allowed values
|
152 |
+
* Tweak: update the list of themes that add a whole page wrapper with the z-index higher than the zoom
|
153 |
+
|
154 |
= 1.23 =
|
155 |
* 08/02/2018
|
156 |
* Fix: on window resize, show zoom on WooCommerce gallery only if the option is enabled (https://wordpress.org/support/topic/disabling-the-zoom-not-working/)
|