YITH WooCommerce Zoom Magnifier - Version 1.3.3

Version Description

Download this release

Release Info

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

Code changes from version 1.3.2 to 1.3.3

README.txt CHANGED
@@ -4,9 +4,10 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
  Requires at least: 4.0
6
  Tested up to: 4.9.4
7
- Stable tag: 1.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
10
 
11
  YITH WooCommerce Zoom Magnifier add zoom effect to product images and a customizable image slider.
12
 
@@ -51,6 +52,12 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
54
  = Version 1.3.2 - Released: Mar 06, 2018 =
55
 
56
  * New: support to WooCommerce 3.3.3
4
  Tags: zoom, magnifier, slider, carousel, woocommerce
5
  Requires at least: 4.0
6
  Tested up to: 4.9.4
7
+ Stable tag: 1.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+ Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
11
 
12
  YITH WooCommerce Zoom Magnifier add zoom effect to product images and a customizable image slider.
13
 
52
 
53
  == Changelog ==
54
 
55
+ = Version 1.3.3 - Released: June 22, 2018 =
56
+
57
+ * Update: documentation link
58
+ * Fix: choosing variation
59
+ * Dev: include 'wp-admin/includes/plugin.php'
60
+
61
  = Version 1.3.2 - Released: Mar 06, 2018 =
62
 
63
  * New: support to WooCommerce 3.3.3
assets/js/yith_magnifier.js CHANGED
@@ -168,6 +168,8 @@
168
  slider: 'carouFredSel',
169
  sliderOptions: {},
170
 
 
 
171
  onLoad: function () {
172
  return false;
173
  },
