Google Reviews Widget - Version 2.0.8

Version Description

  • Bugfix: js errors if reviews are hidden in the slider
  • Bugfix: slider is not responsive on some wp themes
  • Translation fixes
Download this release

Release Info

Developer richplugins
Plugin Icon 128x128 Google Reviews Widget
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

assets/js/public-main.js CHANGED
@@ -3,20 +3,20 @@
3
  A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy)
4
  (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
5
  */
6
- (function(a,b){"function"===typeof define&&define.amd?define(b):"object"===typeof exports?module.exports=b():a.Blazy=b()})(this,function(){function a(a){var h=a._util;h.elements=w(a.options);h.count=h.elements.length;h.destroyed&&(h.destroyed=!1,a.options.container&&u(a.options.container,function(a){n(a,"scroll",h.validateT)}),n(window,"resize",h.saveViewportOffsetT),n(window,"resize",h.validateT),n(window,"scroll",h.validateT));b(a)}function b(a){for(var h=a._util,c=0;c<h.count;c++){var b=h.elements[c];
7
- var e=b;var g=a.options;var f=e.getBoundingClientRect();g.container&&v&&(e=e.closest(g.containerClass))?(e=e.getBoundingClientRect(),g=d(e,k)?d(f,{top:e.top-g.offset,right:e.right+g.offset,bottom:e.bottom+g.offset,left:e.left-g.offset}):!1):g=d(f,k);if(g||l(b,a.options.successClass))a.load(b),h.elements.splice(c,1),h.count--,c--}0===h.count&&a.destroy()}function d(a,b){return a.right>=b.left&&a.bottom>=b.top&&a.left<=b.right&&a.top<=b.bottom}function e(a,b,c){if(!l(a,c.successClass)&&(b||c.loadInvisible||
8
- 0<a.offsetWidth&&0<a.offsetHeight))if(b=a.getAttribute(y)||a.getAttribute(c.src)){b=b.split(c.separator);var h=b[A&&1<b.length?1:0],d=a.getAttribute(c.srcset),e="img"===a.nodeName.toLowerCase(),z=(b=a.parentNode)&&"picture"===b.nodeName.toLowerCase();if(e||void 0===a.src){var r=new Image,k=function(){c.error&&c.error(a,"invalid");p(a,c.errorClass);t(r,"error",k);t(r,"load",m)},m=function(){e?z||f(a,h,d):a.style.backgroundImage='url("'+h+'")';g(a,c);t(r,"load",m);t(r,"error",k)};z&&(r=a,u(b.getElementsByTagName("source"),
9
- function(a){var b=c.srcset,h=a.getAttribute(b);h&&(a.setAttribute("srcset",h),a.removeAttribute(b))}));n(r,"error",k);n(r,"load",m);f(r,h,d)}else a.src=h,g(a,c)}else"video"===a.nodeName.toLowerCase()?(u(a.getElementsByTagName("source"),function(a){var b=c.src,h=a.getAttribute(b);h&&(a.setAttribute("src",h),a.removeAttribute(b))}),a.load(),g(a,c)):(c.error&&c.error(a,"missing"),p(a,c.errorClass))}function g(a,b){p(a,b.successClass);b.success&&b.success(a);a.removeAttribute(b.src);a.removeAttribute(b.srcset);
10
- u(b.breakpoints,function(b){a.removeAttribute(b.src)})}function f(a,b,c){c&&a.setAttribute("srcset",c);a.src=b}function l(a,b){return-1!==(" "+a.className+" ").indexOf(" "+b+" ")}function p(a,b){l(a,b)||(a.className+=" "+b)}function w(a){var b=[];a=a.root.querySelectorAll(a.selector);for(var c=a.length;c--;b.unshift(a[c]));return b}function q(a){k.bottom=(window.innerHeight||document.documentElement.clientHeight)+a;k.right=(window.innerWidth||document.documentElement.clientWidth)+a}function n(a,b,
11
- c){a.attachEvent?a.attachEvent&&a.attachEvent("on"+b,c):a.addEventListener(b,c,{capture:!1,passive:!0})}function t(a,b,c){a.detachEvent?a.detachEvent&&a.detachEvent("on"+b,c):a.removeEventListener(b,c,{capture:!1,passive:!0})}function u(a,b){if(a&&b)for(var c=a.length,d=0;d<c&&!1!==b(a[d],d);d++);}function m(a,b,c){var d=0;return function(){var e=+new Date;e-d<b||(d=e,a.apply(c,arguments))}}var y,k,A,v;return function(d){if(!document.querySelectorAll){var g=document.createStyleSheet();document.querySelectorAll=
12
- function(a,b,c,d,e){e=document.all;b=[];a=a.replace(/\[for\b/gi,"[htmlFor").split(",");for(c=a.length;c--;){g.addRule(a[c],"k:v");for(d=e.length;d--;)e[d].currentStyle.k&&b.push(e[d]);g.removeRule(0)}return b}}var c=this,f=c._util={};f.elements=[];f.destroyed=!0;c.options=d||{};c.options.error=c.options.error||!1;c.options.offset=c.options.offset||100;c.options.root=c.options.root||document;c.options.success=c.options.success||!1;c.options.selector=c.options.selector||".b-lazy";c.options.separator=
13
  c.options.separator||"|";c.options.containerClass=c.options.container;c.options.container=c.options.containerClass?document.querySelectorAll(c.options.containerClass):!1;c.options.errorClass=c.options.errorClass||"b-error";c.options.breakpoints=c.options.breakpoints||!1;c.options.loadInvisible=c.options.loadInvisible||!1;c.options.successClass=c.options.successClass||"b-loaded";c.options.validateDelay=c.options.validateDelay||25;c.options.saveViewportOffsetDelay=c.options.saveViewportOffsetDelay||
14
- 50;c.options.srcset=c.options.srcset||"data-srcset";c.options.src=y=c.options.src||"data-src";v=Element.prototype.closest;A=1<window.devicePixelRatio;k={};k.top=0-c.options.offset;k.left=0-c.options.offset;c.revalidate=function(){a(c)};c.load=function(a,b){var c=this.options;void 0===a.length?e(a,b,c):u(a,function(a){e(a,b,c)})};c.destroy=function(){var a=this._util;this.options.container&&u(this.options.container,function(b){t(b,"scroll",a.validateT)});t(window,"scroll",a.validateT);t(window,"resize",
15
- a.validateT);t(window,"resize",a.saveViewportOffsetT);a.count=0;a.elements.length=0;a.destroyed=!0};f.validateT=m(function(){b(c)},c.options.validateDelay,c);f.saveViewportOffsetT=m(function(){q(c.options.offset)},c.options.saveViewportOffsetDelay,c);q(c.options.offset);u(c.options.breakpoints,function(a){if(a.width>=window.screen.width)return y=a.src,!1});setTimeout(function(){a(c)})}});
16
- var WPacTime=WPacTime||{getTime:function(a,b,d){return"chat"==d?this.getChatTime(a,b||"en"):d?this.getFormatTime(a,d,b||"en"):this.getDefaultTime(a,b||"en")},getChatTime:function(a,b){var d=((new Date).getTime()-a)/1E3/60/60,e=d/24;return 24>d?this.getFormatTime(a,"HH:mm",b):365>e?this.getFormatTime(a,"dd.MM HH:mm",b):this.getFormatTime(a,"yyyy.MM.dd HH:mm",b)},getDefaultTime:function(a,b){return this.getTimeAgo(a,b)},getTimeAgo:function(a,b){a=((new Date).getTime()-a)/1E3;var d=a/60,e=d/60,g=e/24,
17
- f=g/365;b=WPacTime.Messages[b]?b:"en";return 45>a?WPacTime.Messages[b].second:90>a?WPacTime.Messages[b].minute:45>d?WPacTime.Messages[b].minutes(d):90>d?WPacTime.Messages[b].hour:24>e?WPacTime.Messages[b].hours(e):48>e?WPacTime.Messages[b].day:30>g?WPacTime.Messages[b].days(g):60>g?WPacTime.Messages[b].month:365>g?WPacTime.Messages[b].months(g):2>f?WPacTime.Messages[b].year:WPacTime.Messages[b].years(f)},getTime12:function(a,b){a=new Date(a);return(a.getHours()%12?a.getHours()%12:12)+":"+a.getMinutes()+
18
- (12<=a.getHours()?" PM":" AM")},getFormatTime:function(a,b,d){var e=new Date(a),g={SS:e.getMilliseconds(),ss:e.getSeconds(),mm:e.getMinutes(),HH:e.getHours(),hh:(e.getHours()%12?e.getHours()%12:12)+(12<=e.getHours()?"PM":"AM"),dd:e.getDate(),MM:e.getMonth()+1,yyyy:e.getFullYear(),yy:String(e.getFullYear()).toString().substr(2,2),ago:this.getTimeAgo(a,d),12:this.getTime12(a,d)};return b.replace(/(SS|ss|mm|HH|hh|DD|dd|MM|yyyy|yy|ago|12)/g,function(a,b){a=g[b];return 10>a?"0"+a:a})},declineNum:function(a,
19
- b,d,e){return a+" "+this.declineMsg(a,b,d,e)},declineMsg:function(a,b,d,e,g){var f=a%10;return 1==f&&(1==a||20<a)?b:1<f&&5>f&&(20<a||10>a)?d:a?e:g}};
20
  WPacTime.Messages={ru:{second:"\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e",minute:"\u043c\u0438\u043d\u0443\u0442\u0443 \u043d\u0430\u0437\u0430\u0434",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u043c\u0438\u043d\u0443\u0442\u0430 \u043d\u0430\u0437\u0430\u0434","\u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u0437\u0430\u0434","\u043c\u0438\u043d\u0443\u0442 \u043d\u0430\u0437\u0430\u0434")},hour:"\u0447\u0430\u0441 \u043d\u0430\u0437\u0430\u0434",hours:function(a){return WPacTime.declineNum(Math.round(a),
21
  "\u0447\u0430\u0441 \u043d\u0430\u0437\u0430\u0434","\u0447\u0430\u0441\u0430 \u043d\u0430\u0437\u0430\u0434","\u0447\u0430\u0441\u043e\u0432 \u043d\u0430\u0437\u0430\u0434")},day:"\u0434\u0435\u043d\u044c \u043d\u0430\u0437\u0430\u0434",days:function(a){return WPacTime.declineNum(Math.round(a),"\u0434\u0435\u043d\u044c \u043d\u0430\u0437\u0430\u0434","\u0434\u043d\u044f \u043d\u0430\u0437\u0430\u0434","\u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434")},month:"\u043c\u0435\u0441\u044f\u0446 \u043d\u0430\u0437\u0430\u0434",
22
  months:function(a){return WPacTime.declineNum(Math.round(a/30),"\u043c\u0435\u0441\u044f\u0446 \u043d\u0430\u0437\u0430\u0434","\u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434","\u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434")},year:"\u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434",years:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434","\u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434",
@@ -62,16 +62,15 @@ month:"pred mesiacom",months:function(a){return"pred "+Math.round(a/30)+" mesiac
62
  hours:function(a){return Math.round(a)+" \u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87\u0e81\u0ec8\u0ead\u0e99"},day:"\u0edc\u0eb6\u0ec8\u0e87\u0ea1\u0eb7\u0ec9\u0e81\u0ec8\u0ead\u0e99",days:function(a){return Math.round(a)+" \u0ea1\u0eb7\u0ec9\u0e81\u0ec8\u0ead\u0e99"},month:"\u0edc\u0eb6\u0ec8\u0e87\u0ec0\u0e94\u0eb7\u0ead\u0e99\u0e81\u0ec8\u0ead\u0e99",months:function(a){return Math.round(a/30)+" \u0ec0\u0e94\u0eb7\u0ead\u0e99\u0e81\u0ec8\u0ead\u0e99"},year:"\u0edc\u0eb6\u0ec8\u0e87\u0e9b\u0eb5\u0e81\u0ec8\u0ead\u0e99",
63
  years:function(a){return Math.round(a)+" \u0e9b\u0eb5\u0e81\u0ec8\u0ead\u0e99"}},sl:{second:"pravkar",minute:"pred eno minuto",minutes:function(a){return"pred "+Math.round(a)+" minutami"},hour:"pred eno uro",hours:function(a){return"pred "+Math.round(a)+" urami"},day:"pred enim dnem",days:function(a){return"pred "+Math.round(a)+" dnevi"},month:"pred enim mesecem",months:function(a){return"pred "+Math.round(a/30)+" meseci"},year:"pred enim letom",years:function(a){return"pred "+Math.round(a)+" leti"}},
64
  et:{second:"just n\u00fc\u00fcd",minute:"minut tagasi",minutes:function(a){return Math.round(a)+" minutit tagasi"},hour:"tund tagasi",hours:function(a){return Math.round(a)+" tundi tagasi"},day:"p\u00e4ev tagasi",days:function(a){return Math.round(a)+" p\u00e4eva tagasi"},month:"kuu aega tagasi",months:function(a){return Math.round(a/30)+" kuud tagasi"},year:"aasta tagasi",years:function(a){return Math.round(a)+" aastat tagasi"}}};
65
- function rplg_badge_init(a,b,d){var e=a.querySelector(".wp-"+b+"-badge"),g=a.querySelector(".wp-"+b+"-form");if(e&&g){var f=document.createElement("div");f.className=d+" wpac";-1<e.className.indexOf("-fixed")&&f.appendChild(e);f.appendChild(g);document.body.appendChild(f);e.onclick=function(){rplg_load_imgs(f);g.style.display="block"}}}
66
  function rplg_load_imgs(a){a=a.querySelectorAll("img.rplg-blazy[data-src]");for(var b=0;b<a.length;b++)a[b].setAttribute("src",a[b].getAttribute("data-src")),a[b].removeAttribute("data-src")}
67
- function rplg_next_reviews(a,b){var d=this.parentNode,e=".wp-"+a+"-review.wp-"+a+"-hide";reviews=d.querySelectorAll(e);for(var g=0;g<b&&g<reviews.length;g++)reviews[g]&&(reviews[g].className=reviews[g].className.replace("wp-"+a+"-hide"," "),rplg_load_imgs(reviews[g]));reviews=d.querySelectorAll(e);1>reviews.length&&d.removeChild(this);window.rplg_blazy&&window.rplg_blazy.revalidate();return!1}function rplg_leave_review_window(){_rplg_popup(this.getAttribute("href"),620,500);return!1}
68
- function _rplg_lang(){var a=navigator;return(a.language||a.systemLanguage||a.userLanguage||"en").substr(0,2).toLowerCase()}function _rplg_popup(a,b,d,e,g,f){g=g||screen.height/2-d/2;f=f||screen.width/2-b/2;return window.open(a,"","location=1,status=1,resizable=yes,width="+b+",height="+d+",top="+g+",left="+f)}
69
  function _rplg_timeago(a){for(var b=0;b<a.length;b++){var d=a[b].className;-1<d.indexOf("google")?(d=parseInt(a[b].getAttribute("data-time")),d*=1E3):d=-1<d.indexOf("facebook")?(new Date(a[b].getAttribute("data-time").replace(/\+\d+$/,""))).getTime():(new Date(a[b].getAttribute("data-time").replace(/ /,"T"))).getTime();a[b].innerHTML=WPacTime.getTime(d,_rplg_lang(),"ago")}}
70
  function _rplg_init_blazy(a){window.Blazy?window.rplg_blazy=new Blazy({selector:"img.rplg-blazy"}):0<a&&setTimeout(function(){_rplg_init_blazy(a-1)},200)}function _rplg_read_more(){for(var a=document.querySelectorAll(".wp-more-toggle"),b=0;b<a.length;b++)(function(a){a.onclick=function(){a.parentNode.removeChild(a.previousSibling.previousSibling);a.previousSibling.className="";a.textContent=""}})(a[b])}
71
  function _rplg_get_parent(a,b){b=b||"wp-gr";if(0>a.className.split(" ").indexOf(b))for(;(a=a.parentElement)&&0>a.className.split(" ").indexOf(b););return a}
72
- function _rplg_init_slider(a){function b(){f.className=510>f.offsetWidth?"grw-row grw-row-xs":750>f.offsetWidth?"grw-row grw-row-x":1100>f.offsetWidth?"grw-row grw-row-s":1450>f.offsetWidth?"grw-row grw-row-m":1800>f.offsetWidth?"grw-row grw-row-l":"grw-row grw-row-xl";setTimeout(d,200)}function d(){var b=p.length,d=l.offsetWidth/p[0].offsetWidth;console.log("DOTs v",d);b=Math.ceil(b/d);var g=a.querySelector(".grw-slider-dots");console.log("DOTs dots",b);g.innerHTML="";for(var f=0;f<b;f++){var k=
73
- document.createElement("div");k.className="grw-slider-dot";var n=p[0].offsetWidth,v=(l.scrollLeft+(l.scrollLeft+n*d))/2;console.log("CENTER",l.scrollLeft,n,v);x=Math.ceil(v*b/l.scrollWidth);x==f+1&&(k.className="grw-slider-dot active");k.setAttribute("data-index",f+1);k.setAttribute("data-visible",d);g.appendChild(k);k.onclick=function(){var b=a.querySelector(".grw-slider-dot.active");b=parseInt(b.getAttribute("data-index"));var d=parseInt(this.getAttribute("data-index")),c=parseInt(this.getAttribute("data-visible"));
74
- b<d?e(c*Math.abs(d-b)):l.scrollBy(-p[0].offsetWidth*c*Math.abs(d-b),0);a.querySelector(".grw-slider-dot.active").className="grw-slider-dot";this.className="grw-slider-dot active";q&&clearInterval(q)}}}function e(a){l.scrollBy(p[0].offsetWidth*a,0)}function g(){var b=400,f=a.querySelector(".grw-slider-review:last-child"),m=f.getBoundingClientRect();f=f.parentNode.getBoundingClientRect();(2>Math.abs(f.left-m.left)||f.left<=m.left)&&m.left<f.right&&(2>Math.abs(f.right-m.right)||f.right>=m.right)&&m.right>
75
- f.left?(l.scrollBy(-l.scrollWidth,0),b=700):e(1);setTimeout(d,b);q=setTimeout(g,5E3)}a=_rplg_get_parent(a);var f=a.querySelector(".grw-slider .grw-row"),l=a.querySelector(".grw-slider-reviews"),p=a.querySelectorAll(".grw-slider-review"),w=null,q=null;window.addEventListener("resize",function(){clearTimeout(w);w=setTimeout(function(){b()},150)});var n=function(){var d=a.querySelector(".grw-slider");(d.offsetWidth||d.offsetHeight||d.getClientRects().length)&&"hidden"!==window.getComputedStyle(d).visibility?
76
- (b(),_rplg_init_blazy(10),setTimeout(g,300)):setTimeout(n,300);console.log("grw slider init...")};n();a.querySelector(".grw-slider-prev").onclick=function(){l.scrollBy(-p[0].offsetWidth,0);setTimeout(d,200);q&&clearInterval(q)};a.querySelector(".grw-slider-next").onclick=function(){e(1);setTimeout(d,200);q&&clearInterval(q)}}function rplg_init(a,b){_rplg_timeago(document.querySelectorAll(".wpac [data-time]"));_rplg_read_more();_rplg_init_blazy(10);a&&"slider"==b&&_rplg_init_slider(a)}
77
- document.addEventListener("DOMContentLoaded",function(){rplg_init()});
3
  A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy)
