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

The right wine for every dish, from your own range. A food pairing widget for WooCommerce wine shops. Connect in one click, 14 days to try.

== Description ==

**Help your customers choose the right wine for dinner, and sell more of your own wines.**

SommelierX adds wine advice to your WooCommerce shop. On every wine product page, customers see a short line about the wine and the five dishes that fit it best, each with a score; more on request. In a search bar they type what they are cooking and get wines from your range. Only wines from your own range are recommended, and every recommendation links to your product page.

**It fits around your shop, not the other way round.** The widget sits next to the product image or below your product information, never above it. It takes your theme's fonts, works in a narrow column, and you set the accent colour.

**Three clicks to set up.** Install the plugin, click **Connect to SommelierX** (no account, no API key to copy), then **Import your catalog**. We read your products and match every wine; what we do not recognise, our team does by hand.

**Ready for the holidays.** Customers planning a Christmas dinner can look up their menu and find the matching wine in your shop.

**14 days to try, then €9 or €29 per month, cancel anytime.** Starter (€9) or Growth (€29 per month, excl. VAT). Growth also lists your web shop in the SommelierX app. See https://sommelierx.com/en/webshops.

Built over 17 years with scientists and sommeliers.

**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; the endpoint only shows a SHA-256 fingerprint of the token, which SommelierX checks to confirm you own the domain, then returns your widget key. No account or password is involved.
* On "Choose Starter / Growth" and "Manage subscription", the plugin asks `https://api.sommelierx.com` for a Stripe payment page and sends you to `checkout.stripe.com` or `billing.stripe.com`. Your payment details go to Stripe only; the plugin never sees them.
* 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
Partner terms for webshops (accepted when you subscribe): https://sommelierx.com/partnervoorwaarden
Privacy policy: https://sommelierx.com/privacy

**Four focused pairing flows:**

* **Product mode** — On each wine product page: a one-line wine card (style, region, grapes, taste) and the five dishes that pair best, with the rest behind "Show more".
* **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.
* Choose the placement: next to the product image (right column) or below the product information.
* Light and dark theme, your accent colour and your theme's fonts.
* Loads asynchronously — no impact on page speed.
* Works with WooCommerce HPOS (High-Performance Order Storage).
* Fully responsive on mobile and desktop, and in a narrow sidebar or column.

== 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, placement, 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 the SHA-256 fingerprint of a one-time random token at `/wp-json/sommelierx/v1/handshake`. SommelierX checks that fingerprint 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.

= What does it cost? =

14 days to try, then €9 or €29 per month, cancel anytime. Starter (€9) has all four widgets in your branding and four languages; Growth (€29, excl. VAT) has a larger allowance, lists your web shop in the SommelierX app and supports multiple shops.

You choose the plan in the plugin and enter your payment details at Stripe; Stripe charges automatically after the 14 days and sends the invoice. You can cancel via "Manage subscription". Without a plan the widget is paused and shows no wines; your wines and settings are kept.

= 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.

= Where does the widget appear on a product page? =

You choose under **Placement**: next to the product image (in the right-hand column, below the add-to-cart button), below the product information (full width), or only where you place the `[sommelierx_widget]` shortcode. New installs start next to the product image; stores that used an earlier version keep their spot until they change it.

= Can I customize the widget appearance? =

Yes — choose a light or dark theme, set a custom accent color (the default is a quiet neutral grey), and optionally add a CSS class for further styling. The widget uses your theme's fonts.

= 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 connects your store. No account, no API key to copy.
2. On every wine product page: the dishes that fit, each with a score.
3. Customers type their dish and get wines from your own range.

== Changelog ==

= 1.4.7 =
* The default widget accent is now a neutral dark grey, so the widget stays quietly in the background of your shop. Pick any colour under **Accent Color** to match your brand. A colour you already saved is kept as it is.

= 1.4.6 =
* New setting **Placement**: show the widget next to the product image (right-hand column, below the add-to-cart button), below the product information, or only via the shortcode. New installs start next to the product image; existing stores keep their current spot until they change it.
* The product block is compact: a one-line wine card (style, region, grapes, taste, only what we know about the wine), then the five best dishes; "Show more" opens the rest and the filters.
* Fits a narrow column or sidebar: below about 360 pixels the score moves under the dish name.

= 1.4.5 =
* Choose your plan right in the plugin: Starter (€9) or Growth (€29 per month, excl. VAT), with 14 days to try it out. Payment, invoice details and the partner terms are handled in Stripe Checkout; "Manage subscription" opens the Stripe customer portal to switch plans, update your card or cancel.
* Stores that connected before 7 October 2026 keep their original trial and only pay from its end; reconnect once to choose your plan.
* Safer connection check: the handshake only shows a fingerprint of the one-time token.
* On product pages the widget now also passes the product's web address, so it finds the right wine even when the product title has quotes, special characters or a bottle size.

= 1.4.4 =
* On wine product pages the widget now starts in Product mode (the dishes for this wine) when you never picked a mode. A mode you saved yourself stays as it is.

= 1.4.3 =
* The default widget accent is now the SommelierX brand colour (rust brown, #7A3B2E). Shops that never changed the colour move along automatically; a colour you picked yourself stays as it is.

= 1.4.2 =
* Pricing text simplified: two months free with all widgets, then Starter or Growth. No functional changes.

= 1.4.1 =
* Pricing text in the listing and on the settings page now matches sommelierx.com: two months free, then Starter (€9) or Growth (€29 per month, excl. VAT), cancel any month. No functional changes.

= 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.4.7 =
Neutral grey is the new default accent colour. A colour you saved yourself is kept.

= 1.4.6 =
New Placement setting (next to the product image or below the product information) and a compact product block with a short wine card. Your current placement is kept.

= 1.4.5 =
Choose your plan in the plugin: 14 days to try it out, then €9 or €29 per month. Stores already in a trial keep it. Product pages also find their wine more reliably.

= 1.4.4 =
Product pages show the dishes for the wine by default. Your saved mode is kept.

= 1.4.3 =
New default accent colour (rust brown). Your own colour choice is kept.

= 1.4.2 =
Text-only update. No functional changes.

= 1.4.1 =
Text-only update: pricing information now matches sommelierx.com. No functional changes.

= 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.