@@ -241,6 +243,8 @@
241
  gallery.on('click', function (e) {
242
  e.preventDefault();
243
 
 
 
244
  var t = $(this);
245
  self.destroy();
246
 
@@ -319,25 +323,71 @@
319
  self.zoom.wrap('<div class="' + zoom_wrap_css_class + '"></div>');
320
 
321
  self.IMG_zoomImage = new Image();
322
- self.IMG_zoomImage.src = self.zoom.attr('href');
323
 
324
- self.IMG_smallImage = new Image();
325
- self.IMG_smallImage.src = self.zoomImage.attr('src');
326
 
327
- if ($.browser && $.browser.msie && $.browser.version == 8) {
328
- $(self.IMG_zoomImage).load(function () {
 
 
329
 
330
- self._initTrap();
331
- });
332
- } else {
 
 
 
 
 
 
 
 
 
 
333
 
334
- $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
 
335
 
336
- self._initTrap();
 
 
 
 
 
 
 
 
 
 
 
 
337
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  }
339
 
340
- $(document).trigger('yith_magnifier_after_init_zoom')
341
  },
342
 
343
  /**
168
  slider: 'carouFredSel',
169
  sliderOptions: {},
170
 
171
+ from_gallery : 'no',
172
+
173
  onLoad: function () {
174
  return false;
175
  },
243
  gallery.on('click', function (e) {
244
  e.preventDefault();
245
 
246
+ self.options.from_gallery = 'yes';
247
+
248
  var t = $(this);
249
  self.destroy();
250
 
323
  self.zoom.wrap('<div class="' + zoom_wrap_css_class + '"></div>');
324
 
325
  self.IMG_zoomImage = new Image();
 
326
 
327
+ var product_id = $( '.woocommerce-variation-add-to-cart .variation_id' ).val();
328
+ if ( $.isNumeric( product_id ) && product_id != 0 && self.options.from_gallery == 'no' ){
329
 
330
+ var data = {
331
+ action : 'yith_wc_zoom_magnifier_get_main_image',
332
+ product_id : product_id,
333
+ }
334
 
335
+ $.ajax({
336
+ data : data,
337
+ url : yith_wc_zoom_magnifier_storage_object.ajax_url,
338
+ type : 'post',
339
+ error : function ( response ) {
340
+ console.log( 'ERROR - Yith_WC_Zoom_Magnifier' );
341
+ console.log( response );
342
+ },
343
+ success : function ( response ) {
344
+ self.IMG_zoomImage.src = response.url;
345
+
346
+ self.IMG_smallImage = new Image();
347
+ self.IMG_smallImage.src = self.zoomImage.attr('src');
348
 
349
+ if ($.browser && $.browser.msie && $.browser.version == 8) {
350
+ $(self.IMG_zoomImage).load(function () {
351
 
352
+ self._initTrap();
353
+ });
354
+ } else {
355
+
356
+ $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
357
+
358
+ self._initTrap();
359
+ });
360
+ }
361
+
362
+ $(document).trigger('yith_magnifier_after_init_zoom')
363
+
364
+ }
365
  });
366
+
367
+ }
368
+ else{
369
+ self.IMG_zoomImage.src = self.zoom.attr('href');
370
+
371
+ self.IMG_smallImage = new Image();
372
+ self.IMG_smallImage.src = self.zoomImage.attr('src');
373
+
374
+ if ($.browser && $.browser.msie && $.browser.version == 8) {
375
+ $(self.IMG_zoomImage).load(function () {
376
+
377
+ self._initTrap();
378
+ });
379
+ } else {
380
+
381
+ $([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
382
+
383
+ self._initTrap();
384
+ });
385
+ }
386
+
387
+ $(document).trigger('yith_magnifier_after_init_zoom')
388
+
389
  }
390
 
 
391
  },
392
 
393
  /**
assets/js/yith_magnifier.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b,c){"use strict";b.fn.imagesLoaded===c&&!function(a,b){var c="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";a.fn.imagesLoaded=function(d){function l(){var b=a(j),c=a(k);f&&(k.length?f.reject(h,b,c):f.resolve(h)),a.isFunction(d)&&d.call(e,h,b,c)}function m(a){n(a.target,"error"===a.type)}function n(b,d){b.src!==c&&a.inArray(b,i)===-1&&(i.push(b),d?k.push(b):j.push(b),a.data(b,"imagesLoaded",{isBroken:d,src:b.src}),g&&f.notifyWith(a(b),[d,h,a(j),a(k)]),h.length===i.length&&(setTimeout(l),h.unbind(".imagesLoaded",m)))}var e=this,f=a.isFunction(a.Deferred)?a.Deferred():0,g=a.isFunction(f.notify),h=e.find("img").add(e.filter("img")),i=[],j=[],k=[];return a.isPlainObject(d)&&a.each(d,function(a,b){"callback"===a?d=b:f&&f[a](b)}),h.length?h.bind("load.imagesLoaded error.imagesLoaded",m).each(function(d,e){var f=e.src,g=a.data(e,"imagesLoaded");return g&&g.src===f?void n(e,g.isBroken):e.complete&&e.naturalWidth!==b?void n(e,0===e.naturalWidth||0===e.naturalHeight):void((e.readyState||e.complete)&&(e.src=c,e.src=f))}):l(),f?f.promise(e):e}}(jQuery),b.yith_magnifier=function(a,c){this.t=c,this.element=b(c),this._init(a)},b.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:b(".yith_magnifier_zoom"),zoomImage:b(".yith_magnifier_zoom img").first(),gallery:b(".yith_magnifier_gallery li a")}},b.yith_magnifier.prototype={_init:function(a){var c=this;b(document).trigger("yith_magnifier_before_init"),b.each(b.yith_magnifier.defaults.elements,function(a,d){var e=b.yith_magnifier.defaults.elements;e[a]=b(d,c)}),c.options=b.extend(!0,{},b.yith_magnifier.defaults,a),c.isPhone=c._isPhone(),c._loading(),c.element.imagesLoaded(function(){c.options.onLoad(),c._initZoom(),c._initGallery()}),b(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var a=this,c=a.options.elements,d=c.gallery,e=c.zoom,f=c.zoomImage;d.length>0?(d.on("click",function(c){c.preventDefault();var d=b(this);a.destroy(),e.attr("href",this.href),f.attr("src",d.data("small")).attr("srcset",d.data("small")).attr("src-orig",d.data("small")).attr("title","").attr("title",d.attr("title")),b.data(a.t,"yith_magnifier",new b.yith_magnifier(a.options,a.element))}),a.options.enableSlider&&(d.closest("ul").trigger("yith_magnifier_slider_destroy"),d.closest("ul")[a.options.slider](a.options.sliderOptions))):d.on("click",function(a){return a.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&b(document).on("contextmenu",function(a){return!1}),this.mouseTrap===c){var a=this.options.elements.zoom.width();this.options.loadingLabel&&b('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:a,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var a=this;a.zoom=a.options.elements.zoom,a.zoomImage=a.options.elements.zoomImage;var c="yith_magnifier_zoom_wrap";a.options.zoom_wrap_additional_css&&(b("."+c).length||(c+=" "+a.options.zoom_wrap_additional_css)),a.zoom.wrap('<div class="'+c+'"></div>'),a.IMG_zoomImage=new Image,a.IMG_zoomImage.src=a.zoom.attr("href"),a.IMG_smallImage=new Image,a.IMG_smallImage.src=a.zoomImage.attr("src"),b.browser&&b.browser.msie&&8==b.browser.version?b(a.IMG_zoomImage).load(function(){a._initTrap()}):b([a.IMG_zoomImage,a.IMG_smallImage]).imagesLoaded(function(){a._initTrap()}),b(document).trigger("yith_magnifier_after_init_zoom")},_initTrap:function(){var a=this,c=a.IMG_zoomImage;a.IMG_smallImage;a.mx=0,a.my=0,a.controlTimer=0,a.lens=null,a.tint=null,a.softFocus=null,a.zoomDiv=null,a.cw=0,a.ch=0,a.zw=0,a.destU=0,a.destV=0,a.currU=0,a.currV=0,a.mouseTrap=null;var e=a.options.elements.zoom,f=a.options.elements.zoomImage;b(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=b('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var g="ontouchstart"in document.documentElement,h="touchmove mousemove",i="touchend mouseleave",j="touchstart mouseenter",k="touchstart click";this.mouseTrap.on(h,this,function(b){a.options.onMove(),a.mx="undefined"!=typeof b.originalEvent.touches?b.originalEvent.touches[0].pageX:b.pageX,a.my="undefined"!=typeof b.originalEvent.touches?b.originalEvent.touches[0].pageY:b.pageY}).on(i,this,function(b){return clearTimeout(a.controlTimer),a.lens&&a.lens.fadeOut(299),a.tint&&a.tint.fadeOut(299),a.softFocus&&a.softFocus.fadeOut(299),a.zoomDiv.fadeOut(300,function(){a._onLeave()}),!1}).on(k,this,function(b){a.options.onClick()}).on(j,this,function(d){a.options.onEnter(),g&&d.preventDefault(),a.mx="undefined"!=typeof d.originalEvent.touches?d.originalEvent.touches[0].pageX:d.pageX,a.my="undefined"!=typeof d.originalEvent.touches?d.originalEvent.touches[0].pageY:d.pageY,a.zw=d.data,a.zoomDiv&&(a.zoomDiv.stop(!0,!1),a.zoomDiv.remove());var h=a.options.adjustX,i=a.options.adjustY,j=f.outerWidth(),k=f.outerHeight(),l=a.options.zoomWidth,m=a.options.zoomHeight;"auto"==a.options.zoomWidth&&(l=j),"auto"==a.options.zoomHeight&&(m=k);var n=e.parent();switch(a.options.position){case"top":i-=m;break;case"right":h+=j;break;case"bottom":i+=k;break;case"left":h-=l;break;case"inside":l=j,m=k;break;default:n=b("#"+a.options.position),n.length?(l=n.innerWidth(),m=n.innerHeight()):(n=e,h+=j,i+=k)}a.isPhone&&"inside"==a.options.phoneBehavior&&(l=j,m=k,h=0,i=0),a.zoomDiv=b('<div class="yith_magnifier_zoom_magnifier" />').css({left:h,top:i,width:l,height:m,"background-repeat":"no-repeat",backgroundImage:"url("+c.src+")"}).appendTo(n),f.attr("title")&&a.options.showTitle&&b('<div class="yith_magnifier_title">'+f.attr("title")+"</div>").appendTo(a.zoomDiv),a.isPhone?"disable"!=a.options.phoneBehavior?a.zoomDiv.fadeIn(500):a.lens.fadeOut(299):a.zoomDiv.fadeIn(500),a.lens&&(a.lens.remove(),a.lens=null),c.width<=1?a.cw=f.outerWidth()/c.naturalWidth*a.zoomDiv.width():a.cw=f.outerWidth()/c.width*a.zoomDiv.width(),c.height<=1?a.ch=f.outerHeight()/c.naturalHeight*a.zoomDiv.height():a.ch=f.outerHeight()/c.height*a.zoomDiv.height(),a.lens=b('<div class="yith_magnifier_lens" />').css({width:a.cw,height:a.ch}).appendTo(e),a.mouseTrap.css("cursor",a.lens.css("cursor"));var o=!1;a.options.tint&&(a.tint=b("<div />").css({display:"none",position:"absolute",left:0,top:0,width:f.outerWidth(),height:f.outerHeight(),backgroundColor:a.options.tint,opacity:a.options.tintOpacity}).appendTo(e),a.lens.append(b("<img />",{src:f.attr("src")})),o=!0,a.tint.fadeIn(500)),a.options.softFocus&&(a.softFocus=b("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:f.outerWidth(),height:f.outerHeight(),opacity:.5}).appendTo(e),a.softFocus.append(b("<img />",{src:f.attr("src")})),0==a.lens.find("img").length&&a.lens.append(b("<img />",{src:f.attr("src")})),o=!0,a.softFocus.fadeIn(500)),o||a.lens.css("opacity",a.options.lensOpacity),"inside"!==a.options.position&&a.lens.fadeIn(500),a.zw._controlLoop()})},_controlLoop:function(){var a=this;if(this.lens){var b=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,c=this.my-this.zoomImage.offset().top-.5*this.ch>>0;b<0?b=0:b>this.zoomImage.outerWidth()-this.cw&&(b=this.zoomImage.outerWidth()-this.cw),c<0?c=0:c>this.zoomImage.outerHeight()-this.ch&&(c=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:b-2,top:c-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-b+"px ",marginTop:-c+"px"}),this.IMG_zoomImage.width<=1?this.destU=b/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=b/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=c/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=c/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){a._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),this.element.find(".yith_magnifier_loading").length>0&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var a=navigator.userAgent.toLowerCase();return a.match(/iphone/i)||a.match(/ipod/i)||a.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&b(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},b.fn.yith_magnifier=function(a){if("string"==typeof a){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"yith_magnifier");return d?b.isFunction(d[a])&&"_"!==a.charAt(0)?void d[a].apply(d,c):void b.error("no such method '"+a+"' for yith_magnifier instance"):void b.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+a+"'")})}else this.each(function(){var c=b.data(this,"yith_magnifier");c?b.error("yith_magnifier already istantiated."):b.data(this,"yith_magnifier",new b.yith_magnifier(a,this))});return this}}(window,jQuery);
1
+ !function(t,d,i){"use strict";var u,p;d.fn.imagesLoaded===i&&(u=jQuery,p="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",u.fn.imagesLoaded=function(o){var e=this,n=u.isFunction(u.Deferred)?u.Deferred():0,s=u.isFunction(n.notify),a=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var t=u(m),i=u(h);n&&(h.length?n.reject(a,t,i):n.resolve(a)),u.isFunction(o)&&o.call(e,a,t,i)}function c(t){g(t.target,"error"===t.type)}function g(t,i){t.src!==p&&-1===u.inArray(t,r)&&(r.push(t),i?h.push(t):m.push(t),u.data(t,"imagesLoaded",{isBroken:i,src:t.src}),s&&n.notifyWith(u(t),[i,a,u(m),u(h)]),a.length===r.length&&(setTimeout(l),a.unbind(".imagesLoaded",c)))}return u.isPlainObject(o)&&u.each(o,function(t,i){"callback"===t?o=i:n&&n[t](i)}),a.length?a.bind("load.imagesLoaded error.imagesLoaded",c).each(function(t,i){var o=i.src,e=u.data(i,"imagesLoaded");e&&e.src===o?g(i,e.isBroken):i.complete&&void 0!==i.naturalWidth?g(i,0===i.naturalWidth||0===i.naturalHeight):(i.readyState||i.complete)&&(i.src=p,i.src=o)}):l(),n?n.promise(e):e}),d.yith_magnifier=function(t,i){this.t=i,this.element=d(i),this._init(t)},d.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:d(".yith_magnifier_zoom"),zoomImage:d(".yith_magnifier_zoom img").first(),gallery:d(".yith_magnifier_gallery li a")}},d.yith_magnifier.prototype={_init:function(t){var o=this;d(document).trigger("yith_magnifier_before_init"),d.each(d.yith_magnifier.defaults.elements,function(t,i){d.yith_magnifier.defaults.elements[t]=d(i,o)}),o.options=d.extend(!0,{},d.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),d(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var o=this,t=o.options.elements,i=t.gallery,e=t.zoom,n=t.zoomImage;0<i.length?(i.on("click",function(t){t.preventDefault(),d("#yith_wc_zoom_magnifier_click_on_gallery").val("yes");var i=d(this);o.destroy(),e.attr("href",this.href),n.attr("src",i.data("small")).attr("srcset",i.data("small")).attr("src-orig",i.data("small")).attr("title","").attr("title",i.attr("title")),d.data(o.t,"yith_magnifier",new d.yith_magnifier(o.options,o.element))}),o.options.enableSlider&&(i.closest("ul").trigger("yith_magnifier_slider_destroy"),i.closest("ul")[o.options.slider](o.options.sliderOptions))):i.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&d(document).on("contextmenu",function(t){return!1}),this.mouseTrap===i){var t=this.options.elements.zoom.width();this.options.loadingLabel&&d('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var i=this;i.zoom=i.options.elements.zoom,i.zoomImage=i.options.elements.zoomImage;var t="yith_magnifier_zoom_wrap";i.options.zoom_wrap_additional_css&&(d("."+t).length||(t+=" "+i.options.zoom_wrap_additional_css)),i.zoom.wrap('<div class="'+t+'"></div>'),i.IMG_zoomImage=new Image;var o=!0;d("#yith_wc_zoom_magnifier_click_on_gallery").length&&"yes"==d("#yith_wc_zoom_magnifier_click_on_gallery").val()&&(d("#yith_wc_zoom_magnifier_click_on_gallery").val("no"),o=!1);var e=d(".woocommerce-variation-add-to-cart .variation_id").val();if(d.isNumeric(e)&&0!=e&&o){var n={action:"yith_wc_zoom_magnifier_get_main_image",product_id:e};d.ajax({data:n,url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t)},success:function(t){i.IMG_zoomImage.src=t.url,i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")}})}else i.IMG_zoomImage.src=i.zoom.attr("href"),i.IMG_smallImage=new Image,i.IMG_smallImage.src=i.zoomImage.attr("src"),d.browser&&d.browser.msie&&8==d.browser.version?d(i.IMG_zoomImage).load(function(){i._initTrap()}):d([i.IMG_zoomImage,i.IMG_smallImage]).imagesLoaded(function(){i._initTrap()}),d(document).trigger("yith_magnifier_after_init_zoom")},_initTrap:function(){var h=this,l=h.IMG_zoomImage;h.IMG_smallImage;h.mx=0,h.my=0,h.controlTimer=0,h.lens=null,h.tint=null,h.softFocus=null,h.zoomDiv=null,h.cw=0,h.ch=0,h.zw=0,h.destU=0,h.destV=0,h.currU=0,h.currV=0,h.mouseTrap=null;var c=h.options.elements.zoom,g=h.options.elements.zoomImage;d(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=d('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(c.parent());var u="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(t){h.options.onMove(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY}).on("touchend mouseleave",this,function(t){return clearTimeout(h.controlTimer),h.lens&&h.lens.fadeOut(299),h.tint&&h.tint.fadeOut(299),h.softFocus&&h.softFocus.fadeOut(299),h.zoomDiv.fadeOut(300,function(){h._onLeave()}),!1}).on("touchstart click",this,function(t){h.options.onClick()}).on("touchstart mouseenter",this,function(t){h.options.onEnter(),u&&t.preventDefault(),h.mx=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX,h.my=void 0!==t.originalEvent.touches?t.originalEvent.touches[0].pageY:t.pageY,h.zw=t.data,h.zoomDiv&&(h.zoomDiv.stop(!0,!1),h.zoomDiv.remove());var i=h.options.adjustX,o=h.options.adjustY,e=g.outerWidth(),n=g.outerHeight(),s=h.options.zoomWidth,a=h.options.zoomHeight;"auto"==h.options.zoomWidth&&(s=e),"auto"==h.options.zoomHeight&&(a=n);var r=c.parent();switch(h.options.position){case"top":o-=a;break;case"right":i+=e;break;case"bottom":o+=n;break;case"left":i-=s;break;case"inside":s=e,a=n;break;default:(r=d("#"+h.options.position)).length?(s=r.innerWidth(),a=r.innerHeight()):(r=c,i+=e,o+=n)}h.isPhone&&"inside"==h.options.phoneBehavior&&(s=e,a=n,o=i=0),h.zoomDiv=d('<div class="yith_magnifier_zoom_magnifier" />').css({left:i,top:o,width:s,height:a,"background-repeat":"no-repeat",backgroundImage:"url("+l.src+")"}).appendTo(r),g.attr("title")&&h.options.showTitle&&d('<div class="yith_magnifier_title">'+g.attr("title")+"</div>").appendTo(h.zoomDiv),h.isPhone?"disable"!=h.options.phoneBehavior?h.zoomDiv.fadeIn(500):h.lens.fadeOut(299):h.zoomDiv.fadeIn(500),h.lens&&(h.lens.remove(),h.lens=null),l.width<=1?h.cw=g.outerWidth()/l.naturalWidth*h.zoomDiv.width():h.cw=g.outerWidth()/l.width*h.zoomDiv.width(),l.height<=1?h.ch=g.outerHeight()/l.naturalHeight*h.zoomDiv.height():h.ch=g.outerHeight()/l.height*h.zoomDiv.height(),h.lens=d('<div class="yith_magnifier_lens" />').css({width:h.cw,height:h.ch}).appendTo(c),h.mouseTrap.css("cursor",h.lens.css("cursor"));var m=!1;h.options.tint&&(h.tint=d("<div />").css({display:"none",position:"absolute",left:0,top:0,width:g.outerWidth(),height:g.outerHeight(),backgroundColor:h.options.tint,opacity:h.options.tintOpacity}).appendTo(c),h.lens.append(d("<img />",{src:g.attr("src")})),m=!0,h.tint.fadeIn(500)),h.options.softFocus&&(h.softFocus=d("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:g.outerWidth(),height:g.outerHeight(),opacity:.5}).appendTo(c),h.softFocus.append(d("<img />",{src:g.attr("src")})),0==h.lens.find("img").length&&h.lens.append(d("<img />",{src:g.attr("src")})),m=!0,h.softFocus.fadeIn(500)),m||h.lens.css("opacity",h.options.lensOpacity),"inside"!==h.options.position&&h.lens.fadeIn(500),h.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;i<0?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),o<0?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.IMG_zoomImage.width<=1?this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+-(this.currV>>0)+"px")}this.controlTimer=setTimeout(function(){t._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&d(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},d.fn.yith_magnifier=function(i){if("string"==typeof i){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var t=d.data(this,"yith_magnifier");t?d.isFunction(t[i])&&"_"!==i.charAt(0)?t[i].apply(t,o):d.error("no such method '"+i+"' for yith_magnifier instance"):d.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+i+"'")})}else this.each(function(){d.data(this,"yith_magnifier")?d.error("yith_magnifier already istantiated."):d.data(this,"yith_magnifier",new d.yith_magnifier(i,this))});return this}}(window,jQuery);
class.yith-wcmg-frontend.php CHANGED
@@ -28,11 +28,12 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
28
  * @since 1.0.0
29
  */
30
  public function __construct() {
31
-
32
  // add the action only when the loop is initializate
33
  add_action ( 'template_redirect', array( $this, 'render' ) );
 
34
  }
35
-
36
  public function render() {
37
  if ( yith_wcmg_is_enabled () && ! apply_filters ( 'yith_wczm_featured_video_enabled', false ) ) {
38
  //change the templates
@@ -107,6 +108,10 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
107
  array( 'jquery' ),
108
  YITH_YWZM_VERSION,
109
  true );
 
 
 
 
110
 
111
  wp_register_script ( 'ywzm_frontend',
112
  YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'ywzm_frontend.js' ),
28
  * @since 1.0.0
29
  */
30
  public function __construct() {
31
+
32
  // add the action only when the loop is initializate
33
  add_action ( 'template_redirect', array( $this, 'render' ) );
34
+
35
  }
36
+
37
  public function render() {
38
  if ( yith_wcmg_is_enabled () && ! apply_filters ( 'yith_wczm_featured_video_enabled', false ) ) {
39
  //change the templates
108
  array( 'jquery' ),
109
  YITH_YWZM_VERSION,
110
  true );
111
+
112
+ wp_localize_script( 'ywzm-magnifier', 'yith_wc_zoom_magnifier_storage_object', apply_filters( 'yith_wc_zoom_magnifier_front_magnifier_localize', array(
113
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
114
+ ) ) );
115
 
116
  wp_register_script ( 'ywzm_frontend',
117
  YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'ywzm_frontend.js' ),
init.php CHANGED
@@ -3,17 +3,17 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: https://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.3.2
7
  * Author: YITHEMES
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 3.3.x
13
  *
14
  * @author Your Inspiration Themes
15
  * @package YITH WooCommerce Magnifier
16
- * @version 1.3.2
17
  */
18
  /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
@@ -35,8 +35,10 @@ if ( ! defined ( 'ABSPATH' ) ) {
35
  exit;
36
  } // Exit if accessed directly
37
 
38
- if ( ! function_exists ( 'is_plugin_active' ) ) {
39
- require_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
 
 
40
  }
41
 
42
  if ( ! function_exists ( 'yith_ywzm_install_woocommerce_admin_notice' ) ) {
@@ -78,7 +80,7 @@ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
78
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
79
 
80
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
81
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.2' );
82
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
83
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
84
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
@@ -148,7 +150,17 @@ if ( ! function_exists ( 'yith_ywzm_install' ) ) {
148
  } else {
149
  do_action ( 'yith_ywzm_init' );
150
  }
 
151
  }
152
  }
153
 
154
- add_action ( 'plugins_loaded', 'yith_ywzm_install', 11 );
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: https://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.3.3
7
  * Author: YITHEMES
8
  * Author URI: https://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
10
  * Domain Path: /languages/
11
  * WC requires at least: 3.0.0
12
+ * WC tested up to: 3.4.x
13
  *
14
  * @author Your Inspiration Themes
15
  * @package YITH WooCommerce Magnifier
16
+ * @version 1.3.3
17
  */
18
  /* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
19
 
35
  exit;
36
  } // Exit if accessed directly
37
 
38
+ if ( ! function_exists( 'is_plugin_active' ) ) {
39
+ if ( ! function_exists( 'get_plugin_data' ) ) {
40
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
41
+ }
42
  }
43
 
44
  if ( ! function_exists ( 'yith_ywzm_install_woocommerce_admin_notice' ) ) {
80
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
81
 
82
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
83
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.3' );
84
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
85
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
86
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
150
  } else {
151
  do_action ( 'yith_ywzm_init' );
152
  }
153
+
154
  }
155
  }
156
 
157
+ add_action ( 'plugins_loaded', 'yith_ywzm_install', 11 );
158
+
159
+ /*add_action( 'wp_ajax_nopriv_yith_wc_zoom_magnifier_get_main_image', 'test', 10 );
160
+
161
+ add_action( 'wp_ajax_yith_wc_zoom_magnifier_get_main_image', 'test', 10 );
162
+
163
+ function test(){
164
+
165
+ error_log( 'testing -> ' . print_r( 'test yeaaaaaaaah', true ) );
166
+ }*/
lib/class.yith-woocommerce-zoom-magnifier.php CHANGED
@@ -40,6 +40,16 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
40
  return;
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
43
  // actions
44
  add_action( 'init', array( $this, 'init' ) );
45
 
@@ -52,6 +62,25 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
52
  return $this->obj;
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  /**
57
  * Init method:
40
  return;
41
  }
42
 
43
+ add_action( 'wp_ajax_nopriv_yith_wc_zoom_magnifier_get_main_image', array(
44
+ $this,
45
+ 'yith_wc_zoom_magnifier_get_main_image_call_back'
46
+ ), 10 );
47
+
48
+ add_action( 'wp_ajax_yith_wc_zoom_magnifier_get_main_image', array(
49
+ $this,
50
+ 'yith_wc_zoom_magnifier_get_main_image_call_back'
51
+ ), 10 );
52
+
53
  // actions
54
  add_action( 'init', array( $this, 'init' ) );
55
 
62
  return $this->obj;
63
  }
64
 
65
+ /**
66
+ * Ajax method to retrieve the product main imavge
67
+ *
68
+ * @access public
69
+ * @author Daniel Sanchez Saez
70
+ * @since 1.3.3
71
+ */
72
+ public function yith_wc_zoom_magnifier_get_main_image_call_back(){
73
+
74
+ $product_id = ( isset( $_POST[ 'product_id' ] ) ? $_POST[ 'product_id' ] : 0 );
75
+
76
+ $url = wp_get_attachment_image_src ( get_post_thumbnail_id ( $product_id ), "full" );
77
+
78
+ $response = array(
79
+ "url" => $url[ 0 ],
80
+ );
81
+ wp_send_json( $response );
82
+
83
+ }
84
 
85
  /**
86
  * Init method:
lib/class.yith-ywzm-plugin-fw-loader.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
33
  /**
34
  * @var string Plugin official documentation
35
  */
36
- protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith-woocommerce-zoom-magnifier/';
37
 
38
  /**
39
  * @var string Plugin panel page
33
  /**
34
  * @var string Plugin official documentation
35
  */
36
+ protected $_official_documentation = 'https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/';
37
 
38
  /**
39
  * @var string Plugin panel page
plugin-fw/assets/css/yith-fields.css CHANGED
@@ -7,6 +7,11 @@
7
  clear : both;
8
  }
9
 
 
 
 
 
 
10
  .yith-disabled {
11
  opacity : 0.3;
12
  pointer-events : none;
@@ -187,6 +192,10 @@ ul.yit-icons-manager-list li.active {
187
  }
188
 
189
  /* ------- OnOff ------- */
 
 
 
 
190
  .yith-plugin-fw-onoff-container input {
191
  display : none;
192
  }
7
  clear : both;
8
  }
9
 
10
+ .yith-plugin-fw span.description.inline {
11
+ display : inline-block;
12
+ margin : 0 0 0 5px;
13
+ }
14
+
15
  .yith-disabled {
16
  opacity : 0.3;
17
  pointer-events : none;
192
  }
193
 
194
  /* ------- OnOff ------- */
195
+ .yith-plugin-fw-onoff-container {
196
+ display : inline-block;
197
+ }
198
+
199
  .yith-plugin-fw-onoff-container input {
200
  display : none;
201
  }
plugin-fw/assets/js/multisite-updater.js CHANGED
@@ -6,18 +6,18 @@
6
  * It is also available through the world-wide-web at this URL:
7
  * http://www.gnu.org/licenses/gpl-3.0.txt
8
  */
9
- (function ($) {
10
 
11
- var plugins_menu_item = $( '#menu-plugins' ),
12
- update = plugins_menu_item.find('.update-plugins'),
13
- count = update.find(".update-count").text(),
14
- registered = plugins.registered,
15
- activated = plugins.activated;
16
 
17
- if( count == 0 || count == ''){
18
  var update_row = '<span class="update-plugins"><span class="plugin-count"></span></span>';
19
- count = 0;
20
- plugins_menu_item.find( '.wp-menu-name').append( update_row );
21
  }
22
 
23
  /**
@@ -38,51 +38,47 @@
38
  *
39
  * @return void
40
  */
41
- function update_plugins_row( registered, activated, count, localize ){
42
- for( var init in registered ){
43
- var plugin = registered[init];
44
- for( var headers in plugin ){
45
 
46
- if( headers == 'slug' || version_compare( plugin[headers].Version, plugin[headers].Latest, '>=' ) ) {
47
  continue;
48
  }
49
 
50
- count = parseInt(count) + 1;
51
- $(".plugin-count").empty().html(count);
52
 
53
- var regex = new RegExp(' ', 'g'),
54
- info = plugin[headers],
55
- name = '' + info.Name,
56
- id = name.replace(regex, '-').trim(),
57
- row = '*[data-slug="' + id.toLowerCase() +'"]';
58
 
59
- $(row).addClass("update");
60
 
61
  var html = '<tr class="plugin-update-tr">' +
62
- '<td colspan="3" class="plugin-update colspanchange">' +
63
- '<div class="update-message">' + localize.strings.new_version.replace( '%plugin_name%', name ) +
64
- '<a class="thickbox" href="' + localize.details_url[init] + '">' + localize.strings.latest.replace( '%latest%', plugin[headers].Latest ) + '</a>';
65
 
66
- if( typeof activated[init] == "undefined" ) {
67
 
68
  html = html +
69
- ' <em>' + localize.strings.unavailable + '</em>' +
70
- localize.strings.activate.replace( '%activate_link%', localize.licence_activation_url ).replace( '%plugin_name%', name );
71
  } else {
72
  html = html +
73
- '. <a href="' + localize.update_url[init] + '">' + localize.strings.update_now + '</a>';
74
- }
75
-
76
- if( typeof localize.changelogs[init] != 'undefined' ){
77
- html = html + localize.changelogs[init];
78
  }
79
 
80
  html = html +
81
- '</div>' +
82
- '</td>' +
83
- '</tr>';
84
 
85
- $(html).insertAfter(row);
86
  }
87
  }
88
  }
@@ -96,7 +92,7 @@
96
  *
97
  * @see php.js library http://phpjs.org/
98
  */
99
- function version_compare(v1, v2, operator) {
100
  // discuss at: http://phpjs.org/functions/version_compare/
101
  // original by: Philippe Jausions (http://pear.php.net/user/jausions)
102
  // original by: Aidan Lister (http://aidanlister.com/)
@@ -113,21 +109,21 @@
113
  // example 4: version_compare('4.1.0.52','4.01.0.51');
114
  // returns 4: 1
115
 
116
- this.php_js = this.php_js || {};
117
  this.php_js.ENV = this.php_js.ENV || {};
118
  // END REDUNDANT
119
  // Important: compare must be initialized at 0.
120
- var i = 0,
121
- x = 0,
122
- compare = 0,
123
- // vm maps textual PHP versions to negatives so they're less than 0.
124
- // PHP currently defines these as CASE-SENSITIVE. It is important to
125
- // leave these as negatives so that they can come before numerical versions
126
- // and as if no letters were there to begin with.
127
- // (1alpha is < 1 and < 1.1 but > 1dev1)
128
- // If a non-numerical value can't be mapped to this table, it receives
129
- // -7 as its value.
130
- vm = {
131
  'dev' : -6,
132
  'alpha': -5,
133
  'a' : -5,
@@ -139,54 +135,54 @@
139
  'p' : 1,
140
  'pl' : 1
141
  },
142
- // This function will be called to prepare each version argument.
143
- // It replaces every _, -, and + with a dot.
144
- // It surrounds any nonsequence of numbers/dots with dots.
145
- // It replaces sequences of dots with a single dot.
146
- // version_compare('4..0', '4.0') == 0
147
- // Important: A string of 0 length needs to be converted into a value
148
- // even less than an unexisting value in vm (-7), hence [-8].
149
- // It's also important to not strip spaces because of this.
150
- // version_compare('', ' ') == 1
151
- prepVersion = function (v) {
152
  v = ('' + v)
153
- .replace(/[_\-+]/g, '.');
154
- v = v.replace(/([^.\d]+)/g, '.$1.')
155
- .replace(/\.{2,}/g, '.');
156
- return (!v.length ? [-8] : v.split('.'));
157
  };
158
  // This converts a version component to a number.
159
  // Empty component becomes 0.
160
  // Non-numerical component becomes a negative number.
161
  // Numerical component becomes itself as an integer.
162
- numVersion = function (v) {
163
- return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10));
164
  };
165
- v1 = prepVersion(v1);
166
- v2 = prepVersion(v2);
167
- x = Math.max(v1.length, v2.length);
168
- for (i = 0; i < x; i++) {
169
- if (v1[i] == v2[i]) {
170
  continue;
171
  }
172
- v1[i] = numVersion(v1[i]);
173
- v2[i] = numVersion(v2[i]);
174
- if (v1[i] < v2[i]) {
175
  compare = -1;
176
  break;
177
- } else if (v1[i] > v2[i]) {
178
  compare = 1;
179
  break;
180
  }
181
  }
182
- if (!operator) {
183
  return compare;
184
  }
185
 
186
  // Important: operator is CASE-SENSITIVE.
187
  // "No operator" seems to be treated as "<."
188
  // Any other values seem to make the function return null.
189
- switch (operator) {
190
  case '>':
191
  case 'gt':
192
  return (compare > 0);
@@ -217,6 +213,6 @@
217
  $( 'body' ).on( 'click', '.yit-changelog-button', function () {
218
  $( '#TB_window' ).remove();
219
  } );
220
-
221
 
222
- })(jQuery);
 
6
  * It is also available through the world-wide-web at this URL:
7
  * http://www.gnu.org/licenses/gpl-3.0.txt
8
  */
9
+ (function ( $ ) {
10
 
11
+ var plugins_menu_item = $( '#menu-plugins' ),
12
+ update = plugins_menu_item.find( '.update-plugins' ),
13
+ count = update.find( ".update-count" ).text(),
14
+ registered = plugins.registered,
15
+ activated = plugins.activated;
16
 
17
+ if ( count == 0 || count == '' ) {
18
  var update_row = '<span class="update-plugins"><span class="plugin-count"></span></span>';
19
+ count = 0;
20
+ plugins_menu_item.find( '.wp-menu-name' ).append( update_row );
21
  }
22
 
23
  /**
38
  *
39
  * @return void
40
  */
41
+ function update_plugins_row( registered, activated, count, localize ) {
42
+ for ( var init in registered ) {
43
+ var plugin = registered[ init ];
44
+ for ( var headers in plugin ) {
45
 
46
+ if ( headers == 'slug' || version_compare( plugin[ headers ].Version, plugin[ headers ].Latest, '>=' ) ) {
47
  continue;
48
  }
49
 
50
+ count = parseInt( count ) + 1;
51
+ $( ".plugin-count" ).empty().html( count );
52
 
53
+ var regex = new RegExp( ' ', 'g' ),
54
+ info = plugin[ headers ],
55
+ name = '' + info.Name,
56
+ id = name.replace( regex, '-' ).trim(),
57
+ row = '*[data-slug="' + id.toLowerCase() + '"]';
58
 
59
+ $( row ).addClass( "update" );
60
 
61
  var html = '<tr class="plugin-update-tr">' +
62
+ '<td colspan="3" class="plugin-update colspanchange">' +
63
+ '<div class="update-message">' + localize.strings.new_version.replace( '%plugin_name%', name ) +
64
+ '<a class="thickbox open-plugin-details-modal" href="' + localize.details_url[ init ] + '">' + localize.strings.latest.replace( '%latest%', plugin[ headers ].Latest ) + '</a>';
65
 
66
+ if ( typeof activated[ init ] == "undefined" ) {
67
 
68
  html = html +
69
+ ' <em>' + localize.strings.unavailable + '</em>' +
70
+ localize.strings.activate.replace( '%activate_link%', localize.licence_activation_url ).replace( '%plugin_name%', name );
71
  } else {
72
  html = html +
73
+ '. <a href="' + localize.update_url[ init ] + '">' + localize.strings.update_now + '</a>';
 
 
 
 
74
  }
75
 
76
  html = html +
77
+ '</div>' +
78
+ '</td>' +
79
+ '</tr>';
80
 
81
+ $( html ).insertAfter( row );
82
  }
83
  }
84
  }
92
  *
93
  * @see php.js library http://phpjs.org/
94
  */
95
+ function version_compare( v1, v2, operator ) {
96
  // discuss at: http://phpjs.org/functions/version_compare/
97
  // original by: Philippe Jausions (http://pear.php.net/user/jausions)
98
  // original by: Aidan Lister (http://aidanlister.com/)
109
  // example 4: version_compare('4.1.0.52','4.01.0.51');
110
  // returns 4: 1
111
 
112
+ this.php_js = this.php_js || {};
113
  this.php_js.ENV = this.php_js.ENV || {};
114
  // END REDUNDANT
115
  // Important: compare must be initialized at 0.
116
+ var i = 0,
117
+ x = 0,
118
+ compare = 0,
119
+ // vm maps textual PHP versions to negatives so they're less than 0.
120
+ // PHP currently defines these as CASE-SENSITIVE. It is important to
121
+ // leave these as negatives so that they can come before numerical versions
122
+ // and as if no letters were there to begin with.
123
+ // (1alpha is < 1 and < 1.1 but > 1dev1)
124
+ // If a non-numerical value can't be mapped to this table, it receives
125
+ // -7 as its value.
126
+ vm = {
127
  'dev' : -6,
128
  'alpha': -5,
129
  'a' : -5,
135
  'p' : 1,
136
  'pl' : 1
137
  },
138
+ // This function will be called to prepare each version argument.
139
+ // It replaces every _, -, and + with a dot.
140
+ // It surrounds any nonsequence of numbers/dots with dots.
141
+ // It replaces sequences of dots with a single dot.
142
+ // version_compare('4..0', '4.0') == 0
143
+ // Important: A string of 0 length needs to be converted into a value
144
+ // even less than an unexisting value in vm (-7), hence [-8].
145
+ // It's also important to not strip spaces because of this.
146
+ // version_compare('', ' ') == 1
147
+ prepVersion = function ( v ) {
148
  v = ('' + v)
149
+ .replace( /[_\-+]/g, '.' );
150
+ v = v.replace( /([^.\d]+)/g, '.$1.' )
151
+ .replace( /\.{2,}/g, '.' );
152
+ return (!v.length ? [ -8 ] : v.split( '.' ));
153
  };
154
  // This converts a version component to a number.
155
  // Empty component becomes 0.
156
  // Non-numerical component becomes a negative number.
157
  // Numerical component becomes itself as an integer.
158
+ numVersion = function ( v ) {
159
+ return !v ? 0 : (isNaN( v ) ? vm[ v ] || -7 : parseInt( v, 10 ));
160
  };
161
+ v1 = prepVersion( v1 );
162
+ v2 = prepVersion( v2 );
163
+ x = Math.max( v1.length, v2.length );
164
+ for ( i = 0; i < x; i++ ) {
165
+ if ( v1[ i ] == v2[ i ] ) {
166
  continue;
167
  }
168
+ v1[ i ] = numVersion( v1[ i ] );
169
+ v2[ i ] = numVersion( v2[ i ] );
170
+ if ( v1[ i ] < v2[ i ] ) {
171
  compare = -1;
172
  break;
173
+ } else if ( v1[ i ] > v2[ i ] ) {
174
  compare = 1;
175
  break;
176
  }
177
  }
178
+ if ( !operator ) {
179
  return compare;
180
  }
181
 
182
  // Important: operator is CASE-SENSITIVE.
183
  // "No operator" seems to be treated as "<."
184
  // Any other values seem to make the function return null.
185
+ switch ( operator ) {
186
  case '>':
187
  case 'gt':
188
  return (compare > 0);
213
  $( 'body' ).on( 'click', '.yit-changelog-button', function () {
214
  $( '#TB_window' ).remove();
215
  } );
 
216
 
217
+
218
+ })( jQuery );
plugin-fw/assets/js/multisite-updater.min.js CHANGED
@@ -1,4 +1,7 @@
1
- (function(e){function n(c,d,e){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var a=0,f=0,b=0,g={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},a=function(a){a=(""+a).replace(/[_\-+]/g,".");a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return a.length?a.split("."):[-8]};numVersion=function(a){return a?isNaN(a)?g[a]||-7:parseInt(a,10):0};c=a(c);d=a(d);f=Math.max(c.length,d.length);for(a=0;a<f;a++)if(c[a]!=d[a])if(c[a]=numVersion(c[a]),d[a]=numVersion(d[a]),
2
- c[a]<d[a]){b=-1;break}else if(c[a]>d[a]){b=1;break}if(!e)return b;switch(e){case ">":case "gt":return 0<b;case ">=":case "ge":return 0<=b;case "<=":case "le":return 0>=b;case "==":case "=":case "eq":return 0===b;case "<>":case "!=":case "ne":return 0!==b;case "":case "<":case "lt":return 0>b;default:return null}}var l=e("#menu-plugins"),h=l.find(".update-plugins").find(".update-count").text(),p=plugins.registered,q=plugins.activated;if(0==h||""==h)h=0,l.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>');
3
- (function(c,d,h,a){for(var f in c){var b=c[f],g;for(g in b)if("slug"!=g&&!n(b[g].Version,b[g].Latest,">=")){h=parseInt(h)+1;e(".plugin-count").empty().html(h);var m=""+b[g].Name,l='*[data-slug="'+m.replace(RegExp(" ","g"),"-").trim().toLowerCase()+'"]';e(l).addClass("update");var k='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+a.strings.new_version.replace("%plugin_name%",m)+'<a class="thickbox" href="'+a.details_url[f]+'">'+a.strings.latest.replace("%latest%",
4
- b[g].Latest)+"</a>",k="undefined"==typeof d[f]?k+" <em>"+a.strings.unavailable+"</em>"+a.strings.activate.replace("%activate_link%",a.licence_activation_url).replace("%plugin_name%",m):k+'. <a href="'+a.update_url[f]+'">'+a.strings.update_now+"</a>";"undefined"!=typeof a.changelogs[f]&&(k+=a.changelogs[f]);k+="</div></td></tr>";e(k).insertAfter(l)}}})(p,q,h,plugins);e("body").on("click",".yit-changelog-button",function(){e("#TB_window").remove()})})(jQuery);
 
 
 
1
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,f,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var h=a[e];if(f.call(b,h,e,a))return{i:e,v:h}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,b){a!=Array.prototype&&a!=Object.prototype&&(a[f]=b.value)};
2
+ $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,f,b,d){if(f){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];f=f(d);f!=d&&null!=f&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:f})}};
3
+ $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
4
+ (function(a){function f(a,b,d){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var c=0,f=0,g=0,e={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1};c=function(a){a=(""+a).replace(/[_\-+]/g,".");a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return a.length?a.split("."):[-8]};numVersion=function(a){return a?isNaN(a)?e[a]||-7:parseInt(a,10):0};a=c(a);b=c(b);f=Math.max(a.length,b.length);for(c=0;c<f;c++)if(a[c]!=b[c])if(a[c]=numVersion(a[c]),b[c]=numVersion(b[c]),
5
+ a[c]<b[c]){g=-1;break}else if(a[c]>b[c]){g=1;break}if(!d)return g;switch(d){case ">":case "gt":return 0<g;case ">=":case "ge":return 0<=g;case "<=":case "le":return 0>=g;case "==":case "=":case "eq":return 0===g;case "<>":case "!=":case "ne":return 0!==g;case "":case "<":case "lt":return 0>g;default:return null}}var b=a("#menu-plugins"),d=b.find(".update-plugins").find(".update-count").text(),e=plugins.registered,h=plugins.activated;if(0==d||""==d)d=0,b.find(".wp-menu-name").append('<span class="update-plugins"><span class="plugin-count"></span></span>');
6
+ (function(b,d,e,c){for(var h in b){var g=b[h],k;for(k in g)if("slug"!=k&&!f(g[k].Version,g[k].Latest,">=")){e=parseInt(e)+1;a(".plugin-count").empty().html(e);var m=""+g[k].Name,n='*[data-slug="'+m.replace(/ /g,"-").trim().toLowerCase()+'"]';a(n).addClass("update");var l='<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">'+c.strings.new_version.replace("%plugin_name%",m)+'<a class="thickbox open-plugin-details-modal" href="'+c.details_url[h]+
7
+ '">'+c.strings.latest.replace("%latest%",g[k].Latest)+"</a>";l="undefined"==typeof d[h]?l+" <em>"+c.strings.unavailable+"</em>"+c.strings.activate.replace("%activate_link%",c.licence_activation_url).replace("%plugin_name%",m):l+'. <a href="'+c.update_url[h]+'">'+c.strings.update_now+"</a>";l+="</div></td></tr>";a(l).insertAfter(n)}}})(e,h,d,plugins);a("body").on("click",".yit-changelog-button",function(){a("#TB_window").remove()})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.0.13
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
- * @version 3.0.13
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.0.16
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
8
  *
9
  * @author Your Inspiration Themes
10
+ * @version 3.0.16
11
  */
12
  /**
13
  * This file belongs to the YIT Plugin Framework.
plugin-fw/lib/privacy/yit-privacy-plugin-abstract.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
3
+
4
+ if ( !class_exists( 'YITH_Privacy_Plugin_Abstract' ) ) {
5
+ class YITH_Privacy_Plugin_Abstract {
6
+ private $_name;
7
+
8
+ public function __construct( $name ) {
9
+ $this->_name = $name;
10
+ $this->init();
11
+ }
12
+
13
+ protected function init() {
14
+ add_filter( 'yith_plugin_fw_privacy_guide_content', array( $this, 'add_message_in_section' ), 10, 2 );
15
+ }
16
+
17
+ public function add_message_in_section( $html, $section ) {
18
+ if ( $message = $this->get_privacy_message( $section ) ) {
19
+ $html .= "<p class='privacy-policy-tutorial'><strong>{$this->_name}</strong></p>";
20
+ $html .= $message;
21
+ }
22
+ return $html;
23
+ }
24
+
25
+ public function get_privacy_message( $section ) {
26
+ return '';
27
+ }
28
+ }
29
+ }
plugin-fw/lib/privacy/yit-privacy.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ !defined( 'ABSPATH' ) && exit; // Exit if accessed directly
3
+
4
+ if ( !class_exists( 'YITH_Privacy' ) ) {
5
+ /**
6
+ * Class YITH_Privacy
7
+ * Privacy Class
8
+ *
9
+ * @author Leanza Francesco <leanzafrancesco@gmail.com>
10
+ */
11
+ class YITH_Privacy {
12
+ private static $_instance;
13
+
14
+ private $_title;
15
+
16
+ public static function get_instance() {
17
+ return !is_null( self::$_instance ) ? self::$_instance : self::$_instance = new self();
18
+ }
19
+
20
+ /**
21
+ * YITH_Privacy constructor.
22
+ */
23
+ private function __construct() {
24
+ $this->_title = apply_filters( 'yith_plugin_fw_privacy_policy_guide_title', _x( 'YITH Plugins', 'Privacy Policy Guide Title', 'yith-plugin-fw' ) );
25
+ add_action( 'admin_init', array( $this, 'add_privacy_message' ) );
26
+ }
27
+
28
+ /**
29
+ * Adds the privacy message on YITH privacy page.
30
+ */
31
+ public function add_privacy_message() {
32
+ if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
33
+ $content = $this->get_privacy_message();
34
+
35
+ if ( $content ) {
36
+ wp_add_privacy_policy_content( $this->_title, $this->get_privacy_message() );
37
+ }
38
+ }
39
+ }
40
+
41
+ /**
42
+ * get the privacy message
43
+ *
44
+ * @return string
45
+ */
46
+ public function get_privacy_message() {
47
+ $privacy_content_path = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/privacy/html-policy-content.php';
48
+ ob_start();
49
+ $sections = $this->get_sections();
50
+ if ( file_exists( $privacy_content_path ) )
51
+ include $privacy_content_path;
52
+
53
+ return apply_filters( 'yith_wcbk_privacy_policy_content', ob_get_clean() );
54
+ }
55
+
56
+ public function get_sections() {
57
+ return apply_filters( 'yith_wcbk_privacy_policy_content_sections', array(
58
+ 'general' => array(
59
+ 'tutorial' => _x( 'This sample language includes the basics around what personal data your store may be collecting, storing and sharing, as well as who may have access to that data. Depending on what settings are enabled and which additional plugins are used, the specific information shared by your store will vary. We recommend consulting with a lawyer when deciding what information to disclose on your privacy policy.', 'Privacy Policy Content', 'yith-plugin-fw' ),
60
+ 'description' => '',
61
+ ),
62
+ 'collect_and_store' => array(
63
+ 'title' => _x( 'What we collect and store', 'Privacy Policy Content', 'yith-plugin-fw' )
64
+ ),
65
+ 'has_access' => array(
66
+ 'title' => _x( 'Who on our team has access', 'Privacy Policy Content', 'yith-plugin-fw' )
67
+ ),
68
+ 'share' => array(
69
+ 'title' => _x( 'What we share with others', 'Privacy Policy Content', 'yith-plugin-fw' ),
70
+ ),
71
+ 'payments' => array(
72
+ 'title' => _x( 'Payments', 'Privacy Policy Content', 'yith-plugin-fw' )
73
+ ),
74
+ ) );
75
+ }
76
+ }
77
+ }
78
+
79
+ YITH_Privacy::get_instance();
plugin-fw/lib/yit-metabox.php CHANGED
@@ -520,7 +520,11 @@ if ( !class_exists( 'YIT_Metabox' ) ) {
520
  if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
521
  update_post_meta( $post_id, $field[ 'id' ], '1' );
522
  } else {
523
- add_post_meta( $post_id, $field[ 'id' ], $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ], true ) || update_post_meta( $post_id, $field[ 'id' ], $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ] );
 
 
 
 
524
  }
