YITH WooCommerce Zoom Magnifier - Version 1.0.3

Version Description

  • Added ability to load the plugin even when WooCommerce is installed in a different folder
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -69,6 +69,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
69
 
70
  == Changelog ==
71
 
 
 
 
 
72
  = 1.0.2 =
73
 
74
  * Fixed fatal error to yit_debug with yit themes
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
69
 
70
  == Changelog ==
71
 
72
+ = 1.0.3 =
73
+
74
+ * Added ability to load the plugin even when WooCommerce is installed in a different folder
75
+
76
  = 1.0.2 =
77
 
78
  * Fixed fatal error to yit_debug with yit themes
assets/js/frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.0.0
7
  */
8
  jQuery(document).ready(function($){
9
 
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.0.3
7
  */
8
  jQuery(document).ready(function($){
9
 
assets/js/frontend.min.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.0.0
7
  */
8
  jQuery(document).ready(function(b){var a=b(".images"),d=b(".yith_magnifier_zoom"),f=b(".yith_magnifier_zoom img"),e=a.find(".yith_magnifier_zoom").attr("href"),g=a.find(".yith_magnifier_zoom img").attr("src");a.yith_magnifier(yith_magnifier_options);b("form.variations_form").on("found_variation",function(b,c){var h=c.image_src?c.image_src:g;d.attr("href",c.image_magnifier?c.image_magnifier:e);f.attr("src",h);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)}).on("reset_image",
9
  function(){d.attr("href",e);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)});b("form.variations_form .variations select").trigger("change")});
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.0.3
7
  */
8
  jQuery(document).ready(function(b){var a=b(".images"),d=b(".yith_magnifier_zoom"),f=b(".yith_magnifier_zoom img"),e=a.find(".yith_magnifier_zoom").attr("href"),g=a.find(".yith_magnifier_zoom img").attr("src");a.yith_magnifier(yith_magnifier_options);b("form.variations_form").on("found_variation",function(b,c){var h=c.image_src?c.image_src:g;d.attr("href",c.image_magnifier?c.image_magnifier:e);f.attr("src",h);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)}).on("reset_image",
9
  function(){d.attr("href",e);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)});b("form.variations_form .variations select").trigger("change")});
