Google Reviews Widget - Version 2.1.7

Version Description

  • Improve: slider hide prev & next buttons option
  • Improve: slider hide dots option
  • Bugfix: multiple duplicate of business photos
  • Bugfix: duplicate reviews
Download this release

Release Info

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

Code changes from version 2.1.6 to 2.1.7

assets/js/admin-main.js CHANGED
@@ -1,6 +1,6 @@
1
  jQuery(document).ready(function(a){a(".grw-admin-page a.nav-tab").on("click",function(c){var b=a(this),d=b.attr("href");a(d).show().siblings(".tab-content").hide();b.addClass("nav-tab-active").siblings().removeClass("nav-tab-active");c.preventDefault()})});
2
  var GRW_HTML_CONTENT='<div class="grw-builder-platforms grw-builder-inside"><div class="grw-toggle grw-builder-connect grw-connect-google">Connect Google</div><div class="grw-connect-google-inside" style="display:none"><div class="grw-builder-option"><input type="text" class="grw-connect-id" value="" placeholder="Place ID" /><span class="grw-quest grw-toggle" title="Click to help">?</span><div class="grw-quest-help">The standard way to find your Google Place ID is to go to <a href="https://developers.google.com/places/place-id" target="_blank">https://developers.google.com/places/place-id</a> and search for your company name.<br><br>But sometimes it may not work, in this case please see <a href="'+GRW_VARS.supportUrl+
3
- '&grw_tab=fig#place_id" target="_blank">how to find any Google Place ID</a>.</div></div><div class="grw-builder-option"><select class="grw-connect-lang"><option value="" selected="selected">Choose language if required</option><option value="ar">Arabic</option><option value="bg">Bulgarian</option><option value="bn">Bengali</option><option value="ca">Catalan</option><option value="cs">Czech</option><option value="da">Danish</option><option value="de">German</option><option value="el">Greek</option><option value="en">English</option><option value="es">Spanish</option><option value="eu">Basque</option><option value="eu">Basque</option><option value="fa">Farsi</option><option value="fi">Finnish</option><option value="fil">Filipino</option><option value="fr">French</option><option value="gl">Galician</option><option value="gu">Gujarati</option><option value="hi">Hindi</option><option value="hr">Croatian</option><option value="hu">Hungarian</option><option value="id">Indonesian</option><option value="it">Italian</option><option value="iw">Hebrew</option><option value="ja">Japanese</option><option value="kn">Kannada</option><option value="ko">Korean</option><option value="lt">Lithuanian</option><option value="lv">Latvian</option><option value="ml">Malayalam</option><option value="mr">Marathi</option><option value="nl">Dutch</option><option value="no">Norwegian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="pt-BR">Portuguese (Brazil)</option><option value="pt-PT">Portuguese (Portugal)</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="sr">Serbian</option><option value="sv">Swedish</option><option value="ta">Tamil</option><option value="te">Telugu</option><option value="th">Thai</option><option value="tl">Tagalog</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="vi">Vietnamese</option><option value="zh">Chinese (Simplified)</option><option value="zh-Hant">Chinese (Traditional)</option></select></div><div class="grw-builder-option"><button class="grw-connect-btn">Connect Google</button><small class="grw-connect-error"></small></div></div><div class="grw-connections"></div></div><div class="grw-connect-options"><div class="grw-builder-inside"><div class="grw-builder-option">Layout<select id="view_mode" name="view_mode"><option value="slider" selected="selected">Slider</option><option value="list">List</option></select></div><div class="grw-builder-option">Slider speed<input type="text" name="slider_speed" value="" placeholder="5 seconds"></div><div class="grw-builder-option">Slider: text height<input type="text" name="slider_text_height" value="" placeholder="100px"></div><div class="grw-builder-option">Pagination<input type="text" name="pagination" value=""></div><div class="grw-builder-option">Maximum characters before \'read more\' link<input type="text" name="text_size" value=""></div><div class="grw-builder-option">Maximum width<input type="text" name="max_width" value="" placeholder="for instance: 300px"></div><div class="grw-builder-option">Maximum height<input type="text" name="max_height" value="" placeholder="for instance: 500px"></div><div class="grw-builder-option"><label><input type="checkbox" name="header_hide_social" value="">Hide headers</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_based_on" value="">Hide \'Based on ... reviews\'</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_reviews" value="">Hide reviews, leave only rating header</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_border" value="">Slider: hide border</label></div><div class="grw-builder-option"><label><input type="checkbox" name="centered" value="">Place by center (only if Width is set)</label></div><div class="grw-builder-option"><label><input type="checkbox" name="dark_theme">Dark background</label></div></div><div class="grw-builder-top grw-toggle">Advance Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option"><label><input type="checkbox" name="lazy_load_img" checked>Lazy load images</label></div><div class="grw-builder-option"><label><input type="checkbox" name="google_def_rev_link">Use default Google reviews link</label><span class="grw-quest grw-quest-top grw-toggle" title="Click to help">?</span><div class="grw-quest-help" style="display:none;">If the direct link to all reviews <b>https://search.google.com/local/reviews?placeid=&lt;PLACE_ID&gt;</b> does not work with your Google place (leads to 404), please use this option to use the default reviews link to Google map.</div></div><div class="grw-builder-option"><label><input type="checkbox" name="open_link" checked>Open links in new Window</label></div><div class="grw-builder-option"><label><input type="checkbox" name="nofollow_link" checked>Use no follow links</label></div><div class="grw-builder-option">Reviewer avatar size<select name="reviewer_avatar_size"><option value="56" selected="selected">Small: 56px</option><option value="128">Medium: 128px</option><option value="256">Large: 256px</option></select></div><div class="grw-builder-option">Cache data<select name="cache"><option value="1">1 Hour</option><option value="3">3 Hours</option><option value="6">6 Hours</option><option value="12" selected="selected">12 Hours</option><option value="24">1 Day</option><option value="48">2 Days</option><option value="168">1 Week</option><option value="">Disable (NOT recommended)</option></select></div><div class="grw-builder-option">Reviews limit<input type="text" name="reviews_limit" value=""></div></div></div>';
4
  function grw_builder_init(a,c){var b=document.querySelector(c.el);if(b){b.innerHTML=GRW_HTML_CONTENT;c.conns&&grw_deserialize_connections(a,b,c.conns,c.opts);var d=b.querySelector(".grw-connect-google-inside");grw_connection(a,d,"google",c.authcode);a('.grw-connect-options input[type="text"],.grw-connect-options textarea').keyup(function(){grw_serialize_connections()});a('.grw-connect-options input[type="checkbox"],.grw-connect-options select').change(function(){grw_serialize_connections()});a(".grw-toggle",
5
  b).unbind("click").click(function(){a(this).toggleClass("toggled");a(this).next().slideToggle()});a(".grw-connections").sortable&&(a(".grw-connections").sortable({stop:function(a,b){grw_serialize_connections()}}),a(".grw-connections").disableSelection());a(".wp-review-hide").click(function(){grw_review_hide(a(this));return!1});a("#grw_save").click(function(){grw_feed_save_ajax();return!1})}}