525
  } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
526
  update_post_meta( $post_id, $field[ 'id' ], '0' );
520
  if ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
521
  update_post_meta( $post_id, $field[ 'id' ], '1' );
522
  } else {
523
+ $value = $_POST[ 'yit_metaboxes' ][ $field[ 'id' ] ];
524
+ if ( !empty( $field[ 'yith-sanitize-callback' ] ) && is_callable( $field[ 'yith-sanitize-callback' ] ) ) {
525
+ $value = call_user_func( $field[ 'yith-sanitize-callback' ], $value );
526
+ }
527
+ add_post_meta( $post_id, $field[ 'id' ], $value, true ) || update_post_meta( $post_id, $field[ 'id' ], $value );
528
  }
529
  } elseif ( in_array( $field[ 'type' ], array( 'onoff', 'checkbox' ) ) ) {
530
  update_post_meta( $post_id, $field[ 'id' ], '0' );
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -520,9 +520,13 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
520
  $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
521
  }
522
 
523
- if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'textarea-editor', 'textarea-codemirror' ) ) ) {
524
  $value = $raw_value;
525
  }
 
 
 
 
526
  }
527
 
528
  return $value;
520
  $value = yith_plugin_fw_is_true( $raw_value ) ? 'yes' : 'no';
521
  }
