YITH WooCommerce Zoom Magnifier - Version 1.2.11

Version Description

Download this release

Release Info

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

Code changes from version 1.2.10 to 1.2.11

README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
- Tested up to: 4.3
7
- Stable tag: 1.2.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -59,6 +59,10 @@ The size of the Zoom Image is automatically setted. If you want to change these
59
 
60
  == Changelog ==
61
 
 
 
 
 
62
  = Version 1.2.10 - RELEASED: SEP 24, 2015 =
63
 
64
  * Updated: changed text domain as translate.wordpress.org requisite.
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.3.1
7
+ Stable tag: 1.2.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
59
 
60
  == Changelog ==
61
 
62
+ = Version 1.2.11 - RELEASED: OCT 23, 2015 =
63
+
64
+ * Updated: compatibility with YITH WooCommerce Quick View.
65
+
66
  = Version 1.2.10 - RELEASED: SEP 24, 2015 =
67
 
68
  * Updated: changed text domain as translate.wordpress.org requisite.
assets/js/frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.2.10
7
  */
8
  jQuery(document).ready(function ($) {
9
 
@@ -14,7 +14,11 @@ jQuery(document).ready(function ($) {
14
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
15
  var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
16
 
17
- //yith_wcmg.yith_magnifier(yith_magnifier_options);
 
 
 
 
18
 
19
  $(document).on('found_variation', 'form.variations_form', function (event, variation) {
20
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
@@ -42,6 +46,4 @@ jQuery(document).ready(function ($) {
42
 
43
  yith_wcmg.yith_magnifier(yith_magnifier_options);
44
  });
45
-
46
- $('form.variations_form .variations select').trigger('change');
47
  });
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.2.11
7
  */
8
  jQuery(document).ready(function ($) {
9
 
14
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
15
  var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
16
 
17
+ if( typeof yith_magnifier_options == 'undefined' ) {
18
+ return false;
19
+ }
20
+
21
+ yith_wcmg.yith_magnifier(yith_magnifier_options);
22
 
23
  $(document).on('found_variation', 'form.variations_form', function (event, variation) {
24
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
46
 
47
  yith_wcmg.yith_magnifier(yith_magnifier_options);
48
  });
 
 
49
  });
class.yith-wcmg-frontend.php CHANGED
@@ -37,19 +37,19 @@ if (!class_exists('YITH_WCMG_Frontend')) {
37
  $this->version = $version;
38
 
39
  // add the action only when the loop is initializate
40
- add_action('template_redirect', array($this, 'render'));
41
  }
42
 
43
  public function render() {
44
- if (yith_wcmg_is_enabled() && !$this->is_video_featured_enabled()) {
45
  //change the templates
46
  remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20);
47
  remove_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20);
48
- add_action('woocommerce_before_single_product_summary', array($this, 'show_product_images'), 20);
49
- add_action('woocommerce_product_thumbnails', array($this, 'show_product_thumbnails'), 20);
50
 
51
  //custom styles and javascripts
52
- add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_scripts'));
53
 
54
  //add attributes to product variations
55
  add_filter('woocommerce_available_variation', array($this, 'available_variation'), 10, 3);
@@ -104,15 +104,20 @@ if (!class_exists('YITH_WCMG_Frontend')) {
104
  'jquery',
105
  'jquery-migrate'
106
  ), '6.2.1', true);
 
 
 
 
 
 
 
107
 
108
- if (is_product() || (!empty($post->post_content) && strstr($post->post_content, '[product_page'))) {
109
  wp_enqueue_script('yith-magnifier-slider');
110
- wp_enqueue_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js', array('jquery'), $this->version, true);
111
- wp_enqueue_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js', array(
112
- 'jquery',
113
- 'yith-magnifier'
114
- ), $this->version, true);
115
- wp_enqueue_style('yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css');
116
 
117
  $css = file_exists(get_stylesheet_directory() . '/woocommerce/yith_magnifier.css') ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
118
  wp_enqueue_style('yith_wcmg_frontend', $css);
37
  $this->version = $version;
38
 
39
  // add the action only when the loop is initializate
40
+ add_action('template_redirect', array( $this, 'render') );
41
  }
42
 
43
  public function render() {
44
+ if ( yith_wcmg_is_enabled() && ! $this->is_video_featured_enabled() ) {
45
  //change the templates
46
  remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20);
47
  remove_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20);
48
+ add_action('woocommerce_before_single_product_summary', array( $this, 'show_product_images'), 20);
49
+ add_action('woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20);
50
 
51
  //custom styles and javascripts
52
+ add_action( 'wp_enqueue_scripts', array($this, 'enqueue_styles_scripts') );
53
 
54
  //add attributes to product variations
55
  add_filter('woocommerce_available_variation', array($this, 'available_variation'), 10, 3);
104
  'jquery',
105
  'jquery-migrate'
106
  ), '6.2.1', true);