4
  (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
5
  */
6
+ (function(a,b){"function"===typeof define&&define.amd?define(b):"object"===typeof exports?module.exports=b():a.Blazy=b()})(this,function(){function a(a){var k=a._util;k.elements=u(a.options);k.count=k.elements.length;k.destroyed&&(k.destroyed=!1,a.options.container&&t(a.options.container,function(a){r(a,"scroll",k.validateT)}),r(window,"resize",k.saveViewportOffsetT),r(window,"resize",k.validateT),r(window,"scroll",k.validateT));b(a)}function b(a){for(var k=a._util,c=0;c<k.count;c++){var b=k.elements[c];
7
+ var e=b;var f=a.options;var g=e.getBoundingClientRect();f.container&&y&&(e=e.closest(f.containerClass))?(e=e.getBoundingClientRect(),f=d(e,p)?d(g,{top:e.top-f.offset,right:e.right+f.offset,bottom:e.bottom+f.offset,left:e.left-f.offset}):!1):f=d(g,p);if(f||m(b,a.options.successClass))a.load(b),k.elements.splice(c,1),k.count--,c--}0===k.count&&a.destroy()}function d(a,b){return a.right>=b.left&&a.bottom>=b.top&&a.left<=b.right&&a.top<=b.bottom}function e(a,b,c){if(!m(a,c.successClass)&&(b||c.loadInvisible||
8
+ 0<a.offsetWidth&&0<a.offsetHeight))if(b=a.getAttribute(v)||a.getAttribute(c.src)){b=b.split(c.separator);var k=b[z&&1<b.length?1:0],d=a.getAttribute(c.srcset),e="img"===a.nodeName.toLowerCase(),w=(b=a.parentNode)&&"picture"===b.nodeName.toLowerCase();if(e||void 0===a.src){var q=new Image,p=function(){c.error&&c.error(a,"invalid");n(a,c.errorClass);h(q,"error",p);h(q,"load",l)},l=function(){e?w||g(a,k,d):a.style.backgroundImage='url("'+k+'")';f(a,c);h(q,"load",l);h(q,"error",p)};w&&(q=a,t(b.getElementsByTagName("source"),
9
+ function(a){var b=c.srcset,k=a.getAttribute(b);k&&(a.setAttribute("srcset",k),a.removeAttribute(b))}));r(q,"error",p);r(q,"load",l);g(q,k,d)}else a.src=k,f(a,c)}else"video"===a.nodeName.toLowerCase()?(t(a.getElementsByTagName("source"),function(a){var b=c.src,k=a.getAttribute(b);k&&(a.setAttribute("src",k),a.removeAttribute(b))}),a.load(),f(a,c)):(c.error&&c.error(a,"missing"),n(a,c.errorClass))}function f(a,b){n(a,b.successClass);b.success&&b.success(a);a.removeAttribute(b.src);a.removeAttribute(b.srcset);
10
+ t(b.breakpoints,function(b){a.removeAttribute(b.src)})}function g(a,b,c){c&&a.setAttribute("srcset",c);a.src=b}function m(a,b){return-1!==(" "+a.className+" ").indexOf(" "+b+" ")}function n(a,b){m(a,b)||(a.className+=" "+b)}function u(a){var b=[];a=a.root.querySelectorAll(a.selector);for(var c=a.length;c--;b.unshift(a[c]));return b}function l(a){p.bottom=(window.innerHeight||document.documentElement.clientHeight)+a;p.right=(window.innerWidth||document.documentElement.clientWidth)+a}function r(a,b,
11
+ c){a.attachEvent?a.attachEvent&&a.attachEvent("on"+b,c):a.addEventListener(b,c,{capture:!1,passive:!0})}function h(a,b,c){a.detachEvent?a.detachEvent&&a.detachEvent("on"+b,c):a.removeEventListener(b,c,{capture:!1,passive:!0})}function t(a,b){if(a&&b)for(var c=a.length,d=0;d<c&&!1!==b(a[d],d);d++);}function q(a,b,c){var d=0;return function(){var e=+new Date;e-d<b||(d=e,a.apply(c,arguments))}}var v,p,z,y;return function(d){if(!document.querySelectorAll){var f=document.createStyleSheet();document.querySelectorAll=
12
+ function(a,b,c,d,e){e=document.all;b=[];a=a.replace(/\[for\b/gi,"[htmlFor").split(",");for(c=a.length;c--;){f.addRule(a[c],"k:v");for(d=e.length;d--;)e[d].currentStyle.k&&b.push(e[d]);f.removeRule(0)}return b}}var c=this,g=c._util={};g.elements=[];g.destroyed=!0;c.options=d||{};c.options.error=c.options.error||!1;c.options.offset=c.options.offset||100;c.options.root=c.options.root||document;c.options.success=c.options.success||!1;c.options.selector=c.options.selector||".b-lazy";c.options.separator=
13
  c.options.separator||"|";c.options.containerClass=c.options.container;c.options.container=c.options.containerClass?document.querySelectorAll(c.options.containerClass):!1;c.options.errorClass=c.options.errorClass||"b-error";c.options.breakpoints=c.options.breakpoints||!1;c.options.loadInvisible=c.options.loadInvisible||!1;c.options.successClass=c.options.successClass||"b-loaded";c.options.validateDelay=c.options.validateDelay||25;c.options.saveViewportOffsetDelay=c.options.saveViewportOffsetDelay||
14
+ 50;c.options.srcset=c.options.srcset||"data-srcset";c.options.src=v=c.options.src||"data-src";y=Element.prototype.closest;z=1<window.devicePixelRatio;p={};p.top=0-c.options.offset;p.left=0-c.options.offset;c.revalidate=function(){a(c)};c.load=function(a,b){var c=this.options;void 0===a.length?e(a,b,c):t(a,function(a){e(a,b,c)})};c.destroy=function(){var a=this._util;this.options.container&&t(this.options.container,function(b){h(b,"scroll",a.validateT)});h(window,"scroll",a.validateT);h(window,"resize",
15
+ a.validateT);h(window,"resize",a.saveViewportOffsetT);a.count=0;a.elements.length=0;a.destroyed=!0};g.validateT=q(function(){b(c)},c.options.validateDelay,c);g.saveViewportOffsetT=q(function(){l(c.options.offset)},c.options.saveViewportOffsetDelay,c);l(c.options.offset);t(c.options.breakpoints,function(a){if(a.width>=window.screen.width)return v=a.src,!1});setTimeout(function(){a(c)})}});
16
+ var WPacTime=WPacTime||{getTime:function(a,b,d){return"chat"==d?this.getChatTime(a,b||"en"):d?this.getFormatTime(a,d,b||"en"):this.getDefaultTime(a,b||"en")},getChatTime:function(a,b){var d=((new Date).getTime()-a)/1E3/60/60,e=d/24;return 24>d?this.getFormatTime(a,"HH:mm",b):365>e?this.getFormatTime(a,"dd.MM HH:mm",b):this.getFormatTime(a,"yyyy.MM.dd HH:mm",b)},getDefaultTime:function(a,b){return this.getTimeAgo(a,b)},getTimeAgo:function(a,b){a=((new Date).getTime()-a)/1E3;var d=a/60,e=d/60,f=e/24,
17
+ g=f/365;b=WPacTime.Messages[b]?b:"en";return 45>a?WPacTime.Messages[b].second:90>a?WPacTime.Messages[b].minute:45>d?WPacTime.Messages[b].minutes(d):90>d?WPacTime.Messages[b].hour:24>e?WPacTime.Messages[b].hours(e):48>e?WPacTime.Messages[b].day:30>f?WPacTime.Messages[b].days(f):60>f?WPacTime.Messages[b].month:365>f?WPacTime.Messages[b].months(f):2>g?WPacTime.Messages[b].year:WPacTime.Messages[b].years(g)},getTime12:function(a,b){a=new Date(a);return(a.getHours()%12?a.getHours()%12:12)+":"+a.getMinutes()+
18
+ (12<=a.getHours()?" PM":" AM")},getFormatTime:function(a,b,d){var e=new Date(a),f={SS:e.getMilliseconds(),ss:e.getSeconds(),mm:e.getMinutes(),HH:e.getHours(),hh:(e.getHours()%12?e.getHours()%12:12)+(12<=e.getHours()?"PM":"AM"),dd:e.getDate(),MM:e.getMonth()+1,yyyy:e.getFullYear(),yy:String(e.getFullYear()).toString().substr(2,2),ago:this.getTimeAgo(a,d),12:this.getTime12(a,d)};return b.replace(/(SS|ss|mm|HH|hh|DD|dd|MM|yyyy|yy|ago|12)/g,function(a,b){a=f[b];return 10>a?"0"+a:a})},declineNum:function(a,
19
+ b,d,e){return a+" "+this.declineMsg(a,b,d,e)},declineMsg:function(a,b,d,e,f){var g=a%10;return 1==g&&(1==a||20<a)?b:1<g&&5>g&&(20<a||10>a)?d:a?e:f}};
20
  WPacTime.Messages={ru:{second:"\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e",minute:"\u043c\u0438\u043d\u0443\u0442\u0443 \u043d\u0430\u0437\u0430\u0434",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u043c\u0438\u043d\u0443\u0442\u0430 \u043d\u0430\u0437\u0430\u0434","\u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u0437\u0430\u0434","\u043c\u0438\u043d\u0443\u0442 \u043d\u0430\u0437\u0430\u0434")},hour:"\u0447\u0430\u0441 \u043d\u0430\u0437\u0430\u0434",hours:function(a){return WPacTime.declineNum(Math.round(a),
21
  "\u0447\u0430\u0441 \u043d\u0430\u0437\u0430\u0434","\u0447\u0430\u0441\u0430 \u043d\u0430\u0437\u0430\u0434","\u0447\u0430\u0441\u043e\u0432 \u043d\u0430\u0437\u0430\u0434")},day:"\u0434\u0435\u043d\u044c \u043d\u0430\u0437\u0430\u0434",days:function(a){return WPacTime.declineNum(Math.round(a),"\u0434\u0435\u043d\u044c \u043d\u0430\u0437\u0430\u0434","\u0434\u043d\u044f \u043d\u0430\u0437\u0430\u0434","\u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434")},month:"\u043c\u0435\u0441\u044f\u0446 \u043d\u0430\u0437\u0430\u0434",
22
  months:function(a){return WPacTime.declineNum(Math.round(a/30),"\u043c\u0435\u0441\u044f\u0446 \u043d\u0430\u0437\u0430\u0434","\u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434","\u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434")},year:"\u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434",years:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434","\u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434",
62
  hours:function(a){return Math.round(a)+" \u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87\u0e81\u0ec8\u0ead\u0e99"},day:"\u0edc\u0eb6\u0ec8\u0e87\u0ea1\u0eb7\u0ec9\u0e81\u0ec8\u0ead\u0e99",days:function(a){return Math.round(a)+" \u0ea1\u0eb7\u0ec9\u0e81\u0ec8\u0ead\u0e99"},month:"\u0edc\u0eb6\u0ec8\u0e87\u0ec0\u0e94\u0eb7\u0ead\u0e99\u0e81\u0ec8\u0ead\u0e99",months:function(a){return Math.round(a/30)+" \u0ec0\u0e94\u0eb7\u0ead\u0e99\u0e81\u0ec8\u0ead\u0e99"},year:"\u0edc\u0eb6\u0ec8\u0e87\u0e9b\u0eb5\u0e81\u0ec8\u0ead\u0e99",
63
  years:function(a){return Math.round(a)+" \u0e9b\u0eb5\u0e81\u0ec8\u0ead\u0e99"}},sl:{second:"pravkar",minute:"pred eno minuto",minutes:function(a){return"pred "+Math.round(a)+" minutami"},hour:"pred eno uro",hours:function(a){return"pred "+Math.round(a)+" urami"},day:"pred enim dnem",days:function(a){return"pred "+Math.round(a)+" dnevi"},month:"pred enim mesecem",months:function(a){return"pred "+Math.round(a/30)+" meseci"},year:"pred enim letom",years:function(a){return"pred "+Math.round(a)+" leti"}},
64
  et:{second:"just n\u00fc\u00fcd",minute:"minut tagasi",minutes:function(a){return Math.round(a)+" minutit tagasi"},hour:"tund tagasi",hours:function(a){return Math.round(a)+" tundi tagasi"},day:"p\u00e4ev tagasi",days:function(a){return Math.round(a)+" p\u00e4eva tagasi"},month:"kuu aega tagasi",months:function(a){return Math.round(a/30)+" kuud tagasi"},year:"aasta tagasi",years:function(a){return Math.round(a)+" aastat tagasi"}}};