522
 
523
+ if ( isset( $option[ 'yith-type' ] ) && in_array( $option[ 'yith-type' ], array( 'textarea', 'textarea-editor', 'textarea-codemirror' ) ) ) {
524
  $value = $raw_value;
525
  }
526
+
527
+ if ( !empty( $option[ 'yith-sanitize-callback' ] ) && is_callable( $option[ 'yith-sanitize-callback' ] ) ) {
528
+ $value = call_user_func( $option[ 'yith-sanitize-callback' ], $value );
529
+ }
530
  }
531
 
532
  return $value;
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -274,6 +274,11 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
274
  if ( isset( $option[ 'type' ] ) && in_array( $option[ 'type' ], array( 'checkbox', 'onoff' ) ) ) {
275
  $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
276
  }
 
 
 
 
 
277
  $valid_input[ $option[ 'id' ] ] = $value;
278
  }
279
  }
274
  if ( isset( $option[ 'type' ] ) && in_array( $option[ 'type' ], array( 'checkbox', 'onoff' ) ) ) {
275
  $value = yith_plugin_fw_is_true( $value ) ? 'yes' : 'no';
276
  }
277
+
278
+ if ( !empty( $option[ 'yith-sanitize-callback' ] ) && is_callable( $option[ 'yith-sanitize-callback' ] ) ) {
279
+ $value = call_user_func( $option[ 'yith-sanitize-callback' ], $value );
280
+ }
281
+
282
  $valid_input[ $option[ 'id' ] ] = $value;
