=== GMBSync - Reviews Widget for Google ===
Contributors: jrobertse
Tags: reviews, customer reviews, woocommerce, rich snippets, schema
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display Google Business Profile reviews in under 15KB with server-rendered AggregateRating JSON-LD, Gutenberg, Elementor, and WooCommerce.

== Description ==

**GMBSync - Reviews Widget for Google** is a lightweight, performance-first Google Business Profile reviews plugin for WordPress and WooCommerce.

Unlike legacy review plugins that bundle 200KB+ JavaScript libraries, expose billable Google Maps API keys, or bloat `wp_options` and custom database tables with background WP-Cron scrapers, GMBSync bundles a local, zero-dependency, human-readable widget script in under 15KB gzipped (`0.000` CLS) and fetches only lightweight JSON review data from your GMBSync workspace.

### Why GMBSync Stands Out

* **Sub-15KB Zero-Dependency Local Bundle:** Ships pure vanilla JavaScript (`assets/js/widget.js`) and scoped CSS directly inside the plugin with `defer` loading, zero external script execution, and zero jQuery or React frontend overhead to preserve 100/100 Mobile and Desktop Core Web Vitals.
* **Wave-1 Server-Rendered Rich Snippet JSON-LD:** Caches your verified rating summary in a lightweight 6-hour WordPress transient and outputs deduplicated `LocalBusiness` + `AggregateRating` + `Review` Schema.org JSON-LD directly in initial HTML (`#gmbsync-ssr-schema`) so search engines and AI assistants read your star score without executing JavaScript.
* **1-Click WooCommerce Product Page Rating Strips:** Automatically embed a compact verified Google Rating Strip, Carousel, or Badge on single product pages (`woocommerce_after_add_to_cart_form`, `woocommerce_single_product_summary`, or `woocommerce_after_single_product_summary`) with zero theme file edits.
* **Native Gutenberg Block, Elementor Widget & Shortcodes:** Insert the native **GMBSync Reviews for Google** block in the Block Editor, drag the **GMBSync Reviews for Google** widget in Elementor, or use shortcodes in Bricks, Divi, Beaver Builder, or GeneratePress.
* **Zero `wp_options` Review Table Bloat:** Review syncing runs off-site on GMBSync servers instead of hammering your WordPress database with cron jobs or storing thousands of duplicate review rows locally.
* **Official Google Business Profile OAuth Pagination:** Connect via official Google Business Profile OAuth 2.0 in your GMBSync workspace to bypass the 5-review Google Places API cap, sync your complete review history, and manage owner replies.
* **4 Native Display Layouts & Clean Defaults:** Horizontal swipeable Carousel, 3-column Masonry Grid, compact Product Rating Strip, and Floating Corner Trust Badge (Light & Dark themes + custom brand accent color). Optional attribution link is strictly opt-in and disabled by default.
* **Optional Review Shield QR & Feedback Embed:** Use `[gmbsync_invite]` when you want to embed a customer feedback and Google review composer card on a thank-you or review landing page.

### Available Shortcodes

* `[gmbsync]` or `[gmbsync_reviews]` - Renders your default review widget (Carousel, Grid, Strip, or Badge).
* `[gmbsync id="wdg_12345" layout="carousel" theme="light" min_stars="4" accent="#2563eb"]` - Overrides layout, theme, minimum star filter, or brand accent color per embed.
* `[gmbsync_strip]` - Renders a compact inline rating strip ideal below WooCommerce Add to Cart buttons or pricing sections.
* `[gmbsync_badge position="inline"]` - Embeds an inline or floating trust badge.
* `[gmbsync_invite id="loc_12345"]` - Embeds the optional GMBSync Review Shield customer feedback and Google review composer card.

== External services ==

This plugin runs all widget JavaScript locally from its own bundled `assets/js/widget.js` file and connects to external services operated by GMBSync (CodeWays) only for review JSON data and optional review invite iframes:

1. **GMBSync Public Widget API (`https://api.gmbsync.com/api/v1/widget/{widget_id}`)**
   * **What it is used for:** Retrieves your public synced Google Business Profile star rating, review count, and verified customer review JSON data for frontend widget display, admin connection verification, and optional 6-hour transient caching of server-rendered Schema.org `AggregateRating` JSON-LD.
   * **When it is called:** On frontend pages where a GMBSync block, shortcode, WooCommerce strip, or floating badge is active, when Wave-1 SSR JSON-LD refreshes its 6-hour transient, or when an administrator clicks Verify Connection or Refresh SEO Cache in Settings.
   * **Data sent:** Only the public GMBSync Widget ID configured by the site administrator and optional display filter parameters (`min_stars`, `max_reviews`). No visitor personal data or WordPress user data is collected or transmitted.
2. **GMBSync Review Link Page (`https://gmbsync.com/review`)**
   * **What it is used for:** Loaded inside an iframe only if a site administrator explicitly inserts the optional `[gmbsync_invite]` shortcode.
   * **Data sent:** Only the public GMBSync Location ID specified by the administrator.