65
+ function rplg_badge_init(a,b,d){var e=a.querySelector(".wp-"+b+"-badge"),f=a.querySelector(".wp-"+b+"-form");if(e&&f){var g=document.createElement("div");g.className=d+" wpac";-1<e.className.indexOf("-fixed")&&g.appendChild(e);g.appendChild(f);document.body.appendChild(g);e.onclick=function(){rplg_load_imgs(g);f.style.display="block"}}}
66
  function rplg_load_imgs(a){a=a.querySelectorAll("img.rplg-blazy[data-src]");for(var b=0;b<a.length;b++)a[b].setAttribute("src",a[b].getAttribute("data-src")),a[b].removeAttribute("data-src")}
67
+ function rplg_next_reviews(a,b){var d=this.parentNode,e=".wp-"+a+"-review.wp-"+a+"-hide";reviews=d.querySelectorAll(e);for(var f=0;f<b&&f<reviews.length;f++)reviews[f]&&(reviews[f].className=reviews[f].className.replace("wp-"+a+"-hide"," "),rplg_load_imgs(reviews[f]));reviews=d.querySelectorAll(e);1>reviews.length&&d.removeChild(this);window.rplg_blazy&&window.rplg_blazy.revalidate();return!1}function rplg_leave_review_window(){_rplg_popup(this.getAttribute("href"),620,500);return!1}
68
+ function _rplg_lang(){var a=navigator;return(a.language||a.systemLanguage||a.userLanguage||"en").substr(0,2).toLowerCase()}function _rplg_popup(a,b,d,e,f,g){f=f||screen.height/2-d/2;g=g||screen.width/2-b/2;return window.open(a,"","location=1,status=1,resizable=yes,width="+b+",height="+d+",top="+f+",left="+g)}
69
  function _rplg_timeago(a){for(var b=0;b<a.length;b++){var d=a[b].className;-1<d.indexOf("google")?(d=parseInt(a[b].getAttribute("data-time")),d*=1E3):d=-1<d.indexOf("facebook")?(new Date(a[b].getAttribute("data-time").replace(/\+\d+$/,""))).getTime():(new Date(a[b].getAttribute("data-time").replace(/ /,"T"))).getTime();a[b].innerHTML=WPacTime.getTime(d,_rplg_lang(),"ago")}}
