WP Image Zoom - Version 1.40

Version Description

  • 03/04/2020
  • Fix: the WC product images were distorted on the Flatsome theme
  • Fix: allow saving options only if the current user has the "manage_options" capability
  • Changes to the backend form
  • Declare compatibility with WooCommerce 4.0
Download this release

Release Info

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

Code changes from version 1.39.2 to 1.40

assets/js/image_zoom.settings.js CHANGED
@@ -35,8 +35,6 @@ jQuery(document).ready(function($) {
35
  tintOpacity : parseFloat($("#tintOpacity").val()),
36
  };
37
 
38
- validateInput( settings );
39
-
40
  if ( settings.tintOpacity > 1 ) {
41
  settings.tintOpacity = 1;
42
  }
@@ -133,72 +131,6 @@ jQuery(document).ready(function($) {
133
  updateZoomer();
134
  }
135
 
136
-
137
- function validateInput( settings ) {
138
-
139
- if ( isNaN(settings.zwEasing) || settings.zwEasing < 0 || settings.zwEasing > 200 ) {
140
- show_alert('<b>Animation Easing Effect</b> accepts integers between 0 and 200. Your value was stripped to 12');
141
- settings.zwEasing = 12;
142
- $("#zwEasing").val('12');
143
- }
144
-
145
- if ( isNaN(settings.lensSize) || settings.lensSize < 20 || settings.lensSize > 2000 ) {
146
- show_alert('<b>Lens Size</b> accepts integers between 20 and 2000. Your value was reset to 200');
147
- settings.lensSize = 200;
148
- $("#lensSize").val('200');
149
- }
150
-
151
- if ( isNaN(settings.borderThickness) || settings.borderThickness < 0 || settings.borderThickness > 200 ) {
152
- show_alert('<b>Border Thickness</b> accepts integers between 0 and 200. Your value was reset to 1');
153
- settings.borderThickness = 1;
154
- $("#borderThickness").val('1');
155
- }
156
-
157
- if (isNaN(settings.lensFade) || settings.lensFade < 0 || settings.lensFade > 10000) {
158
- show_alert('<b>Fade Time</b> accepts integers between 0 and 10. Your value was reset to 1');
159
- settings.lensFade = 1;
160
- $("#lensFade").val('1');
161
- }
162
-
163
- if (isNaN(settings.tintOpacity) || settings.tintOpacity < 0 || settings.tintOpacity > 1) {
164
- show_alert('<b>Tint Opacity</b> accepts a number between 0 and 1. Your value was reset to 0.5');
165
- settings.tintOpacity = 0.5;
166
- $("#tintOpacity").val('0.5');
167
- }
168
-
169
- if (isNaN(settings.zwWidth) || settings.zwWidth < 0 || settings.zwWidth > 2000) {
170
- show_alert('<b>Zoom Window Width</b> accepts a number between 0 and 2000. Your value was reset to 400');
171
- settings.zwWidth = 400;
172
- $("#zwWidth").val('400');
173
- }
174
-
175
- if (isNaN(settings.zwHeight) || settings.zwHeight < 0 || settings.zwHeight > 2000) {
176
- show_alert('<b>Zoom Window Height</b> accepts a number between 0 and 2000. Your value was reset to 360');
177
- settings.zwHeight = 360;
178
- $("#zwHeight").val('360');
179
- }
180
-
181
- if ( isNaN(settings.zwBorderThickness) || settings.zwBorderThickness < 0 || settings.zwBorderThickness > 200 ) {
182
- show_alert('<b>Border Thickness</b> accepts integers between 0 and 200. Your value was reset to 4');
183
- settings.zwBorderThickness = 4;
184
- $("#zwBorderThickness").val('4');
185
- }
186
-
187
- if ( isNaN(settings.zwBorderRadius) || settings.zwBorderRadius < 0 || settings.zwBorderRadius > 500 ) {
188
- show_alert('<b>Rounded Corners</b> accepts integers between 0 and 500. Your value was reset to 0');
189
- settings.zwBorderRadius = 0;
190
- $("#zwBorderRadius").val('0');
191
- }
192
-
193
- if ( isNaN(settings.zwFade) || settings.zwFade < 0 || settings.zwFade > 10000 ) {
194
- show_alert('<b>Fade Time</b> accepts integers between 0 and 10. Your value was reset to 0');
195
- settings.zwFade = 0;
196
- $("#zwFade").val('0');
197
- }
198
-
199
-
200
- }
201
-
202
  function enableDisableFields(settings) {
203
  // activate all fields
204
  $("#tab_lens, #tab_zoom_window").removeClass('disabled');
@@ -251,13 +183,4 @@ jQuery(document).ready(function($) {
251
 
252
  $(".form-group input").change(updateZoomer);
253
 
254
-
255
- function show_alert( message ) {
256
- $("#alert_messages").html(
257
- '<div class="alert alert-dismissable alert-danger">' +
258
- '<button type="button" class="close" data-dismiss="alert">&times;</button>' +
259
- message +
260
- '</div>');
261
- }
262
-
263
  });
35
  tintOpacity : parseFloat($("#tintOpacity").val()),
36
  };
37
 
 
 
38
  if ( settings.tintOpacity > 1 ) {
39
  settings.tintOpacity = 1;
40
  }
131
  updateZoomer();
132
  }
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  function enableDisableFields(settings) {
135
  // activate all fields
136
  $("#tab_lens, #tab_zoom_window").removeClass('disabled');
183
 
184
  $(".form-group input").change(updateZoomer);
185
 
 
 
 
 
 
 
 
 
 
186
  });