* Terms of Service: [https://gmbsync.com/terms](https://gmbsync.com/terms)
* Privacy Policy: [https://gmbsync.com/privacy](https://gmbsync.com/privacy)

== Installation ==

1. Install **GMBSync - Reviews Widget for Google** from the WordPress Plugin Directory, or upload `gmbsync-reviews-widget-for-google.zip` via **Plugins > Add New > Upload Plugin**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Settings > GMBSync Reviews**.
4. Create or sign in to your account at [https://gmbsync.com](https://gmbsync.com), connect your Google Business Profile, and copy your **Widget ID** (`wdg_...`).
5. Paste your Widget ID, click **Verify Connection**, and click **Save GMBSync Settings**.
6. Add the **GMBSync Reviews for Google** Gutenberg block, Elementor widget, WooCommerce product strip toggle, or `[gmbsync]` shortcode to any page.

== Frequently Asked Questions ==

= Do I need a Google Maps / Places API key or Google Cloud billing card? =
No. GMBSync manages official Google Business Profile OAuth synchronization on its own servers so you never need to configure Google Cloud billing or expose API keys inside WordPress.

= Does this plugin load external JavaScript from a third-party server? =
No. All widget JavaScript (`assets/js/widget.js`) is bundled locally inside this plugin and enqueued from your own WordPress site with `defer`. The widget only fetches public review JSON data from `https://api.gmbsync.com/api/v1/widget/{widget_id}`.

= Does this plugin add a "Powered by" or credit link automatically? =
No. External attribution links are disabled by default. Site administrators can optionally enable the "Verified by GMBSync" attribution link in **Settings > GMBSync Reviews** if they choose to.

= Does this plugin output Google Rich Snippet JSON-LD on initial HTML load? =
Yes. When **Server-Rendered AggregateRating JSON-LD** is enabled in Settings, GMBSync caches your verified summary in a 6-hour WordPress transient and outputs deduplicated `LocalBusiness` + `AggregateRating` + `Review` JSON-LD directly in initial HTML (`#gmbsync-ssr-schema`).

= Can I show multiple GMBSync widgets on the same page? =
Yes. Version 2.0 uses class-based widget mount containers (`.gmbsync-widget`) with zero duplicate HTML IDs, so you can place a Product Rating Strip above the fold and a full Review Carousel further down the same page.

= Is WooCommerce supported out of the box? =
Yes. Enable **WooCommerce Product Page Auto-Embed** in **Settings > GMBSync Reviews** to automatically show your verified rating strip below Add to Cart or inside the product summary with zero code edits.

= Is GMBSync compatible with WP Rocket, LiteSpeed Cache, and Cloudflare APO? =
Yes. Because live reviews hydrate asynchronously from JSON while the local script loads with `defer`, full-page HTML caches keep serving fast cached pages without requiring cache purges when new reviews arrive.

== Screenshots ==

1. GMBSync Settings page with live Widget ID connection verification, Wave-1 SSR JSON-LD cache controls, WooCommerce auto-embed, and interactive Shortcode Builder.
2. Responsive Reviews Carousel widget in Light and Dark themes (<15KB gzipped local bundle, 0.000 CLS).
3. Compact Rating Strip automatically positioned below WooCommerce Add to Cart buttons.
4. Native Gutenberg Block Editor inspector with live layout, theme, minimum star filter, and brand accent controls.

== Changelog ==

= 2.0.0 =
* Bundled the sub-15KB zero-dependency widget renderer locally inside `assets/js/widget.js` for zero remote script execution and full WordPress.org compliance.
* Made attribution credit link strictly opt-in (`show_credit_link`, disabled by default).
* Added Wave-1 Server-Rendered `LocalBusiness` + `AggregateRating` + `Review` JSON-LD (`#gmbsync-ssr-schema`) backed by a 6-hour WordPress transient with 1-click cache refresh.
* Added native WooCommerce Single Product Rating Strip auto-embed with selectable hook placement.
* Added `strip` (Product Rating Strip) layout and custom brand accent color across Shortcodes, Gutenberg Block, and Elementor Widget.
* Added `[gmbsync_reviews]` and `[gmbsync_strip]` shortcodes and migrated containers to class-based mounts so multiple widgets render cleanly on the same page.
* Upgraded Admin connection tester to nonce-protected server-side WordPress AJAX (`wp_remote_get`), added clean `uninstall.php`, and verified full WordPress 7.1 & Plugin Check compliance.

= 1.0.2 =
* Added Gutenberg Block, Elementor Widget, Interactive Shortcode Builder, and Sitewide Floating Trust Badge.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.0 =
Bundles the sub-15KB widget script locally, adds Wave-1 Server-Rendered Rich Snippet JSON-LD, native WooCommerce product rating strips, opt-in attribution settings, and WordPress 7.1 compatibility.
