# Google Business + Verified Product Reviews

## Commerce: Verified Product Reviews

This release adds a native verified-review stack to Help4 Commerce.

- Admin moderation: `Commerce -> Reviews`
- Public endpoint: `GET /wp-json/h4bs/v1/products/{id}/reviews`
- Submit endpoint (logged-in): `POST /wp-json/h4bs/v1/products/{id}/reviews`
- Frontend shortcode:
  - `[h4_product_reviews product_id="123" limit="5" show_form="1"]`

### Verification logic

- Review submission is allowed only if the customer has a matching paid/completed order containing that product.
- Duplicate review posts for the same verified order + product + customer are blocked.
- New reviews default to `pending` status for moderation.

## Non-Commerce: Google Business by Domain

This release adds domain-based Google Business profile mapping.

- Admin page: `Help4 Builder -> Google Business`
- Data source: Google Places API by Place ID
- Shared-host safe design: map profiles by **domain**, not by server IP

### Required setup

1. Add your Google Maps / Places API key.
2. Add one or more rows with:
   - `domain` (example: `example.com`)
   - `place_id`
   - optional map embed URL and service areas

### Shortcodes

- `[h4_google_business domain="example.com" reviews="3"]`
- `[h4_google_reviews domain="example.com" limit="5"]`
- `[h4_google_map domain="example.com" location="1"]`

### Notes

- If no explicit map embed URL is set, the plugin builds a fallback embed URL from place geometry/address.
- Reviews and ratings are cached in transients for 10 minutes.

## Builder Widgets (Visual Editor)

Both systems are now available as native Builder elements (not shortcode-only tiles):

- `Product Reviews` element
  - Settings: `product_id`, `limit`, `title`, `show_summary`, `show_form`, `empty_text`
- `Google Business` element
  - Settings: `domain`, `view` (`business`/`reviews`/`map`), `reviews`, `location`, `height`, `show_map`, `show_reviews`, `show_header`, `show_aggregate`, `show_service_areas`, `empty_text`

These appear in the widget library and open full popup settings for editing.