assets/js/image_zoom.settings.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){a('input[type=color]').on('change', function() {a(this).siblings('span').text(a(this).val());});function b(){a(".zoomContainer").remove();var b={},e={lensShape:a("input[name=lensShape]:checked").val(),cursorType:a("input[name=cursorType]:checked").val(),zwEasing:parseInt(a("#zwEasing").val()),lensSize:parseInt(a("#lensSize").val()),lensColour:a("#lensColour").val(),lensOverlay:a("#lensOverlay").is(":checked"),borderThickness:parseInt(a("#borderThickness").val()),borderColor:a("#borderColor").val(),borderRadius:parseInt(a("#borderRadius").val()),zwWidth:parseInt(a("#zwWidth").val()),zwHeight:parseInt(a("#zwHeight").val()),zwShadow:parseInt(a("#zwShadow").val()),zwPadding:parseInt(a("#zwPadding").val()),zwBorderThickness:parseInt(a("#zwBorderThickness").val()),zwBorderColor:a("#zwBorderColor").val(),zwBorderRadius:parseInt(a("#zwBorderRadius").val()),lensFade:1e3*parseFloat(a("#lensFade").val()),zwFade:1e3*parseFloat(a("#zwFade").val()),tint:a("#tint").is(":checked"),tintColor:a("#tintColor").val(),tintOpacity:parseFloat(a("#tintOpacity").val())};switch(c(e),e.tintOpacity>1&&(e.tintOpacity=1),e.tintOpacity<0&&(e.tintOpacity=0),"zoom"===e.cursorType&&(e.cursorType="url(../images/cursor_type_zoom.svg) auto"),e.lensOverlay===!0&&(e.lensOverlay="../images/lens-overlay-1.png"),e.lensShape){case"none":b={zoomType:"inner",cursor:e.cursorType,easingAmount:e.zwEasing};break;case"square":case"round":b={lensShape:e.lensShape,zoomType:"lens",lensSize:e.lensSize,borderSize:e.borderThickness,borderColour:e.borderColor,cursor:e.cursorType,lensFadeIn:e.lensFade,lensFadeOut:e.lensFade},e.tint===!0&&(b.tint=!0,b.tintColour=e.tintColor,b.tintOpacity=e.tintOpacity);break;case"zoom_window":b={lensShape:"square",lensSize:e.lensSize,lensBorderSize:e.borderThickness,lensBorderColour:e.borderColor,lensColour:e.lensColour,lensOverlay:e.lensOverlay,borderRadius:e.zwBorderRadius,cursor:e.cursorType,zoomWindowWidth:e.zwWidth,zoomWindowHeight:e.zwHeight,zoomWindowShadow:e.zwShadow,borderSize:e.zwBorderThickness,borderColour:e.zwBorderColor,zoomWindowOffsetx:e.zwPadding,lensFadeIn:e.lensFade,lensFadeOut:e.lensFade,zoomWindowFadeIn:e.zwFade,zoomWindowFadeOut:e.zwFade,easingAmount:e.zwEasing,zoomWindowPosition:1},e.tint===!0&&(b.tint=!0,b.tintColour=e.tintColor,b.tintOpacity=e.tintOpacity),a("#demo_wrapper").css("text-align","left")}a("#demo").image_zoom(b),a(window).bind("resize",function(){a(window).resize(function(){clearTimeout(window.resizeEvt),window.resizeEvt=setTimeout(function(){a(".zoomContainer").remove(),a("#demo").image_zoom(b)},300)})}),d(e)}function c(b){(isNaN(b.zwEasing)||b.zwEasing<0||b.zwEasing>200)&&(e("<b>Animation Easing Effect</b> accepts integers between 0 and 200. Your value was stripped to 12"),b.zwEasing=12,a("#zwEasing").val("12")),(isNaN(b.lensSize)||b.lensSize<20||b.lensSize>2e3)&&(e("<b>Lens Size</b> accepts integers between 20 and 2000. Your value was reset to 200"),b.lensSize=200,a("#lensSize").val("200")),(isNaN(b.borderThickness)||b.borderThickness<0||b.borderThickness>200)&&(e("<b>Border Thickness</b> accepts integers between 0 and 200. Your value was reset to 1"),b.borderThickness=1,a("#borderThickness").val("1")),(isNaN(b.lensFade)||b.lensFade<0||b.lensFade>1e4)&&(e("<b>Fade Time</b> accepts integers between 0 and 10. Your value was reset to 1"),b.lensFade=1,a("#lensFade").val("1")),(isNaN(b.tintOpacity)||b.tintOpacity<0||b.tintOpacity>1)&&(e("<b>Tint Opacity</b> accepts a number between 0 and 1. Your value was reset to 0.5"),b.tintOpacity=.5,a("#tintOpacity").val("0.5")),(isNaN(b.zwWidth)||b.zwWidth<0||b.zwWidth>2e3)&&(e("<b>Zoom Window Width</b> accepts a number between 0 and 2000. Your value was reset to 400"),b.zwWidth=400,a("#zwWidth").val("400")),(isNaN(b.zwHeight)||b.zwHeight<0||b.zwHeight>2e3)&&(e("<b>Zoom Window Height</b> accepts a number between 0 and 2000. Your value was reset to 360"),b.zwHeight=360,a("#zwHeight").val("360")),(isNaN(b.zwBorderThickness)||b.zwBorderThickness<0||b.zwBorderThickness>200)&&(e("<b>Border Thickness</b> accepts integers between 0 and 200. Your value was reset to 4"),b.zwBorderThickness=4,a("#zwBorderThickness").val("4")),(isNaN(b.zwBorderRadius)||b.zwBorderRadius<0||b.zwBorderRadius>500)&&(e("<b>Rounded Corners</b> accepts integers between 0 and 500. Your value was reset to 0"),b.zwBorderRadius=0,a("#zwBorderRadius").val("0")),(isNaN(b.zwFade)||b.zwFade<0||b.zwFade>1e4)&&(e("<b>Fade Time</b> accepts integers between 0 and 10. Your value was reset to 0"),b.zwFade=0,a("#zwFade").val("0"))}function d(b){switch(a("#tab_lens, #tab_zoom_window").removeClass("disabled"),a("#tab_lens a").attr("href","#lens_settings"),a("#tab_zoom_window a").attr("href","#zoom_window_settings"),a("#lensSize").removeAttr("disabled"),a("#lensColour").removeAttr("disabled"),a("#lensBgImage").removeAttr("disabled"),a("#tintColor").removeAttr("disabled"),a("#tintOpacity").removeAttr("disabled"),a("#lensColour").removeAttr("disabled"),a("#lensOverlay").removeAttr("disabled"),b.lensShape){case"none":a("#tab_lens, #tab_zoom_window").addClass("disabled"),a("#tab_lens a").attr("href",""),a("#tab_zoom_window a").attr("href",""),a("#lensColour").attr("disabled","disabled"),a("#lensBgImage").attr("disabled","disabled");break;case"square":case"round":a("#tab_zoom_window").addClass("disabled"),a("#tab_zoom_window a").attr("href",""),a("#lensColour").attr("disabled","disabled"),a("#lensBgImage").attr("disabled","disabled");break;case"zoom_window":a("#lensSize").attr("disabled","disabled")}b.tint===!1?(a("#tintColor").attr("disabled","disabled"),a("#tintOpacity").attr("disabled","disabled")):(a("#lensColour").attr("disabled","disabled"),a("#lensOverlay").attr("disabled","disabled"))}function e(b){a("#alert_messages").html('<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">&times;</button>'+b+"</div>")}a('[data-toggle="tooltip"]').tooltip(),a("#demo").length>0&&b(),a(".form-group input").change(b)});
1
+ jQuery(document).ready(function($){$("input[type=color]").on("change",function(){$(this).siblings("span").text($(this).val())});function updateZoomer(){$(".zoomContainer").remove();$("#demo").unbind("touchstart touchmove touchend click mouseenter");var zoom_options={};var settings={lensShape:$("input[name=lensShape]:checked").val(),cursorType:$("input[name=cursorType]:checked").val(),zwEasing:parseInt($("#zwEasing").val()),lensSize:parseInt($("#lensSize").val()),lensColour:$("#lensColour").val(),lensOverlay:$("#lensOverlay").is(":checked"),borderThickness:parseInt($("#borderThickness").val()),borderColor:$("#borderColor").val(),borderRadius:parseInt($("#borderRadius").val()),zwWidth:parseInt($("#zwWidth").val()),zwHeight:parseInt($("#zwHeight").val()),zwShadow:parseInt($("#zwShadow").val()),zwPadding:parseInt($("#zwPadding").val()),zwBorderThickness:parseInt($("#zwBorderThickness").val()),zwBorderColor:$("#zwBorderColor").val(),zwBorderRadius:parseInt($("#zwBorderRadius").val()),lensFade:parseFloat($("#lensFade").val())*1e3,zwFade:parseFloat($("#zwFade").val())*1e3,tint:$("#tint").is(":checked"),tintColor:$("#tintColor").val(),tintOpacity:parseFloat($("#tintOpacity").val())};if(settings.tintOpacity>1){settings.tintOpacity=1}if(settings.tintOpacity<0){settings.tintOpacity=0}if(settings.cursorType==="zoom"){settings.cursorType="url(../images/cursor_type_zoom.svg) auto"}if(settings.lensOverlay===true){settings.lensOverlay="../images/lens-overlay-1.png"}switch(settings.lensShape){case"none":zoom_options={zoomType:"inner",cursor:settings.cursorType,easingAmount:settings.zwEasing};break;case"square":case"round":zoom_options={lensShape:settings.lensShape,zoomType:"lens",lensSize:settings.lensSize,borderSize:settings.borderThickness,borderColour:settings.borderColor,cursor:settings.cursorType,lensFadeIn:settings.lensFade,lensFadeOut:settings.lensFade};if(settings.tint===true){zoom_options.tint=true;zoom_options.tintColour=settings.tintColor;zoom_options.tintOpacity=settings.tintOpacity}break;case"zoom_window":zoom_options={lensShape:"square",lensSize:settings.lensSize,lensBorderSize:settings.borderThickness,lensBorderColour:settings.borderColor,lensColour:settings.lensColour,lensOverlay:settings.lensOverlay,borderRadius:settings.zwBorderRadius,cursor:settings.cursorType,zoomWindowWidth:settings.zwWidth,zoomWindowHeight:settings.zwHeight,zoomWindowShadow:settings.zwShadow,borderSize:settings.zwBorderThickness,borderColour:settings.zwBorderColor,zoomWindowOffsetx:settings.zwPadding,lensFadeIn:settings.lensFade,lensFadeOut:settings.lensFade,zoomWindowFadeIn:settings.zwFade,zoomWindowFadeOut:settings.zwFade,easingAmount:settings.zwEasing,zoomWindowPosition:1};if(settings.tint===true){zoom_options.tint=true;zoom_options.tintColour=settings.tintColor;zoom_options.tintOpacity=settings.tintOpacity}$("#demo_wrapper").css("text-align","left");break}$("#demo").image_zoom(zoom_options);$(window).bind("resize",function(){$(window).resize(function(){clearTimeout(window.resizeEvt);window.resizeEvt=setTimeout(function(){$(".zoomContainer").remove();$("#demo").image_zoom(zoom_options)},300)})});enableDisableFields(settings)}$('[data-toggle="tooltip"]').tooltip();if($("#demo").length>0){updateZoomer()}function enableDisableFields(settings){$("#tab_lens, #tab_zoom_window").removeClass("disabled");$("#tab_lens a").attr("href","#lens_settings");$("#tab_zoom_window a").attr("href","#zoom_window_settings");$("#lensSize").removeAttr("disabled");$("#lensColour").removeAttr("disabled");$("#lensBgImage").removeAttr("disabled");$("#tintColor").removeAttr("disabled");$("#tintOpacity").removeAttr("disabled");$("#lensColour").removeAttr("disabled");$("#lensOverlay").removeAttr("disabled");switch(settings["lensShape"]){case"none":$("#tab_lens, #tab_zoom_window").addClass("disabled");$("#tab_lens a").attr("href","");$("#tab_zoom_window a").attr("href","");$("#lensColour").attr("disabled","disabled");$("#lensBgImage").attr("disabled","disabled");if($("#lens_settings.active").length>0||$("#zoom_window_settings.active").length>0){$("#tab_general a").trigger("click")}break;case"square":case"round":$("#tab_zoom_window").addClass("disabled");$("#tab_zoom_window a").attr("href","");$("#lensColour").attr("disabled","disabled");$("#lensBgImage").attr("disabled","disabled");if($("#zoom_window_settings.active").length>0){$("#tab_lens a").trigger("click")}break;case"zoom_window":$("#lensSize").attr("disabled","disabled");break}if(settings.tint===false){$("#tintColor").attr("disabled","disabled");$("#tintOpacity").attr("disabled","disabled")}else{$("#lensColour").attr("disabled","disabled");$("#lensOverlay").attr("disabled","disabled")}}$(".form-group input").change(updateZoomer)});
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.39.2
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.9
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
@@ -26,7 +26,7 @@ if ( ! class_exists( 'ImageZoooom' ) ) :
26
  * @class ImageZoooom
27
  */