107
+ wp_register_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js', array('jquery'), $this->version, true);
108
+ wp_register_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js', array(
109
+ 'jquery',
110
+ 'yith-magnifier'
111
+ ), $this->version, true);
112
+
113
+ wp_register_style('yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css');
114
 
115
+ if ( is_product() || (!empty($post->post_content) && strstr($post->post_content, '[product_page') ) ) {
116
  wp_enqueue_script('yith-magnifier-slider');
117
+ wp_enqueue_script('yith-magnifier');
118
+ wp_enqueue_script('yith_wcmg_frontend');
119
+
120
+ wp_enqueue_style('yith-magnifier');
 
 
121
 
122
  $css = file_exists(get_stylesheet_directory() . '/woocommerce/yith_magnifier.css') ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
123
  wp_enqueue_style('yith_wcmg_frontend', $css);
class.yith-wcmg.php CHANGED
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.2.10';
26
 
27
  /**
28
  * Plugin object
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.2.11';
26
 
27
  /**
28
  * Plugin object
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.2.10
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.10
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -65,7 +65,7 @@ if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
- define( 'YITH_YWZM_VERSION', '1.2.10' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.2.11
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.11
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
+ define( 'YITH_YWZM_VERSION', '1.2.11' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
languages/yith-woocommerce-zoom-magnifier-it_IT.mo CHANGED
Binary file
languages/yith-woocommerce-zoom-magnifier-it_IT.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
- "POT-Creation-Date: 2015-09-02 15:20+0200\n"
5
- "PO-Revision-Date: 2015-09-02 15:38+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
+ "POT-Creation-Date: 2015-10-07 15:48+0200\n"
5
+ "PO-Revision-Date: 2015-10-07 15:48+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
languages/yith-woocommerce-zoom-magnifier.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
5
- "POT-Creation-Date: 2015-09-01 14:07+0100\n"
6
  "PO-Revision-Date: 2015-04-22 12:25+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
@@ -10,8 +10,8 @@ msgstr ""
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8.1\n"
14
- "X-Poedit-Basepath: ..\\\n"
15
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
16
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
@@ -277,6 +277,69 @@ msgid ""
277
  "and support through our platform available 24h/24."
278
  msgstr ""
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  #: yit-common/yith-panel.php:418
281
  msgid "Select a date"
282
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
5
+ "POT-Creation-Date: 2015-10-07 15:48+0200\n"
6
  "PO-Revision-Date: 2015-04-22 12:25+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.4\n"
14
+ "X-Poedit-Basepath: ..\n"
15
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
16
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
277
  "and support through our platform available 24h/24."
278
  msgstr ""
279
 
280
+ #: templates/admin/premium.php:193
281
+ #, php-format
282
+ msgid ""
283
+ "Upgrade to the %1$s premium version %2$s of %1$s YITH WooCommerce Zoom "
284
+ "Magnifier %2$s to benefit from all features!"
285
+ msgstr ""
286
+
287
+ #: templates/admin/premium.php:196
288
+ #, php-format
289
+ msgid "%1$sUPGRADE%2$s%3$sto the premium version%2$s"
290
+ msgstr ""
291
+
292
+ #: templates/admin/premium.php:202
293
+ #, php-format
294
+ msgid "%1$sPremium Features%2$s"
295
+ msgstr ""
296
+
297
+ #: templates/admin/premium.php:210
298
+ msgid "ZOOM BOX POSITION"
299
+ msgstr ""
300
+
301
+ #: templates/admin/premium.php:213
302
+ #, php-format
303
+ msgid ""
304
+ "Choose where you want to show the %1$szoomed version%2$s of the image of "
305
+ "your products. Place it above or below the original image, on its left or "
306
+ "its right, or you can even place it over it.$2$s"
307
+ msgstr ""
308
+
309
+ #: templates/admin/premium.php:223
310
+ msgid "ENLARGE THE IMAGES"
311
+ msgstr ""
312
+
313
+ #: templates/admin/premium.php:225
314
+ msgid ""
315
+ "Just one click and the product image will appear in a bigger size in a modal "
316
+ "window. A further chance to let users analyze in a better way what you sell."
317
+ msgstr ""
318
+
319
+ #: templates/admin/premium.php:240
320
+ msgid "EXCLUDE PRODUCTS"
321
+ msgstr ""
322
+
323
+ #: templates/admin/premium.php:242
324
+ msgid ""
325
+ "Tailored options to limit the plugin features only to certain products. Some "
326
+ "of these could have too small images to be zoomed, or maybe being part of "
327
+ "categories that do not imply zoomed images. Select the products and the "
328
+ "categories to exclude and delete all your problems"
329
+ msgstr ""
330
+
331
+ #: templates/admin/premium.php:251
332
+ #, php-format
333
+ msgid ""
334
+ "Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Zoom Magnifier"
335
+ "%2$s to benefit from all features!"
336
+ msgstr ""
337
+
338
+ #: templates/admin/premium.php:254
339
+ #, php-format
340
+ msgid "%1$sUPGRADE%2$s %3$sto the premium version%2$s"
341
+ msgstr ""
342
+
343
  #: yit-common/yith-panel.php:418
344
  msgid "Select a date"
345
  msgstr ""
lib/class.yith-woocommerce-zoom-magnifier.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
25
  * @var string
26
  * @since 1.0.0
27
  */
28
- public $version = '1.2.10';
29
 
30
  /**
31
  * Plugin object
@@ -50,7 +50,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
50
  // actions
51
  add_action( 'init', array( $this, 'init' ) );
52
 
53
- if ( is_admin() ) {
54
  $this->obj = new YITH_WCMG_Admin( $this->version );
55
  } else {
56
  $this->obj = new YITH_WCMG_Frontend( $this->version );
25
  * @var string
26
  * @since 1.0.0
27
  */
28
+ public $version = '1.2.11';
29
 
30
  /**
31
  * Plugin object
50
  // actions
51
  add_action( 'init', array( $this, 'init' ) );
52
 
53
+ if ( is_admin() && ( ! isset( $_REQUEST['action'] ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] != 'yith_load_product_quick_view' ) ) ) {
54
  $this->obj = new YITH_WCMG_Admin( $this->version );
55
  } else {
56
  $this->obj = new YITH_WCMG_Frontend( $this->version );
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -165,6 +165,12 @@
165
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
 
167
  $("#" + id).val( attachment.url );
 
 
 
 
 
 
168
  $('.plugin-option .upload_img_url').trigger('change');
169
  });
170
 
165
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
 
167
  $("#" + id).val( attachment.url );
168
+ // Save the id of the selected element to an element which name is the same with
169
+ // a suffix "-yith-attachment-id"
170
+ if ($("#" + id + "-yith-attachment-id")) {
171
+ $("#" + id + "-yith-attachment-id").val(attachment.id);
172
+ }
173
+
174
  $('.plugin-option .upload_img_url').trigger('change');
175
  });
176
 
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,10 +1 @@
1
- (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
- "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
- function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
- a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
- var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a(".plugin-option .upload_img_url").trigger("change")}));c.open()}));a(".plugin-option .add_media").on("click",
6
- function(){});a("[data-field]").each(function(){var b=a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");
7
- b.sortable({connectWith:b,update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",
8
- resizable:!1,draggable:!1,create:function(b,d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=
9
- a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
- b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
1
+ !function(e){function t(t,i,n){var a=!0;if("string"==typeof i){":radio"==i.substr(0,6)&&(i+=":checked");for(var n=n.split(","),o=0;o<n.length;o++){if(e(i).val()==n[o]){a=!0;break}a=!1}}a?e(t+"-container").closest("tr").show():e(t+"-container").closest("tr").hide()}var i=function(){var t="";e(this).attr("multiple")?(e(this).children("option:selected").each(function(i,n){0!=i&&(t+=", "),t+=e(n).text()}),""==t&&e(this).children().children("option:selected").each(function(i,n){0!=i&&(t+=", "),t+=e(n).text()})):(t=e(this).children("option:selected").text(),""==t&&(t=e(this).children().children("option:selected").text())),e(this).parent().find("span").length<=0&&e(this).before("<span></span>"),e(this).parent().children("span").replaceWith("<span>"+t+"</span>")};if(e(".plugin-option .select_wrapper select").not(".chosen").each(i).change(i),e(".plugin-option .select_wrapper").click(function(t){t.stopPropagation(),e(this).find("select[multiple]").not(".chosen").toggle()}),e(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(e){e.stopPropagation()}),e(window).click(function(){e(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()}),e(".plugin-option .chosen .select_wrapper select").chosen(),e(".plugin-option .on_off_container span").on("click",function(){var t=e(this).prev("input"),i=t.prop("checked");i?t.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):t.prop("checked",!0).attr("value","yes").addClass("onoffchecked"),t.change()}),e(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var t=e(this).data("val"),i=e(this).data("min"),n=e(this).data("max"),a=e(this).data("step"),o=e(this).data("labels");e(this).slider({value:t,min:i,max:n,range:"min",step:a,slide:function(t,i){e(this).find("input").val(i.value),e(this).siblings(".feedback").find("strong").text(i.value+o)}})}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media){{var n=!0;wp.media.editor.send.attachment}e(".plugin-option .upload_img_url").change(function(){var t=e(this).val(),i=new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico)"),n=e(this).parents().siblings(".upload_img_preview");n.html(i.test(t)?'<img src="'+t+'" style="max-width:600px; max-height:300px;" />':"")}).trigger("change"),e(document).on("click",".plugin-option .upload_button",function(t){t.preventDefault();var i,n=e(this),a=n.attr("id").replace(/-button$/,"");if(i)return void i.open();var o=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})];i=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:o}),i.on("select",function(){var t=i.state().get("selection").first().toJSON();e("#"+a).val(t.url),e("#"+a+"-yith-attachment-id")&&e("#"+a+"-yith-attachment-id").val(t.id),e(".plugin-option .upload_img_url").trigger("change")}),i.open()})}e(".plugin-option .add_media").on("click",function(){n=!1}),e("[data-field]").each(function(){var i=e(this),n="#"+i.data("field"),a="#"+i.data("dep"),o=i.data("value");e(a).on("change",function(){t(n,a,o.toString())}).change()}),e(".rm_connectedlist").each(function(){{var t=e(this).find("ul"),i=e(this).find(":hidden");t.sortable({connectWith:t,update:function(){var n={};t.each(function(){var t={};e(this).children().each(function(){t[e(this).data("option")]=e(this).text()}),n[e(this).data("list")]=t}),i.val(JSON.stringify(n).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()}}),e(document).ready(function(){e(".yith-video-link").click(function(t){t.preventDefault();var i=e(this).data("video-id");e("."+i).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(){e(this).css("maxWidth","853px")},open:function(){e(".ui-widget-overlay").bind("click",function(){e(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}}),e(".ui-dialog :button").blur()})}),e(document).ready(function(){e(".codemirror").each(function(t,i){var n=CodeMirror.fromTextArea(i,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});e(i).data("codemirrorInstance",n)})}),e(document).ready(function(){e(".google-analytic-generate").click(function(){var t=e("#"+e(this).data("textarea")).data("codemirrorInstance"),i=e("#"+e(this).data("input")).val(),n=e(this).data("basename"),a="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n";a+="(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\n",a+="m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",a+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n",a+="ga('create', '"+i+"', '"+n+"');\n",a+="ga('send', 'pageview');\n",t.replaceRange(a,t.getCursor("start"),t.getCursor("end"))})})}(jQuery);
 
 
 
 
 
 
 
 
 
plugin-fw/init.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Framework Name: YIT Plugin Framework
4
+ * Version: 2.1
5
+ * Author: Yithemes
6
+ * Text Domain: yith-plugin-fw
7
+ * Domain Path: /languages/
8
+ *
9
+ * @author Your Inspiration Themes
10
+ * @package YITH WooCommerce Ajax Navigation
11
+ * @version 2.0
12
+ */
13
+ /**
14
+ * This file belongs to the YIT Plugin Framework.
15
+ *
16
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
17
+ * that is bundled with this package in the file LICENSE.txt.
18
+ * It is also available through the world-wide-web at this URL:
19
+ * http://www.gnu.org/licenses/gpl-3.0.txt
20
+ */
21
+
22
+
23
+ if ( ! defined( 'ABSPATH' ) ) {
24
+ exit;
25
+ } // Exit if accessed directly
26
+
27
+ if ( ! function_exists( 'yit_maybe_plugin_fw_loader' ) ) {
28
+ /**
29
+ * YITH WooCommerce Ajax Navigation
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ function yit_maybe_plugin_fw_loader( $plugin_path ) {
34
+ global $plugin_fw_data;
35
+
36
+ $default_headers = array(
37
+ 'Name' => 'Framework Name',
38
+ 'Version' => 'Version',
39
+ 'Author' => 'Author',
40
+ 'TextDomain' => 'Text Domain',
41
+ 'DomainPath' => 'Domain Path',
42
+ );
43
+
44
+ $framework_data = get_file_data( trailingslashit( $plugin_path ) .'plugin-fw/init.php', $default_headers );
45
+ $plugin_fw_main_file = trailingslashit( $plugin_path ) . 'plugin-fw/yit-plugin.php';
46
+
47
+ if( ! empty( $plugin_fw_data ) ){
48
+ foreach( $plugin_fw_data as $version => $path ){
49
+ if( version_compare( $version, $framework_data['Version'], '<' ) ){
50
+ $plugin_fw_data = array( $framework_data['Version'] => $plugin_fw_main_file );
51
+ }
52
+ }
53
+ }
54
+
55
+ else {
56
+ $plugin_fw_data = array( $framework_data['Version'] => $plugin_fw_main_file );
57
+ }
58
+ }
59
+ }
plugin-fw/lib/yit-metabox.php CHANGED
@@ -161,8 +161,6 @@ if (!class_exists('YIT_Metabox')) {
161
  wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
162
  wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
163
  wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
164
-
165
-
166
  }
167
 
168
  /**
161
  wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
162
  wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
163
  wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
 
 
164
  }
165
 
166
  /**
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -278,6 +278,20 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
278
  }
279
  }
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  woocommerce_update_options( $yit_options[ $current_tab ] );
282
 
283
  do_action( 'yit_panel_wc_after_update' );
@@ -314,7 +328,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
314
  wp_enqueue_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $woocommerce->version );
315
  wp_enqueue_style ( 'wp-jquery-ui-dialog' );
316
 
317
-
318
  wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
319
  wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
320
  wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', array( 'jquery', 'jquery-ui-datepicker','jquery-ui-dialog', 'jquery-ui-sortable', 'iris', 'chosen' ), $woocommerce->version, true );
@@ -365,7 +378,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
365
  * @return array Filtered body classes
366
  */
367
  public function admin_body_class( $admin_body_classes ){
368
- return substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
 
369
  }
370
 
371
  /**
278
  }
279
  }
280
 
281
+ foreach($_POST as $name => $value) {
282
+
283
+ // Check if current POST var which name ends with a specific needle
284
+ $attachment_id_needle = "-yith-attachment-id";
285
+ $is_hidden_input = (($temp = strlen($name) - strlen($attachment_id_needle)) >= 0 && strpos($name, $attachment_id_needle, $temp) !== FALSE);
286
+ if ($is_hidden_input){
287
+ // Is an input element of type "hidden" coupled with an input element for selecting an element from the media gallery
288
+ $yit_options[ $current_tab ][$name] = array(
289
+ "type" => "text",
290
+ "id" => $name
291
+ );
292
+ }
293
+ }
294
+
295
  woocommerce_update_options( $yit_options[ $current_tab ] );
296
 
297
  do_action( 'yit_panel_wc_after_update' );
328
  wp_enqueue_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $woocommerce->version );
329
  wp_enqueue_style ( 'wp-jquery-ui-dialog' );
330
 
 
331
  wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
332
  wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
333
  wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', array( 'jquery', 'jquery-ui-datepicker','jquery-ui-dialog', 'jquery-ui-sortable', 'iris', 'chosen' ), $woocommerce->version, true );
378
  * @return array Filtered body classes
379
  */
380
  public function admin_body_class( $admin_body_classes ){
381
+ global $pagenow;
382
+ return 'admin.php' == $pagenow && substr_count( $admin_body_classes, 'woocommerce' ) == 0 ? $admin_body_classes .= ' woocommerce ' : $admin_body_classes;
383
  }
384
 
385
  /**
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -121,32 +121,27 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
121
  */
122
  public function admin_enqueue_scripts() {
123
 
124
- global $wp_scripts;
125
 
126
  //scripts
127
- wp_enqueue_media();
128
- wp_enqueue_script( 'jquery-ui' );
129
- wp_enqueue_script( 'jquery-ui-core' );
130
- wp_enqueue_script( 'jquery-ui-slider' );
131
- wp_enqueue_script( 'jquery-ui-dialog' );
132
- wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
133
- wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
134
- wp_enqueue_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
135
- wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
136
- wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
137
-
138
-
139
- wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
140
 
141
  //styles
142
-
143
  $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
144
-
145
  wp_enqueue_style( 'jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all' );
146
  wp_enqueue_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $this->version );
147
  wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
148
-
149
- wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
150
  }
151
 
152
  /**
121
  */
122
  public function admin_enqueue_scripts() {
123
 
124
+ global $wp_scripts, $pagenow;
125
 
126
  //scripts
127
+ wp_enqueue_media();
128
+ wp_enqueue_script( 'jquery-ui' );
129
+ wp_enqueue_script( 'jquery-ui-core' );
130
+ wp_enqueue_script( 'jquery-ui-slider' );
131
+ wp_enqueue_script( 'jquery-ui-dialog' );
132
+ wp_enqueue_script( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array( 'jquery' ), '1.1.0', true );
133
+ wp_enqueue_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
134
+ wp_register_script( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/codemirror.js', array( 'jquery' ), $this->version, true );
135
+ wp_register_script( 'codemirror-javascript', YIT_CORE_PLUGIN_URL . '/assets/js/codemirror/javascript.js', array( 'jquery', 'codemirror' ), $this->version, true );
 
 
 
 
136
 
137
  //styles
 
138
  $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
139
+ wp_register_style( 'codemirror', YIT_CORE_PLUGIN_URL . '/assets/css/codemirror/codemirror.css' );
140
  wp_enqueue_style( 'jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all' );
141
  wp_enqueue_style( 'yit-plugin-style', YIT_CORE_PLUGIN_URL . '/assets/css/yit-plugin-panel.css', $this->version );
142
  wp_enqueue_style( 'raleway-font', '//fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,100,200,300,900' );
143
+ wp_enqueue_style( 'jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css' );
144
+ wp_enqueue_style( 'yit-jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
145
  }
146
 
147
  /**
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -190,15 +190,34 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
190
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
191
  */
192
  protected function _upgrader_pre_download( $reply, $package, $upgrader ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
  /**
195
  * It isn't YITH Premium plugins, please wordpress update it for me!
196
  */
197
- if( ! isset( $upgrader->skin->plugin ) ) {
198
  return $reply;
199
  }
200
 
201
- $plugin_info = YIT_Plugin_Licence()->get_product( $upgrader->skin->plugin );
202
 
203
  /**
204
  * False ? It isn't YITH Premium plugins, please wordpress update it for me!
190
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
191
  */
192
  protected function _upgrader_pre_download( $reply, $package, $upgrader ) {
193
+ $plugin = false;
194
+ $is_bulk = $upgrader->skin instanceof Bulk_Plugin_Upgrader_Skin;
195
+
196
+ if( ! $is_bulk ){
197
+ $plugin = isset( $upgrader->skin->plugin ) ? $upgrader->skin->plugin : false;
198
+ }
199
+
200
+ else {
201
+ //Bulk action upgrade
202
+ $action_url = parse_url( $upgrader->skin->options['url'] );
203
+ parse_str( rawurldecode( htmlspecialchars_decode( $action_url['query'] ) ) );
204
+ $plugins = explode( ',', $plugins );
205
+ foreach( $plugins as $plugin_init ){
206
+ $to_upgrade = get_plugin_data( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_init );
207
+ if( $to_upgrade['Name'] == $upgrader->skin->plugin_info['Name'] ){
208
+ $plugin = $plugin_init;
209
+ }
210
+ }
211
+ }
212
 
213
  /**
214
  * It isn't YITH Premium plugins, please wordpress update it for me!
215
  */
216
+ if( ! $plugin ) {
217
  return $reply;
218
  }
219
 
220
+ $plugin_info = YIT_Plugin_Licence()->get_product( $plugin );
221
 
222
  /**
223
  * False ? It isn't YITH Premium plugins, please wordpress update it for me!
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'YIT_Licence' ) ) {
48
  * @var string The yithemes api uri
49
  * @since 1.0
50
  */
51
- protected $_api_uri = 'http://www.yithemes.com';
52
 
53
  /**
54
  * @var string The yithemes api uri query args
48
  * @var string The yithemes api uri
49
  * @since 1.0
50
  */
51
+ protected $_api_uri = 'http://yithemes.com';
52
 
53
  /**
54
  * @var string The yithemes api uri query args
plugin-fw/licence/lib/yit-plugin-licence.php CHANGED
@@ -75,9 +75,7 @@ if ( ! class_exists( 'YIT_Plugin_Licence' ) ) {
75
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
76
  add_action( 'admin_enqueue_scripts', array( $this, 'localize_script' ), 15 );
77
  add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
78
- add_action( "wp_ajax_nopriv_activate-{$this->_product_type}", array( $this, 'activate' ) );
79
  add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
80
- add_action( "wp_ajax_nopriv_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
81
  add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
82
  }
83
 
75
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
76
  add_action( 'admin_enqueue_scripts', array( $this, 'localize_script' ), 15 );
77
  add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
 
78
  add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
 
79
  add_action( 'yit_licence_after_check', array( $this, 'licence_after_check' ) );
80
  }
81
 
plugin-fw/licence/lib/yit-theme-licence.php CHANGED
@@ -71,9 +71,7 @@ if ( ! class_exists( 'YIT_Theme_Licence' ) ) {
71
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
72
  add_action( 'admin_enqueue_scripts', array( $this, 'localize_script' ), 15 );
73
  add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
74
- add_action( "wp_ajax_nopriv_activate-{$this->_product_type}", array( $this, 'activate' ) );
75
  add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
76
- add_action( "wp_ajax_nopriv_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
77
  }
78
 
79
  /**
71
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
72
  add_action( 'admin_enqueue_scripts', array( $this, 'localize_script' ), 15 );
73
  add_action( "wp_ajax_activate-{$this->_product_type}", array( $this, 'activate' ) );
 
74
  add_action( "wp_ajax_update_licence_information-{$this->_product_type}", array( $this, 'update_licence_information' ) );
 
75
  }
76
 
77
  /**
plugin-fw/templates/panel/woocommerce/woocommerce-upload.php CHANGED
@@ -16,10 +16,10 @@
16
  * @since 1.0.0
17
  */
18
 
19
- if ( ! defined( 'ABSPATH' ) ) {
20
  exit;
21
  } // Exit if accessed directly
22
-
23
 
24
  ?>
25
 
@@ -29,18 +29,25 @@ if ( ! defined( 'ABSPATH' ) ) {
29
  </th>
30
  <td class="forminp forminp-color plugin-option">
31
 
32
- <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text rm_upload" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
 
 
 
33
  <div class="option">
34
- <input type="text" name="<?php echo $id ?>" id="<?php echo $id ?>" value="<?php echo $value == '1' ? '' : esc_attr( $value ) ?>" class="upload_img_url" />
35
- <input type="button" value="<?php _e( 'Upload', 'yith-plugin-fw' ) ?>" id="<?php echo $id ?>-button" class="upload_button button" />
 
 
 
36
  </div>
37
  <div class="clear"></div>
38
  <span class="description"><?php echo $desc ?></span>
 
39
  <div class="upload_img_preview" style="margin-top:10px;">
40
  <?php
41
  $file = $value;
42
- if ( preg_match( '/(jpg|jpeg|png|gif|ico)$/', $file ) ) {
43
- echo "<img src=\"" . YIT_CORE_PLUGIN_URL. "/assets/images/sleep.png\" data-src=\"$file\" />";
44
  }
45
  ?>
46
  </div>
16
  * @since 1.0.0
17
  */
18
 
19
+ if (!defined('ABSPATH')) {
20
  exit;
21
  } // Exit if accessed directly
22
+ $hidden_val = get_option($id . "-yith-attachment-id", 0);
23
 
24
  ?>
25
 
29
  </th>
30
  <td class="forminp forminp-color plugin-option">
31
 
32
+ <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text rm_upload"
33
+ <?php if (isset($option['deps'])): ?>data-field="<?php echo $id ?>"
34
+ data-dep="<?php echo $this->get_id_field($option['deps']['ids']) ?>"
35
+ data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
36
  <div class="option">
37
+ <input type="text" name="<?php echo $id ?>" id="<?php echo $id ?>"
38
+ value="<?php echo $value == '1' ? '' : esc_attr($value) ?>" class="upload_img_url"/>
39
+ <input type="hidden" name="<?php echo $id ?>-yith-attachment-id" id="<?php echo $id ?>-yith-attachment-id" value="<?php echo $hidden_val; ?>" />
40
+ <input type="button" value="<?php _e('Upload', 'yith-plugin-fw') ?>" id="<?php echo $id ?>-button"
41
+ class="upload_button button"/>
42
  </div>
43
  <div class="clear"></div>
44
  <span class="description"><?php echo $desc ?></span>
45
+
46
  <div class="upload_img_preview" style="margin-top:10px;">
47
  <?php
48
  $file = $value;
49
+ if (preg_match('/(jpg|jpeg|png|gif|ico)$/', $file)) {
50
+ echo "<img src=\"" . YIT_CORE_PLUGIN_URL . "/assets/images/sleep.png\" data-src=\"$file\" />";
51
  }
52
  ?>
53
  </div>
plugin-fw/yit-plugin.php CHANGED
@@ -13,22 +13,10 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  } // Exit if accessed directly
14
 
15
 
16
- if( !defined('YIT_CORE_PLUGIN')) {
17
- define( 'YIT_CORE_PLUGIN', true);
18
- }
19
-
20
- if( !defined('YIT_CORE_PLUGIN_PATH')) {
21
- define( 'YIT_CORE_PLUGIN_PATH', dirname(__FILE__));
22
- }
23
-
24
- if( !defined('YIT_CORE_PLUGIN_URL')) {
25
- define( 'YIT_CORE_PLUGIN_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ));
26
- }
27
-
28
- if( ! defined( 'YIT_CORE_PLUGIN_TEMPLATE_PATH' ) ){
29
- define ( 'YIT_CORE_PLUGIN_TEMPLATE_PATH', YIT_CORE_PLUGIN_PATH . '/templates' );
30
- }
31
-
32
 
33
  include_once( 'yit-functions.php' );
34
  include_once( 'yit-plugin-registration-hook.php' );
13
  } // Exit if accessed directly
14
 
15
 
16
+ ! defined( 'YIT_CORE_PLUGIN' ) && define( 'YIT_CORE_PLUGIN', true);
17
+ ! defined( 'YIT_CORE_PLUGIN_PATH' ) && define( 'YIT_CORE_PLUGIN_PATH', dirname(__FILE__) );
18
+ ! defined( 'YIT_CORE_PLUGIN_URL' ) && define( 'YIT_CORE_PLUGIN_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
19
+ ! defined( 'YIT_CORE_PLUGIN_TEMPLATE_PATH' ) && define( 'YIT_CORE_PLUGIN_TEMPLATE_PATH', YIT_CORE_PLUGIN_PATH . '/templates' );
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  include_once( 'yit-functions.php' );
22
  include_once( 'yit-plugin-registration-hook.php' );