6
  function grw_feed_save_ajax(a){if(!window.grw_title.value)return window.grw_title.focus(),!1;window.grw_save.innerText="Auto save, wait";window.grw_save.disabled=!0;jQuery.post(ajaxurl,{post_id:window.grw_post_id.value,title:window.grw_title.value,content:document.getElementById("grw-builder-connection").value,action:"grw_feed_save_ajax"},function(a){for(var b=document.querySelectorAll(".wp-gr"),c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);window.grw_collection_preview.innerHTML=a;jQuery(".wp-review-hide").unbind("click").click(function(){grw_review_hide(jQuery(this));
1
  jQuery(document).ready(function(a){a(".grw-admin-page a.nav-tab").on("click",function(c){var b=a(this),d=b.attr("href");a(d).show().siblings(".tab-content").hide();b.addClass("nav-tab-active").siblings().removeClass("nav-tab-active");c.preventDefault()})});
2
  var GRW_HTML_CONTENT='<div class="grw-builder-platforms grw-builder-inside"><div class="grw-toggle grw-builder-connect grw-connect-google">Connect Google</div><div class="grw-connect-google-inside" style="display:none"><div class="grw-builder-option"><input type="text" class="grw-connect-id" value="" placeholder="Place ID" /><span class="grw-quest grw-toggle" title="Click to help">?</span><div class="grw-quest-help">The standard way to find your Google Place ID is to go to <a href="https://developers.google.com/places/place-id" target="_blank">https://developers.google.com/places/place-id</a> and search for your company name.<br><br>But sometimes it may not work, in this case please see <a href="'+GRW_VARS.supportUrl+
3
+ '&grw_tab=fig#place_id" target="_blank">how to find any Google Place ID</a>.</div></div><div class="grw-builder-option"><select class="grw-connect-lang"><option value="" selected="selected">Choose language if required</option><option value="ar">Arabic</option><option value="bg">Bulgarian</option><option value="bn">Bengali</option><option value="ca">Catalan</option><option value="cs">Czech</option><option value="da">Danish</option><option value="de">German</option><option value="el">Greek</option><option value="en">English</option><option value="es">Spanish</option><option value="eu">Basque</option><option value="eu">Basque</option><option value="fa">Farsi</option><option value="fi">Finnish</option><option value="fil">Filipino</option><option value="fr">French</option><option value="gl">Galician</option><option value="gu">Gujarati</option><option value="hi">Hindi</option><option value="hr">Croatian</option><option value="hu">Hungarian</option><option value="id">Indonesian</option><option value="it">Italian</option><option value="iw">Hebrew</option><option value="ja">Japanese</option><option value="kn">Kannada</option><option value="ko">Korean</option><option value="lt">Lithuanian</option><option value="lv">Latvian</option><option value="ml">Malayalam</option><option value="mr">Marathi</option><option value="nl">Dutch</option><option value="no">Norwegian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="pt-BR">Portuguese (Brazil)</option><option value="pt-PT">Portuguese (Portugal)</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="sr">Serbian</option><option value="sv">Swedish</option><option value="ta">Tamil</option><option value="te">Telugu</option><option value="th">Thai</option><option value="tl">Tagalog</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="vi">Vietnamese</option><option value="zh">Chinese (Simplified)</option><option value="zh-Hant">Chinese (Traditional)</option></select></div><div class="grw-builder-option"><button class="grw-connect-btn">Connect Google</button><small class="grw-connect-error"></small></div></div><div class="grw-connections"></div></div><div class="grw-connect-options"><div class="grw-builder-inside"><div class="grw-builder-option">Layout<select id="view_mode" name="view_mode"><option value="slider" selected="selected">Slider</option><option value="list">List</option></select></div><div class="grw-builder-option">Slider speed<input type="text" name="slider_speed" value="" placeholder="5 seconds"></div><div class="grw-builder-option">Slider: text height<input type="text" name="slider_text_height" value="" placeholder="100px"></div><div class="grw-builder-option">Pagination<input type="text" name="pagination" value=""></div><div class="grw-builder-option">Maximum characters before \'read more\' link<input type="text" name="text_size" value=""></div><div class="grw-builder-option">Maximum width<input type="text" name="max_width" value="" placeholder="for instance: 300px"></div><div class="grw-builder-option">Maximum height<input type="text" name="max_height" value="" placeholder="for instance: 500px"></div><div class="grw-builder-option"><label><input type="checkbox" name="header_hide_social" value="">Hide headers</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_based_on" value="">Hide \'Based on ... reviews\'</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_reviews" value="">Hide reviews, leave only rating header</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_border" value="">Slider: hide border</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_prevnext" value="">Slider: hide prev & next buttons</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_dots" value="">Slider: hide dots</label></div><div class="grw-builder-option"><label><input type="checkbox" name="centered" value="">Place by center (only if Width is set)</label></div><div class="grw-builder-option"><label><input type="checkbox" name="dark_theme">Dark background</label></div></div><div class="grw-builder-top grw-toggle">Advance Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option"><label><input type="checkbox" name="lazy_load_img" checked>Lazy load images</label></div><div class="grw-builder-option"><label><input type="checkbox" name="google_def_rev_link">Use default Google reviews link</label><span class="grw-quest grw-quest-top grw-toggle" title="Click to help">?</span><div class="grw-quest-help" style="display:none;">If the direct link to all reviews <b>https://search.google.com/local/reviews?placeid=&lt;PLACE_ID&gt;</b> does not work with your Google place (leads to 404), please use this option to use the default reviews link to Google map.</div></div><div class="grw-builder-option"><label><input type="checkbox" name="open_link" checked>Open links in new Window</label></div><div class="grw-builder-option"><label><input type="checkbox" name="nofollow_link" checked>Use no follow links</label></div><div class="grw-builder-option">Reviewer avatar size<select name="reviewer_avatar_size"><option value="56" selected="selected">Small: 56px</option><option value="128">Medium: 128px</option><option value="256">Large: 256px</option></select></div><div class="grw-builder-option">Cache data<select name="cache"><option value="1">1 Hour</option><option value="3">3 Hours</option><option value="6">6 Hours</option><option value="12" selected="selected">12 Hours</option><option value="24">1 Day</option><option value="48">2 Days</option><option value="168">1 Week</option><option value="">Disable (NOT recommended)</option></select></div><div class="grw-builder-option">Reviews limit<input type="text" name="reviews_limit" value=""></div></div></div>';
4
  function grw_builder_init(a,c){var b=document.querySelector(c.el);if(b){b.innerHTML=GRW_HTML_CONTENT;c.conns&&grw_deserialize_connections(a,b,c.conns,c.opts);var d=b.querySelector(".grw-connect-google-inside");grw_connection(a,d,"google",c.authcode);a('.grw-connect-options input[type="text"],.grw-connect-options textarea').keyup(function(){grw_serialize_connections()});a('.grw-connect-options input[type="checkbox"],.grw-connect-options select').change(function(){grw_serialize_connections()});a(".grw-toggle",
5
  b).unbind("click").click(function(){a(this).toggleClass("toggled");a(this).next().slideToggle()});a(".grw-connections").sortable&&(a(".grw-connections").sortable({stop:function(a,b){grw_serialize_connections()}}),a(".grw-connections").disableSelection());a(".wp-review-hide").click(function(){grw_review_hide(a(this));return!1});a("#grw_save").click(function(){grw_feed_save_ajax();return!1})}}
6
  function grw_feed_save_ajax(a){if(!window.grw_title.value)return window.grw_title.focus(),!1;window.grw_save.innerText="Auto save, wait";window.grw_save.disabled=!0;jQuery.post(ajaxurl,{post_id:window.grw_post_id.value,title:window.grw_title.value,content:document.getElementById("grw-builder-connection").value,action:"grw_feed_save_ajax"},function(a){for(var b=document.querySelectorAll(".wp-gr"),c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);window.grw_collection_preview.innerHTML=a;jQuery(".wp-review-hide").unbind("click").click(function(){grw_review_hide(jQuery(this));
assets/js/public-main.js CHANGED
@@ -3,16 +3,16 @@
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 g=a._util;g.elements=k(a.options);g.count=g.elements.length;g.destroyed&&(g.destroyed=!1,a.options.container&&p(a.options.container,function(a){r(a,"scroll",g.validateT)}),r(window,"resize",g.saveViewportOffsetT),r(window,"resize",g.validateT),r(window,"scroll",g.validateT));b(a)}function b(a){for(var g=a._util,c=0;c<g.count;c++){var b=g.elements[c];
7
- var e=b;var f=a.options;var h=e.getBoundingClientRect();f.container&&y&&(e=e.closest(f.containerClass))?(e=e.getBoundingClientRect(),f=d(e,l)?d(h,{top:e.top-f.offset,right:e.right+f.offset,bottom:e.bottom+f.offset,left:e.left-f.offset}):!1):f=d(h,l);if(f||u(b,a.options.successClass))a.load(b),g.elements.splice(c,1),g.count--,c--}0===g.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(!u(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 g=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 l=new Image,k=function(){c.error&&c.error(a,"invalid");q(a,c.errorClass);m(l,"error",k);m(l,"load",n)},n=function(){e?w||h(a,g,d):a.style.backgroundImage='url("'+g+'")';f(a,c);m(l,"load",n);m(l,"error",k)};w&&(l=a,p(b.getElementsByTagName("source"),
9
- function(a){var b=c.srcset,g=a.getAttribute(b);g&&(a.setAttribute("srcset",g),a.removeAttribute(b))}));r(l,"error",k);r(l,"load",n);h(l,g,d)}else a.src=g,f(a,c)}else"video"===a.nodeName.toLowerCase()?(p(a.getElementsByTagName("source"),function(a){var b=c.src,g=a.getAttribute(b);g&&(a.setAttribute("src",g),a.removeAttribute(b))}),a.load(),f(a,c)):(c.error&&c.error(a,"missing"),q(a,c.errorClass))}function f(a,b){q(a,b.successClass);b.success&&b.success(a);a.removeAttribute(b.src);a.removeAttribute(b.srcset);
10
- p(b.breakpoints,function(b){a.removeAttribute(b.src)})}function h(a,b,c){c&&a.setAttribute("srcset",c);a.src=b}function u(a,b){return-1!==(" "+a.className+" ").indexOf(" "+b+" ")}function q(a,b){u(a,b)||(a.className+=" "+b)}function k(a){var b=[];a=a.root.querySelectorAll(a.selector);for(var c=a.length;c--;b.unshift(a[c]));return b}function n(a){l.bottom=(window.innerHeight||document.documentElement.clientHeight)+a;l.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 m(a,b,c){a.detachEvent?a.detachEvent&&a.detachEvent("on"+b,c):a.removeEventListener(b,c,{capture:!1,passive:!0})}function p(a,b){if(a&&b)for(var c=a.length,d=0;d<c&&!1!==b(a[d],d);d++);}function t(a,b,c){var d=0;return function(){var e=+new Date;e-d<b||(d=e,a.apply(c,arguments))}}var v,l,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;l={};l.top=0-c.options.offset;l.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):p(a,function(a){e(a,b,c)})};c.destroy=function(){var a=this._util;this.options.container&&p(this.options.container,function(b){m(b,"scroll",a.validateT)});m(window,"scroll",a.validateT);m(window,"resize",
15
- a.validateT);m(window,"resize",a.saveViewportOffsetT);a.count=0;a.elements.length=0;a.destroyed=!0};g.validateT=t(function(){b(c)},c.options.validateDelay,c);g.saveViewportOffsetT=t(function(){n(c.options.offset)},c.options.saveViewportOffsetDelay,c);n(c.options.offset);p(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
  h=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>h?WPacTime.Messages[b].year:WPacTime.Messages[b].years(h)},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,
@@ -69,9 +69,9 @@ function _rplg_lang(){var a=navigator;return(a.language||a.systemLanguage||a.use
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||"rplg";if(0>a.className.split(" ").indexOf(b))for(;(a=a.parentElement)&&0>a.className.split(" ").indexOf(b););return a}
72
- function _grw_init_slider(a){function b(){q.className=510>q.offsetWidth?"grw-row grw-row-xs":750>q.offsetWidth?"grw-row grw-row-x":1100>q.offsetWidth?"grw-row grw-row-s":1450>q.offsetWidth?"grw-row grw-row-m":1800>q.offsetWidth?"grw-row grw-row-l":"grw-row grw-row-xl";n.length&&setTimeout(d,200)}function d(){var b=k.offsetWidth/n[0].offsetWidth,d=Math.ceil(n.length/b),f=a.querySelector(".grw-slider-dots");f.innerHTML="";for(var h=0;h<d;h++){var g=document.createElement("div");g.className="grw-slider-dot";
73
- x=Math.ceil((k.scrollLeft+(k.scrollLeft+n[0].offsetWidth*b))/2*d/k.scrollWidth);x==h+1&&(g.className="grw-slider-dot active");g.setAttribute("data-index",h+1);g.setAttribute("data-visible",b);f.appendChild(g);g.onclick=function(){var b=a.querySelector(".grw-slider-dot.active");b=parseInt(b.getAttribute("data-index"));var c=parseInt(this.getAttribute("data-index")),d=parseInt(this.getAttribute("data-visible"));b<c?e(d*Math.abs(c-b)):k.scrollBy(-n[0].offsetWidth*d*Math.abs(c-b),0);a.querySelector(".grw-slider-dot.active").className=
74
- "grw-slider-dot";this.className="grw-slider-dot active";m&&clearInterval(m)}}}function e(a){k.scrollBy(n[0].offsetWidth*a,0)}function f(){var b=a.querySelector(".grw-slider-review:last-child"),d=b.getBoundingClientRect();b=b.parentNode.getBoundingClientRect();(2>Math.abs(b.left-d.left)||b.left<=d.left)&&d.left<b.right&&(2>Math.abs(b.right-d.right)||b.right>=d.right)&&d.right>b.left?k.scrollBy(-k.scrollWidth,0):e(1);m=setTimeout(f,1E3*u.speed)}var h=a.querySelector(".grw-slider"),u=JSON.parse(h.getAttribute("data-options")),
75
- q=a.querySelector(".grw-slider .grw-row"),k=a.querySelector(".grw-slider-reviews"),n=a.querySelectorAll(".grw-slider-review"),r=null,m=null,p=function(){(h.offsetWidth||h.offsetHeight||h.getClientRects().length)&&"hidden"!==window.getComputedStyle(h).visibility?(b(),_rplg_init_blazy(10),n.length&&setTimeout(f,300)):setTimeout(p,300)};p();window.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(function(){b()},150)});k.addEventListener("scroll",function(){setTimeout(d,200);window.rplg_blazy&&
76
- window.rplg_blazy.revalidate()});var t=a.querySelector(".grw-slider-prev");t&&(t.onclick=function(){k.scrollBy(-n[0].offsetWidth,0);m&&clearInterval(m)});if(t=a.querySelector(".grw-slider-next"))t.onclick=function(){e(1);m&&clearInterval(m)}}
77
  function grw_init(a,b){_rplg_timeago(document.querySelectorAll(".wpac [data-time]"));_rplg_read_more();_rplg_init_blazy(10);(a=_rplg_get_parent(a,"wp-gr"))&&"true"!=a.getAttribute("data-exec")&&"slider"==b&&(a.setAttribute("data-exec","true"),_grw_init_slider(a))}document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll('.wp-gr[data-exec="false"]'),b=0;b<a.length;b++){var d=a[b];grw_init(d,d.getAttribute("data-layout"))}});
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 g=a._util;g.elements=n(a.options);g.count=g.elements.length;g.destroyed&&(g.destroyed=!1,a.options.container&&l(a.options.container,function(a){m(a,"scroll",g.validateT)}),m(window,"resize",g.saveViewportOffsetT),m(window,"resize",g.validateT),m(window,"scroll",g.validateT));b(a)}function b(a){for(var g=a._util,c=0;c<g.count;c++){var b=g.elements[c];
7
+ var r=b;var e=a.options;var f=r.getBoundingClientRect();e.container&&z&&(r=r.closest(e.containerClass))?(r=r.getBoundingClientRect(),e=d(r,p)?d(f,{top:r.top-e.offset,right:r.right+e.offset,bottom:r.bottom+e.offset,left:r.left-e.offset}):!1):e=d(f,p);if(e||u(b,a.options.successClass))a.load(b),g.elements.splice(c,1),g.count--,c--}0===g.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(!u(a,c.successClass)&&(b||c.loadInvisible||
8
+ 0<a.offsetWidth&&0<a.offsetHeight))if(b=a.getAttribute(w)||a.getAttribute(c.src)){b=b.split(c.separator);var g=b[A&&1<b.length?1:0],d=a.getAttribute(c.srcset),e="img"===a.nodeName.toLowerCase(),y=(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");t(a,c.errorClass);k(q,"error",p);k(q,"load",n)},n=function(){e?y||h(a,g,d):a.style.backgroundImage='url("'+g+'")';f(a,c);k(q,"load",n);k(q,"error",p)};y&&(q=a,l(b.getElementsByTagName("source"),
9
+ function(a){var b=c.srcset,g=a.getAttribute(b);g&&(a.setAttribute("srcset",g),a.removeAttribute(b))}));m(q,"error",p);m(q,"load",n);h(q,g,d)}else a.src=g,f(a,c)}else"video"===a.nodeName.toLowerCase()?(l(a.getElementsByTagName("source"),function(a){var b=c.src,g=a.getAttribute(b);g&&(a.setAttribute("src",g),a.removeAttribute(b))}),a.load(),f(a,c)):(c.error&&c.error(a,"missing"),t(a,c.errorClass))}function f(a,b){t(a,b.successClass);b.success&&b.success(a);a.removeAttribute(b.src);a.removeAttribute(b.srcset);
10
+ l(b.breakpoints,function(b){a.removeAttribute(b.src)})}function h(a,b,c){c&&a.setAttribute("srcset",c);a.src=b}function u(a,b){return-1!==(" "+a.className+" ").indexOf(" "+b+" ")}function t(a,b){u(a,b)||(a.className+=" "+b)}function n(a){var b=[];a=a.root.querySelectorAll(a.selector);for(var c=a.length;c--;b.unshift(a[c]));return b}function v(a){p.bottom=(window.innerHeight||document.documentElement.clientHeight)+a;p.right=(window.innerWidth||document.documentElement.clientWidth)+a}function m(a,b,
11
+ c){a.attachEvent?a.attachEvent&&a.attachEvent("on"+b,c):a.addEventListener(b,c,{capture:!1,passive:!0})}function k(a,b,c){a.detachEvent?a.detachEvent&&a.detachEvent("on"+b,c):a.removeEventListener(b,c,{capture:!1,passive:!0})}function l(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 w,p,A,z;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=w=c.options.src||"data-src";z=Element.prototype.closest;A=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):l(a,function(a){e(a,b,c)})};c.destroy=function(){var a=this._util;this.options.container&&l(this.options.container,function(b){k(b,"scroll",a.validateT)});k(window,"scroll",a.validateT);k(window,"resize",
15
+ a.validateT);k(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(){v(c.options.offset)},c.options.saveViewportOffsetDelay,c);v(c.options.offset);l(c.options.breakpoints,function(a){if(a.width>=window.screen.width)return w=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
  h=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>h?WPacTime.Messages[b].year:WPacTime.Messages[b].years(h)},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,
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||"rplg";if(0>a.className.split(" ").indexOf(b))for(;(a=a.parentElement)&&0>a.className.split(" ").indexOf(b););return a}
72
+ function _grw_init_slider(a){function b(){var b=a.querySelector(".grw-slider .grw-row");b.className=510>b.offsetWidth?"grw-row grw-row-xs":750>b.offsetWidth?"grw-row grw-row-x":1100>b.offsetWidth?"grw-row grw-row-s":1450>b.offsetWidth?"grw-row grw-row-m":1800>b.offsetWidth?"grw-row grw-row-l":"grw-row grw-row-xl";n.length&&setTimeout(d,200)}function d(){var b=a.querySelector(".grw-slider-reviews"),d=a.querySelectorAll(".grw-slider-review"),f=b.offsetWidth/d[0].offsetWidth,h=Math.ceil(d.length/f),
73
+ l=a.querySelector(".grw-slider-dots");if(l){l.innerHTML="";for(var g=0;g<h;g++){var k=document.createElement("div");k.className="grw-slider-dot";x=Math.ceil((b.scrollLeft+(b.scrollLeft+d[0].offsetWidth*f))/2*h/b.scrollWidth);x==g+1&&(k.className="grw-slider-dot active");k.setAttribute("data-index",g+1);k.setAttribute("data-visible",f);l.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")),
74
+ f=parseInt(this.getAttribute("data-visible"));b<d?e(f*Math.abs(d-b)):t.scrollBy(-n[0].offsetWidth*f*Math.abs(d-b),0);a.querySelector(".grw-slider-dot.active").className="grw-slider-dot";this.className="grw-slider-dot active";m&&clearInterval(m)}}}}function e(a){t.scrollBy(n[0].offsetWidth*a,0)}function f(){var b=a.querySelector(".grw-slider-review:last-child"),d=b.getBoundingClientRect();b=b.parentNode.getBoundingClientRect();(2>Math.abs(b.left-d.left)||b.left<=d.left)&&d.left<b.right&&(2>Math.abs(b.right-
75
+ d.right)||b.right>=d.right)&&d.right>b.left?t.scrollBy(-t.scrollWidth,0):e(1);m=setTimeout(f,1E3*u.speed)}var h=a.querySelector(".grw-slider"),u=JSON.parse(h.getAttribute("data-options")),t=a.querySelector(".grw-slider-reviews"),n=a.querySelectorAll(".grw-slider-review"),v=null,m=null,k=function(){(h.offsetWidth||h.offsetHeight||h.getClientRects().length)&&"hidden"!==window.getComputedStyle(h).visibility?(b(),_rplg_init_blazy(10),n.length&&setTimeout(f,300)):setTimeout(k,300)};k();window.addEventListener("resize",
76
+ function(){clearTimeout(v);v=setTimeout(function(){b()},150)});t.addEventListener("scroll",function(){setTimeout(d,200);window.rplg_blazy&&window.rplg_blazy.revalidate()});var l=a.querySelector(".grw-slider-prev");l&&(l.onclick=function(){t.scrollBy(-n[0].offsetWidth,0);m&&clearInterval(m)});if(l=a.querySelector(".grw-slider-next"))l.onclick=function(){e(1);m&&clearInterval(m)}}
77
  function grw_init(a,b){_rplg_timeago(document.querySelectorAll(".wpac [data-time]"));_rplg_read_more();_rplg_init_blazy(10);(a=_rplg_get_parent(a,"wp-gr"))&&"true"!=a.getAttribute("data-exec")&&"slider"==b&&(a.setAttribute("data-exec","true"),_grw_init_slider(a))}document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll('.wp-gr[data-exec="false"]'),b=0;b<a.length;b++){var d=a[b];grw_init(d,d.getAttribute("data-layout"))}});