283
  }
284
  }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -62,6 +62,40 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
62
  $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
63
  add_filter( 'block_local_requests', '__return_false' );
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  /**
@@ -89,46 +123,49 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
89
  'slug' => $plugin_slug,
90
  );
91
 
92
- /* === HOOKS === */
93
- if ( !is_multisite() || is_plugin_active_for_network( $plugin_init ) ) {
94
- add_action( 'load-plugins.php', array( $this, 'remove_wp_plugin_update_row' ), 25 );
95
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
96
- } else if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
97
- $transient = 'yith_register_' . md5( $plugin_slug );
98
- if ( apply_filters( 'yith_register_delete_transient', false ) ) {
99
- delete_transient( $transient );
100
- }
101
- $info = get_transient( $transient );
102
- if ( false === $info || apply_filters( 'yith_register_delete_transient', false ) ) {
103
- $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
104
- $remote_xml = wp_remote_get( $xml );
105
-
106
- $error = false;
107
- if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] ) {
108
- $plugin_remote_info = @simplexml_load_string( $remote_xml[ 'body' ] );
109
- if ( $plugin_remote_info ) {
110
- $info[ 'Latest' ] = (string) $plugin_remote_info->latest;
111
- $info[ 'changelog' ] = (string) $plugin_remote_info->changelog;
112
  YIT_Plugin_Licence()->check( $plugin_slug, false );
113
- set_transient( $transient, $info, DAY_IN_SECONDS );
114
- } else {
115
- $error = true;
116
- error_log( sprintf( 'SimpleXML error in %s:%s [plugin slug: %s]',
117
- __FILE__, __FUNCTION__, $plugin_slug ) );
118
  }
 
119
  } else {
120
  $error = true;
 
 
121
  }
 
 
 
