=== SommelierX Wine Pairing ===
Contributors: sommelierx
Tags: wine, wine pairing, food pairing, woocommerce, sommelier
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.4.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Wine and food pairing for your WooCommerce wine shop, scored by professional sommeliers. Install and you're connected — no account needed.

== Description ==

SommelierX Wine Pairing brings taste-calculated food-pairing suggestions to your WooCommerce store, explained through SommelierX Wine DNA. It helps customers understand which dishes fit each bottle and why.

**Install and you're connected — no account needed.** Click one button and the plugin verifies your domain and sets everything up for you. There is no separate sign-up, and no API key to copy or paste. It just works.

**Free during the early-store programme.** Use SommelierX while we build it together with early stores. Tell us what you need and we will build it.

**External services disclosure**

This plugin relies on the SommelierX service:

* On "Connect", the plugin briefly publishes a random verification token at `/wp-json/sommelierx/v1/handshake` and asks `https://api.sommelierx.com` to provision your store; SommelierX fetches that token to confirm you own the domain, then returns your widget key. No account or password is involved.
* On "Import your catalog", SommelierX reads your published products from the public WooCommerce Store API (`/wp-json/wc/store/products`) to build your wine assortment.
* On product pages, the plugin loads a script from `https://sommelierx.com/widget/v2.js`, which sends the wine's product information (name, ID, and your widget key) to `https://api.sommelierx.com` to fetch pairings.
* No customer personal data is sent — only product and widget usage information.

Terms of service: https://sommelierx.com/terms
Privacy policy: https://sommelierx.com/privacy

**Four focused pairing flows:**

* **Product mode** — Food-pairing suggestions on individual wine product pages: customers see which dishes pair best with the wine they are viewing.
* **Search mode** — A search bar where visitors type a dish (or even a single ingredient) and get wine recommendations from your catalog.
* **Build your Dish mode** — Visitors add main ingredients, preparation, sauce, sides, and amounts before seeing wines from your catalog.
* **By Taste mode** — Visitors choose a wine colour and taste tags while matching wines from your catalog update immediately.
* **Multilingual** — Search and results in Dutch, English, German, or French.

**Key features:**

* One-click connect — install, click "Connect to SommelierX", done. No account.
* One-click catalog import from the WooCommerce Store API — recognised wines become ready for the widget; the rest are staged for a quick review.
* Place any flow anywhere with the `[sommelierx_widget]` shortcode, for example `[sommelierx_widget mode="builder"]`.
* Search by dish name or ingredient, in Dutch, English, German, or French.
* Light and dark theme to match your store.
* Configurable accent color for brand consistency.
* Loads asynchronously — no impact on page speed.
* Works with WooCommerce HPOS (High-Performance Order Storage).
* Fully responsive on mobile and desktop.

== Installation ==

1. Download the plugin ZIP file.
2. In your WordPress admin, go to **Plugins > Add New > Upload Plugin**.
3. Upload the ZIP file and click **Install Now**, then **Activate**.
4. Go to **WooCommerce > SommelierX** in the admin menu.
5. Click **Connect to SommelierX**. That's it — your store is connected automatically, no account or API key needed.
6. Click **Import your catalog** to bring in your wines.
7. Optionally set your mode, theme, language, and accent color, then **Save Settings**.

== Frequently Asked Questions ==

= Do I need a SommelierX account? =

No. Click **Connect to SommelierX** on the settings page and the plugin verifies your domain and sets everything up for you. No sign-up, no API key to copy.

= How does the automatic connection work? =

When you click Connect, the plugin publishes a one-time random token at `/wp-json/sommelierx/v1/handshake`. SommelierX fetches that token to confirm you control the domain, then hands back your widget key, which the plugin stores for you. The token is deleted straight after.

= How do I import my wines? =

Click **Import your catalog**. SommelierX reads your published products from the public WooCommerce Store API. Wines we recognise become ready for the widget; anything we're unsure about is staged for a quick review. Placement and storefront visibility remain separate settings.

= Is it really free? =

Yes — it's free during the early-store programme. Use the feedback button on the settings page to tell us what you need.

= Can I still enter a key manually? =

Yes. The API key field is still there as a fallback if you'd rather paste a key from the SommelierX dashboard.

= Does this plugin slow down my site? =

No. The widget script loads asynchronously with `defer`, so it does not block page rendering.

= Can I customize the widget appearance? =

Yes — choose a light or dark theme, set a custom accent color, and optionally add a CSS class for further styling.

= Does it work with variable products? =

Yes. The widget works on all WooCommerce product types, including simple, variable, and grouped products.

== Screenshots ==

1. One-click connect and catalog import — no account needed.
2. Widget in product mode on a wine product page (light theme).
3. Search mode — find wines by dish or ingredient, in Dutch, English, German, or French.

== Changelog ==

= 1.4.0 =
* The widget now runs on the same code as the SommelierX app: dish search, build your dish, wine product pairings and by taste behave exactly like the app, limited to your own wines.
* Category filters in the wine product block follow the shop language.
* Faster loading; the shop stylesheet option (data-css) keeps working.

= 1.3.0 =
* Rebuilt the four focused flows: dish search, build your dish, wine product pairings, and by taste.
* Replaced the former wine picker with instant assortment filtering by colour and taste tags.
* Removed layout variants so every use case has one complete, consistent interface.
* Existing wine-picker settings migrate automatically to the new taste flow.

= 1.2.0 =
* Four widget flows: dish search, build a plate, wine product pairings, and choose a wine.
* Compact and full variants for every flow.
* Placeable `[sommelierx_widget]` shortcode with mode, variant, theme, language, and accent options.
* Clear separation between wines that are ready and a widget that is actually visible on the storefront.

= 1.1.0 =
* One-click "Connect to SommelierX" — account-less setup with automatic domain verification (no API key to copy).
* One-click "Import your catalog" from the WooCommerce Store API — recognised wines go live, the rest are staged for review.
* Assortment status line on the settings page (wines ready vs. awaiting review).
* Feedback card — SommelierX is free during the early-store programme.
* Manual API key field kept as a fallback.

= 1.0.0 =
* Initial release.
* Product mode and search mode support.
* Light and dark theme.
* Dutch, English, German, and French language support.
* WordPress color picker for accent color.
* WooCommerce HPOS compatibility.
* Clean uninstall — removes all options.

== Upgrade Notice ==

= 1.3.0 =
Introduces the final four focused widget flows and automatically replaces the former wine picker with By Taste.

= 1.2.0 =
Adds four pairing flows, compact/full variants, and a placeable shortcode while keeping storefront placement explicit.

= 1.1.0 =
Install and you're connected — no account needed. Click Connect, then Import your catalog.

= 1.0.0 =
Initial release. Install and configure your API key to get started.
