=== WP Reviews Widget ===
Contributors: pluginfactory
Tags: reviews, google reviews, tripadvisor, testimonials, rating, google maps, social proof
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn your Google Maps and TripAdvisor reviews into a powerful trust engine — display filtered, beautifully styled reviews anywhere on your WordPress site.

== Description ==

**WP Reviews Widget** is the simplest way to showcase your best customer reviews directly on your WordPress site. Pull reviews from Google Maps and TripAdvisor, filter by star rating and date, and embed them anywhere with a single shortcode.

No coding required. No expensive API plans. Just real reviews, beautifully displayed.

= Why WP Reviews Widget? =

★ **Two platforms, one plugin** — Display Google Maps *and* TripAdvisor reviews side by side or separately.

★ **Smart filtering** — Show only the reviews that represent your business best. Filter by star rating (e.g. 4–5 stars only) and date range so your best reviews always shine.

★ **Intelligent caching** — Reviews are fetched once and stored in your WordPress database. Your pages load fast, and your Apify credits last longer.

★ **Two display layouts** — Choose between a responsive card grid or a clean full-width list. Switch layouts instantly via shortcode parameter.

★ **Live preview in admin** — See exactly how your reviews will look before they go live, right from the settings page.

★ **Multilingual admin** — The settings panel supports both English and Turkish.

★ **WordPress-native** — Uses `wp_options` for storage, `WP_Cron` for auto-refresh, and follows all WordPress coding standards.

= How It Works =

1. Connect your free [Apify](https://apify.com) account (includes $5/month free credits — more than enough for most businesses)
2. Enter your Google Place ID and/or TripAdvisor URL
3. Click **Refresh** — reviews are fetched and cached
4. Add `[wrw_google]` or `[wrw_tripadvisor]` to any page or post
5. Done ✓

= Shortcode Examples =

**Google Reviews — basic:**
`[wrw_google]`

**Google Reviews — filtered grid:**
`[wrw_google limit="6" min_rating="4" sort="date_desc" layout="grid"]`

**TripAdvisor Reviews — list layout:**
`[wrw_tripadvisor limit="5" min_rating="4" sort="rating_desc" layout="list"]`

= Shortcode Parameters =

* `limit` — Number of reviews to display (default: 10)
* `min_rating` — Minimum star rating to show, 1–5 (default: 1)
* `max_rating` — Maximum star rating to show, 1–5 (default: 5)
* `date_from` — Show reviews from this date onward (YYYY-MM-DD)
* `date_to` — Show reviews up to this date (YYYY-MM-DD)
* `sort` — Sort order: `date_desc`, `date_asc`, `rating_desc`, `rating_asc`
* `layout` — Display style: `grid` (card columns) or `list` (full-width rows)

== Installation ==

1. Upload the `wp-reviews-widget` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Settings → Reviews Widget**
4. Enter your Apify API token, Google Place ID, and/or TripAdvisor URL
5. Click **Refresh** to fetch your reviews
6. Add `[wrw_google]` or `[wrw_tripadvisor]` to any page or post

**Getting your Apify API token:**

1. Sign up for free at [apify.com](https://apify.com)
2. Go to **Settings → API & Integrations**
3. Copy your Personal API token

**Finding your Google Place ID:**

Use the [Place ID Finder](https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder) — search for your business and copy the `ChIJ...` code.

== Frequently Asked Questions ==

= Is this plugin free? =
Yes. The plugin is completely free. You need a free [Apify](https://apify.com) account which includes $5/month in free credits — sufficient for most small and medium businesses.

= How often are reviews updated? =
Reviews are automatically refreshed based on the cache duration you set (default: 24 hours). You can also refresh manually at any time from the settings page.

= How many reviews can I display? =
You can fetch up to 200 reviews per source via Apify. Use the `limit` shortcode parameter to control how many are displayed.

= Does this work with page builders like Elementor or Divi? =
Yes. The shortcode works in any context that renders WordPress shortcodes, including Elementor's shortcode widget and Divi's code module.

= Can I show both Google and TripAdvisor reviews on the same page? =
Yes — simply add both shortcodes to the same page:
`[wrw_google limit="3"]`
`[wrw_tripadvisor limit="3"]`

= What happens if the Apify API fails? =
The plugin falls back to the last cached data, so your reviews remain visible even if a fetch fails.

= Is my API token stored securely? =
Your Apify token is stored in the WordPress database and never exposed in the frontend HTML output.

== Screenshots ==

1. Modern admin settings panel with cache status
2. How To Use tab with step-by-step guide and shortcode reference
3. Live preview of reviews in admin panel
4. Frontend grid layout — responsive card display
5. Frontend list layout — full-width row display

== Changelog ==

= 2.0.0 =
* Added TripAdvisor reviews support via Apify
* Added `[wrw_google]` and `[wrw_tripadvisor]` shortcodes
* Added grid and list layout options via `layout` parameter
* Added live preview tab in admin panel
* Added How To Use tab with full shortcode reference
* Added EN/TR language switcher in admin
* Added Settings link in plugin list
* Refactored all classes for stability and WordPress coding standards
* Added `WRW_Data_Store` with separate cache keys per source
* Added `WRW_Filter` with multi-field date parsing
* Improved error handling and fallback to cached data

= 1.0.0 =
* Initial release — Google Reviews only

== Upgrade Notice ==

= 2.0.0 =
Major update: TripAdvisor support, new shortcodes, layout options, and a redesigned admin panel. Existing shortcodes ([reviews_widget]) should be updated to [wrw_google].

== Credits ==

Developed by [Melih Andıç](https://tr.linkedin.com/in/melihandic/) at [Plugin Factory](https://pluginfactory.online/).