28
  final class ImageZoooom {
29
- public $version = '1.39.2';
30
  public $theme = '';
31
  protected static $_instance = null;
32
 
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.40
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: 4.0
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) {
26
  * @class ImageZoooom
27
  */
28
  final class ImageZoooom {
29
+ public $version = '1.40';
30
  public $theme = '';
31
  protected static $_instance = null;
32
 
includes/admin-side.php CHANGED
@@ -81,27 +81,6 @@ class ImageZoooom_Admin {
81
  }
82
  }
83
 
84
- /**
85
- * Build an array with settings that will be used in the form
86
- *
87
- * @access public
88
- */
89
- public function get_settings( $id = '' ) {
90
- $settings = wp_image_zoooom_settings( 'settings' );
91
- $pro_fields = wp_image_zoooom_settings( 'pro_fields' );
92
-
93
- $settings = array_merge( $settings, $pro_fields );
94
-
95
- if ( isset( $settings[ $id ] ) ) {
96
- $settings[ $id ]['name'] = $id;
97
- return $settings[ $id ];
98
- } elseif ( empty( $id ) ) {
99
- return $settings;
100
- }
101
- return false;
102
- }
103
-
104
-
105
  /**
106
  * Add "with Image Zoom" style for the Image block in Gutenberg
107
  *
@@ -296,7 +275,7 @@ class ImageZoooom_Admin {
296
  self::iz_dismiss_ajax_product_filters( $w );
297
 
298
  // Check if Jetpack Photon module is active
299
- if ( defined( 'JETPACK__VERSION' ) && Jetpack::is_module_active( 'photon' ) ) {
300
  $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-pro' );
301
  $w->add_notice( 'iz_dismiss_jetpack', $message );
302
  }
@@ -346,8 +325,8 @@ class ImageZoooom_Admin {
346
  }
347
  }
348
 
349
- // Warning about Flatsome theme
350
- if ( strpos( strtolower(get_template()), 'flatsome') !== false && $w->is_url('zoooom_settings')) {
351
  $message = __( 'The Flatsome theme replaces the default WooCommerce gallery with a Flickity carousel, which leads to the effects that it zooms only on the first image. Please check <a href="https://www.silkypress.com/wp-image-zoom/zoom-woocommerce-gallery-flatsome-theme/" target="_blank">this article</a> for a solution to the issue.', 'wp-image-zoooom-pro' );
352
  $w->add_notice( 'iz_dismiss_flatsome_theme', $message );
353
  }
81
  }
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * Add "with Image Zoom" style for the Image block in Gutenberg
86
  *
275
  self::iz_dismiss_ajax_product_filters( $w );
276
 
277
  // Check if Jetpack Photon module is active
278
+ if ( defined( 'JETPACK__VERSION' ) ) {
279
  $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-pro' );
280
  $w->add_notice( 'iz_dismiss_jetpack', $message );
281
  }
325
  }
326
  }
327
 
328
+ // Warning about Flatsome theme
329
+ if ( strpos( strtolower(get_template()), 'flatsome') !== false && $w->is_url('zoooom_settings')) {
330
  $message = __( 'The Flatsome theme replaces the default WooCommerce gallery with a Flickity carousel, which leads to the effects that it zooms only on the first image. Please check <a href="https://www.silkypress.com/wp-image-zoom/zoom-woocommerce-gallery-flatsome-theme/" target="_blank">this article</a> for a solution to the issue.', 'wp-image-zoooom-pro' );
331
  $w->add_notice( 'iz_dismiss_flatsome_theme', $message );
332
  }
includes/frm/class-form-fields.php CHANGED
@@ -151,8 +151,8 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
151
  // Button templates.
152
  if ( 'buttons' === $_field['input_form'] ) {
153
  foreach ( $_field['values'] as $__id => $__value ) {
154
- $toggle = ( ! empty( $__value[1] ) ) ? ' data-toggle="tooltip" data-placement="top" title="' . $__value[1] . '" data-original-title="' . $__value[1] . '"' : '';
155
- $__atts = ( $__id === $_field['value'] ) ? ' active' : '';
156
  $__atts .= ( $_field['disabled'] ) ? ' disabled' : '';
157
 
158
  $input_values .= vsprintf(
@@ -169,11 +169,11 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
169
  'buttons' => array( '<div class="btn-group%s" data-toggle="buttons" id="btn-group-style-circle">%s</div>', array( $atts, $input_values ) ),
170
  'input_color' => array(
171
  '<input type="color" class="form-control" id="%s" name="%s" value="%s"%s /><span class="input-group-addon" id="color-text-color-hex">%s</span>',
172
- array( $_key, $_key, esc_attr( $_field['value'] ), $atts, esc_attr( $_field['value'] ) ),
173
  ),
174
  'input_text' => array(
175
  '<input type="text" class="form-control" id="%s" name="%s" value="%s"%s />',
176
- array( $_key, $_key, esc_attr( $_field['value'] ), $atts ),
177
  ),
178
  'checkbox' => array(
179
  '<input type="checkbox" id="%s" name="%s" value="1"%s />',
@@ -191,6 +191,11 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
191
  $templates[ $_field['input_form'] ][1]
192
  );
193
 
 
 
 
 
 
194
  // The description.
195
  if ( isset( $_field['description'] ) && ! empty( $_field['description'] ) ) {
196
  $description = vsprintf(
@@ -233,6 +238,7 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
233
  $post = array_intersect_key( $post, array_fill_keys( array_keys( $this->fields ), '' ) );
234
 
235
  foreach ( $this->fields as $_key => $settings ) {
 
236
 
237
  // Validate only fields from the current section.
238
  if ( isset( $this->atts['section'] ) && $settings['section'] !== $this->atts['section'] ) {
@@ -258,7 +264,7 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
258
 
259
  // Sanitize text inputs.
260
  if ( 'input_text' === $settings['input_form'] ) {
261
- $post[ $_key ] = isset( $post[ $_key ] ) ? sanitize_text_field( $post[ $_key ] ) : $settings['value'];
262
  }
263
 
264
  // Validate button and radio inputs.
@@ -273,13 +279,35 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
273
  // Validate according to a rule.
274
  if ( isset( $settings['validate'] ) && isset( $post[ $_key ] ) ) {
275
  if ( 'int' === $settings['validate']['type'] ) {
 
 
 
 
 
 
 
 
 
 
276
  $post[ $_key ] = (int) $post[ $_key ];
277
  }
278
  if ( 'float' === $settings['validate']['type'] ) {
 
 
 
 
 
 
 
 
 
 
279
  $post[ $_key ] = (float) $post[ $_key ];
280
  }
281
 
282
- if ( ! is_numeric( $post[ $_key ] ) || $post[ $_key ] < $settings['validate']['range'][0] || $post[ $_key ] > $settings['validate']['range'][1] ) {
 
 
283
  $reset = array(
284
  /* translators: 1: field label 2: minimum value 3: maximum value 4: value */
285
  __( '%1$s accepts values between %2$s and %3$s. Your value was reset to %4$s' ),
@@ -289,9 +317,9 @@ if ( ! class_exists( '\SilkyPressFrm\Form_Fields' ) ) {
289
  }
290
 
291
  // Reset the value and add the info message.
292
- if ( isset( $reset ) ) {
293
  $post[ $_key ] = $settings['value'];
294
- $this->add_message( 'info', vsprintf( $reset[0] ), $reset[1] );
295
  }
296
  }
297
  return $post;
151
  // Button templates.
152
  if ( 'buttons' === $_field['input_form'] ) {
153
  foreach ( $_field['values'] as $__id => $__value ) {
154
+ $toggle = ( ! empty( $__value[1] ) ) ? ' data-toggle="tooltip" data-placement="top" title="' . $__value[1] . '" data-original-title="' . $__value[1] . '"' : '';
155
+ $__atts = ( $__id === $_field['value'] ) ? ' active' : '';
156
  $__atts .= ( $_field['disabled'] ) ? ' disabled' : '';
157
 
158
  $input_values .= vsprintf(
169
  'buttons' => array( '<div class="btn-group%s" data-toggle="buttons" id="btn-group-style-circle">%s</div>', array( $atts, $input_values ) ),
170
  'input_color' => array(
171
  '<input type="color" class="form-control" id="%s" name="%s" value="%s"%s /><span class="input-group-addon" id="color-text-color-hex">%s</span>',
172
+ array( $_key, $_key, $_field['value'], $atts, $_field['value'] ),
173
  ),
174
  'input_text' => array(
175
  '<input type="text" class="form-control" id="%s" name="%s" value="%s"%s />',
176
+ array( $_key, $_key, stripslashes( $_field['value'] ), $atts ),
177
  ),
178
  'checkbox' => array(
179
  '<input type="checkbox" id="%s" name="%s" value="1"%s />',
191
  $templates[ $_field['input_form'] ][1]
192
  );
193
 
194
+ // The input addon.
195
+ if ( isset( $_field['post_input'] ) && ! empty( $_field['post_input'] ) ) {
196
+ $input .= sprintf( '<span class="input-group-addon">%s</span>', $_field['post_input'] );
197
+ }
198
+
199
  // The description.
200
  if ( isset( $_field['description'] ) && ! empty( $_field['description'] ) ) {
201
  $description = vsprintf(
238
  $post = array_intersect_key( $post, array_fill_keys( array_keys( $this->fields ), '' ) );
239
 
240
  foreach ( $this->fields as $_key => $settings ) {
241
+ $reset = array();
242
 
243
  // Validate only fields from the current section.
244
  if ( isset( $this->atts['section'] ) && $settings['section'] !== $this->atts['section'] ) {
264
 
265
  // Sanitize text inputs.
266
  if ( 'input_text' === $settings['input_form'] ) {
267
+ $post[ $_key ] = isset( $post[ $_key ] ) ? filter_var( sanitize_text_field( $post[ $_key ] ), FILTER_SANITIZE_STRING ) : (string) $settings['value'];
268
  }
269
 
270
  // Validate button and radio inputs.
279
  // Validate according to a rule.
280
  if ( isset( $settings['validate'] ) && isset( $post[ $_key ] ) ) {
281
  if ( 'int' === $settings['validate']['type'] ) {
282
+ if ( (string) (int) $post[ $_key ] !== $post[ $_key ] ) {
283
+ $this->add_message(
284
+ 'info',
285
+ vsprintf(
286
+ /* translators: 1: field label 2: value */
287
+ __( 'The %1$s field accepts only an integer value. It was set to %2$s' ),
288
+ array( '<b>' . $settings['label'] . '</b>', (int) $post[ $_key ] )
289
+ )
290
+ );
291
+ }
292
  $post[ $_key ] = (int) $post[ $_key ];
293
  }
294
  if ( 'float' === $settings['validate']['type'] ) {
295
+ if ( (string) (float) $post[ $_key ] !== $post[ $_key ] ) {
296
+ $this->add_message(
297
+ 'info',
298
+ vsprintf(
299
+ /* translators: 1: field label 2: value */
300
+ __( 'The %1$s field accepts only a number. It was set to %2$s' ),
301
+ array( '<b>' . $settings['label'] . '</b>', (float) $post[ $_key ] )
302
+ )
303
+ );
304
+ }
305
  $post[ $_key ] = (float) $post[ $_key ];
306
  }
307
 
308
+ if ( in_array( $settings['validate']['type'], array( 'int', 'float' ), true ) &&
309
+ ( $post[ $_key ] < $settings['validate']['range'][0] ||
310
+ $post[ $_key ] > $settings['validate']['range'][1] ) ) {
311
  $reset = array(
312
  /* translators: 1: field label 2: minimum value 3: maximum value 4: value */
313
  __( '%1$s accepts values between %2$s and %3$s. Your value was reset to %4$s' ),
317
  }
318
 
319
  // Reset the value and add the info message.
320
+ if ( count( $reset ) > 0 ) {
321
  $post[ $_key ] = $settings['value'];
322
+ $this->add_message( 'info', vsprintf( $reset[0], $reset[1] ) );
323
  }
324
  }
325
  return $post;
includes/settings.php CHANGED
@@ -5,30 +5,28 @@ defined( 'ABSPATH' ) || exit;
5
  if ( ! function_exists( 'wp_image_zoooom_settings' ) ) {
6
  function wp_image_zoooom_settings() {
7
 
8
- $l = 'wp-image-zoooom';
9
-
10
  $settings = array(
11
  'lensShape' => array(
12
- 'label' => __( 'Lens Shape', $l ),
13
  'values' => array(
14
- 'none' => array( '<i class="icon-lens_shape_none"></i>', __( 'No Lens', $l ) ),
15
- 'round' => array( '<i class="icon-lens_shape_circle"></i>', __( 'Circle Lens', $l ) ),
16
- 'square' => array( '<i class="icon-lens_shape_square"></i>', __( 'Square Lens', $l ) ),
17
- 'zoom_window' => array( '<i class="icon-type_zoom_window"></i>', __( 'With Zoom Window', $l ) ),
18
  ),
19
  'value' => 'zoom_window',
20
  'input_form' => 'buttons',
21
  'style' => 'full',
22
- 'section' => 'settings',
23
  'no_wrap' => true,
 
24
  ),
25
  'cursorType' => array(
26
- 'label' => __( 'Cursor Type', $l ),
27
  'values' => array(
28
- 'default' => array( '<i class="icon-cursor_type_default"></i>', __( 'Default', $l ) ),
29
- 'pointer' => array( '<i class="icon-cursor_type_pointer"></i>', __( 'Pointer', $l ) ),
30
- 'crosshair' => array( '<i class="icon-cursor_type_crosshair"></i>', __( 'Crosshair', $l ) ),
31
- 'zoom-in' => array( '<i class="icon-zoom-in"></i>', __( 'Zoom', $l ) ),
32
  ),
33
  'value' => 'default',
34
  'input_form' => 'buttons',
@@ -36,333 +34,479 @@ if ( ! function_exists( 'wp_image_zoooom_settings' ) ) {
36
  'section' => 'settings',
37
  ),
38
  'zwEasing' => array(
39
- 'label' => __( 'Animation Easing Effect', $l ),
40
  'value' => 12,
41
- 'description' => __( 'A number between 0 and 200 to represent the degree of the Animation Easing Effect', $l ),
42
  'input_form' => 'input_text',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  'section' => 'settings',
44
  ),
45
-
46
  'lensSize' => array(
47
- 'label' => __( 'Lens Size', $l ),
48
  'post_input' => 'px',
49
  'value' => 200,
50
- 'description' => __( 'For Circle Lens it means the diameters, for Square Lens it means the width', $l ),
51
  'input_form' => 'input_text',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  'section' => 'settings',
53
  ),
54
  'borderThickness' => array(
55
- 'label' => __( 'Border Thickness', $l ),
56
  'post_input' => 'px',
57
  'value' => 1,
58
  'input_form' => 'input_text',
 
 
 
 
59
  'section' => 'settings',
60
  ),
61
  'borderColor' => array(
62
- 'label' => __( 'Border Color', $l ),
63
  'value' => '#ffffff',
64
  'input_form' => 'input_color',
65
  'section' => 'settings',
66
  ),
67
  'lensFade' => array(
68
- 'label' => __( 'Fade Time', $l ),
69
  'post_input' => 'sec',
70
  'value' => 0.5,
71
- 'description' => __( 'The amount of time it takes for the Lens to slowly appear or disappear', $l ),
72
  'input_form' => 'input_text',
 
 
 
 
73
  'section' => 'settings',
74
  ),
75
  'tint' => array(
76
- 'label' => __( 'Tint', $l ),
77
  'value' => true,
78
- 'description' => __( 'A color that will layed on top the of non-magnified image in order to emphasize the lens', $l ),
79
  'input_form' => 'checkbox',
80
  'section' => 'settings',
81
  ),
82
  'tintColor' => array(
83
- 'label' => __( 'Tint Color', $l ),
84
  'value' => '#ffffff',
85
  'input_form' => 'input_color',
86
  'section' => 'settings',
87
  ),
88
  'tintOpacity' => array(
89
- 'label' => __( 'Tint Opacity', $l ),
90
- 'value' => '0.1',
91
- 'post_input' => '%',
92
- 'input_form' => 'input_text',
93
- 'section' => 'settings',
 
 
 
 
 
94
  ),
95
  'zwWidth' => array(
96
- 'label' => __( 'Zoom Window Width', $l ),
97
  'post_input' => 'px',
98
  'value' => 400,
99
  'input_form' => 'input_text',
 
 
 
 
100
  'section' => 'settings',
101
  ),
102
  'zwHeight' => array(
103
- 'label' => __( 'Zoom Window Height', $l ),
104
  'post_input' => 'px',
105
  'value' => 360,
106
  'input_form' => 'input_text',
 
 
 
 
107
  'section' => 'settings',
108
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  'zwPadding' => array(
110
- 'label' => __( 'Distance from the Main Image', $l ),
111
  'post_input' => 'px',
112
  'value' => 10,
113
  'input_form' => 'input_text',
 
 
 
 
114
  'section' => 'settings',
115
  ),
116
  'zwBorderThickness' => array(
117
- 'label' => __( 'Border Thickness', $l ),
118
  'post_input' => 'px',
119
  'value' => 1,
120
  'input_form' => 'input_text',
 
 
 
 
121
  'section' => 'settings',
122
  ),
123
  'zwShadow' => array(
124
- 'label' => __( 'Shadow Thickness', $l ),
125
  'post_input' => 'px',
126
  'value' => 4,
127
  'input_form' => 'input_text',
128
- 'description' => __( 'Use 0px to remove the shadow', $l ),
 
 
 
 
129
  'section' => 'settings',
130
  ),
131
  'zwBorderColor' => array(
132
- 'label' => __( 'Border Color', $l ),
133
  'value' => '#888888',
134
  'input_form' => 'input_color',
135
  'section' => 'settings',
136
  ),
137
  'zwBorderRadius' => array(
138
- 'label' => __( 'Rounded Corners', $l ),
139
  'post_input' => 'px',
140
  'value' => 0,
141
  'input_form' => 'input_text',
 
 
 
 
142
  'section' => 'settings',
143
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  'zwFade' => array(
145
- 'label' => __( 'Fade Time', $l ),
146
  'post_input' => 'sec',
147
  'value' => 0.5,
148
- 'description' => __( 'The amount of time it takes for the Zoom Window to slowly appear or disappear', $l ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  'input_form' => 'input_text',
 
 
 
 
 
150
  'section' => 'settings',
151
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  'enable_woocommerce' => array(
153
- 'label' => __( 'Enable the zoom on WooCommerce products', $l ),
154
  'value' => true,
155
  'input_form' => 'checkbox',
156
  'section' => 'general',
157
  ),
158
  'exchange_thumbnails' => array(
159
- 'label' => __( 'Exchange the thumbnail with main image on WooCommerce products', $l ),
160
  'value' => true,
161
  'input_form' => 'checkbox',
162
- 'description' => __( 'On a WooCommerce gallery, when clicking on a thumbnail, not only the main image will be replaced with the thumbnail\'s image, but also the thumbnail will be replaced with the main image', $l ),
163
  'section' => 'general',
164
  ),
165
  'enable_mobile' => array(
166
- 'label' => __( 'Enable the zoom on mobile devices', $l ),
167
  'value' => false,
168
  'input_form' => 'checkbox',
169
- 'description' => __( 'Tablets are also considered mobile devices' ),
170
  'section' => 'general',
171
  ),
 
 
 
 
 
 
 
172
  'woo_cat' => array(
173
- 'label' => __( 'Enable the zoom on WooCommerce category pages', $l ),
174
  'value' => false,
175
  'input_form' => 'checkbox',
176
  'section' => 'general',
177
  ),
178
-
179
  'force_woocommerce' => array(
180
- 'label' => __( 'Force it to work on WooCommerce', $l ),
181
  'value' => true,
182
  'input_form' => 'checkbox',
183
  'section' => 'general',
184
  ),
185
  'remove_lightbox_thumbnails' => array(
186
- 'label' => __( 'Remove the Lightbox on thumbnail images', $l ),
187
- 'value' => false,
188
- 'pro' => true,
189
  'input_form' => 'checkbox',
190
  'description' => __( 'Some themes implement a Lightbox for WooCommerce galleris that opens on click. Enabling this checkbox will remove the Lightbox on thumbnail images and leave it only on the main image', 'wp-image-zoooom' ),
191
- 'disabled' => true,
192
  'section' => 'general',
193
  ),
194
  'remove_lightbox' => array(
195
- 'label' => __( 'Remove the Lightbox', $l ),
196
- 'value' => false,
197
- 'pro' => true,
198
  'input_form' => 'checkbox',
199
  'description' => __( 'Some themes implement a Lightbox that opens on click on the image. Enabling this checkbox will remove the Lightbox' ),
200
- 'disabled' => true,
201
  'section' => 'general',
202
  ),
203
- 'woo_variations' => array(
204
- 'label' => __( 'Enable on WooCommerce variation products', $l ),
205
- 'value' => false,
206
- 'pro' => true,
207
- 'input_form' => 'checkbox',
208
- 'disabled' => true,
209
- 'section' => 'general',
210
- ),
211
  'force_attachments' => array(
212
- 'label' => __( 'Enable on attachments pages', $l ),
213
  'value' => false,
214
- 'pro' => true,
215
  'input_form' => 'checkbox',
216
- 'disabled' => true,
217
  'section' => 'general',
218
  ),
219
  'custom_class' => array(
220
- 'label' => __( 'Apply zoom on this particular image(s)', $l ),
221
  'value' => '',
222
- 'pro' => true,
223
  'input_form' => 'input_text',
224
- 'description' => __( 'CSS style selector(s) for identifying the image(s) on which to apply the zoom.', $l ),
225
- 'disabled' => true,
226
  'section' => 'general',
227
  ),
228
  'flexslider' => array(
229
- 'label' => __( 'FlexSlider container class', $l ),
230
- 'value' => '',
231
- 'pro' => true,
232
- 'input_form' => 'input_text',
233
- 'disabled' => true,
234
- 'section' => 'general',
235
  ),
236
  'owl' => array(
237
- 'label' => __( '<a href="https://www.silkypress.com/i/js-owl" target="_blank">Owl Carousel</a> container class', $l ),
238
  'value' => '',
239
  'input_form' => 'input_text',
 
240
  'pro' => true,
241
- 'description' => __( 'If the images are in a Owl Carousel gallery, then type in here the class of the div containing the Owl Carousel gallery', $l ),
242
- 'disabled' => true,
243
  'section' => 'general',
244
  ),
245
  'flickity' => array(
246
- 'label' => __( '<a href="https://flickity.metafizzy.co/" target="_blank">Flickity Carousel</a> container class', $l ),
247
  'value' => '',
248
  'input_form' => 'input_text',
 
 
 
 
 
 
 
 
 
249
  'pro' => true,
250
- 'description' => __( 'If the images are in a Flickity Carousel gallery, then type in here the class of the div containing the Flickity Carousel gallery', $l ),
251
- 'disabled' => true,
252
  'section' => 'general',
253
  ),
254
  'slick' => array(
255
- 'label' => __( '<a href="https://kenwheeler.github.io/slick/" target="_blank">Slick carousel</a> container class', $l ),
256
  'value' => '',
257
  'input_form' => 'input_text',
258
- 'description' => __( 'If the images are in a Slick carousel gallery, then type in here the class of the div containing the Slick carousel gallery', $l ),
259
  'pro' => true,
260
- 'disabled' => true,
261
  'section' => 'general',
262
  ),
263
  'huge_it_gallery' => array(
264
- 'label' => __( '<a href="https://www.silkypress.com/i/wp-huge-it-gallery" target="_blank">Huge IT Gallery</a> id', $l ),
265
- 'value' => '',
266
- 'pro' => true,
267
- 'input_form' => 'input_text',
268
- 'disabled' => true,
269
- 'section' => 'general',
270
  ),
271
  'enable_lightbox_zoom' => array(
272
- 'label' => __( 'Enable inside a Lightbox. <a href="#TB_inline?width=600&height=400&inlineId=supported-lightboxes" class="thickbox">See supported lightboxes</a>', $l ),
273
  'value' => false,
274
- 'pro' => true,
275
  'input_form' => 'checkbox',
276
- 'disabled' => true,
277
  'section' => 'general',
278
  ),
279
- 'onClick' => array(
280
- 'label' => __( 'Enable the zoom on ...', $l ),
281
  'values' => array(
282
- 'false' => 'mouse hover',
283
- 'true' => 'mouse click',
 
284
  ),
285
  'value' => 'false',
286
  'input_form' => 'radio',
287
  'pro' => true,
288
- 'disabled' => true,
289
  'section' => 'settings',
290
  ),
291
- 'ratio' => array(
292
- 'label' => __( 'Zoom Level', $l ),
293
- 'values' => array(
294
- 'default' => array( '<i class="icon-zoom_level_default"></i>', __( 'Default', $l ) ),
295
- '1.5' => array( '<i class="icon-zoom_level_15"></i>', __( '1,5 times', $l ) ),
296
- '2' => array( '<i class="icon-zoom_level_2"></i>', __( '2 times', $l ) ),
297
- '2.5' => array( '<i class="icon-zoom_level_25"></i>', __( '2,5 times', $l ) ),
298
- '3' => array( '<i class="icon-zoom_level_3"></i>', __( '3 times', $l ) ),
299
- ),
300
- 'value' => 'default',
301
- 'input_form' => 'buttons',
302
- 'pro' => true,
303
- 'style' => 'full',
304
- 'disabled' => true,
305
- 'section' => 'settings',
306
- ),
307
- 'lensColour' => array(
308
- 'label' => __( 'Lens Color', $l ),
309
  'value' => '#ffffff',
310
- 'pro' => true,
311
  'input_form' => 'input_color',
312
- 'disabled' => true,
313
- 'section' => 'settings',
314
- ),
315
- 'lensOverlay' => array(
316
- 'label' => __( 'Show as Grid', $l ),
317
- 'value' => false,
318
  'pro' => true,
319
- 'input_form' => 'checkbox',
320
- 'disabled' => true,
321
  'section' => 'settings',
322
  ),
323
- 'zwResponsive' => array(
324
- 'label' => __( 'Responsive', $l ),
325
- 'input_form' => 'checkbox',
 
326
  'pro' => true,
327
- 'value' => false,
328
- 'disabled' => true,
329
  'section' => 'settings',
330
  ),
331
- 'zwResponsiveThreshold' => array(
332
- 'label' => __( 'Responsive Threshold', $l ),
333
- 'pro' => true,
334
  'post_input' => 'px',
335
- 'value' => '',
336
  'input_form' => 'input_text',
337
- 'disabled' => true,
338
- 'section' => 'settings',
339
- ),
340
- 'zwPositioning' => array(
341
- 'label' => __( 'Positioning', $l ),
342
- 'values' => array(
343
- 'right_top' => array( '<i class="icon-type_zoom_window_right_top"></i>', __( 'Right Top', $l ) ),
344
- 'right_bottom' => array( '<i class="icon-type_zoom_window_right_bottom"></i>', __( 'Right Bottom', $l ) ),
345
- 'right_center' => array( '<i class="icon-type_zoom_window_right_center"></i>', __( 'Right Center', $l ) ),
346
- 'left_top' => array( '<i class="icon-type_zoom_window_left_top"></i>', __( 'Left Top', $l ) ),
347
- 'left_bottom' => array( '<i class="icon-type_zoom_window_left_bottom"></i>', __( 'Left Bottom', $l ) ),
348
- 'left_center' => array( '<i class="icon-type_zoom_window_left_center"></i>', __( 'Left Center', $l ) ),
349
- ),
350
  'pro' => true,
351
- 'value' => '',
352
- 'disabled' => true,
353
- 'input_form' => 'buttons',
354
- 'style' => 'full',
355
- 'disabled' => true,
356
  'section' => 'settings',
357
  ),
358
- 'mousewheelZoom' => array(
359
- 'label' => __( 'Mousewheel Zoom', $l ),
360
- 'value' => '',
361
- 'pro' => true,
362
  'input_form' => 'checkbox',
363
- 'disabled' => true,
364
  'section' => 'settings',
365
  ),
 
366
  );
367
 
368
  return $settings;
5
  if ( ! function_exists( 'wp_image_zoooom_settings' ) ) {
6
  function wp_image_zoooom_settings() {
7
 
 
 
8
  $settings = array(
9
  'lensShape' => array(
10
+ 'label' => __( 'Lens Shape', 'wp-image-zoooom' ),
11
  'values' => array(
12
+ 'none' => array( '<i class="icon-lens_shape_none"></i>', __( 'No Lens', 'wp-image-zoooom' ) ),
13
+ 'round' => array( '<i class="icon-lens_shape_circle"></i>', __( 'Circle Lens', 'wp-image-zoooom' ) ),
14
+ 'square' => array( '<i class="icon-lens_shape_square"></i>', __( 'Square Lens', 'wp-image-zoooom' ) ),
15
+ 'zoom_window' => array( '<i class="icon-type_zoom_window"></i>', __( 'With Zoom Window', 'wp-image-zoooom' ) ),
16
  ),
17
  'value' => 'zoom_window',
18
  'input_form' => 'buttons',
19
  'style' => 'full',
 
20
  'no_wrap' => true,
21
+ 'section' => 'settings',
22
  ),
23
  'cursorType' => array(
24
+ 'label' => __( 'Cursor Type', 'wp-image-zoooom' ),
25
  'values' => array(
26
+ 'default' => array( '<i class="icon-cursor_type_default"></i>', __( 'Default', 'wp-image-zoooom' ) ),
27
+ 'pointer' => array( '<i class="icon-cursor_type_pointer"></i>', __( 'Pointer', 'wp-image-zoooom' ) ),
28
+ 'crosshair' => array( '<i class="icon-cursor_type_crosshair"></i>', __( 'Crosshair', 'wp-image-zoooom' ) ),
29
+ 'zoom-in' => array( '<i class="icon-zoom-in"></i>', __( 'Zoom', 'wp-image-zoooom' ) ),
30
  ),
31
  'value' => 'default',
32
  'input_form' => 'buttons',
34
  'section' => 'settings',
35
  ),
36
  'zwEasing' => array(
37
+ 'label' => __( 'Animation Easing Effect', 'wp-image-zoooom' ),
38
  'value' => 12,
39
+ 'description' => __( 'A number between 0 and 200 to represent the degree of the Animation Easing Effect', 'wp-image-zoooom' ),
40
  'input_form' => 'input_text',
41
+ 'validate' => array(
42
+ 'type' => 'int',
43
+ 'range' => array( 0, 200 ),
44
+ ),
45
+ 'section' => 'settings',
46
+ ),
47
+ 'onClick' => array(
48
+ 'label' => __( 'Enable the zoom on ...', 'wp-image-zoooom' ),
49
+ 'values' => array(
50
+ 'false' => __( 'mouse hover', 'wp-image-zoooom' ),
51
+ 'true' => __( 'mouse click', 'wp-image-zoooom' ),
52
+ ),
53
+ 'value' => 'false',
54
+ 'input_form' => 'radio',
55
+ 'pro' => true,
56
+ 'section' => 'settings',
57
+ ),
58
+ 'ratio' => array(
59
+ 'label' => __( 'Zoom Level', 'wp-image-zoooom' ),
60
+ 'values' => array(
61
+ 'default' => array( '<i class="icon-zoom_level_default"></i>', __( 'Default', 'wp-image-zoooom' ) ),
62
+ '1.5' => array( '<i class="icon-zoom_level_15"></i>', __( '1,5 times', 'wp-image-zoooom' ) ),
63
+ '2' => array( '<i class="icon-zoom_level_2"></i>', __( '2 times', 'wp-image-zoooom' ) ),
64
+ '2.5' => array( '<i class="icon-zoom_level_25"></i>', __( '2,5 times', 'wp-image-zoooom' ) ),
65
+ '3' => array( '<i class="icon-zoom_level_3"></i>', __( '3 times', 'wp-image-zoooom' ) ),
66
+ ),
67
+ 'value' => 'default',
68
+ 'description' => __( 'By default the zoom level is calculated automatically from the full size of the uploaded image', 'wp-image-zoooom' ),
69
+ 'input_form' => 'buttons',
70
+ 'pro' => true,
71
+ 'style' => 'full',
72
  'section' => 'settings',
73
  ),
 
74
  'lensSize' => array(
75
+ 'label' => __( 'Lens Size', 'wp-image-zoooom' ),
76
  'post_input' => 'px',
77
  'value' => 200,
78
+ 'description' => __( 'For Circle Lens it means the diameters, for Square Lens it means the width', 'wp-image-zoooom' ),
79
  'input_form' => 'input_text',
80
+ 'validate' => array(
81
+ 'type' => 'int',
82
+ 'range' => array( 20, 2000 ),
83
+ ),
84
+ 'section' => 'settings',
85
+ ),
86
+ 'lensColour' => array(
87
+ 'label' => __( 'Lens Color', 'wp-image-zoooom' ),
88
+ 'value' => '#ffffff',
89
+ 'pro' => true,
90
+ 'input_form' => 'input_color',
91
+ 'description' => __( 'Only for Zoom Window. Only when Tint is not used', 'wp-image-zoooom' ),
92
+ 'section' => 'settings',
93
+ ),
94
+ 'lensOverlay' => array(
95
+ 'label' => __( 'Show as Grid', 'wp-image-zoooom' ),
96
+ 'value' => false,
97
+ 'pro' => true,
98
+ 'input_form' => 'checkbox',
99
+ 'description' => __( 'Only for Zoom Window. Only when Tint is not used', 'wp-image-zoooom' ),
100
  'section' => 'settings',
101
  ),
102
  'borderThickness' => array(
103
+ 'label' => __( 'Border Thickness', 'wp-image-zoooom' ),
104
  'post_input' => 'px',
105
  'value' => 1,
106
  'input_form' => 'input_text',
107
+ 'validate' => array(
108
+ 'type' => 'int',
109
+ 'range' => array( 0, 200 ),
110
+ ),
111
  'section' => 'settings',
112
  ),
113
  'borderColor' => array(
114
+ 'label' => __( 'Border Color', 'wp-image-zoooom' ),
115
  'value' => '#ffffff',
116
  'input_form' => 'input_color',
117
  'section' => 'settings',
118
  ),
119
  'lensFade' => array(
120
+ 'label' => __( 'Fade Time', 'wp-image-zoooom' ),
121
  'post_input' => 'sec',
122
  'value' => 0.5,
123
+ 'description' => __( 'The amount of time it takes for the Lens to slowly appear or disappear', 'wp-image-zoooom' ),
124
  'input_form' => 'input_text',
125
+ 'validate' => array(
126
+ 'type' => 'float',
127
+ 'range' => array( 0, 10 ),
128
+ ),
129
  'section' => 'settings',
130
  ),
131
  'tint' => array(
132
+ 'label' => __( 'Tint', 'wp-image-zoooom' ),
133
  'value' => true,
134
+ 'description' => __( 'A color that will layed on top the of non-magnified image in order to emphasize the lens', 'wp-image-zoooom' ),
135
  'input_form' => 'checkbox',
136
  'section' => 'settings',
137
  ),
138
  'tintColor' => array(
139
+ 'label' => __( 'Tint Color', 'wp-image-zoooom' ),
140
  'value' => '#ffffff',
141
  'input_form' => 'input_color',
142
  'section' => 'settings',
143
  ),
144
  'tintOpacity' => array(
145
+ 'label' => __( 'Tint Opacity', 'wp-image-zoooom' ),
146
+ 'value' => '0.1',
147
+ 'post_input' => '%',
148
+ 'input_form' => 'input_text',
149
+ 'description' => __( 'Accepted value between 0 and 1', 'wp-image-zoooom' ),
150
+ 'validate' => array(
151
+ 'type' => 'float',
152
+ 'range' => array( 0, 1 ),
153
+ ),
154
+ 'section' => 'settings',
155
  ),
156
  'zwWidth' => array(
157
+ 'label' => __( 'Zoom Window Width', 'wp-image-zoooom' ),
158
  'post_input' => 'px',
159
  'value' => 400,
160
  'input_form' => 'input_text',
161
+ 'validate' => array(
162
+ 'type' => 'int',
163
+ 'range' => array( 0, 2000 ),
164
+ ),
165
  'section' => 'settings',
166
  ),
167
  'zwHeight' => array(
168
+ 'label' => __( 'Zoom Window Height', 'wp-image-zoooom' ),
169
  'post_input' => 'px',
170
  'value' => 360,
171
  'input_form' => 'input_text',
172
+ 'validate' => array(
173
+ 'type' => 'int',
174
+ 'range' => array( 0, 2000 ),
175
+ ),
176
  'section' => 'settings',
177
  ),
178
+ 'zwResponsive' => array(
179
+ 'label' => __( 'Responsive', 'wp-image-zoooom' ),
180
+ 'description' => __( 'The Zoom Window Width will adapt to the browser\'s size. Works only on the frontend, not on this demo.', 'wp-image-zoooom' ),
181
+ 'input_form' => 'checkbox',
182
+ 'value' => true,
183
+ 'pro' => true,
184
+ 'section' => 'settings',
185
+ ),
186
+ 'zwResponsiveThreshold' => array(
187
+ 'label' => __( 'Responsive Threshold', 'wp-image-zoooom' ),
188
+ 'description' => __( 'The zoom type will authomatically switch to No Lens zoom once the browser\'s width becomes less than the threshold. Works only on the frontend, not on this demo.', 'wp-image-zoooom' ),
189
+ 'post_input' => 'px',
190
+ 'value' => 800,
191
+ 'input_form' => 'input_text',
192
+ 'validate' => array(
193
+ 'type' => 'int',
194
+ 'range' => array( 1, 3000 ),
195
+ ),
196
+ 'pro' => true,
197
+ 'section' => 'settings',
198
+ ),
199
+ 'zwPositioning' => array(
200
+ 'label' => __( 'Positioning', 'wp-image-zoooom' ),
201
+ 'values' => array(
202
+ 'right_top' => array( '<i class="icon-type_zoom_window_right_top"></i>', __( 'Right Top', 'wp-image-zoooom' ) ),
203
+ 'right_bottom' => array( '<i class="icon-type_zoom_window_right_bottom"></i>', __( 'Right Bottom', 'wp-image-zoooom' ) ),
204
+ 'right_center' => array( '<i class="icon-type_zoom_window_right_center"></i>', __( 'Right Center', 'wp-image-zoooom' ) ),
205
+ 'left_top' => array( '<i class="icon-type_zoom_window_left_top"></i>', __( 'Left Top', 'wp-image-zoooom' ) ),
206
+ 'left_bottom' => array( '<i class="icon-type_zoom_window_left_bottom"></i>', __( 'Left Bottom', 'wp-image-zoooom' ) ),
207
+ 'left_center' => array( '<i class="icon-type_zoom_window_left_center"></i>', __( 'Left Center', 'wp-image-zoooom' ) ),
208
+ ),
209
+ 'value' => 'right_top',
210
+ 'description' => __( 'Feature available only in the PRO Version', 'wp-image-zoooom' ),
211
+ 'disabled' => true,
212
+ 'input_form' => 'buttons',
213
+ 'style' => 'full',
214
+ 'pro' => true,
215
+ 'section' => 'settings',
216
+ ),
217
  'zwPadding' => array(
218
+ 'label' => __( 'Distance from the Main Image', 'wp-image-zoooom' ),
219
  'post_input' => 'px',
220
  'value' => 10,
221
  'input_form' => 'input_text',
222
+ 'validate' => array(
223
+ 'type' => 'int',
224
+ 'range' => array( 0, 200 ),
225
+ ),
226
  'section' => 'settings',
227
  ),
228
  'zwBorderThickness' => array(
229
+ 'label' => __( 'Border Thickness', 'wp-image-zoooom' ),
230
  'post_input' => 'px',
231
  'value' => 1,
232
  'input_form' => 'input_text',
233
+ 'validate' => array(
234
+ 'type' => 'int',
235
+ 'range' => array( 0, 200 ),
236
+ ),
237
  'section' => 'settings',
238
  ),
239
  'zwShadow' => array(
240
+ 'label' => __( 'Shadow Thickness', 'wp-image-zoooom' ),
241
  'post_input' => 'px',
242
  'value' => 4,
243
  'input_form' => 'input_text',
244
+ 'description' => __( 'Use 0px to remove the shadow', 'wp-image-zoooom' ),
245
+ 'validate' => array(
246
+ 'type' => 'int',
247
+ 'range' => array( 0, 500 ),
248
+ ),
249
  'section' => 'settings',
250
  ),
251
  'zwBorderColor' => array(
252
+ 'label' => __( 'Border Color', 'wp-image-zoooom' ),
253
  'value' => '#888888',
254
  'input_form' => 'input_color',
255
  'section' => 'settings',
256
  ),
257
  'zwBorderRadius' => array(
258
+ 'label' => __( 'Rounded Corners', 'wp-image-zoooom' ),
259
  'post_input' => 'px',
260
  'value' => 0,
261
  'input_form' => 'input_text',
262
+ 'validate' => array(
263
+ 'type' => 'int',
264
+ 'range' => array( 0, 500 ),
265
+ ),
266
  'section' => 'settings',
267
  ),
268
+ 'mousewheelZoom' => array(
269
+ 'label' => __( 'Mousewheel Zoom', 'wp-image-zoooom' ),
270
+ 'value' => true,
271
+ 'description' => __( 'When using the mousewheel, the zoomed level of the image will change', 'wp-image-zoooom' ),
272
+ 'input_form' => 'checkbox',
273
+ 'pro' => true,
274
+ 'section' => 'settings',
275
+ ),
276
+ 'zwVerticallyResponsive' => array(
277
+ 'label' => __( 'Zoom Window vertically responsive', 'wp-image-zoooom' ),
278
+ 'value' => false,
279
+ 'description' => __( 'If the Mousewheel Zoom option is enabled, then the user cannot scroll the page. This option will adjust the Zoom Window\'s position vertically so it can always be fully visible.', 'wp-image-zoooom' ),
280
+ 'input_form' => 'checkbox',
281
+ 'section' => 'settings',
282
+ ),
283
  'zwFade' => array(
284
+ 'label' => __( 'Fade Time', 'wp-image-zoooom' ),
285
  'post_input' => 'sec',
286
  'value' => 0.5,
287
+ 'description' => __( 'The amount of time it takes for the Zoom Window to slowly appear or disappear', 'wp-image-zoooom' ),
288
+ 'input_form' => 'input_text',
289
+ 'validate' => array(
290
+ 'type' => 'float',
291
+ 'range' => array( 0, 10 ),
292
+ ),
293
+ 'section' => 'settings',
294
+ ),
295
+ 'customText' => array(
296
+ 'label' => __( 'Text on the image', 'wp-image-zoooom' ),
297
+ 'value' => '',
298
+ 'description' => __( 'Feature available only in the PRO Version', 'wp-image-zoooom' ),
299
+ 'input_form' => 'input_text',
300
+ 'disabled' => true,
301
+ 'section' => 'settings',
302
+ ),
303
+ 'customTextSize' => array(
304
+ 'label' => __( 'Text Size', 'wp-image-zoooom' ),
305
+ 'post_input' => 'px',
306
+ 'value' => 12,
307
+ 'description' => __( 'Feature available only in the PRO Version', 'wp-image-zoooom' ),
308
  'input_form' => 'input_text',
309
+ 'disabled' => true,
310
+ 'validate' => array(
311
+ 'type' => 'int',
312
+ 'range' => array( 0, 45 ),
313
+ ),
314
  'section' => 'settings',
315
  ),
316
+ 'customTextColor' => array(
317
+ 'label' => __( 'Text Color', 'wp-image-zoooom' ),
318
+ 'value' => '#cccccc',
319
+ 'description' => __( 'Feature available only in the PRO Version', 'wp-image-zoooom' ),
320
+ 'input_form' => 'input_color',
321
+ 'disabled' => true,
322
+ 'section' => 'settings',
323
+ ),
324
+ 'customTextAlign' => array(
325
+ 'label' => __( 'Text Align', 'wp-image-zoooom' ),
326
+ 'values' => array(
327
+ 'top_left' => array( '<i class="icon-text_align_top_left"></i>', __( 'Top Left', 'wp-image-zoooom' ) ),
328
+ 'top_center' => array( '<i class="icon-text_align_top_center"></i>', __( 'Top Center', 'wp-image-zoooom' ) ),
329
+ 'top_right' => array( '<i class="icon-text_align_top_right"></i>', __( 'Top Right', 'wp-image-zoooom' ) ),
330
+ 'bottom_left' => array( '<i class="icon-text_align_bottom_left"></i>', __( 'Bottom Left', 'wp-image-zoooom' ) ),
331
+ 'bottom_center' => array( '<i class="icon-text_align_bottom_center"></i>', __( 'Bottom Center', 'wp-image-zoooom' ) ),
332
+ 'bottom_right' => array( '<i class="icon-text_align_bottom_right"></i>', __( 'Bottom Right', 'wp-image-zoooom' ) ),
333
+ ),
334
+ 'value' => 'bottom_right',
335
+ 'input_form' => 'buttons',
336
+ 'style' => 'full',
337
+ 'section' => 'settings',
338
+ ),
339
  'enable_woocommerce' => array(
340
+ 'label' => __( 'Enable the zoom on WooCommerce products', 'wp-image-zoooom' ),
341
  'value' => true,
342
  'input_form' => 'checkbox',
343
  'section' => 'general',
344
  ),
345
  'exchange_thumbnails' => array(
346
+ 'label' => __( 'Exchange the thumbnail with main image on WooCommerce products', 'wp-image-zoooom' ),
347
  'value' => true,
348
  'input_form' => 'checkbox',
349
+ 'description' => __( 'On a WooCommerce gallery, when clicking on a thumbnail, not only the main image will be replaced with the thumbnail\'s image, but also the thumbnail will be replaced with the main image', 'wp-image-zoooom' ),
350
  'section' => 'general',
351
  ),
352
  'enable_mobile' => array(
353
+ 'label' => __( 'Enable the zoom on mobile devices', 'wp-image-zoooom' ),
354
  'value' => false,
355
  'input_form' => 'checkbox',
356
+ 'description' => __( 'Tablets are also considered mobile devices', 'wp-image-zoooom' ),
357
  'section' => 'general',
358
  ),
359
+ 'woo_variations' => array(
360
+ 'label' => __( 'Enable on WooCommerce variation products', 'wp-image-zoooom' ),
361
+ 'value' => false,
362
+ 'input_form' => 'checkbox',
363
+ 'pro' => true,
364
+ 'section' => 'general',
365
+ ),
366
  'woo_cat' => array(
367
+ 'label' => __( 'Enable the zoom on WooCommerce category pages', 'wp-image-zoooom' ),
368
  'value' => false,
369
  'input_form' => 'checkbox',
370
  'section' => 'general',
371
  ),
 
372
  'force_woocommerce' => array(
373
+ 'label' => __( 'Force it to work on WooCommerce', 'wp-image-zoooom' ),
374
  'value' => true,
375
  'input_form' => 'checkbox',
376
  'section' => 'general',
377
  ),
378
  'remove_lightbox_thumbnails' => array(
379
+ 'label' => __( 'Remove the Lightbox on thumbnail images', 'wp-image-zoooom' ),
380
+ 'value' => true,
 
381
  'input_form' => 'checkbox',
382
  'description' => __( 'Some themes implement a Lightbox for WooCommerce galleris that opens on click. Enabling this checkbox will remove the Lightbox on thumbnail images and leave it only on the main image', 'wp-image-zoooom' ),
383
+ 'pro' => true,
384
  'section' => 'general',
385
  ),
386
  'remove_lightbox' => array(
387
+ 'label' => __( 'Remove the Lightbox', 'wp-image-zoooom' ),
388
+ 'value' => true,
 
389
  'input_form' => 'checkbox',
390
  'description' => __( 'Some themes implement a Lightbox that opens on click on the image. Enabling this checkbox will remove the Lightbox' ),
391
+ 'pro' => true,
392
  'section' => 'general',
393
  ),
394
+
 
 
 
 
 
 
 
395
  'force_attachments' => array(
396
+ 'label' => __( 'Enable on attachments pages', 'wp-image-zoooom' ),
397
  'value' => false,
 
398
  'input_form' => 'checkbox',
399
+ 'pro' => true,
400
  'section' => 'general',
401
  ),
402
  'custom_class' => array(
403
+ 'label' => __( 'Apply zoom on this particular image(s)', 'wp-image-zoooom' ),
404
  'value' => '',
 
405
  'input_form' => 'input_text',
406
+ 'description' => __( 'CSS style selector(s) for identifying the image(s) on which to apply the zoom.', 'wp-image-zoooom' ),
407
+ 'pro' => true,
408
  'section' => 'general',
409
  ),
410
  'flexslider' => array(
411
+ 'label' => __( 'FlexSlider container class', 'wp-image-zoooom' ),
412
+ 'value' => '',
413
+ 'input_form' => 'input_text',
414
+ 'description' => __( 'If the images are in a Woo FlexSlider gallery, then type in here the class of the div containing the FlexSlider gallery', 'wp-image-zoooom' ),
415
+ 'pro' => true,
416
+ 'section' => 'general',
417
  ),
418
  'owl' => array(
419
+ 'label' => __( '<a href="https://owlcarousel2.github.io/OwlCarousel2/" target="_blank">Owl Carousel</a> container class', 'wp-image-zoooom' ),
420
  'value' => '',
421
  'input_form' => 'input_text',
422
+ 'description' => __( 'If the images are in a Owl Carousel gallery, then type in here the class of the div containing the Owl Carousel gallery', 'wp-image-zoooom' ),
423
  'pro' => true,
 
 
424
  'section' => 'general',
425
  ),
426
  'flickity' => array(
427
+ 'label' => __( '<a href="https://flickity.metafizzy.co/" target="_blank">Flickity Carousel</a> container class', 'wp-image-zoooom' ),
428
  'value' => '',
429
  'input_form' => 'input_text',
430
+ 'description' => __( 'If the images are in a Flickity Carousel gallery, then type in here the class of the div containing the Flickity Carousel gallery', 'wp-image-zoooom' ),
431
+ 'pro' => true,
432
+ 'section' => 'general',
433
+ ),
434
+ 'swiper' => array(
435
+ 'label' => __( '<a href="http://idangero.us/swiper/" target="_blank">Swiper slider</a> container class', 'wp-image-zoooom' ),
436
+ 'value' => '',
437
+ 'input_form' => 'input_text',
438
+ 'description' => __( 'If the images are in a Swiper slider, then type in here the class of the div containing the Swiper slider', 'wp-image-zoooom' ),
439
  'pro' => true,
 
 
440
  'section' => 'general',
441
  ),
442
  'slick' => array(
443
+ 'label' => __( '<a href="https://kenwheeler.github.io/slick/" target="_blank">Slick carousel</a> container class', 'wp-image-zoooom' ),
444
  'value' => '',
445
  'input_form' => 'input_text',
446
+ 'description' => __( 'If the images are in a Slick carousel gallery, then type in here the class of the div containing the Slick carousel gallery', 'wp-image-zoooom' ),
447
  'pro' => true,
 
448
  'section' => 'general',
449
  ),
450
  'huge_it_gallery' => array(
451
+ 'label' => __( '<a href="https://wordpress.org/plugins/gallery-images/" target="_blank">Huge IT Gallery</a> id', 'wp-image-zoooom' ),
452
+ 'value' => '',
453
+ 'input_form' => 'input_text',
454
+ 'description' => __( 'In order to apply to more galleries, enter the respective ids separated by comma', 'wp-image-zoooom' ),
455
+ 'pro' => true,
456
+ 'section' => 'general',
457
  ),
458
  'enable_lightbox_zoom' => array(
459
+ 'label' => __( 'Enable inside a Lightbox. <a href="#TB_inline?width=600&height=400&inlineId=supported-lightboxes" class="thickbox">See supported lightboxes</a>', 'wp-image-zoooom' ),
460
  'value' => false,
 
461
  'input_form' => 'checkbox',
462
+ 'pro' => true,
463
  'section' => 'general',
464
  ),
465
+ 'image_title_position' => array(
466
+ 'label' => __( 'Image Title Position on the Zoom Window', 'wp-image-zoooom' ),
467
  'values' => array(
468
+ 'false' => __( 'Do no show', 'wp-image-zoooom' ),
469
+ 'top' => __( 'Top', 'wp-image-zoooom' ),
470
+ 'bottom' => __( 'Bottom', 'wp-image-zoooom' ),
471
  ),
472
  'value' => 'false',
473
  'input_form' => 'radio',
474
  'pro' => true,
 
475
  'section' => 'settings',
476
  ),
477
+ 'image_title_color' => array(
478
+ 'label' => __( 'Image Title Text Color', 'wp-image-zoooom' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  'value' => '#ffffff',
 
480
  'input_form' => 'input_color',
 
 
 
 
 
 
481
  'pro' => true,
 
 
482
  'section' => 'settings',
483
  ),
484
+ 'image_title_bg' => array(
485
+ 'label' => __( 'Image Title Background Color', 'wp-image-zoooom' ),
486
+ 'value' => '#000000',
487
+ 'input_form' => 'input_color',
488
  'pro' => true,
 
 
489
  'section' => 'settings',
490
  ),
491
+ 'image_title_size' => array(
492
+ 'label' => __( 'Image Title Font Size', 'wp-image-zoooom' ),
 
493
  'post_input' => 'px',
494
+ 'value' => 12,
495
  'input_form' => 'input_text',
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  'pro' => true,
497
+ 'validate' => array(
498
+ 'type' => 'int',
499
+ 'range' => array( 0, 45 ),
500
+ ),
 
501
  'section' => 'settings',
502
  ),
503
+ 'lens_overflow' => array(
504
+ 'label' => __( 'Lens margins extend over image\'s margins', 'wp-image-zoooom' ),
505
+ 'value' => false,
 
506
  'input_form' => 'checkbox',
 
507
  'section' => 'settings',
508
  ),
509
+
510
  );
511
 
512
  return $settings;
includes/template-general.php CHANGED
@@ -37,8 +37,8 @@ $brand = vsprintf(
37
  <li>the <a href="https://www.silkypress.com/i/js-prettyphoto" target="_blank" rel="nofollow">prettyPhoto</a> lightbox (also used by the <a href="https://www.silkypress.com/i/visual-composer" target="_blank" rel="nofollow">WPBakery</a> gallery)</li>
38
  <li>the <a href="https://www.silkypress.com/i/js-fancybox" target="_blank" rel="nofollow">fancyBox</a> lightbox (also used by the <a href="https://wordpress.org/plugins/easy-fancybox/" target="_blank" rel="nofollow">Easy Fancybox</a> or the <a href="https://wordpress.org/plugins/woocommerce-lightbox/" target="_blank" rel="nofollow">WooCommerce LightBox</a> plugin)</li>
39
  <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>
40
- <li>the lightbox created by the Ultimate Product Catalogue by Etoile Web Design</li>
41
- <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, the Divi gallery or the <a href="https://wordpress.org/plugins/beaver-builder-lite-version/" target="_blank">Beaver Builder</a>)</li>
42
  <li>the lightbox from the <a href="https://wordpress.org/plugins/elementor/" target="_blank" rel="nofollow">Elementor</a> Page Builder</li>
43
  <li>the lightbox from the <a href="https://lcweb.it/media-grid/bundle-pack" target="_blank" rel="nofollow">Media Grid - Bundle Pack</a></li>
44
  </ul>
@@ -58,7 +58,7 @@ $brand = vsprintf(
58
  <div id="alert_messages">
59
  <?php echo $messages; ?>
60
  </div>
61
-
62
  <form class="form-horizontal" method="post" action="" id="form_settings">
63
  <?php echo $form->render(); ?>
64
 
37
  <li>the <a href="https://www.silkypress.com/i/js-prettyphoto" target="_blank" rel="nofollow">prettyPhoto</a> lightbox (also used by the <a href="https://www.silkypress.com/i/visual-composer" target="_blank" rel="nofollow">WPBakery</a> gallery)</li>
38
  <li>the <a href="https://www.silkypress.com/i/js-fancybox" target="_blank" rel="nofollow">fancyBox</a> lightbox (also used by the <a href="https://wordpress.org/plugins/easy-fancybox/" target="_blank" rel="nofollow">Easy Fancybox</a> or the <a href="https://wordpress.org/plugins/woocommerce-lightbox/" target="_blank" rel="nofollow">WooCommerce LightBox</a> plugin)</li>
39
  <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>
40
+ <li>the lightbox created by the Ultimate Product Catalogue by Etoile Web Design</li>
41
+ <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, the Divi gallery or the <a href="https://wordpress.org/plugins/beaver-builder-lite-version/" target="_blank">Beaver Builder</a>)</li>
42
  <li>the lightbox from the <a href="https://wordpress.org/plugins/elementor/" target="_blank" rel="nofollow">Elementor</a> Page Builder</li>
43
  <li>the lightbox from the <a href="https://lcweb.it/media-grid/bundle-pack" target="_blank" rel="nofollow">Media Grid - Bundle Pack</a></li>
44
  </ul>
58
  <div id="alert_messages">
59
  <?php echo $messages; ?>
60
  </div>
61
+
62
  <form class="form-horizontal" method="post" action="" id="form_settings">
63
  <?php echo $form->render(); ?>
64
 
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: diana_burduja
4
  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: 5.3
8
- Stable tag: 1.39.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Requires PHP: 5.2.4
@@ -152,16 +152,15 @@ Alternatively you can upgrade to the Pro version, as there the zoom lens is buil
152
 
153
  == Changelog ==
154
 
155
- = 1.39.2 =
156
- * 02/12/2019
157
  * Fix: the WC product images were distorted on the Flatsome theme
158
-
159
- = 1.39.1 =
160
- * 02/11/2019
161
  * Fix: allow saving options only if the current user has the "manage_options" capability
 
 
162
 
163
  = 1.39 =
164
- * 02/09/2019
165
  * Fix: zoom was showing only in customizer if the Lazy Load option from Jetpack is enabled
166
  * Declare compatibility with WooCommerce 3.9
167
 
4
  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: 5.4
8
+ Stable tag: 1.40
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
  Requires PHP: 5.2.4
152
 
153
  == Changelog ==
154
 
155
+ = 1.40 =
156
+ * 03/04/2020
157
  * Fix: the WC product images were distorted on the Flatsome theme
 
 
 
158
  * Fix: allow saving options only if the current user has the "manage_options" capability
159
+ * Changes to the backend form
160
+ * Declare compatibility with WooCommerce 4.0
161
 
162
  = 1.39 =
163
+ * 02/09/2020
164
  * Fix: zoom was showing only in customizer if the Lazy Load option from Jetpack is enabled
165
  * Declare compatibility with WooCommerce 3.9
166