122
 
123
- if ( $error ) {
124
- // If error, set empty value in the transient to prevent multiple requests
125
- $info = array( 'Latest' => '', 'changelog' => '' );
126
- set_transient( $transient, $info, HOUR_IN_SECONDS );
127
- }
128
  }
 
 
 
 
129
 
130
- $this->_plugins[ $plugin_init ][ 'info' ][ 'Latest' ] = $info[ 'Latest' ];
131
- $this->_plugins[ $plugin_init ][ 'info' ][ 'changelog' ] = $info[ 'changelog' ];
 
 
 
132
  add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
133
  }
134
  }
@@ -142,7 +179,6 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
142
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
143
  */
144
  public function multisite_updater_script() {
145
-
146
  $update_url = $changelogs = $details_url = array();
147
  $strings = array(
148
  'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
@@ -155,10 +191,7 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
155
 
156
  foreach ( $this->_plugins as $init => $info ) {
157
  $update_url[ $init ] = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin-multisite&plugin=' ) . $init, 'upgrade-plugin-multisite_' . $init );
158
- $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
159
- $details_url[ $init ] = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
160
- $plugin_changelog = isset( $this->_plugins[ $init ][ 'info' ][ 'changelog' ] ) ? $this->_plugins[ $init ][ 'info' ][ 'changelog' ] : '';
161
- $changelogs[ $init ] = $this->in_theme_update_message( $this->_plugins[ $init ], $plugin_changelog, $changelog_id, false );
162
  }
163
 
164
  $localize_script_args = array(
@@ -168,7 +201,6 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
168
  'update_url' => $update_url,
169
  'details_url' => $details_url,
170
  'strings' => $strings,
171
- 'changelogs' => $changelogs
172
  );
173
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
174
  yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
@@ -442,7 +474,7 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
442
  $r = $current->response[ $init ];
443
 
444
  $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
445
- $details_url = '#TB_inline' . esc_url( add_query_arg( array( 'width' => 722, 'height' => 914, 'inlineId' => $changelog_id ), '' ) );
446
 
447
  /**
448
  * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
@@ -503,14 +535,12 @@ if ( !class_exists( 'YIT_Upgrade' ) ) {
503
  foreach ( $this->_plugins as $init => $plugin ) {
504
  remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10 );
505
  add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
506
- add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
507
  }
508
  }
509
 
510
  public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ) {
511
-
512
- $res
513
- = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
514
  <div class='yit-plugin-changelog'>
515
  <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
516
  <p>{$changelog}</p>
62
  $this->_package_url = defined( 'YIT_LICENCE_DEBUG_LOCALHOST' ) ? YIT_LICENCE_DEBUG_LOCALHOST : 'http://dev.yithemes.com';
63
  add_filter( 'block_local_requests', '__return_false' );
64
  }
65
+
66
+ add_action( 'install_plugins_pre_plugin-information', array( $this, 'show_changelog_for_premium_plugins' ) );
67
+ add_action( 'wp_ajax_yith_plugin_fw_get_premium_changelog', array( $this, 'show_changelog_for_premium_plugins' ) );
68
+ }
69
+
70
+ /**
71
+ * show changelog for premium plugins
72
+ *
73
+ * @since 3.0.14
74
+ */
75
+ public function show_changelog_for_premium_plugins() {
76
+ if ( isset( $_GET[ 'plugin' ] ) && isset( $_GET[ 'section' ] ) && 'changelog' === $_GET[ 'section' ] ) {
77
+ $plugin_init = $_GET[ 'plugin' ];
78
+ if ( isset( $this->_plugins[ $plugin_init ] ) ) {
79
+ // this is YITH Premium Plugin
80
+ if ( !empty( $this->_plugins[ $plugin_init ][ 'info' ][ 'changelog' ] ) ) {
81
+ $plugin_name = $this->_plugins[ $plugin_init ][ 'info' ][ 'Name' ];
82
+ $changelog = $this->_plugins[ $plugin_init ][ 'info' ][ 'changelog' ];
83
+ $template = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/upgrade/changelog.php';
84
+ if ( file_exists( $template ) ) {
85
+ include( $template );
86
+ }
87
+ die();
88
+ }
89
+ $error = __( 'An unexpected error occurred, please try again later. Thanks!', 'yith-plugin-fw' );
90
+ $template = YIT_CORE_PLUGIN_TEMPLATE_PATH . '/upgrade/error.php';
91
+ if ( file_exists( $template ) ) {
92
+ include( $template );
93
+ } else {
94
+ echo "<p>$error</p>";
95
+ }
96
+ die();
97
+ }
98
+ }
99
  }
100
 
101
  /**
123
  'slug' => $plugin_slug,
124
  );
125
 
126
+ $transient = 'yith_register_' . md5( $plugin_slug );
127
+ if ( apply_filters( 'yith_register_delete_transient', false ) ) {
128
+ delete_transient( $transient );
129
+ }
130
+ $info = get_transient( $transient );
131
+ if ( false === $info || apply_filters( 'yith_register_delete_transient', false ) ) {
132
+ $xml = str_replace( '%plugin_slug%', $plugin_slug, $this->_xml );
133
+ $remote_xml = wp_remote_get( $xml );
134
+
135
+ $error = false;
136
+ if ( !is_wp_error( $remote_xml ) && isset( $remote_xml[ 'response' ][ 'code' ] ) && '200' == $remote_xml[ 'response' ][ 'code' ] ) {
137
+ $plugin_remote_info = @simplexml_load_string( $remote_xml[ 'body' ] );
138
+ if ( $plugin_remote_info ) {
139
+ $info[ 'Latest' ] = (string) $plugin_remote_info->latest;
140
+ $info[ 'changelog' ] = (string) $plugin_remote_info->changelog;
141
+ if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
 
 
 
 
142
  YIT_Plugin_Licence()->check( $plugin_slug, false );
 
 
 
 
 
143
  }
144
+ set_transient( $transient, $info, DAY_IN_SECONDS );
145
  } else {
146
  $error = true;
147
+ error_log( sprintf( 'SimpleXML error in %s:%s [plugin slug: %s]',
148
+ __FILE__, __FUNCTION__, $plugin_slug ) );
149
  }
150
+ } else {
151
+ $error = true;
152
+ }
153
 
154
+ if ( $error ) {
155
+ // If error, set empty value in the transient to prevent multiple requests
156
+ $info = array( 'Latest' => '', 'changelog' => '' );
157
+ set_transient( $transient, $info, HOUR_IN_SECONDS );
 
158
  }
159
+ }
160
+
161
+ $this->_plugins[ $plugin_init ][ 'info' ][ 'Latest' ] = $info[ 'Latest' ];
162
+ $this->_plugins[ $plugin_init ][ 'info' ][ 'changelog' ] = $info[ 'changelog' ];
163
 
164
+ /* === HOOKS === */
165
+ if ( !is_multisite() || is_plugin_active_for_network( $plugin_init ) ) {
166
+ add_action( 'load-plugins.php', array( $this, 'remove_wp_plugin_update_row' ), 25 );
167
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
168
+ } else if ( is_multisite() && current_user_can( 'update_plugins' ) ) {
169
  add_action( 'admin_enqueue_scripts', array( $this, 'multisite_updater_script' ) );
170
  }
171
  }
179
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
180
  */
181
  public function multisite_updater_script() {
 
182
  $update_url = $changelogs = $details_url = array();
183
  $strings = array(
184
  'new_version' => __( 'There is a new version of %plugin_name% available.', 'yith-plugin-fw' ),
191
 
192
  foreach ( $this->_plugins as $init => $info ) {
193
  $update_url[ $init ] = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin-multisite&plugin=' ) . $init, 'upgrade-plugin-multisite_' . $init );
194
+ $details_url[ $init ] = admin_url( 'admin-ajax.php?action=yith_plugin_fw_get_premium_changelog&tab=plugin-information&plugin=' . $init . '&section=changelog&TB_iframe=true&width=640&height=662' );
 
 
 
195
  }
196
 
197
  $localize_script_args = array(
201
  'update_url' => $update_url,
202
  'details_url' => $details_url,
203
  'strings' => $strings,
 
204
  );
205
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
206
  yit_enqueue_script( 'yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater' . $suffix . '.js', array( 'jquery' ), false, true );
474
  $r = $current->response[ $init ];
475
 
476
  $changelog_id = str_replace( array( '/', '.php', '.' ), array( '-', '', '-' ), $init );
477
+ $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $init . '&section=changelog&TB_iframe=true&width=640&height=662' );
478
 
479
  /**
480
  * @see wp_plugin_update_rows() in wp-single\wp-admin\includes\update.php
535
  foreach ( $this->_plugins as $init => $plugin ) {
536
  remove_action( "after_plugin_row_{$init}", 'wp_plugin_update_row', 10 );
537
  add_action( "after_plugin_row_{$init}", array( $this, 'plugin_update_row' ) );
538
+ //add_action( "in_theme_update_message-{$init}", array( $this, 'in_theme_update_message' ), 10, 3 );
539
  }
540
  }
541
 
542
  public function in_theme_update_message( $plugin, $changelog, $changelog_id, $echo = true ) {
543
+ $res = "<div id='{$changelog_id}' class='yit-plugin-changelog-wrapper'>
 
 
544
  <div class='yit-plugin-changelog'>
545
  <h2 class='yit-plugin-changelog-title'>{$plugin['info']['Name']} - Changelog</h2>
546
  <p>{$changelog}</p>
plugin-fw/lib/yit-video.php CHANGED
@@ -135,6 +135,7 @@ if ( ! class_exists( 'YIT_Video' ) ) {
135
  public static function video_id_by_url( $url ) {
136
  $parsed = parse_url( esc_url( $url ) );
137
 
 
138
  if ( ! isset( $parsed['host'] ) ) {
139
  return false;
140
  }
@@ -150,7 +151,8 @@ if ( ! class_exists( 'YIT_Video' ) ) {
150
 
151
  case 'www.vimeo.com' :
152
  case 'vimeo.com' :
153
- preg_match( '/http(s)?:\/\/(\w+.)?vimeo\.com\/(.*)?(\/[0-9]+)/', $url, $matches );
 
154
  $id = trim( $matches[4], '/' );
155
  return "vimeo:$id";
156
 
135
  public static function video_id_by_url( $url ) {
136
  $parsed = parse_url( esc_url( $url ) );
137
 
138
+
139
  if ( ! isset( $parsed['host'] ) ) {
140
  return false;
141
  }
151
 
152
  case 'www.vimeo.com' :
153
  case 'vimeo.com' :
154
+ preg_match( '/http(s)?:\/\/(\w+.)?vimeo\.com\/(.*\/)?([0-9]+)/', $url, $matches );
155
+
156
  $id = trim( $matches[4], '/' );
157
  return "vimeo:$id";
158
 
plugin-fw/licence/lib/yit-licence.php CHANGED
@@ -198,8 +198,8 @@ if ( !class_exists( 'YIT_Licence' ) ) {
198
  )
199
  );
200
 
201
- /* Enqueue Scripts only in Licence Activation page */
202
- if ( strpos( get_current_screen()->id, 'yith_plugins_activation' ) !== false ) {
203
  wp_enqueue_script( 'yit-licence' );
204
  wp_enqueue_style( 'yit-theme-licence' );
205
  }
198
  )
199
  );
