WP Image Zoom - Version 1.29

Version Description

  • 02/11/2018
  • Check and declare compatibility with WooCommerce 3.5.0
  • Code refactoring
Download this release

Release Info

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

Code changes from version 1.28 to 1.29

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.28
7
  * Author: SilkyPress
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
@@ -12,7 +12,7 @@
12
  * Domain Path: /languages/
13
  *
14
  * WC requires at least: 2.3.0
15
- * WC tested up to: 3.3.0
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
@@ -27,6 +27,7 @@ if ( ! class_exists( 'ImageZoooom' ) ) :
27
  */
28
  final class ImageZoooom {
29
  public $plugin;
 
30
  public $theme = '';
31
  protected static $_instance = null;
32
 
@@ -68,8 +69,13 @@ final class ImageZoooom {
68
  public function __construct() {
69
  global $_wp_theme_features;
70
 
 
 
 
 
 
 
71
  $this->theme = strtolower(get_template());
72
- add_action('init', array($this, 'plugins_url'));
73
  include_once( 'includes/settings.php' );
74
  $this->plugin = wp_image_zoooom_settings('plugin');
75
 
@@ -331,8 +337,8 @@ final class ImageZoooom {
331
  * @access public
332
  */
333
  public function wp_enqueue_scripts() {
334
- $v = $this->plugin['version'];
335
- $url = $this->plugin['url'];
336
  $prefix = '.min';
337
 
338
  // Load the jquery.image_zoom.js
@@ -396,27 +402,27 @@ final class ImageZoooom {
396
  switch ( $i['lensShape'] ) {
397
  case 'none' :
398
  $o = array(
399
- 'zoomType' => 'inner',
400
- 'cursor' => $i['cursorType'],
401
- 'easingAmount' => $i['zwEasing'],
402
  );
403
  break;
404
  case 'square' :
405
  case 'round' :
406
  $o = array(
407
- 'lensShape' => $i['lensShape'],
408
- 'zoomType' => 'lens',
409
- 'lensSize' => $i['lensSize'],
410
- 'borderSize' => $i['borderThickness'],
411
- 'borderColour' => $i['borderColor'],
412
- 'cursor' => $i['cursorType'],
413
- 'lensFadeIn' => $i['lensFade'],
414
- 'lensFadeOut' => $i['lensFade'],
415
  );
416
  if ( $i['tint'] == true ) {
417
- $o['tint'] = 'true';
418
- $o['tintColour'] = $i['tintColor'];
419
- $o['tintOpacity'] = $i['tintOpacity'];
420
  }
421
 
422
  break;
@@ -424,29 +430,29 @@ final class ImageZoooom {
424
  break;
425
  case 'zoom_window' :
426
  $o = array(
427
- 'lensShape' => 'square',
428
- 'lensSize' => $i['lensSize'],
429
- 'lensBorderSize' => $i['borderThickness'],
430
- 'lensBorderColour' => $i['borderColor'],
431
- 'borderRadius' => $i['zwBorderRadius'],
432
- 'cursor' => $i['cursorType'],
433
- 'zoomWindowWidth' => $i['zwWidth'],
434
- 'zoomWindowHeight' => $i['zwHeight'],
435
- 'zoomWindowOffsetx' => $i['zwPadding'],
436
- 'borderSize' => $i['zwBorderThickness'],
437
- 'borderColour' => $i['zwBorderColor'],
438
- 'zoomWindowShadow' => $i['zwShadow'],
439
- 'lensFadeIn' => $i['lensFade'],
440
- 'lensFadeOut' => $i['lensFade'],
441
- 'zoomWindowFadeIn' => $i['zwFade'],
442
- 'zoomWindowFadeOut' => $i['zwFade'],
443
- 'easingAmount' => $i['zwEasing'],
444
  );
445
 
446
  if ( $i['tint'] == true ) {
447
- $o['tint'] = 'true';
448
- $o['tintColour'] = $i['tintColor'];
449
- $o['tintOpacity'] = $i['tintOpacity'];
450
  }
451
 
452
  break;
@@ -469,14 +475,6 @@ final class ImageZoooom {
469
  return false;
470
  }
471
 
472
- function plugins_url() {
473
- define('IMAGE_ZOOM_FILE', __FILE__);
474
- define('IMAGE_ZOOM_URL', plugins_url('/', __FILE__));
475
- define('IMAGE_ZOOM_PATH', plugin_dir_path(__FILE__));
476
- $this->plugin['url'] = IMAGE_ZOOM_URL;
477
- $this->plugin['path'] = IMAGE_ZOOM_PATH;
478
- }
479
-
480
 
481
  /**
482
  * Check if WooCommerce is activated
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.29
7
  * Author: SilkyPress
8
  * Author URI: https://www.silkypress.com
9
  * License: GPL2
12
  * Domain Path: /languages/
13
  *
14
  * WC requires at least: 2.3.0
15
+ * WC tested up to: 3.5.0
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
27
  */
28
  final class ImageZoooom {
29
  public $plugin;
30
+ public $version = '1.29';
31
  public $theme = '';
32
  protected static $_instance = null;
33
 
69
  public function __construct() {
70
  global $_wp_theme_features;
71
 
72
+
73
+ define('IMAGE_ZOOM_FILE', __FILE__);
74
+ define('IMAGE_ZOOM_URL', plugins_url('/', __FILE__));
75
+ define('IMAGE_ZOOM_PATH', plugin_dir_path(__FILE__));
76
+ define('IMAGE_ZOOM_VERSION', $this->version);
77
+
78
  $this->theme = strtolower(get_template());
 
79
  include_once( 'includes/settings.php' );
80
  $this->plugin = wp_image_zoooom_settings('plugin');
81
 
337
  * @access public
338
  */
339
  public function wp_enqueue_scripts() {
340
+ $v = IMAGE_ZOOM_VERSION;
341
+ $url = IMAGE_ZOOM_URL;
342
  $prefix = '.min';
343
 
344
  // Load the jquery.image_zoom.js
402
  switch ( $i['lensShape'] ) {
403
  case 'none' :
404
  $o = array(
405
+ 'zoomType' => 'inner',
406
+ 'cursor' => $i['cursorType'],
407
+ 'easingAmount' => $i['zwEasing'],
408
  );
409
  break;
410
  case 'square' :
411
  case 'round' :
412
  $o = array(
413
+ 'lensShape' => $i['lensShape'],
414
+ 'zoomType' => 'lens',
415
+ 'lensSize' => $i['lensSize'],
416
+ 'borderSize' => $i['borderThickness'],
417
+ 'borderColour' => $i['borderColor'],
418
+ 'cursor' => $i['cursorType'],
419
+ 'lensFadeIn' => $i['lensFade'],
420
+ 'lensFadeOut' => $i['lensFade'],
421
  );
422
  if ( $i['tint'] == true ) {
423
+ $o['tint'] = 'true';
424
+ $o['tintColour'] = $i['tintColor'];
425
+ $o['tintOpacity'] = $i['tintOpacity'];
426
  }
427
 
428
  break;
430
  break;
431
  case 'zoom_window' :
432
  $o = array(
433
+ 'lensShape' => 'square',
434
+ 'lensSize' => $i['lensSize'],
435
+ 'lensBorderSize' => $i['borderThickness'],
436
+ 'lensBorderColour' => $i['borderColor'],
437
+ 'borderRadius' => $i['zwBorderRadius'],
438
+ 'cursor' => $i['cursorType'],
439
+ 'zoomWindowWidth' => $i['zwWidth'],
440
+ 'zoomWindowHeight' => $i['zwHeight'],
441
+ 'zoomWindowOffsetx' => $i['zwPadding'],
442
+ 'borderSize' => $i['zwBorderThickness'],
443
+ 'borderColour' => $i['zwBorderColor'],
444
+ 'zoomWindowShadow' => $i['zwShadow'],
445
+ 'lensFadeIn' => $i['lensFade'],
446
+ 'lensFadeOut' => $i['lensFade'],
447
+ 'zoomWindowFadeIn' => $i['zwFade'],
448
+ 'zoomWindowFadeOut' => $i['zwFade'],
449
+ 'easingAmount' => $i['zwEasing'],
450
  );
451
 
452
  if ( $i['tint'] == true ) {
453
+ $o['tint'] = 'true';
454
+ $o['tintColour'] = $i['tintColor'];
455
+ $o['tintOpacity'] = $i['tintOpacity'];
456
  }
457
 
458
  break;
475
  return false;
476
  }
477
 
 
 
 
 
 
 
 
 
478
 
479
  /**
480
  * Check if WooCommerce is activated
includes/image-zoom-admin-general.php CHANGED
@@ -49,6 +49,7 @@ include_once( 'premium-tooltips.php' );
49
  <li>the <a href="https://www.silkypress.com/i/js-featherlight" target="_blank" rel="nofollow">Featherlight.js</a> lightbox (also used by <a href="https://www.silkypress.com/i/wp-draw-attention" target="_blank" rel="nofollow">Draw Attention</a> plugin)</li>
50
  <li>the lightbox created by the Ultimate Product Catalogue by Etoile Web Design</li>
51
  <li>the <a href="http://dimsemenov.com/plugins/magnific-popup/" target="_blank" rel="nofollow">Magnific Popup</a> lightbox (also used by <a href="https://www.silkypress.com/i/enfold-theme" target="_blank" rel="nofollow">Enfold</a> portfolio items)</li>
 
52
  </ul>
53
  </p>
54
  </div>
49
  <li>the <a href="https://www.silkypress.com/i/js-featherlight" target="_blank" rel="nofollow">Featherlight.js</a> lightbox (also used by <a href="https://www.silkypress.com/i/wp-draw-attention" target="_blank" rel="nofollow">Draw Attention</a> plugin)</li>
50
  <li>the lightbox created by the Ultimate Product Catalogue by Etoile Web Design</li>
51
  <li>the <a href="http://dimsemenov.com/plugins/magnific-popup/" target="_blank" rel="nofollow">Magnific Popup</a> lightbox (also used by <a href="https://www.silkypress.com/i/enfold-theme" target="_blank" rel="nofollow">Enfold</a> portfolio items)</li>
52
+ <li>the lightbox from the <a href="https://wordpress.org/plugins/elementor/" target="_blank" rel="nofollow">Elementor</a> Page Builder</li>
53
  </ul>
54
  </p>
55
  </div>
includes/image-zoom-admin.php CHANGED
@@ -45,20 +45,20 @@ class ImageZoooom_Admin {
45
  return false;
46
 
47
  $url = IMAGE_ZOOM_URL. 'assets/';
48
- $version = $this->plugin['version'];
49
 
50
  // Register the javascript files
51
  if ( $this->plugin['testing'] == true ) {
52
- wp_register_script( 'bootstrap', $url. 'js/bootstrap.3.2.0.min.js' , array( 'jquery' ), $version, true );
53
- wp_register_script( 'image_zoooom', $url.'js/jquery.image_zoom.js' , array( 'jquery' ), $version, true );
54
  if ( !isset($_GET['tab']) || $_GET['tab'] == 'settings' ) {
55
- wp_register_script( 'zoooom-settings', $url. 'js/image_zoom.settings.free.js', array( 'image_zoooom' ), $version, true );
56
  }
57
  } else {
58
- wp_register_script( 'bootstrap', $url.'js/bootstrap.3.2.0.min.js', array( 'jquery' ), $version, true );
59
- wp_register_script( 'image_zoooom', $url.'js/jquery.image_zoom.min.js', array( 'jquery' ), $version, true );
60
  if ( !isset($_GET['tab']) || $_GET['tab'] == 'settings' ) {
61
- wp_register_script( 'zoooom-settings', $url.'js/image_zoom.settings.min.js', array( 'image_zoooom' ), $version, true );
62
  }
63
  }
64
 
@@ -68,11 +68,11 @@ class ImageZoooom_Admin {
68
  wp_enqueue_script( 'zoooom-settings' );
69
 
70
  // Register the css files
71
- wp_register_style( 'bootstrap', $url.'css/bootstrap.min.css', array(), $version );
72
  if ( $this->plugin['testing'] == true ) {
73
- wp_register_style( 'zoooom', $url.'css/style.css', array(), $version );
74
  } else {
75
- wp_register_style( 'zoooom', $url.'css/style.min.css', array(), $version );
76
  }
77
 
78
  // Enqueue the css files
@@ -124,9 +124,9 @@ class ImageZoooom_Admin {
124
  if ( ! empty( $_POST ) ) {
125
  check_admin_referer('iz_template');
126
  $new_settings = $this->validate_settings( $_POST );
127
- $new_settings_js = $this->generate_js_settings( $new_settings );
128
  update_option( 'zoooom_settings', $new_settings );
129
- update_option( 'zoooom_settings_js', $new_settings_js );
130
  $this->add_message( 'success', '<b>'.__('Your settings have been saved.', 'wp-image-zoooom') . '</b>' );
131
  }
132
 
@@ -140,6 +140,7 @@ class ImageZoooom_Admin {
140
  * Build the jquery.image_zoom.js options and save them directly in the database
141
  * @access private
142
  */
 
143
  private function generate_js_settings( $settings ) {
144
  $options = array();
145
  switch ( $settings['lensShape'] ) {
@@ -199,6 +200,7 @@ class ImageZoooom_Admin {
199
 
200
  return $options;
201
  }
 
202
 
203
 
204
  /**
45
  return false;
46
 
47
  $url = IMAGE_ZOOM_URL. 'assets/';
48
+ $v = IMAGE_ZOOM_VERSION;
49
 
50
  // Register the javascript files
51
  if ( $this->plugin['testing'] == true ) {
52
+ wp_register_script( 'bootstrap', $url. 'js/bootstrap.3.2.0.min.js' , array( 'jquery' ), $v, true );
53
+ wp_register_script( 'image_zoooom', $url.'js/jquery.image_zoom.js' , array( 'jquery' ), $v, true );
54
  if ( !isset($_GET['tab']) || $_GET['tab'] == 'settings' ) {
55
+ wp_register_script( 'zoooom-settings', $url. 'js/image_zoom.settings.free.js', array( 'image_zoooom' ), $v, true );
56
  }
57
  } else {
58
+ wp_register_script( 'bootstrap', $url.'js/bootstrap.3.2.0.min.js', array( 'jquery' ), $v, true );
59
+ wp_register_script( 'image_zoooom', $url.'js/jquery.image_zoom.min.js', array( 'jquery' ), $v, true );
60
  if ( !isset($_GET['tab']) || $_GET['tab'] == 'settings' ) {
61
+ wp_register_script( 'zoooom-settings', $url.'js/image_zoom.settings.min.js', array( 'image_zoooom' ), $v, true );
62
  }
63
  }
64
 
68
  wp_enqueue_script( 'zoooom-settings' );
69
 
70
  // Register the css files
71
+ wp_register_style( 'bootstrap', $url.'css/bootstrap.min.css', array(), $v);
72
  if ( $this->plugin['testing'] == true ) {
73
+ wp_register_style( 'zoooom', $url.'css/style.css', array(), $v);
74
  } else {
75
+ wp_register_style( 'zoooom', $url.'css/style.min.css', array(), $v);
76
  }
77
 
78
  // Enqueue the css files
124
  if ( ! empty( $_POST ) ) {
125
  check_admin_referer('iz_template');
126
  $new_settings = $this->validate_settings( $_POST );
127
+ // $new_settings_js = $this->generate_js_settings( $new_settings );
128
  update_option( 'zoooom_settings', $new_settings );
129
+ // update_option( 'zoooom_settings_js', $new_settings_js );
130
  $this->add_message( 'success', '<b>'.__('Your settings have been saved.', 'wp-image-zoooom') . '</b>' );
131
  }
132
 
140
  * Build the jquery.image_zoom.js options and save them directly in the database
141
  * @access private
142
  */
143
+ /*
144
  private function generate_js_settings( $settings ) {
145
  $options = array();
146
  switch ( $settings['lensShape'] ) {
200
 
201
  return $options;
202
  }
203
+ */
204
 
205
 
206
  /**
includes/image-zoom-notices.php CHANGED
@@ -11,7 +11,6 @@ class ImageZoooom_Notices {
11
 
12
  var $main = '';
13
  var $activation_time = '';
14
- var $version = '';
15
  var $dismiss_notice = '';
16
  var $expiration_days = 3;
17
 
@@ -20,8 +19,6 @@ class ImageZoooom_Notices {
20
  */
21
  public function __construct() {
22
 
23
- $this->main = new ImageZoooom();
24
-
25
  $this->set_variables();
26
 
27
  if ( $this->dismiss_notice == 1 ) {
@@ -53,13 +50,14 @@ class ImageZoooom_Notices {
53
  $now = time();
54
 
55
  $this->activation_time = get_option( 'zoooom_activation_time', '' );
56
- $this->version = get_option( 'zoooom_version', '' );
 
57
  $this->dismiss_notice = get_option( 'zoooom_dismiss_notice', false );
58
 
59
- if ( empty( $this->activation_time ) || version_compare( $this->version, $this->main->version, '<' ) ) {
60
  $this->activation_time = $now;
61
  update_option( 'zoooom_activation_time', $now );
62
- update_option( 'zoooom_version', $this->main->version );
63
  update_option( 'zoooom_dismiss_notice', false );
64
  }
65
 
11
 
12
  var $main = '';
13
  var $activation_time = '';
 
14
  var $dismiss_notice = '';
15
  var $expiration_days = 3;
16
 
19
  */
20
  public function __construct() {
21
 
 
 
22
  $this->set_variables();
23
 
24
  if ( $this->dismiss_notice == 1 ) {
50
  $now = time();
51
 
52
  $this->activation_time = get_option( 'zoooom_activation_time', '' );
53
+ $last_version = get_option( 'zoooom_version', '' );
54
+ $v = IMAGE_ZOOM_VERSION;
55
  $this->dismiss_notice = get_option( 'zoooom_dismiss_notice', false );
56
 
57
+ if ( empty( $this->activation_time ) || version_compare( $last_version, $v, '<' ) ) {
58
  $this->activation_time = $now;
59
  update_option( 'zoooom_activation_time', $now );
60
+ update_option( 'zoooom_version', $v );
61
  update_option( 'zoooom_dismiss_notice', false );
62
  }
63
 
includes/image-zoom.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit; // Exit if accessed directly
5
- }
6
-
7
- if ( ! class_exists( 'ImageZoooom' ) ) :
8
- /**
9
- * Main ImageZoooom Class
10
- *
11
- * @class ImageZoooom
12
- */
13
- final class ImageZoooom {
14
- public $version = '1.0.0';
15
- protected static $_instance = null;
16
-
17
- /**
18
- * Main ImageZoooom Instance
19
- *
20
- * Ensures only one instance of ImageZoooom is loaded or can be loaded
21
- *
22
- * @static
23
- * @return ImageZoooom - Main instance
24
- */
25
- public static function instance() {
26
- if ( is_null( self::$_instance ) ) {
27
- self::$_instance = new self();
28
- }
29
- return self::$_instance;
30
- }
31
-
32
- /**
33
- * Cloning is forbidden.
34
- */
35
- public function __clone() {
36
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'zoooom' ), '1.0' );
37
- }
38
-
39
- /**
40
- * Unserializing instances of this class is forbidden.
41
- */
42
- public function __wakeup() {
43
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'zoooom' ), '1.0' );
44
- }
45
-
46
- /**
47
- * Image Zoooom Constructor
48
- * @access public
49
- * @return ImageZoooom
50
- */
51
- public function __construct() {
52
-
53
- if ( is_admin() ) {
54
- include_once( 'includes/image-zoom-admin.php' );
55
- add_action( 'admin_menu', 'add_menu' );
56
- add_action( 'admin_init', 'register_mysettings' );
57
- } else {
58
- include_once( 'includes/image-zoom-page.php' );
59
- }
60
- }
61
-
62
- }
63
-
64
- endif;
65
-
66
- /**
67
- * Returns the main instance of ImageZoooom
68
- *
69
- * @return ImageZoooom
70
- */
71
- function ImageZoooom() {
72
- return ImageZoooom::instance();
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/right_columns.php CHANGED
@@ -4,12 +4,11 @@ $now = time();
4
 
5
  $zoooom_activation_time = get_option( 'zoooom_activation_time', '' );
6
  $zoooom_version = get_option( 'zoooom_version', '' );
7
- $plugin = wp_image_zoooom_settings('plugin');
8
 
9
- if ( empty( $zoooom_activation_time ) || version_compare( $zoooom_version, $plugin['version'], '<' ) ) {
10
  $zoooom_activation_time = $now;
11
  update_option( 'zoooom_activation_time', $now );
12
- update_option( 'zoooom_version', $plugin['version']);
13
  }
14
 
15
 
4
 
5
  $zoooom_activation_time = get_option( 'zoooom_activation_time', '' );
6
  $zoooom_version = get_option( 'zoooom_version', '' );
 
7
 
8
+ if ( empty( $zoooom_activation_time ) || version_compare( $zoooom_version, IMAGE_ZOOM_VERSION, '<' ) ) {
9
  $zoooom_activation_time = $now;
10
  update_option( 'zoooom_activation_time', $now );
11
+ update_option( 'zoooom_version', IMAGE_ZOOM_VERSION);
12
  }
13
 
14
 
includes/settings.php CHANGED
@@ -6,7 +6,6 @@ function wp_image_zoooom_settings($type) {
6
  $l = 'wp-image-zoooom';
7
 
8
  $plugin = array(
9
- 'version' => '1.28',
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
  'plugin_name' => 'WP Image Zoom',
10
  'plugin_file' => str_replace('includes/settings.php', 'image-zoooom.php', __FILE__),
11
  'plugin_server' => 'https://www.silkypress.com',
readme.txt CHANGED
@@ -152,10 +152,17 @@ Alternatively you can upgrade to the Pro version, as there the zoom lens is buil
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
155
  = 1.28 =
 
156
  * Fix: the zoom is hidden behind a wrapper for all the Mikado-Themes
157
 
158
  = 1.27 =
 
159
  * Fix: the zoom is hidden behind a wrapper on the Salient theme
160
  * Describe how to apply the zoom with different page builders
161
 
152
 
153
  == Changelog ==
154
 
155
+ = 1.29 =
156
+ * 02/11/2018
157
+ * Check and declare compatibility with WooCommerce 3.5.0
158
+ * Code refactoring
159
+
160
  = 1.28 =
161
+ * 23/10/2018
162
  * Fix: the zoom is hidden behind a wrapper for all the Mikado-Themes
163
 
164
  = 1.27 =
165
+ * 10/10/2018
166
  * Fix: the zoom is hidden behind a wrapper on the Salient theme
167
  * Describe how to apply the zoom with different page builders
168