70
  function _rplg_init_blazy(a){window.Blazy?window.rplg_blazy=new Blazy({selector:"img.rplg-blazy"}):0<a&&setTimeout(function(){_rplg_init_blazy(a-1)},200)}function _rplg_read_more(){for(var a=document.querySelectorAll(".wp-more-toggle"),b=0;b<a.length;b++)(function(a){a.onclick=function(){a.parentNode.removeChild(a.previousSibling.previousSibling);a.previousSibling.className="";a.textContent=""}})(a[b])}
71
  function _rplg_get_parent(a,b){b=b||"wp-gr";if(0>a.className.split(" ").indexOf(b))for(;(a=a.parentElement)&&0>a.className.split(" ").indexOf(b););return a}
72
+ function _rplg_init_slider(a){function b(){g.className=510>g.offsetWidth?"grw-row grw-row-xs":750>g.offsetWidth?"grw-row grw-row-x":1100>g.offsetWidth?"grw-row grw-row-s":1450>g.offsetWidth?"grw-row grw-row-m":1800>g.offsetWidth?"grw-row grw-row-l":"grw-row grw-row-xl";n.length&&setTimeout(d,200)}function d(){var b=m.offsetWidth/n[0].offsetWidth,d=Math.ceil(n.length/b),f=a.querySelector(".grw-slider-dots");f.innerHTML="";for(var g=0;g<d;g++){var h=document.createElement("div");h.className="grw-slider-dot";
73
+ x=Math.ceil((m.scrollLeft+(m.scrollLeft+n[0].offsetWidth*b))/2*d/m.scrollWidth);x==g+1&&(h.className="grw-slider-dot active");h.setAttribute("data-index",g+1);h.setAttribute("data-visible",b);f.appendChild(h);h.onclick=function(){var b=a.querySelector(".grw-slider-dot.active");b=parseInt(b.getAttribute("data-index"));var d=parseInt(this.getAttribute("data-index")),f=parseInt(this.getAttribute("data-visible"));b<d?e(f*Math.abs(d-b)):m.scrollBy(-n[0].offsetWidth*f*Math.abs(d-b),0);a.querySelector(".grw-slider-dot.active").className=
74
+ "grw-slider-dot";this.className="grw-slider-dot active";l&&clearInterval(l)}}}function e(a){m.scrollBy(n[0].offsetWidth*a,0)}function f(){var b=400,g=a.querySelector(".grw-slider-review:last-child"),h=g.getBoundingClientRect();g=g.parentNode.getBoundingClientRect();(2>Math.abs(g.left-h.left)||g.left<=h.left)&&h.left<g.right&&(2>Math.abs(g.right-h.right)||g.right>=h.right)&&h.right>g.left?(m.scrollBy(-m.scrollWidth,0),b=700):e(1);setTimeout(d,b);l=setTimeout(f,5E3)}a=_rplg_get_parent(a);var g=a.querySelector(".grw-slider .grw-row"),
75
+ m=a.querySelector(".grw-slider-reviews"),n=a.querySelectorAll(".grw-slider-review"),u=null,l=null,r=function(){var d=a.querySelector(".grw-slider");(d.offsetWidth||d.offsetHeight||d.getClientRects().length)&&"hidden"!==window.getComputedStyle(d).visibility?(b(),_rplg_init_blazy(10),n.length&&setTimeout(f,300)):setTimeout(r,300)};r();window.addEventListener("resize",function(){clearTimeout(u);u=setTimeout(function(){b()},150)});var h=a.querySelector(".grw-slider-prev");h&&(h.onclick=function(){m.scrollBy(-n[0].offsetWidth,
76
+ 0);setTimeout(d,200);l&&clearInterval(l)});if(h=a.querySelector(".grw-slider-next"))h.onclick=function(){e(1);setTimeout(d,200);l&&clearInterval(l)}}function rplg_init(a,b){_rplg_timeago(document.querySelectorAll(".wpac [data-time]"));_rplg_read_more();_rplg_init_blazy(10);a&&"slider"==b&&_rplg_init_slider(a)}document.addEventListener("DOMContentLoaded",function(){rplg_init()});
 