200
 
201
+ /* Enqueue Scripts only in Licence Activation page of plugins and themes */
202
+ if ( strpos( get_current_screen()->id, 'yith_plugins_activation' ) !== false || strpos( get_current_screen()->id, 'yit_panel_license' ) !== false ) {
203
  wp_enqueue_script( 'yit-licence' );
204
  wp_enqueue_style( 'yit-theme-licence' );
205
  }
plugin-fw/templates/fields/onoff.php CHANGED
@@ -18,4 +18,9 @@ extract( $field );
18
  <div class="yith-plugin-fw-onoff-container">
19
  <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( yith_plugin_fw_is_true( $value ) ) ?> class="on_off" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
20
  <span class="yith-plugin-fw-onoff">&nbsp;</span>
21
- </div>
 
 
 
 
 
18
  <div class="yith-plugin-fw-onoff-container">
19
  <input type="checkbox" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>" <?php checked( yith_plugin_fw_is_true( $value ) ) ?> class="on_off" <?php if ( isset( $std ) ) : ?>data-std="<?php echo $std ?>"<?php endif ?> />
20
  <span class="yith-plugin-fw-onoff">&nbsp;</span>
21
+ </div>
22
+ <?php
23
+ if ( isset( $field[ 'desc-inline' ] ) ) {
24
+ echo "<span class='description inline'>" . $field[ 'desc-inline' ] . "</span>";
25
+ }
26
+ ?>
plugin-fw/templates/privacy/html-policy-content.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @var array $sections
4
+ */
5
+ ?>
6
+ <div class="wp-suggested-text">
7
+ <?php do_action( 'yith_plugin_fw_privacy_guide_content_before' ); ?>
8
+
9
+ <?php
10
+ foreach ( $sections as $key => $section ) {
11
+ $action = "yith_plugin_fw_privacy_guide_content_{$key}";
12
+ $content = apply_filters( 'yith_plugin_fw_privacy_guide_content', '', $key );
13
+
14
+ if ( has_action( $action ) || !empty( $section[ 'tutorial' ] ) || !empty( $section[ 'description' ] ) || $content ) {
15
+ if ( !empty( $section[ 'title' ] ) ) {
16
+ echo "<h2>{$section['title']}</h2>";
17
+ }
18
+
19
+ if ( !empty( $section[ 'tutorial' ] ) ) {
20
+ echo "<p class='privacy-policy-tutorial'>{$section['tutorial']}</p>";
21
+ }
22
+
23
+ if ( !empty( $section[ 'description' ] ) ) {
24
+ echo "<p>{$section['description']}</p>";
25
+ }
26
+
27
+ if ( !empty( $content ) ) {
28
+ echo $content;
29
+ }
30
+ }
31
+
32
+ do_action( $action );
33
+ }
34
+ ?>
35
+
36
+ <?php do_action( 'yith_plugin_fw_privacy_guide_content_after' ); ?>
37
+ </div>
plugin-fw/templates/upgrade/changelog.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var string $plugin_name
11
+ * @var string $changelog
12
+ *
13
+ */
14
+ ?>
15
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
16
+ <head>
17
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
18
+ <meta name="viewport" content="width=device-width">
19
+ <meta name="robots" content="noindex,follow">
20
+ <title><?php echo $plugin_name ?> - Changelog</title>
21
+ <style type="text/css">
22
+ body {
23
+ background : #ffffff;
24
+ color : #444;
25
+ font-family : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
26
+ font-size : 13px;
27
+ line-height : 1.4em;
28
+ padding : 10px;
29
+ }
30
+
31
+ h2.yith-plugin-changelog-title {
32
+ text-transform : uppercase;
33
+ font-size : 17px;
34
+ }
35
+
36
+ ul {
37
+ list-style : none;
38
+ padding : 0;
39
+ }
40
+
41
+ li {
42
+ display : list-item;
43
+ margin-bottom : 6px;
44
+ }
45
+ </style>
46
+ </head>
47
+ <body>
48
+ <h2 class='yith-plugin-changelog-title'><?php echo $plugin_name ?> - Changelog</h2>
49
+ <div class='yith-plugin-changelog'><?php echo $changelog ?></div>
50
+ </body>
51
+ </html>
plugin-fw/templates/upgrade/error.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ *
10
+ * @var string $plugin_name
11
+ * @var string $changelog
12
+ *
13
+ */
14
+ ?>
15
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
16
+ <head>
17
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
18
+ <meta name="viewport" content="width=device-width">
19
+ <meta name="robots" content="noindex,follow">
20
+ <title>WordPress › Error</title>
21
+ <style type="text/css">
22
+ html {
23
+ background : #f1f1f1;
24
+ }
25
+
26
+ .container {
27
+ background : #fff;
28
+ color : #444;
29
+ font-family : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
30
+ margin : 2em auto;
31
+ padding : 1em 2em;
32
+ max-width : 700px;
33
+ -webkit-box-shadow : 0 1px 3px rgba(0, 0, 0, 0.13);
34
+ box-shadow : 0 1px 3px rgba(0, 0, 0, 0.13);
35
+ }
36
+
37
+ h1 {
38
+ border-bottom : 1px solid #dadada;
39
+ clear : both;
40
+ color : #666;
41
+ font-size : 24px;
42
+ margin : 30px 0 0 0;
43
+ padding : 0;
44
+ padding-bottom : 7px;
45
+ }
46
+
47
+ #error {
48
+ margin-top : 50px;
49
+ }
50
+
51
+ #error p {
52
+ font-size : 14px;
53
+ line-height : 1.5;
54
+ margin : 25px 0 20px;
55
+ }
56
+
57
+ #error code {
58
+ font-family : Consolas, Monaco, monospace;
59
+ }
60
+
61
+ ul li {
62
+ margin-bottom : 10px;
63
+ font-size : 14px;
64
+ }
65
+
66
+ a {
67
+ color : #0073aa;
68
+ }
69
+
70
+ a:hover,
71
+ a:active {
72
+ color : #00a0d2;
73
+ }
74
+
75
+ a:focus {
76
+ color : #124964;
77
+ -webkit-box-shadow : 0 0 0 1px #5b9dd9,
78
+ 0 0 2px 1px rgba(30, 140, 190, .8);
79
+ box-shadow : 0 0 0 1px #5b9dd9,
80
+ 0 0 2px 1px rgba(30, 140, 190, .8);
81
+ outline : none;
82
+ }
83
+
84
+ .button {
85
+ background : #f7f7f7;
86
+ border : 1px solid #ccc;
87
+ color : #555;
88
+ display : inline-block;
89
+ text-decoration : none;
90
+ font-size : 13px;
91
+ line-height : 26px;
92
+ height : 28px;
93
+ margin : 0;
94
+ padding : 0 10px 1px;
95
+ cursor : pointer;
96
+ -webkit-border-radius : 3px;
97
+ -webkit-appearance : none;
98
+ border-radius : 3px;
99
+ white-space : nowrap;
100
+ -webkit-box-sizing : border-box;
101
+ -moz-box-sizing : border-box;
102
+ box-sizing : border-box;
103
+
104
+ -webkit-box-shadow : 0 1px 0 #ccc;
105
+ box-shadow : 0 1px 0 #ccc;
106
+ vertical-align : top;
107
+ }
108
+
109
+ .button.button-large {
110
+ height : 30px;
111
+ line-height : 28px;
112
+ padding : 0 12px 2px;
113
+ }
114
+
115
+ .button:hover,
116
+ .button:focus {
117
+ background : #fafafa;
118
+ border-color : #999;
119
+ color : #23282d;
120
+ }
121
+
122
+ .button:focus {
123
+ border-color : #5b9dd9;
124
+ -webkit-box-shadow : 0 0 3px rgba(0, 115, 170, .8);
125
+ box-shadow : 0 0 3px rgba(0, 115, 170, .8);
126
+ outline : none;
127
+ }
128
+
129
+ .button:active {
130
+ background : #eee;
131
+ border-color : #999;
132
+ -webkit-box-shadow : inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
133
+ box-shadow : inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
134
+ -webkit-transform : translateY(1px);
135
+ -ms-transform : translateY(1px);
136
+ transform : translateY(1px);
137
+ }
138
+
139
+ </style>
140
+ </head>
141
+ <body>
142
+ <div id="error" class="container">
143
+ <p><?php echo $error ?></p>
144
+ </div>
145
+
146
+ </body>
147
+ </html>
plugin-fw/yit-plugin.php CHANGED
@@ -37,6 +37,8 @@ include_once( 'lib/yit-pointers.php');
37
  include_once( 'lib/yit-icons.php');
38
  include_once( 'lib/yit-assets.php');
39
  include_once( 'lib/yit-debug.php');
 
 
40
 
41
  // load from theme folder...
42
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
37
  include_once( 'lib/yit-icons.php');
38
  include_once( 'lib/yit-assets.php');
39
  include_once( 'lib/yit-debug.php');
40
+ include_once( 'lib/privacy/yit-privacy.php' );
41
+ include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
42
 
43
  // load from theme folder...
44
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )