Google Reviews Widget - Version 2.1.0

Version Description

  • Bugfix: broken the 'See All Reviews' link without header
  • Bugfix: wrong language ISO codes for Chinese (correct zh and zh-Hant)
Download this release

Release Info

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

Code changes from version 2.0.9 to 2.1.0

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-CN">Chinese (Simplified)</option><option value="zh-TW">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">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="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">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="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
@@ -69,8 +69,8 @@ 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 _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,"wp-gr");var g=
75
  a.querySelector(".grw-slider .grw-row"),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");
76
- h&&(h.onclick=function(){m.scrollBy(-n[0].offsetWidth,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 grw_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(){grw_init()});
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(){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,"wp-gr");var g=
75
  a.querySelector(".grw-slider .grw-row"),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");
76
+ h&&(h.onclick=function(){m.scrollBy(-n[0].offsetWidth,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 grw_init(a,b){_rplg_timeago(document.querySelectorAll(".wpac [data-time]"));_rplg_read_more();_rplg_init_blazy(10);a&&"slider"==b&&_grw_init_slider(a)}document.addEventListener("DOMContentLoaded",function(){grw_init()});
assets/src/js/admin-builder.js CHANGED
@@ -67,8 +67,8 @@ var GRW_HTML_CONTENT = '' +
67
  '<option value="tr">Turkish</option>' +
68
  '<option value="uk">Ukrainian</option>' +
69
  '<option value="vi">Vietnamese</option>' +
70
- '<option value="zh-CN">Chinese (Simplified)</option>' +
71
- '<option value="zh-TW">Chinese (Traditional)</option>' +
72
  '</select>' +
73
  '</div>' +
74
  /*'<div class="grw-builder-option">' +
67
  '<option value="tr">Turkish</option>' +
68
  '<option value="uk">Ukrainian</option>' +
69
  '<option value="vi">Vietnamese</option>' +
70
+ '<option value="zh">Chinese (Simplified)</option>' +
71
+ '<option value="zh-Hant">Chinese (Traditional)</option>' +
72
  '</select>' +
73
  '</div>' +
74
  /*'<div class="grw-builder-option">' +
assets/src/js/public-main.js CHANGED
@@ -109,7 +109,7 @@ function _rplg_get_parent(el, cl) {
109
  return el;
110
  }
111
 
112
- function _rplg_init_slider(el) {
113
  el = _rplg_get_parent(el, 'wp-gr');
114
 
115
  const ROW_ELEM = el.querySelector('.grw-slider .grw-row'),
@@ -266,7 +266,7 @@ function grw_init(el, layout) {
266
  _rplg_read_more();
267
  _rplg_init_blazy(10);
268
  if (el && layout == 'slider') {
269
- _rplg_init_slider(el);
270
  }
271
  }
272
 
109
  return el;
110
  }
111
 
112
+ function _grw_init_slider(el) {
113
  el = _rplg_get_parent(el, 'wp-gr');
114
 
115
  const ROW_ELEM = el.querySelector('.grw-slider .grw-row'),
266
  _rplg_read_more();
267
  _rplg_init_blazy(10);
268
  if (el && layout == 'slider') {
269
+ _grw_init_slider(el);
270
  }
271
  }
272
 
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.9
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.9');
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.0
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.0');
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
@@ -120,21 +120,7 @@ class View {
120
  <?php }
121
  if (!$options->hide_reviews) { ?>
122
  <div class="wp-google-content-inner">
123
- <?php
124
- $this->grw_place_reviews(
125
- $business,
126
- $reviews,
127
- $business->id,
128
- $options->text_size,
129
- $options->pagination,
130
- $options->reviewer_avatar_size,
131
- $options->open_link,
132
- $options->nofollow_link,
133
- $options->lazy_load_img,
134
- $options->google_def_rev_link,
135
- $is_admin
136
- );
137
- ?>
138
  </div>
139
  <?php } ?>
140
  </div>
@@ -192,19 +178,7 @@ class View {
192
  <div class="wp-google-body"></div>
193
  <div class="wp-google-content">
194
  <div class="wp-google-content-inner">
195
- <?php
196
- $this->grw_place_reviews(
197
- $businesses[0],
198
- $reviews,
199
- $businesses[0]->id,
200
- $options->text_size,
201
- $options->pagination,
202
- $options->reviewer_avatar_size,
203
- $options->open_link,
204
- $options->nofollow_link,
205
- $options->lazy_load_img,
206
- $options->google_def_rev_link
207
- ); ?>
208
  </div>
209
  </div>
210
  <div class="wp-google-footer">
@@ -241,29 +215,44 @@ class View {
241
  <?php
242
  }
243
 
244
- function grw_place_reviews($place, $reviews, $place_id, $text_size, $pagination, $reviewer_avatar_size, $open_link, $nofollow_link, $lazy_load_img, $google_def_rev_link, $is_admin = false) {
245
  ?>
246
  <div class="wp-google-reviews">
247
  <?php
 
 
 
248
  $hr = false;
249
  if (count($reviews) > 0) {
250
  $i = 0;
251
  foreach ($reviews as $review) {
252
- if ($pagination > 0 && $pagination <= $i++) {
 
 
 
 
253
  $hr = true;
254
  }
255
- $this->grw_place_review($review, $hr, $text_size, $reviewer_avatar_size, $open_link, $nofollow_link, $lazy_load_img, $is_admin);
 
 
 
 
 
 
 
 
256
  }
257
  }
258
  ?>
259
  </div>
260
- <?php if ($pagination > 0 && $hr) { ?>
261
- <a class="wp-google-url" href="#" onclick="return rplg_next_reviews.call(this, 'google', <?php echo $pagination; ?>);">
262
  <?php echo __('Next Reviews', 'grw'); ?>
263
  </a>
264
  <?php
265
  } else {
266
- $reviews_link = $google_def_rev_link ? $place->url : 'https://search.google.com/local/reviews?placeid=' . $place_id;
267
  $this->grw_anchor($reviews_link, 'wp-google-url', __('See All Reviews', 'grw'), true, true);
268
  }
269
  }
120
  <?php }
121
  if (!$options->hide_reviews) { ?>
122
  <div class="wp-google-content-inner">
123
+ <?php $this->grw_place_reviews($reviews, $options, $is_admin); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  </div>
125
  <?php } ?>
126
  </div>
178
  <div class="wp-google-body"></div>
179
  <div class="wp-google-content">
180
  <div class="wp-google-content-inner">
181
+ <?php $this->grw_place_reviews($reviews, $options); ?>
 
 
 
 
 
 
 
 
 
 
 
 
182
  </div>
183
  </div>
184
  <div class="wp-google-footer">
215
  <?php
216
  }
217
 
218
+ function grw_place_reviews($reviews, $options, $is_admin = false) {
219
  ?>
220
  <div class="wp-google-reviews">
221
  <?php
222
+ $place_id = null;
223
+ $place_url = null;
224
+
225
  $hr = false;
226
  if (count($reviews) > 0) {
227
  $i = 0;
228
  foreach ($reviews as $review) {
229
+ if (!$place_id) {
230
+ $place_id = $review->biz_id;
231
+ $place_url = $review->biz_url;
232
+ }
233
+ if ($options->pagination > 0 && $options->pagination <= $i++) {
234
  $hr = true;
235
  }
236
+ $this->grw_place_review(
237
+ $review, $hr,
238
+ $options->text_size,
239
+ $options->reviewer_avatar_size,
240
+ $options->open_link,
241
+ $options->nofollow_link,
242
+ $options->lazy_load_img,
243
+ $is_admin
244
+ );
245
  }
246
  }
247
  ?>
248
  </div>
249
+ <?php if ($options->pagination > 0 && $hr) { ?>
250
+ <a class="wp-google-url" href="#" onclick="return rplg_next_reviews.call(this, 'google', <?php echo $options->pagination; ?>);">
251
  <?php echo __('Next Reviews', 'grw'); ?>
252
  </a>
253
  <?php
254
  } else {
255
+ $reviews_link = $options->google_def_rev_link ? $place_url : 'https://search.google.com/local/reviews?placeid=' . $place_id;
256
  $this->grw_anchor($reviews_link, 'wp-google-url', __('See All Reviews', 'grw'), true, true);
257
  }
258
  }
includes/core/class-core.php CHANGED
@@ -251,6 +251,7 @@ class Core {
251
  'id' => $rev->id,
252
  'hide' => $rev->hide,
253
  'biz_id' => $google_biz->id,
 
254
  'rating' => $rev->rating,
255
  'text' => wp_encode_emoji($rev->text),
256
  'author_avatar' => $rev->profile_photo_url,
251
  'id' => $rev->id,
252
  'hide' => $rev->hide,
253
  'biz_id' => $google_biz->id,
254
+ 'biz_url' => $place->url,
255
  'rating' => $rev->rating,
256
  'text' => wp_encode_emoji($rev->text),
257
  'author_avatar' => $rev->profile_photo_url,
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.8
7
- Stable tag: 2.0.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -98,9 +98,15 @@ To find out more about who we are and what we do, here are some useful links:
98
 
99
  == Changelog ==
100
 
 
 
 
 
101
  = 2.0.9 =
102
  * Improve: added settings for manually db updates
103
  * Bugfix: conflict with a business version
 
 
104
 
105
  = 2.0.8 =
106
  * Bugfix: js errors if reviews are hidden in the slider
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.8
7
+ Stable tag: 2.1.0
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.0 =
102
+ * Bugfix: broken the 'See All Reviews' link without header
103
+ * Bugfix: wrong language ISO codes for Chinese (correct zh and zh-Hant)
104
+
105
  = 2.0.9 =
106
  * Improve: added settings for manually db updates
107
  * Bugfix: conflict with a business version
108
+ * Bugfix: broken the 'See All Reviews' link without header
109
+ * Bugfix: wrong language ISO codes for Chinese (correct zh and zh-Hant)
110
 
111
  = 2.0.8 =
112
  * Bugfix: js errors if reviews are hidden in the slider