assets/src/js/public-main.js CHANGED
@@ -119,23 +119,24 @@ function _rplg_init_slider(el) {
119
  var resizeTimout = null,
120
  swipeTimout = null;
121
 
122
- window.addEventListener('resize', function() {
123
- clearTimeout(resizeTimout);
124
- resizeTimout = setTimeout(function() { resize(); }, 150);
125
- });
126
-
127
  var init = function() {
128
  if (isVisible(el.querySelector('.grw-slider'))) {
129
  resize();
130
  _rplg_init_blazy(10);
131
- setTimeout(swipe, 300);
 
 
132
  } else {
133
  setTimeout(init, 300);
134
  }
135
- console.log('grw slider init...');
136
  }
137
  init();
138
 
 
 
 
 
 
139
  function resize() {
140
  if (ROW_ELEM.offsetWidth < 510) {
141
  ROW_ELEM.className = 'grw-row grw-row-xs';
@@ -150,20 +151,18 @@ function _rplg_init_slider(el) {
150
  } else {
151
  ROW_ELEM.className = 'grw-row grw-row-xl';
152
  }
153
- setTimeout(dotsinit, 200);
 
 
154
  }
155
 
156
  function dotsinit() {
157
  var t = REVIEW_ELEMS.length,
158
  v = REVIEWS_ELEM.offsetWidth / REVIEW_ELEMS[0].offsetWidth;
159
 
160
- console.log('DOTs v', v);
161
-
162
  var dots = Math.ceil(t/v),
163
  dotscnt = el.querySelector('.grw-slider-dots');
164
 
165
- console.log('DOTs dots', dots);
166
-
167
  dotscnt.innerHTML = '';
168
  for (var i = 0; i < dots; i++) {
169
  var dot = document.createElement('div');
@@ -172,8 +171,6 @@ function _rplg_init_slider(el) {
172
  var revWidth = REVIEW_ELEMS[0].offsetWidth;
173
  var center = (REVIEWS_ELEM.scrollLeft + (REVIEWS_ELEM.scrollLeft + revWidth * v)) / 2;
174
 
175
- console.log('CENTER', REVIEWS_ELEM.scrollLeft, revWidth, center);
176
-
177
  /*var x = Math.ceil( ((center * 100 / REVIEWS_ELEM.scrollWidth) * dots) / 100 );
178
  if (x == i + 1) dot.className = 'dot active';*/
179
  x = Math.ceil((center * dots) / REVIEWS_ELEM.scrollWidth);
@@ -229,21 +226,27 @@ function _rplg_init_slider(el) {
229
  );
230
  }
231
 
232
- el.querySelector('.grw-slider-prev').onclick = function() {
233
- scrollPrev(1);
234
- setTimeout(dotsinit, 200);
235
- if (swipeTimout) {
236
- clearInterval(swipeTimout);
237
- }
238
- };
 
 
 
239
 
240
- el.querySelector('.grw-slider-next').onclick = function() {
241
- scrollNext(1);
242
- setTimeout(dotsinit, 200);
243
- if (swipeTimout) {
244
- clearInterval(swipeTimout);
245
- }
246
- };
 
 
 
247
 
248
  function swipe() {
249
  var dt = 400;
119
  var resizeTimout = null,
120
  swipeTimout = null;
121
 
 
 
 
 
 
122
  var init = function() {
123
  if (isVisible(el.querySelector('.grw-slider'))) {
124
  resize();
125
  _rplg_init_blazy(10);
126
+ if (REVIEW_ELEMS.length) {
127
+ setTimeout(swipe, 300);
128
+ }
129
  } else {
130
  setTimeout(init, 300);
131
  }
 
132
  }
133
  init();
134
 
135
+ window.addEventListener('resize', function() {
136
+ clearTimeout(resizeTimout);
137
+ resizeTimout = setTimeout(function() { resize(); }, 150);
138
+ });
139
+
140
  function resize() {
141
  if (ROW_ELEM.offsetWidth < 510) {
142
  ROW_ELEM.className = 'grw-row grw-row-xs';
151
  } else {
152
  ROW_ELEM.className = 'grw-row grw-row-xl';
153
  }
154
+ if (REVIEW_ELEMS.length) {
155
+ setTimeout(dotsinit, 200);
156
+ }
157
  }
158
 
159
  function dotsinit() {
160
  var t = REVIEW_ELEMS.length,
161
  v = REVIEWS_ELEM.offsetWidth / REVIEW_ELEMS[0].offsetWidth;
162
 
 
 
163
  var dots = Math.ceil(t/v),
164
  dotscnt = el.querySelector('.grw-slider-dots');
165
 
 
 
166
  dotscnt.innerHTML = '';
167
  for (var i = 0; i < dots; i++) {
168
  var dot = document.createElement('div');
171
  var revWidth = REVIEW_ELEMS[0].offsetWidth;
172
  var center = (REVIEWS_ELEM.scrollLeft + (REVIEWS_ELEM.scrollLeft + revWidth * v)) / 2;
173
 
 
 
174
  /*var x = Math.ceil( ((center * 100 / REVIEWS_ELEM.scrollWidth) * dots) / 100 );
175
  if (x == i + 1) dot.className = 'dot active';*/
176
  x = Math.ceil((center * dots) / REVIEWS_ELEM.scrollWidth);
226
  );
227
  }
228
 
229
+ var prev = el.querySelector('.grw-slider-prev');
230
+ if (prev) {
231
+ prev.onclick = function() {
232
+ scrollPrev(1);
233
+ setTimeout(dotsinit, 200);
234
+ if (swipeTimout) {
235
+ clearInterval(swipeTimout);
236
+ }
237
+ };
238
+ }
239
 
240
+ var next = el.querySelector('.grw-slider-next');
241
+ if (next) {
242
+ next.onclick = function() {
243
+ scrollNext(1);
244
+ setTimeout(dotsinit, 200);
245
+ if (swipeTimout) {
246
+ clearInterval(swipeTimout);
247
+ }
248
+ };
249
+ }
250
 
251
  function swipe() {
252
  var dt = 400;
grw.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Widget for Google Reviews
4
  Plugin URI: https://richplugins.com/business-reviews-bundle-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
- Version: 2.0.7
7
  Author: RichPlugins <support@richplugins.com>
8
  Author URI: https://richplugins.com
9
  Text Domain: widget-google-reviews
@@ -18,7 +18,7 @@ if (!defined('ABSPATH')) {
18
 
19
  require(ABSPATH . 'wp-includes/version.php');
20
 
21
- define('GRW_VERSION' , '2.0.7');
22
  define('GRW_PLUGIN_FILE' , __FILE__);
23
  define('GRW_PLUGIN_URL' , plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
24
  define('GRW_ASSETS_URL' , GRW_PLUGIN_URL . '/assets/');
3
  Plugin Name: Widget for Google Reviews
4
  Plugin URI: https://richplugins.com/business-reviews-bundle-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
+ Version: 2.0.8
7
  Author: RichPlugins <support@richplugins.com>
8
  Author URI: https://richplugins.com
9
  Text Domain: widget-google-reviews
18
 
19
  require(ABSPATH . 'wp-includes/version.php');
20
 
21
+ define('GRW_VERSION' , '2.0.8');
22
  define('GRW_PLUGIN_FILE' , __FILE__);
23
  define('GRW_PLUGIN_URL' , plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
24
  define('GRW_ASSETS_URL' , GRW_PLUGIN_URL . '/assets/');
includes/admin/class-admin-feed-columns.php CHANGED
@@ -7,7 +7,8 @@ use WP_Rplg_Google_Reviews\Includes\Post_Types;
7
  class Admin_Feed_Columns {
8
 
9
  private static $plugin_themes = array(
10
- 'list' => 'List',
 
11
  );
12
 
13
  public function __construct($feed_deserializer) {
7
  class Admin_Feed_Columns {
8
 
9
  private static $plugin_themes = array(
10
+ 'list' => 'List',
11
+ 'slider' => 'Slider',
12
  );
13
 
14
  public function __construct($feed_deserializer) {
includes/class-assets.php CHANGED
@@ -42,9 +42,24 @@ class Assets {
42
  add_action('wp_enqueue_scripts', array($this, 'enqueue_public_styles'));
43
  add_action('wp_enqueue_scripts', array($this, 'enqueue_public_scripts'));
44
  }
 
45
  }
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  public function register_styles() {
49
  $styles = array('grw-admin-main-css', 'grw-public-main-css');
50
  if ($this->debug) {
42
  add_action('wp_enqueue_scripts', array($this, 'enqueue_public_styles'));
43
  add_action('wp_enqueue_scripts', array($this, 'enqueue_public_scripts'));
44
  }
45
+ add_filter('script_loader_tag', array($this, 'add_async'), 10, 2);
46
  }
47
  }
48
 
49
+ function add_async($tag, $handle) {
50
+ $js_assets = array(
51
+ 'grw-admin-main-js' => 'js/admin-main',
52
+ 'grw-admin-builder-js' => 'js/admin-builder',
53
+ 'grw-public-time-js' => 'js/public-time',
54
+ 'grw-public-blazy-js' => 'js/public-blazy.min',
55
+ 'grw-public-main-js' => 'js/public-main',
56
+ );
57
+ if (isset($handle) && array_key_exists($handle, $js_assets)) {
58
+ return str_replace(' src', ' defer="defer" src', $tag);
59
+ }
60
+ return $tag;
61
+ }
62
+
63
  public function register_styles() {
64
  $styles = array('grw-admin-main-css', 'grw-public-main-css');
65
  if ($this->debug) {
includes/class-plugin-support.php CHANGED
@@ -79,7 +79,7 @@ class Plugin_Support {
79
  </div>
80
  </div>
81
  <div class="grw-flex-col">
82
- <iframe width="100%" height="315" src="https://www.youtube.com/embed/Wbst-UBgXXk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
83
  </div>
84
  </div>
85
  </div>
79
  </div>
80
  </div>
81
  <div class="grw-flex-col">
82
+ <iframe width="100%" height="315" src="https://www.youtube.com/embed/1s7mZUSo3eg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
83
  </div>
84
  </div>
85
  </div>
includes/class-view.php CHANGED
@@ -98,7 +98,7 @@ class View {
98
  </div>
99
  <?php } ?>
100
  </div>
101
- <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="js_loader" onload="rplg_init(this, 'slider')" width="1px" height="1px" style="display:none">
102
  </div>
103
  <?php
104
  }
@@ -138,8 +138,7 @@ class View {
138
  </div>
139
  <?php } ?>
140
  </div>
141
- <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="js_loader" onload="rplg_init()" style="display:none">
142
- <?php
143
  }
144
 
145
  private function render_badge($businesses, $reviews, $options) {
@@ -212,8 +211,7 @@ class View {
212
  <img src="<?php echo GRW_ASSETS_URL; ?>img/powered_by_google_on_<?php if ($options->dark_theme) { ?>non_<?php } ?>white.png" alt="powered by Google" width="144" height="18" title="powered by Google">
213
  </div>
214
  </div>
215
- <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" onload="(function(el) { document.addEventListener('DOMContentLoaded', function() { grw_badge_init(el); }); })(this.parentNode);" style="display:none">
216
- <?php
217
  }
218
 
219
  function grw_place($rating, $place, $place_img, $reviews, $dark_theme, $hide_based_on, $show_powered = true) {
@@ -384,6 +382,10 @@ class View {
384
  ?><img <?php if ($lazy) { ?>src="<?php echo $def_ava; ?>" data-<?php } ?>src="<?php echo $src; ?>" class="rplg-review-avatar<?php if ($lazy) { ?> rplg-blazy<?php } ?>" alt="<?php echo $alt; ?>" width="50" height="50" title="<?php echo $alt; ?>" onerror="if(this.src!='<?php echo $def_ava; ?>')this.src='<?php echo $def_ava; ?>';" <?php echo $atts; ?>><?php
385
  }
386
 
 
 
 
 
387
  function grw_trim_text($text, $size) {
388
  if ($size > 0 && $this->grw_strlen($text) > $size) {
389
  $sub_text = $this->grw_substr($text, 0, $size);
98
  </div>
99
  <?php } ?>
100
  </div>
101
+ <?php $this->js_loader('rplg_init', '\'slider\''); ?>
102
  </div>
103
  <?php
104
  }
138
  </div>
139
  <?php } ?>
140
  </div>
141
+ <?php $this->js_loader('rplg_init');
 
142
  }
143
 
144
  private function render_badge($businesses, $reviews, $options) {
211
  <img src="<?php echo GRW_ASSETS_URL; ?>img/powered_by_google_on_<?php if ($options->dark_theme) { ?>non_<?php } ?>white.png" alt="powered by Google" width="144" height="18" title="powered by Google">
212
  </div>
213
  </div>
214
+ <?php $this->js_loader('grw_badge_init');
 
215
  }
216
 
217
  function grw_place($rating, $place, $place_img, $reviews, $dark_theme, $hide_based_on, $show_powered = true) {
382
  ?><img <?php if ($lazy) { ?>src="<?php echo $def_ava; ?>" data-<?php } ?>src="<?php echo $src; ?>" class="rplg-review-avatar<?php if ($lazy) { ?> rplg-blazy<?php } ?>" alt="<?php echo $alt; ?>" width="50" height="50" title="<?php echo $alt; ?>" onerror="if(this.src!='<?php echo $def_ava; ?>')this.src='<?php echo $def_ava; ?>';" <?php echo $atts; ?>><?php
383
  }
384
 
385
+ private function js_loader($func, $data = '') {
386
+ ?><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="js_loader" onload="(function(el, data) {var f = function() { window.<?php echo $func; ?> ? <?php echo $func; ?>(el, data) : setTimeout(f, 400) }; f() })(this<?php if (strlen($data) > 0) { ?>, <?php echo str_replace('"', '\'', $data); } ?>);" data-exec="false" width="1" height="1" style="display:none"><?php
387
+ }
388
+
389
  function grw_trim_text($text, $size) {
390
  if ($size > 0 && $this->grw_strlen($text) > $size) {
391
  $sub_text = $this->grw_substr($text, 0, $size);
languages/grw-de_DE.mo CHANGED
Binary file
languages/grw-de_DE.po CHANGED
@@ -28,3 +28,6 @@ msgstr "Nächste Bewertungen"
28
 
29
  msgid "Based on %s reviews"
30
  msgstr "Basierend auf %s Rezensionen"
 
 
 
28
 
29
  msgid "Based on %s reviews"
30
  msgstr "Basierend auf %s Rezensionen"
31
+
32
+ msgid "Ready to review?"
33
+ msgstr "Bereit zu bewerten?"
languages/grw-es_ES.mo CHANGED
Binary file
languages/grw-es_ES.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
4
  "MIME-Version: 1.0\n"
5
  "Content-Type: text/plain; charset=UTF-8\n"
6
  "Content-Transfer-Encoding: 8bit\n"
7
- "X-Generator: Poedit 1.8.11\n"
8
  "Project-Id-Version: \n"
9
  "POT-Creation-Date: \n"
10
  "PO-Revision-Date: \n"
@@ -26,5 +26,8 @@ msgstr "leer más"
26
  msgid "Next Reviews"
27
  msgstr "Siguientes"
28
 
29
- msgid "Write a review"
30
- msgstr "Escribir un comentario"
 
 
 
4
  "MIME-Version: 1.0\n"
5
  "Content-Type: text/plain; charset=UTF-8\n"
6
  "Content-Transfer-Encoding: 8bit\n"
7
+ "X-Generator: Poedit 2.2\n"
8
  "Project-Id-Version: \n"
9
  "POT-Creation-Date: \n"
10
  "PO-Revision-Date: \n"
26
  msgid "Next Reviews"
27
  msgstr "Siguientes"
28
 
29
+ msgid "Based on %s reviews"
30
+ msgstr "Basado en %s opiniones"
31
+
32
+ msgid "Ready to review?"
33
+ msgstr "¿Listo para revisar?"
languages/grw-pl_PL.mo CHANGED
Binary file
languages/grw-pl_PL.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
4
  "MIME-Version: 1.0\n"
5
  "Content-Type: text/plain; charset=UTF-8\n"
6
  "Content-Transfer-Encoding: 8bit\n"
7
- "X-Generator: Poedit 1.8.11\n"
8
  "Project-Id-Version: \n"
9
  "POT-Creation-Date: \n"
10
  "PO-Revision-Date: \n"
@@ -28,3 +28,9 @@ msgstr "Następne Opinie"
28
 
29
  msgid "Write a review"
30
  msgstr "Napisz Opinię"
 
 
 
 
 
 
4
  "MIME-Version: 1.0\n"
5
  "Content-Type: text/plain; charset=UTF-8\n"
6
  "Content-Transfer-Encoding: 8bit\n"
7
+ "X-Generator: Poedit 2.2\n"
8
  "Project-Id-Version: \n"
9
  "POT-Creation-Date: \n"
10
  "PO-Revision-Date: \n"
28
 
29
  msgid "Write a review"
30
  msgstr "Napisz Opinię"
31
+
32
+ msgid "Based on %s reviews"
33
+ msgstr "Na podstawie %s opinii"
34
+
35
+ msgid "Ready to review?"
36
+ msgstr "Chcesz dodać opinię?"
readme.txt CHANGED
@@ -4,78 +4,61 @@ Donate link: https://richplugins.com/business-reviews-bundle-wordpress-plugin
4
  Tags: google, google reviews, reviews, rating, widget, google business, testimonial, testimonials, google places reviews, map reviews, google my business
5
  Requires at least: 2.8
6
  Tested up to: 5.8
7
- Stable tag: 2.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Official way to show Google Reviews on your WordPress site without Google crawling and other unofficial methods. Google Rating boosts user trust and sales!
12
 
13
  == Description ==
14
 
15
- `To get more features we have <a href="https://richplugins.com/business-reviews-bundle-wordpress-plugin">Business version</a> of the plugin`
16
 
17
- This plugin display Google Business Reviews on your websites in sidebar widget or shortcode. A unique feature of the plugin is that it saves reviews in WordPress database and have no depend on any services like Google to show reviews in the widget.
18
 
19
- [youtube https://www.youtube.com/watch?v=Wbst-UBgXXk]
 
 
20
 
21
  [Online demo](https://richplugins.com/demos/)
22
 
23
- = Plugin Features =
24
-
25
- * Free!
26
- * Awesome & responsive slider
27
- * Engaging 'Write a review' button
28
- * SEO
29
- * Multiple Google places connection
30
- * Reviews auto-updating
31
- * Shortcode support!
32
- * Auto refresh reviews
33
- * Shows "Based on ... reviews" section
34
  * Trim long reviews with "read more" link
35
- * Support any page builder: Gutenberg, Elementor, Page Origin, Beaver Builder, WPBakery, Divi
36
- * Displays up to 5 Google business reviews per location
37
- * Keep all reviews in WordPress database
38
- * Shows real reviews from G+ users to increase user confidence
39
- * Easy search of place and instantly show reviews
40
- * Custom business place photo
41
- * Review list theme
42
- * Pagination
43
- * Support dark websites
44
- * Nofollow, target="_blank" links
45
- * Zero load time regardless of your site
46
- * Works even if Google is unavailable
47
-
48
- = Get More Features with Business version! =
49
 
50
  [Upgrade to Business](https://richplugins.com/business-reviews-bundle-wordpress-plugin)
51
 
52
- * New awesome flash theme!
53
- * Possibility to connect multiple locations
54
- * Displays ALL reviews through Google My Business (GMB) API
55
- * Automatically reviews sync
56
- * Merge reviews between each other from different platforms (Google, Facebook, Yelp) and places
57
- * Powerful <b>Collection Builder</b>
58
- * Slider/Grid themes to show G+ reviews like testimonials
59
- * Google Trust Badge (right/left fixed or embedded)
60
- * 'Write a review' button to available leave Google review directly on your website
61
- * Show/hide any elements (business, reviews, avatars, names, time and etc)
 
62
  * Any Sorting: recent, oldest, rating, striped, random
63
- * Include/Exclude words filter
64
  * Minimum rating filter
65
  * Priority support
66
 
67
- = Additional Free Reviews Plugins =
68
-
69
- Why limit your reviews to just Google Reviews? Check out our other free reviews plugins to add to your site as well:
70
-
71
- * [Facebook Reviews Widget](https://wordpress.org/plugins/fb-reviews-widget/ "Facebook Reviews Widget")
72
- * [Yelp Reviews Widget](https://wordpress.org/plugins/widget-yelp-reviews/ "Yelp Reviews Widget")
73
-
74
- == Installation ==
75
-
76
- 1. Unpack archive to this archive to the 'wp-content/plugins/' directory inside of WordPress
77
- 2. Activate the plugin through the 'Plugins' menu in WordPress
78
-
79
  == Screenshots ==
80
 
81
  1. Google Reviews slider
@@ -84,8 +67,42 @@ Why limit your reviews to just Google Reviews? Check out our other free reviews
84
  4. Google Reviews shortcode builder
85
  5. Google Reviews sidebar widget
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  == Changelog ==
88
 
 
 
 
 
 
89
  = 2.0.7 =
90
  * Slider layout: bug and style fixes
91
 
@@ -371,8 +388,3 @@ Why limit your reviews to just Google Reviews? Check out our other free reviews
371
 
372
  = 1.4 =
373
  * Bugfix: update path images
374
-
375
- == Support ==
376
-
377
- * Email support support@richplugins.com
378
- * Live support https://richplugins.com/forum
4
  Tags: google, google reviews, reviews, rating, widget, google business, testimonial, testimonials, google places reviews, map reviews, google my business
5
  Requires at least: 2.8
6
  Tested up to: 5.8
7
+ Stable tag: 2.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Official way to show Google Reviews on your WordPress site without Google crawling and other unofficial methods. Boost user trust and sales on your site!
12
 
13
  == Description ==
14
 
15
+ This plugin displays **Google Business Reviews** on your WordPress website through a public and approved by Google API without crawling and other unofficial methods. With this plugin, you can be sure of the right way for showing **Google Reviews**.
16
 
17
+ Displaying **Google Rating** and Reviews on your site is the easiest and most effective way to increase your customer confidence and, as a result, increase sales!
18
 
19
+ By the way, with the <a href="https://richplugins.com/business-reviews-bundle-wordpress-plugin">Business version</a> of this plugin, you can get better results, because it shows all reviews, auto syncs these, supports other platforms like Facebook, Yelp which you can mix and has many other great features!
20
+
21
+ [youtube https://www.youtube.com/watch?v=1s7mZUSo3eg]
22
 
23
  [Online demo](https://richplugins.com/demos/)
24
 
25
+ ### Free plugin features
26
+
27
+ * Awesome, responsive and really cool slider which works anywhere, started from mobile to a HD desktops
28
+ * Collect new Google Reviews and increase your Google Rating with a 'Write a review' button
29
+ * Slider don't fit? You can use a List layout or hide the reviews and show just a rating badge
30
+ * Create multiple widgets and connect **several Google places**, not just one like in other similar plugins
31
+ * Connected Google rating and reviews are automatically updated and most-helpful reviews will show without any actions
32
+ * Display the reviews through a shortcode, widget or any page builder: Gutenberg, Elementor, Page Origin, Beaver Builder, WPBakery, Divi and others
33
+ * Hide certain reviews from displaying, sometimes it may not only be a negatively rated review
34
+ * Upload your own Google business photo
35
+ * Use Pagination to hide some of the reviews
36
  * Trim long reviews with "read more" link
37
+ * Works on a dark websites
38
+ * Multi language support
39
+ * Ability to customize layout with additional CSS
40
+ * Zero load time: SVG, lazy load images and the smallest size of assets (css ~ **3**kb, js ~ **8**kb)
41
+
42
+ ### Get More Features with Business version
 
 
 
 
 
 
 
 
43
 
44
  [Upgrade to Business](https://richplugins.com/business-reviews-bundle-wordpress-plugin)
45
 
46
+ The business version of the plugin uses another Google API to show all reviews. It's also official and approved by Google like in the free plugin, but can uses only for business owners and show all reviews. To connect reviews, just log in through your GMB owner account and that's it.
47
+
48
+ * Shows ALL Google reviews with constant automatic updates
49
+ * Connecting and showing reviews is easier than ever, just log in through your GMB account
50
+ * Flash theme: increase user trust, social proof and sales via beautiful popups with your real recent reviews
51
+ * Ability to connect one, several or all your Google locations just through one log in
52
+ * Mix ratings and reviews between each other from the same or different platforms: Google, Facebook, Yelp
53
+ * Awesome and beautiful layouts: list, grid, slider, float and embedded badges
54
+ * Absolutely unique feature: a custom rating and reviews template will allow to create your own layout
55
+ * Lift important reviews to the top
56
+ * Show/hide any elements (business photo, name, rating, reviews, avatars, names, time and etc)
57
  * Any Sorting: recent, oldest, rating, striped, random
58
+ * Include/Exclude words filter to show or hide certain reviews
59
  * Minimum rating filter
60
  * Priority support
61
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  == Screenshots ==
63
 
64
  1. Google Reviews slider
67
  4. Google Reviews shortcode builder
68
  5. Google Reviews sidebar widget
69
 
70
+ == Additional Free Reviews Plugins ==
71
+
72
+ Why limit your reviews to just Google Reviews? Check out our other free reviews plugins to add to your site as well:
73
+
74
+ * <a href="https://wordpress.org/plugins/fb-reviews-widget/" target="_blank">Facebook Reviews Widget</a>
75
+ * <a href="https://wordpress.org/plugins/widget-yelp-reviews/" target="_blank">Yelp Reviews Widget</a>
76
+
77
+ == Support ==
78
+
79
+ If you have any questions regarding this plugin or business version, you can contact us directly.
80
+
81
+ We offer 24/7 email support in English.
82
+
83
+ We recommend the following order when searching for answers:
84
+ 1. Plugin's support page in wp-admin: Google Reviews / Support.
85
+ 2. Check topics or ask a new question here: [Support Forum](https://wordpress.org/support/plugin/widget-google-reviews/)
86
+ 3. Try to find similar question/answer on our [Live Chat page](https://richplugins.com/forum)
87
+ 4. If you still can't find the answer, feel free to email us: support@richplugins.com
88
+
89
+ To find out more about who we are and what we do, here are some useful links:
90
+
91
+ * [RichPlugins Website](https://richplugins.com/)
92
+ * [Our Blog](https://richplugins.com/blog/)
93
+
94
+ == Installation ==
95
+
96
+ 1. Unpack archive to the 'wp-content/plugins/' directory or install the plugin through the WordPress plugins screen directly
97
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
98
+
99
  == Changelog ==
100
 
101
+ = 2.0.8 =
102
+ * Bugfix: js errors if reviews are hidden in the slider
103
+ * Bugfix: slider is not responsive on some wp themes
104
+ * Translation fixes
105
+
106
  = 2.0.7 =
107
  * Slider layout: bug and style fixes
108
 
388
 
389
  = 1.4 =
390
  * Bugfix: update path images