{"id":410,"date":"2023-10-21T06:03:14","date_gmt":"2023-10-21T06:03:14","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=410"},"modified":"2023-10-27T12:43:01","modified_gmt":"2023-10-27T12:43:01","slug":"widget-google-reviews","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/widget-google-reviews\/","title":{"rendered":"Widget Google Reviews Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Widget Google Reviews Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the  for Google Reviews Plugin shortcode not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Widget Google Reviews Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/widget-google-reviews\/assets\/icon-128x128.png?rev=2871993\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/widget-google-reviews\" target=\"_blank\" rel=\"noopener\">\n                        Plugin for Google Reviews                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Plugin for Google Reviews is a WordPress tool that enables you to effortlessly integrate and display Google Reviews on your website, enhancing your site&#039;s credibility and trust.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2606<\/span> (1192)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 100000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: false            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[grw]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Widget Google Reviews [grw] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Widget-Google-Reviews plugin shortcode &#8216;grw&#8217; initializes the display of Google reviews. It checks if the plugin is active, then retrieves and renders the reviews based on provided place_id or id.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[grw]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible grw shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>place_id<\/code> &#8211; Identifier for a specific Google Place to get reviews from.<\/li>\n<li><code>id<\/code> &#8211; Identifier for a specific feed stored in the plugin.<\/li>\n<li><code>grw_active<\/code> &#8211; Controls if the plugin functionality is active or not.<\/li>\n<li><code>grw_demand_assets<\/code> &#8211; Decides whether to load the plugin&#8217;s public styles and scripts.<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A basic usage of the shortcode to initialize the Google Reviews Widget plugin. This shortcode does not require any additional parameters.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[grw \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to display Google Reviews for a specific place by referencing the place_id. The widget will fetch and display reviews for the specified place.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[grw place_id=\"ChIJN1t_tDeuEmsRUsoyG83frY4\" \/]<\/code><\/pre>\n\n\n<p>Using the shortcode to display Google Reviews for a specific ID. If the ID does not exist, the widget will not display anything.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[grw id=\"12345\" \/]<\/code><\/pre>\n\n\n<p>Using the shortcode to display Google Reviews for a specific place and also enqueue public styles and scripts by setting grw_demand_assets to true. This will enhance the display of the reviews on the front-end.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[grw place_id=\"ChIJN1t_tDeuEmsRUsoyG83frY4\" grw_demand_assets=\"true\" \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[grw]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode('grw', array($this, 'init'));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction init($atts) {\n        if (get_option(&#039;grw_active&#039;) === &#039;0&#039;) {\n            return &#039;&#039;;\n        }\n\n        if (isset($atts&#91;&#039;place_id&#039;]) &amp;&amp; strlen($atts&#91;&#039;place_id&#039;]) &gt; 0) {\n            $feed = $this-&gt;feed_old-&gt;get_feed($atts&#91;&#039;place_id&#039;], $atts);\n\n        } else {\n            $atts = shortcode_atts(array(&#039;id&#039; =&gt; 0), $atts, &#039;grw&#039;);\n            $feed = $this-&gt;feed_deserializer-&gt;get_feed($atts&#91;&#039;id&#039;]);\n\n            if (!$feed) {\n                return null;\n            }\n        }\n\n        $grw_demand_assets = get_option(&#039;grw_demand_assets&#039;);\n        if ($grw_demand_assets || $grw_demand_assets == &#039;true&#039;) {\n            $this-&gt;assets-&gt;enqueue_public_styles();\n            $this-&gt;assets-&gt;enqueue_public_scripts();\n        }\n\n        $data = $this-&gt;core-&gt;get_reviews($feed);\n        return $this-&gt;view-&gt;render($feed-&gt;ID, $data&#91;&#039;businesses&#039;], $data&#91;&#039;reviews&#039;], $data&#91;&#039;options&#039;]);\n    }\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">widget-google-reviews\/widget-google-reviews\/includes\/class-feed-shortcode.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong> for Google Reviews Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Widget Google Reviews Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the for Google Reviews Plugin shortcode not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Plugin for Google Reviews","slug":"","version":"2.8","author":"<a href=\"https:\/\/richplugins.com\">RichPlugins <\/a>","icons":"https:\/\/ps.w.org\/widget-google-reviews\/assets\/icon-128x128.png?rev=2871993","plugin_tags":"{\"google\":\"google\",\"google-reviews\":\"Google Reviews\",\"rating\":\"rating\",\"reviews\":\"reviews\",\"widget\":\"widget\"}","author_profile":"https:\/\/profiles.wordpress.org\/widgetpack\/","requires":"2.8","tested":"6.3.2","requires_php":"false","rating":98,"num_ratings":1192,"active_installs":100000,"downloaded":2942937,"last_updated":"2023-08-13 11:59pm GMT","added":"2016-10-08","homepage":"https:\/\/richplugins.com\/business-reviews-bundle-wordpress-plugin","short_description":"Official way to show Google Reviews on WordPress site without Google crawling and other unofficial methods. Boost user trust and sales on your website &hellip;","description":"\"Plugin for Google Reviews is a WordPress tool that enables you to effortlessly integrate and display Google Reviews on your website, enhancing your site's credibility and trust.\"","shortcodes":"[\"grw\"]","footnotes":""},"categories":[1],"tags":[4],"class_list":["post-410","post","type-post","status-publish","format-standard","hentry","category-plugins","tag-featured"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=410"}],"version-history":[{"count":2,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/410\/revisions"}],"predecessor-version":[{"id":539,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/410\/revisions\/539"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}