assets/src/js/admin-builder.js CHANGED
@@ -158,6 +158,20 @@ var GRW_HTML_CONTENT = '' +
158
  '</label>' +
159
  '</div>' +
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  '<div class="grw-builder-option">' +
162
  '<label>' +
163
  '<input type="checkbox" name="centered" value="">' +
158
  '</label>' +
159
  '</div>' +
160
 
161
+ '<div class="grw-builder-option">' +
162
+ '<label>' +
163
+ '<input type="checkbox" name="slider_hide_prevnext" value="">' +
164
+ 'Slider: hide prev & next buttons' +
165
+ '</label>' +
166
+ '</div>' +
167
+
168
+ '<div class="grw-builder-option">' +
169
+ '<label>' +
170
+ '<input type="checkbox" name="slider_hide_dots" value="">' +
171
+ 'Slider: hide dots' +
172
+ '</label>' +
173
+ '</div>' +
174
+
175
  '<div class="grw-builder-option">' +
176
  '<label>' +
177
  '<input type="checkbox" name="centered" value="">' +
assets/src/js/public-main.js CHANGED
@@ -112,7 +112,6 @@ function _rplg_get_parent(el, cl) {
112
  function _grw_init_slider(el) {
113
  const SLIDER_ELEM = el.querySelector('.grw-slider'),
114
  SLIDER_OPTS = JSON.parse(SLIDER_ELEM.getAttribute('data-options')),
115
- ROW_ELEM = el.querySelector('.grw-slider .grw-row'),
116
  REVIEWS_ELEM = el.querySelector('.grw-slider-reviews'),
117
  REVIEW_ELEMS = el.querySelectorAll('.grw-slider-review');
118
 
@@ -145,18 +144,19 @@ function _grw_init_slider(el) {
145
  });
146
 
147
  function resize() {
148
- if (ROW_ELEM.offsetWidth < 510) {
149
- ROW_ELEM.className = 'grw-row grw-row-xs';
150
- } else if (ROW_ELEM.offsetWidth < 750) {
151
- ROW_ELEM.className = 'grw-row grw-row-x';
152
- } else if (ROW_ELEM.offsetWidth < 1100) {
153
- ROW_ELEM.className = 'grw-row grw-row-s';
154
- } else if (ROW_ELEM.offsetWidth < 1450) {
155
- ROW_ELEM.className = 'grw-row grw-row-m';
156
- } else if (ROW_ELEM.offsetWidth < 1800) {
157
- ROW_ELEM.className = 'grw-row grw-row-l';
 
158
  } else {
159
- ROW_ELEM.className = 'grw-row grw-row-xl';
160
  }
161
  if (REVIEW_ELEMS.length) {
162
  setTimeout(dotsinit, 200);
@@ -164,21 +164,25 @@ function _grw_init_slider(el) {
164
  }
165
 
166
  function dotsinit() {
167
- var t = REVIEW_ELEMS.length,
168
- v = REVIEWS_ELEM.offsetWidth / REVIEW_ELEMS[0].offsetWidth;
 
 
169
 
170
  var dots = Math.ceil(t/v),
171
  dotscnt = el.querySelector('.grw-slider-dots');
172
 
 
 
173
  dotscnt.innerHTML = '';
174
  for (var i = 0; i < dots; i++) {
175
  var dot = document.createElement('div');
176
  dot.className = 'grw-slider-dot';
177
 
178
- var revWidth = REVIEW_ELEMS[0].offsetWidth;
179
- var center = (REVIEWS_ELEM.scrollLeft + (REVIEWS_ELEM.scrollLeft + revWidth * v)) / 2;
180
 
181
- x = Math.ceil((center * dots) / REVIEWS_ELEM.scrollWidth);
182
  if (x == i + 1) dot.className = 'grw-slider-dot active';
183
 
184
  dot.setAttribute('data-index', i + 1);
112
  function _grw_init_slider(el) {
113
  const SLIDER_ELEM = el.querySelector('.grw-slider'),
114
  SLIDER_OPTS = JSON.parse(SLIDER_ELEM.getAttribute('data-options')),
 
115
  REVIEWS_ELEM = el.querySelector('.grw-slider-reviews'),
116
  REVIEW_ELEMS = el.querySelectorAll('.grw-slider-review');
117
 
144
  });
145
 
146
  function resize() {
147
+ var row_elem = el.querySelector('.grw-slider .grw-row');
148
+ if (row_elem.offsetWidth < 510) {
149
+ row_elem.className = 'grw-row grw-row-xs';
150
+ } else if (row_elem.offsetWidth < 750) {
151
+ row_elem.className = 'grw-row grw-row-x';
152
+ } else if (row_elem.offsetWidth < 1100) {
153
+ row_elem.className = 'grw-row grw-row-s';
154
+ } else if (row_elem.offsetWidth < 1450) {
155
+ row_elem.className = 'grw-row grw-row-m';
156
+ } else if (row_elem.offsetWidth < 1800) {
157
+ row_elem.className = 'grw-row grw-row-l';
158
  } else {
159
+ row_elem.className = 'grw-row grw-row-xl';
160
  }
161
  if (REVIEW_ELEMS.length) {
162
  setTimeout(dotsinit, 200);
164
  }
165
 
166
  function dotsinit() {
167
+ var reviews_elem = el.querySelector('.grw-slider-reviews'),
168
+ review_elems = el.querySelectorAll('.grw-slider-review'),
169
+ t = review_elems.length,
170
+ v = reviews_elem.offsetWidth / review_elems[0].offsetWidth;
171
 
172
  var dots = Math.ceil(t/v),
173
  dotscnt = el.querySelector('.grw-slider-dots');
174
 
175
+ if (!dotscnt) return;
176
+
177
  dotscnt.innerHTML = '';
178
  for (var i = 0; i < dots; i++) {
179
  var dot = document.createElement('div');
180
  dot.className = 'grw-slider-dot';
181
 
182
+ var revWidth = review_elems[0].offsetWidth;
183
+ var center = (reviews_elem.scrollLeft + (reviews_elem.scrollLeft + revWidth * v)) / 2;
184
 
185
+ x = Math.ceil((center * dots) / reviews_elem.scrollWidth);
186
  if (x == i + 1) dot.className = 'grw-slider-dot active';
187
 
188
  dot.setAttribute('data-index', i + 1);
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.1.6
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.1.6');
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.1.7
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.1.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/');
includes/class-view.php CHANGED
@@ -92,12 +92,14 @@ class View {
92
  </div>
93
  <?php } ?>
94
  </div>
 
95
  <div class="grw-slider-controls">
96
  <div class="grw-slider-btns grw-slider-prev">‹</div>
97
  <div class="grw-slider-btns grw-slider-next">›</div>
98
  </div>
 
99
  </div>
100
- <div class="grw-slider-dots"></div>
101
  </div>
102
  <?php } ?>
103
  </div>
92
  </div>
93
  <?php } ?>
94
  </div>
95
+ <?php if (!$options->slider_hide_prevnext) { ?>
96
  <div class="grw-slider-controls">
97
  <div class="grw-slider-btns grw-slider-prev">‹</div>
98
  <div class="grw-slider-btns grw-slider-next">›</div>
99
  </div>
100
+ <?php } ?>
101
  </div>
102
+ <?php if (!$options->slider_hide_dots) { ?><div class="grw-slider-dots"></div><?php } ?>
103
  </div>
104
  <?php } ?>
105
  </div>
includes/core/class-connect-google.php CHANGED
@@ -61,11 +61,8 @@ class Connect_Google {
61
  $result = array(
62
  'id' => $body_json->result->place_id,
63
  'name' => $body_json->result->name,
64
- 'photo' => strlen($photo) ? $photo
65
- : (
66
- strlen($body_json->result->business_photo) ?
67
- $body_json->result->business_photo : $body_json->result->icon
68
- ),
69
  'reviews' => $body_json->result->reviews
70
  );
71
  $status = 'success';
@@ -265,7 +262,7 @@ class Connect_Google {
265
  'rating' => $review->rating,
266
  'text' => $review->text,
267
  'time' => $review->time,
268
- 'language' => $review->language,
269
  'author_name' => $review->author_name,
270
  'author_url' => isset($review->author_url) ? $review->author_url : null,
271
  'profile_photo_url' => isset($review->profile_photo_url) ? $review->profile_photo_url : null
@@ -298,6 +295,13 @@ class Connect_Google {
298
  if(!is_wp_error($res)) {
299
  $bits = wp_remote_retrieve_body($res);
300
  $filename = $response_result_json->place_id . '.jpg';
 
 
 
 
 
 
 
301
  $upload = wp_upload_bits($filename, null, $bits);
302
  return $upload['url'];
303
  }
61
  $result = array(
62
  'id' => $body_json->result->place_id,
63
  'name' => $body_json->result->name,
64
+ 'photo' => strlen($body_json->result->business_photo) ?
65
+ $body_json->result->business_photo : $body_json->result->icon,
 
 
 
66
  'reviews' => $body_json->result->reviews
67
  );
68
  $status = 'success';
262
  'rating' => $review->rating,
263
  'text' => $review->text,
264
  'time' => $review->time,
265
+ 'language' => $review_lang,
266
  'author_name' => $review->author_name,
267
  'author_url' => isset($review->author_url) ? $review->author_url : null,
268
  'profile_photo_url' => isset($review->profile_photo_url) ? $review->profile_photo_url : null
295
  if(!is_wp_error($res)) {
296
  $bits = wp_remote_retrieve_body($res);
297
  $filename = $response_result_json->place_id . '.jpg';
298
+
299
+ $upload_dir = wp_upload_dir();
300
+ $full_filepath = $upload_dir['path'] . '/' . $filename;
301
+ if (file_exists($full_filepath)) {
302
+ wp_delete_file($full_filepath);
303
+ }
304
+
305
  $upload = wp_upload_bits($filename, null, $bits);
306
  return $upload['url'];
307
  }
includes/core/class-core.php CHANGED
@@ -17,6 +17,8 @@ class Core {
17
  'hide_reviews' => false,
18
 
19
  'slider_hide_border' => false,
 
 
20
  'slider_text_height' => '',
21
  'slider_speed' => 5,
22
 
17
  'hide_reviews' => false,
18
 
19
  'slider_hide_border' => false,
20
+ 'slider_hide_prevnext' => false,
21
+ 'slider_hide_dots' => false,
22
  'slider_text_height' => '',
23
  'slider_speed' => 5,
24
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://richplugins.com/business-reviews-bundle-wordpress-plugin
4
  Tags: google reviews, google, 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.9
7
- Stable tag: 2.1.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -98,6 +98,12 @@ To find out more about who we are and what we do, here are some useful links:
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
101
  = 2.1.6 =
102
  * Bugfix: slider fixed with latest webkit
103
  * Bugfix: wrong text domain for load_plugin_textdomain
4
  Tags: google reviews, google, 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.9
7
+ Stable tag: 2.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
98
 
99
  == Changelog ==
100
 
101
+ = 2.1.7 =
102
+ * Improve: slider hide prev & next buttons option
103
+ * Improve: slider hide dots option
104
+ * Bugfix: multiple duplicate of business photos
105
+ * Bugfix: duplicate reviews
106
+
107
  = 2.1.6 =
108
  * Bugfix: slider fixed with latest webkit
109
  * Bugfix: wrong text domain for load_plugin_textdomain