=== TrustFusion — Show Reviews from Google Business Profile ===
Contributors: forkanhossain
Donate link: https://wise.com/pay/me/mdforkanh
Tags: google reviews, reviews, schema, business profile, google business
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display your Google Business Profile reviews on your WordPress site, synced server-side, with SEO-friendly JSON-LD schema markup.

== Description ==

**TrustFusion** connects to your Google Business Profile and displays your Google reviews per business on your site via a simple shortcode. Reviews are fetched and stored server-side (not loaded live from Google on every page view), which keeps pages fast and lets reviews contribute to your site's SEO through JSON-LD schema markup.

### Key Features
* Connect a Google Business Profile via the TrustFusion relay — no Google API key required.
* Grid, list, and carousel display layouts.
* Multi-location support: connect and display reviews from more than one business, individually or merged into a single feed.
* Hide/show individual reviews from the admin without deleting them.
* JSON-LD `AggregateRating` schema markup, using the business's real Google rating and review count.
* Automatic sync via WP-Cron (about once a month); the manual "Sync Now" button matches that cadence via the relay, or works anytime once you add your own Google API key.
* Shortcode: `[trustfusion_reviews]` (supports `id`, `place_id`, `ids`, `layout`, and `limit` attributes).

[TrustFusion Pro](https://reviews.webcitylab.com/) is a separate plugin, sold directly at reviews.webcitylab.com (not listed on or distributed through WordPress.org), with official Google OAuth connect and a higher review-sync ceiling for licensed sites.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin via the 'Plugins' menu in WordPress.
3. Go to **TrustFusion → Add New** in the WordPress admin menu and connect your Google Business Profile.
4. Use the `[trustfusion_reviews]` shortcode (generated automatically for you on the TrustFusion overview page) to display reviews.

== Frequently Asked Questions ==

= How often does the plugin sync reviews? =
Automatic sync runs about once a month via WP-Cron, to keep unattended Google API usage sustainable. The manual "Sync Reviews Now" button follows the same once-a-month cadence when syncing via the built-in TrustFusion relay. If you add your own Google Maps/Places API key in Settings, manual sync works immediately, anytime — since it then runs on your own Google quota instead of the shared relay.

= Do I need a Google API key? =
No — the built-in TrustFusion relay can fetch reviews without one. You can optionally add your own Google Maps/Places API key in Settings for direct access.

= Can I display reviews from multiple locations? =
Yes. Connect as many businesses as you like (unlimited) and either show them individually or merge several into one combined feed using the `ids` shortcode attribute.

= Can I hide a specific review? =
Yes, from the **Manage Reviews** admin page. Hidden reviews are excluded from both the on-page display and the JSON-LD schema rating.

== Screenshots ==

1. My Businesses overview page.
2. Connect a Google Business Profile.
3. Frontend display using the grid layout.
4. Frontend display using the carousel layout.

== External services ==

This plugin connects to external services to fetch and display your Google reviews. Details below.

1. **Google Business Profile API / Google Places API**
Used to search for your business and fetch its reviews, rating, and business details for display on your site. This happens when: you search for a business on the "Add New" admin page, you connect a business (via the TrustFusion relay, or your own Google Maps/Places API key if you've added one), and during the monthly automatic sync (and manual "Sync Now"). Data sent to Google includes your search query and/or the connected business's Google Place ID.
This service is provided by Google LLC — [Google APIs Terms of Service](https://developers.google.com/terms) — [Google Privacy Policy](https://policies.google.com/privacy).

2. **TrustFusion Relay (reviews.webcitylab.com)**
When you connect a business without entering your own Google API key (the default, key-free path), this plugin sends your site URL and the connected business's Google Place ID to reviews.webcitylab.com — a service operated by Web City Lab (this plugin's developer) — which fetches the review data on your behalf. This plugin doesn't impose any review-count limit of its own; the relay itself currently returns up to 10 reviews per business for requests without a paid TrustFusion Pro license, to keep the shared, free service sustainable.
This service is provided by Web City Lab — [Terms of Service](https://reviews.webcitylab.com/terms-of-service-trustfusion/) — [Privacy Policy](https://reviews.webcitylab.com/privacy-policy-trustfusion/) — [Data Deletion Policy](https://reviews.webcitylab.com/data-deletion-policy-trustfusion/).

== Changelog ==

= 2.0.6 =
* Removed the remaining promotional links to TrustFusion Pro from the admin UI (Plugins list row action and dashboard banner).
* Reworded the "Connect & Fetch Reviews" helper text for accuracy.
* Plugin activation now re-syncs connected businesses immediately, instead of waiting on the throttled background/manual sync.

= 2.0.5 =
* Removed the plugin's own hardcoded 10-review cap on fetching, storing, and displaying reviews (`TrustFusion_Shortcode::REVIEW_CAP`). This plugin no longer imposes any review-count limit of its own; it fetches and shows whatever the TrustFusion Relay returns, and the relay independently caps unlicensed/free requests to keep the shared service sustainable (see the "External services" section below). Site owners can still set an explicit `limit` on the `[trustfusion_reviews]` shortcode.
* Reworded the description and readme to reflect the above — the review-count limit was never something this plugin's own code needs to enforce.
* Removed the "Connect Official Google Business Profile (TrustFusion Pro)" upsell link from the Add New page for this submission — to be reintroduced later.

= 2.0.4 =
* Author changed from "Web City Lab" to a personal name (matches the WordPress.org account/Contributors); Author URI now points to a personal GitHub profile. The previous Author URI/Donate link (webcitylab.com) was unreachable during a plugin review check.
* Donate link changed to a personal Wise payment link, for the same reason.
* Manual "Sync Reviews Now" via the TrustFusion relay is now limited to once a month per business, matching the automatic sync cadence (was once a day), to keep shared relay usage sustainable. Add your own free Google Maps/Places API key in Settings to sync manually anytime instead — that path was always immediate and still is.
* Fixed a stale reference to "OAuth tokens" in the plugin-delete confirmation dialog; this plugin hasn't stored any since Google OAuth moved to TrustFusion Pro in v2.0.0.
* Corrected a docblock on an internal repository method that inaccurately described a 10-review cap it doesn't itself enforce (the cap is applied by the caller).

= 2.0.3 =
* Removed the "Powered by Google" attribution feature entirely (was an opt-in Settings toggle; not needed).
* Removed the optional async-CSS preload toggle — it rewrote an already-enqueued stylesheet's tag via `style_loader_tag`, which repeatedly triggered plugin-review false positives for unenqueued CSS. Not worth the friction for an optional perf toggle.

= 2.0.2 =
* Fixed Plugin Check warnings on the `wait` query parameter (uses `absint( wp_unslash( ... ) )` now, the recognized WP sanitization pattern).

= 2.0.1 =
* Manual "Sync Reviews Now" is now limited to once a day per business, to keep shared relay API usage sustainable across every Free install. Automatic background sync (about once a month) is unaffected. TrustFusion Pro has no such limit.
* Tested up to WordPress 7.1.

= 2.0.0 =
* This plugin is now Free-only and fully self-contained — no license key, no locked/limited built-in features. TrustFusion Pro is a separate plugin distributed outside WordPress.org.
* Official Google OAuth connect moved to TrustFusion Pro; this plugin uses the key-free TrustFusion relay only.
* Fixed: JSON-LD review text could contain a literal `</script>` sequence, breaking out of the schema markup.
* "Powered by Google" credit is now an opt-in Settings toggle instead of always-on.
* "Based on X reviews" and the JSON-LD rating now reflect the business's real Google review count, not just the reviews stored locally.
* Renamed all AJAX actions/nonces to a `trustfusion_` prefix; removed an unused, unreachable secondary OAuth code path.
* Plugin renamed to "TrustFusion — Show Reviews from Google Business Profile".

= 1.2.5 =
* Fixed: an invalid or expired license key saved in Settings couldn't be cleared from the admin UI — the "Deactivate" button only appeared for a currently-valid license, so a stale/rejected key would keep reappearing in the field after every save. A "Clear" button is now shown next to "Activate" whenever a key is saved, regardless of its current validity.

= 1.2.4 =
* Free plan's automatic background sync now runs about once a month instead of weekly, to keep unattended Google API usage sustainable on a plan with no associated revenue. Paid plans are unaffected (still weekly). The manual "Sync Reviews Now" button works immediately on any plan regardless of this schedule.

= 1.2.3 =
* Removed a leftover developer debug tool from the My Businesses admin page (reachable via an undocumented query string) that dumped internal diagnostics and wrote to the reviews table on a plain, un-nonced GET request.

= 1.2.2 =
* Removed a Google Maps internal-endpoint fallback used for fetching extra reviews via a user-supplied API key; the plugin now only calls Google's official, public Places API endpoints.
* Fixed `uninstall.php` referencing incorrect database table names (data removal on uninstall now actually removes all plugin tables).
* Added "External services" disclosure section to this readme.

= 1.2.1 =
* Code-quality pass: prepared-statement corrections, input sanitization/escaping fixes, gated debug logging behind WP_DEBUG, corrected readme metadata.

= 1.2.0 =
* Multi-location connect and merged shortcode display.
* Hide/show individual reviews from the admin.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.5 =
Removed the plugin's own 10-review cap on fetch/store/display — the relay enforces its own limit for unlicensed requests server-side. No settings changes required.

= 2.0.4 =
Author/Donate links updated. Manual "Sync Reviews Now" via the relay is now once a month (was once a day), matching automatic sync — add your own free Google API key in Settings for anytime manual sync.

= 2.0.1 =
Manual "Sync Reviews Now" is now limited to once a day per business on the Free plan. No settings changes required.

= 2.0.0 =
License key/Pro features removed from this plugin — install TrustFusion Pro separately for unlimited reviews and official OAuth connect.

= 1.2.2 =
Removed a non-public Google endpoint call and fixed uninstall data cleanup. No settings changes required.

= 1.2.1 =
Code-quality and security hardening update. No settings changes required.