class.yith-wcmg-admin.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
@@ -62,8 +62,8 @@ if( !class_exists( 'YITH_WCMG_Admin' ) ) {
62
 
63
  add_action( 'woocommerce_settings_tabs_yith_wcmg', array( $this, 'print_plugin_options' ) );
64
  add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
65
- add_action( 'woocommerce_admin_field_slider', array( $this, 'admin_fields_slider' ) );
66
- add_action( 'woocommerce_admin_field_picker', array( $this, 'admin_fields_picker' ) );
67
  add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
68
  add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
69
 
@@ -181,10 +181,12 @@ if( !class_exists( 'YITH_WCMG_Admin' ) ) {
181
  </ul>
182
  <br class="clear" />
183
 
184
- <?php foreach( $this->options as $id => $tab ) : ?>
 
 
185
  <!-- tab #<?php echo $id ?> -->
186
  <div class="section" id="yith_wcmg_<?php echo $id ?>">
187
- <?php woocommerce_admin_fields( $this->options[$id] ) ?>
188
  </div>
189
  <?php endforeach ?>
190
  </div>
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.3
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
62
 
63
  add_action( 'woocommerce_settings_tabs_yith_wcmg', array( $this, 'print_plugin_options' ) );
64
  add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
65
+ if ( !has_action('woocommerce_admin_field_slider')) add_action( 'woocommerce_admin_field_slider', array( $this, 'admin_fields_slider' ) );
66
+ if ( !has_action('woocommerce_admin_field_picker')) add_action( 'woocommerce_admin_field_picker', array( $this, 'admin_fields_picker' ) );
67
  add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
68
  add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
69
 
181
  </ul>
182
  <br class="clear" />
183
 
184
+ <?php
185
+ $option_theme = apply_filters('yith_wcmg_options_theme_plugin', $this->options );
186
+ foreach( $option_theme as $id => $tab ) : ?>
187
  <!-- tab #<?php echo $id ?> -->
188
  <div class="section" id="yith_wcmg_<?php echo $id ?>">
189
+ <?php woocommerce_admin_fields( $option_theme[$id] ) ?>
190
  </div>
191
  <?php endforeach ?>
192
  </div>
class.yith-wcmg-frontend.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.3
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
class.yith-wcmg.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.0.0';
26
 
27
  /**
28
  * Plugin object
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.3
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.0.3';
26
 
27
  /**
28
  * Plugin object
functions.yith-wcmg.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.3
8
  */
9
 
10
  if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
- * Version: 1.0.2
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.0.2
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -30,27 +30,31 @@
30
  */
31
  if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
32
 
33
- /**
34
- * Required functions
35
- */
36
- if( !defined('YITH_FUNCTIONS') ) {
37
- require_once( 'yit-common/yit-functions.php' );
38
- }
39
- if ( ! yit_is_woocommerce_active() ) return;
40
 
41
- load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
 
 
 
 
 
42
 
43
- define( 'YITH_WCMG', true );
44
- define( 'YITH_WCMG_URL', plugin_dir_url( __FILE__ ) );
45
- define( 'YITH_WCMG_DIR', plugin_dir_path( __FILE__ ) );
46
 
47
- // Load required classes and functions
48
- require_once('functions.yith-wcmg.php');
49
- require_once('class.yith-wcmg-admin.php');
50
- require_once('class.yith-wcmg-frontend.php');
51
- require_once('class.yith-wcmg.php');
52
-
53
- // Let's start the game!
54
- global $yith_wcmg;
55
- $yith_wcmg = new YITH_WCMG();
56
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
+ * Version: 1.0.3
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.0.3
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
30
  */
31
  if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
32
 
33
+ function yith_magnifier_constructor() {
34
+ global $woocommerce;
35
+ if ( ! isset( $woocommerce ) ) return;
 
 
 
 
36
 
37
+ /**
38
+ * Required functions
39
+ */
40
+ if( !defined('YITH_FUNCTIONS') ) {
41
+ require_once( 'yit-common/yit-functions.php' );
42
+ }
43
 
44
+ load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
 
 
45
 
46
+ define( 'YITH_WCMG', true );
47
+ define( 'YITH_WCMG_URL', plugin_dir_url( __FILE__ ) );
48
+ define( 'YITH_WCMG_DIR', plugin_dir_path( __FILE__ ) );
 
 
 
 
 
 
49
 
50
+ // Load required classes and functions
51
+ require_once('functions.yith-wcmg.php');
52
+ require_once('class.yith-wcmg-admin.php');
53
+ require_once('class.yith-wcmg-frontend.php');
54
+ require_once('class.yith-wcmg.php');
55
+
56
+ // Let's start the game!
57
+ global $yith_wcmg;
58
+ $yith_wcmg = new YITH_WCMG();
59
+ }
60
+ add_action( 'plugins_loaded', 'yith_magnifier_constructor' );
uninstall.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
- * @version 1.0.0
8
  */
9
 
10
  // If uninstall not called from WordPress exit
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Zoom Magnifier
7
+ * @version 1.0.3
8
  */
9
 
10
  // If uninstall not called from WordPress exit
yit-common/yit-functions.php CHANGED
@@ -205,4 +205,27 @@ if( !function_exists('yit_typo_option_to_css') ) {
205
 
206
  return implode( "\n", $attrs ) . "\n";
207
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
205
 
206
  return implode( "\n", $attrs ) . "\n";
207
  }
208
+ }
209
+
210
+
211
+ if( !function_exists('yit_curPageURL') ) {
212
+ /**
213
+ * Retrieve the current complete url
214
+ *
215
+ * @since 1.0
216
+ */
217
+ function yit_curPageURL() {
218
+ $pageURL = 'http';
219
+ if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" )
220
+ $pageURL .= "s";
221
+
222
+ $pageURL .= "://";
223
+
224
+ if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" )
225
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
226
+ else
227
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
228
+
229
+ return $pageURL;
230
+ }
231
  }