WP Image Zoom - Version 1.25

Version Description

  • 31/03/2018
  • Fix: Fatal error for PHP older than 5.5
  • Code refactory
Download this release

Release Info

Developer diana_burduja
Plugin Icon 128x128 WP Image Zoom
Version 1.25
Comparing to
See all releases

Code changes from version 1.24 to 1.25

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.24
7
  * Author: SilkyPress
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
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.25
7
  * Author: SilkyPress
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
includes/image-zoom-admin.php CHANGED
@@ -364,7 +364,7 @@ class ImageZoooom_Admin {
364
  */
365
  public function show_messages() {
366
  global $comment;
367
- if ( sizeof( $comment ) == 0 ) return;
368
  $output = '';
369
  foreach ( $comment as $message ) {
370
  $output .= '<div class="alert alert-'.$message['type'].'">
364
  */
365
  public function show_messages() {
366
  global $comment;
367
+ if ( !$comment || sizeof( $comment ) == 0 ) return;
368
  $output = '';
369
  foreach ( $comment as $message ) {
370
  $output .= '<div class="alert alert-'.$message['type'].'">
includes/image-zoom-warnings.php CHANGED
@@ -36,35 +36,21 @@ class ImageZoooom_Warnings {
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
  */
67
- function check_ajax_product_filters() {
68
  $continue = false;
69
 
70
  $general = get_option('zoooom_general');
@@ -79,116 +65,104 @@ class ImageZoooom_Warnings {
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
 
36
  return;
37
  }
38
 
39
+ $this->iz_dismiss_ajax_product_filters();
40
+ $this->iz_dismiss_jetpack();
41
+ $this->iz_dismiss_avada();
42
+ $this->iz_dismiss_shopkeeper();
43
+ $this->iz_dismiss_bwp_minify();
44
+ $this->iz_dismiss_wooswipe();
45
+
46
+ add_action( 'admin_notices', array($this, 'show_admin_notice') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
 
50
  /**
51
  * Warning about AJAX product filter plugins
52
  */
53
+ function iz_dismiss_ajax_product_filters() {
54
  $continue = false;
55
 
56
  $general = get_option('zoooom_general');
65
 
66
  if ( !$continue ) return false;
67
 
 
 
68
  $article_url = 'https://www.silkypress.com/wp-image-zoom/zoom-woocommerce-category-page-ajax/';
69
+
70
+ $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);
 
 
 
71
 
72
+ $this->add_notice( 'iz_dismiss_ajax_product_filters', $message );
73
  }
74
 
75
 
76
  /**
77
  * Check if Jetpack Photon module is active
78
  */
79
+ function iz_dismiss_jetpack() {
80
  if ( ! defined('JETPACK__VERSION' ) ) return false;
81
 
82
  if ( ! Jetpack::is_module_active( 'photon' ) ) return false;
83
 
84
+ $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' );
 
 
 
 
 
85
 
86
+ $this->add_notice( 'iz_dismiss_jetpack', $message );
87
  }
88
 
89
 
90
  /**
91
  * Check if the Avada theme is active
92
  */
93
+ function iz_dismiss_avada() {
94
  if ( get_template() != 'Avada' ) return false;
95
 
96
  if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
97
 
 
 
98
  $flexslider_url = 'https://woocommerce.com/flexslider/';
99
  $pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
100
+
101
+ $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 );
 
 
102
 
103
+ $this->add_notice( 'iz_dismiss_avada', $message );
104
  }
105
 
106
 
107
  /**
108
  * Check if for the Shopkeeper theme
109
  */
110
+ function iz_dismiss_shopkeeper() {
111
  if ( get_template() != 'shopkeeper' ) return false;
112
 
113
  if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) return false;
114
 
 
 
115
  $pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
 
 
 
 
 
116
 
117
+ $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 );
118
+
119
+ $this->add_notice( 'iz_dismiss_shopkeeper', $message, 'updated settings-error notice is-dismissible' );
120
  }
121
 
122
 
123
  /**
124
  * Warning about BWF Minify settings
125
  */
126
+ function iz_dismiss_bwp_minify() {
 
127
  if ( ! is_plugin_active( 'bwp-minify/bwp-minify.php' ) ) return false;
128
 
 
 
129
  $url = 'https://www.silkypress.com/wp-content/uploads/2016/09/image-zoom-bwp.png';
 
 
 
 
130
 
131
+ $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);
132
+
133
+ $this->add_notice( 'iz_dismiss_bwp_minify', $message );
134
  }
135
 
136
 
137
  /**
138
  * Warning about WooSwipe plugin
139
  */
140
+ function iz_dismiss_wooswipe() {
141
 
142
  if ( ! is_plugin_active( 'wooswipe/wooswipe.php' ) ) return false;
143
 
 
 
144
  $pro_url = 'https://www.silkypress.com/wp-image-zoom-plugin/?utm_source=wordpress&utm_campaign=iz_free&utm_medium=banner';
145
  $wooswipe_url = 'https://wordpress.org/plugins/wooswipe/';
146
+
147
+ $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);
148
+
149
+ $this->add_notice( 'iz_dismiss_woo_swipe', $message );
150
+ }
151
+
152
+
153
+ /**
154
+ * Add this message to the $this->notices array
155
+ */
156
+ function add_notice($id, $message, $class = '') {
157
+ if ( get_option($id) != false ) return false;
158
+
159
  $notice = array(
160
+ 'id' => $id,
161
+ 'message' => $message,
162
  );
163
+ if ( !empty($class) ) $notice['class'] = $class;
164
 
165
+ $this->notices[] = $notice;
166
  }
167
 
168
 
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.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',
6
  $l = 'wp-image-zoooom';
7
 
8
  $plugin = array(
9
+ 'version' => '1.25',
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.24
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -144,11 +144,16 @@ Alternatively you can upgrade to the Pro version, as there the zoom lens is buil
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 =
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.25
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
144
 
145
  == Changelog ==
146
 
147
+ = 1.25 =
148
+ * 31/03/2018
149
+ * Fix: Fatal error for PHP older than 5.5
150
+ * Code refactory
151
+
152
  = 1.24 =
153
  * 29/03/2018
154
  * Fix: Allow the default WooCommerce lightbox along with the zoom
155
  * Fix: WC3 with the "Remove Lightbox" option disabled showed a lingering image after closing the lightbox.
156
+ * Security fix: check the option name against an array of allowed values. (https://advisories.dxw.com/advisories/wp-image-zoom-dos/)
157
  * Tweak: update the list of themes that add a whole page wrapper with the z-index higher than the zoom
158
 
159
  = 1.23 =