=== Rooster One ===
Contributors: oxfordmetadata
Tags: woocommerce, ai, seo, automation, performance
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 9.4
Woocommerce tested up to: 10.9
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

One plugin does the work of a whole AI stack: chat, recommendations, SEO, measurement, merchandising & fulfilment. Anthropic Claude + Voyage AI.

== Description ==
# Rooster One — the unified AI commerce & content suite for WordPress & WooCommerce

Rooster One turns your site into an adaptive, self-optimising storefront — or content platform. One plugin does the work of a whole stack of subscriptions — an AI assistant, product recommendations, a complete in-house SEO engine, first-party measurement and consent, pricing and merchandising, fulfilment and operations, customer intelligence, and plain-language analytics — powered by the latest models from **Anthropic Claude**, with **Voyage AI** embeddings for semantic search.

Its guiding principle is **unification of experiences and functionality**: products are content and content is products, measured on one spine; every storefront surface shares the same design tokens, containers and controls; every report reads from one canonical source of truth; and the heavy lifting is pre-computed into materialised tables and served by a thin front-end runtime — so each feature adds capability, not milliseconds.

**Works with or without WooCommerce.** Tell Rooster One what your site is — a shop, a catalogue (products shown as content, without checkout), or a pure content/publisher site — or let it auto-detect, and every metric, score and report adapts. Perfect for:
- WooCommerce stores that want recommendations, merchandising, SEO, fulfilment and attribution in one place
- Publishers, portals and content sites that want first-class SEO, conversion goals and campaign analytics — not a bolted-on afterthought
- Corporate and information sites that want an intelligent, on-brand AI assistant and support

You can adopt it one capability at a time. Almost everything ships **off by default** and runs **alongside** your existing tools (your current SEO plugin, your pixel manager, your CMP) until you choose to switch each piece on — so installing changes nothing until you flip a toggle.

== Features ==

### Conversational AI & semantic search
- A floating, fully themeable chat widget that answers shoppers in natural language, grounded in your own catalogue and content by retrieval-augmented search on **Anthropic Claude** — it recommends only real, in-stock items with exact links, and never invents products.
- **Semantic product & content search** powered by **Voyage AI** embeddings — shoppers find products by meaning, not keywords, across products, posts, pages and taxonomy terms (embeddings refresh only when content actually changes).
- **Site-type-aware** — the assistant detects whether it is on a shop, a blog, an information portal or a mixed site and adapts its role and wording: a shopping assistant, a content guide or a pure support assistant.
- **You stay in control** — a curated business-info knowledge base (policies, shipping, locations, FAQs) is always in context; identity guardrails ("what this site IS / is NOT") stop it mis-describing you; results are re-ranked and quota-filtered by your own rules; and chat can be scoped to a single category (respecting the terms you hide from browsing).
- **Themeable without code** — position, colours, rounded/square style and separate desktop/mobile font sizes, with a per-answer happiness rating that feeds AI Chat Analytics. The model list is registry-driven and self-healing, and all AI runs through your Rooster AI credits with no per-provider API keys to manage.

### AI product recommendations
- Graph-database-powered up-sell / cross-sell pairings from your real sales patterns (the optional service at eshop-optimizer.com), importable with one click — or import any recommendations from a CSV in our format.
- **Products for the same need** — surfaces alternatives that satisfy the same customer need (via your need taxonomy), ranked by pre-computed sales performance, de-duplicated against your up-sells and cross-sells.
- **Recommendation rails, ordered your way** — drag-and-drop ordering of every rail (Up-sells, Cross-sells, Related, Recently Viewed, Same-need) with per-rail show/hide, on both block (FSE) and classic themes.
- **Custom slots** between the rails — drop in rich HTML/WooCommerce shortcodes or a Tolstoy video-shopping widget, each with its own heading.
- Built-in performance tracking with Google UTM tags and a recommendation-lift report, so you can see the incremental orders and revenue the engine adds over each traffic channel.

### In-house SEO engine — for shops *and* content sites (a faster, Greek-aware AIOSEO/Yoast replacement)
- A complete on-page engine — title, meta description, canonical, robots, Open Graph, Twitter and JSON-LD — built once into a head cache and served by the thin runtime in a single cached read (near-zero added TTFB, no per-request assembly, no telemetry). It self-gates behind your existing SEO plugin until you switch it on, with a read-only **AIOSEO importer** and a head-parity verify before you cut over.
- **Site profiles** — shop, catalogue or content/publisher (or auto-detected from real sales evidence); opportunity scoring, cornerstone selection and the demand score all adapt, so SEO works correctly on a magazine or a portal, not just a shop.
- **Rich commerce schema**, all vitals-driven (never live queries): variable products emit `ProductGroup` + `hasVariant`/`variesBy`; real per-variant **colour** mapped from your own swatch attributes; `gtin`, brand, sale-price strikethrough, and operator-configured `OfferShippingDetails` + `MerchantReturnPolicy` on every Offer. Category, brand and tag archives emit `CollectionPage` + `ItemList` + `BreadcrumbList`.
- **AI titles & descriptions with live SERP context** — a nightly queue picks your highest-ROI pages, pulls the real Google results (competitor titles, descriptions, People-Also-Ask) for the target keyword, and has Claude write copy to beat that exact SERP; drafts wait for approval, or switch on **Autopilot**. Plus one-click **Claude AI Assist** for any single title/description/keyphrase, in the content's own language and grounded in real demand.
- **DataForSEO rank tracking** — connect a DataForSEO account and Rooster One pulls a weekly snapshot of every Google keyword you rank for and surfaces **striking-distance** opportunities (positions 8–20 by volume, one push from page one), under a monthly spend cap you set.
- **Behaviour-informed opportunity grid & auto-pillars** — every product and content object is placed on a traffic × conversion grid (hidden gem, intent mismatch, defend, prune) with an action per quadrant, and cornerstone/pillar pages are chosen from real performance, not a manual flag.
- **Local SEO** — a `LocalBusiness` node per physical store (hours, geo, price range, image, Maps links) with Store Locator / Opening Hours / Business Info blocks and an optional store-page post type.
- **Image SEO** (auto-fills only empty alt text), a **redirects engine** with an automatic slug monitor, unique-404 list and loop / target-exists import safeguards, a **static, outage-proof sitemap** (served as files even if the plugin is off), and a **managed robots.txt** written as a static web-root file (never overwriting one it didn't create).
- A live **0–100 SEO score** and health dashboard, **EU Omnibus** lowest-price history, and multilingual head + hreflang (WPML / Polylang / TranslatePress).

### Measurement, consent & attribution
- **First-party, server-side measurement** you own end to end: Meta Pixel + Conversions API, GA4 + Measurement Protocol, Google Ads (browser + server-side Enhanced Conversions), and TikTok Pixel + Events API — deduplicated on a shared event id and dispatched in-request after the order is saved (no cron to drain) for zero checkout latency. A confirmed 2xx is required before an order counts as sent, and a daily safety-net re-fires any paid order whose send was dropped — so no purchase is silently lost. Each platform is independently selectable, so you can keep the tools you already run.
- **Advertiser-grade match quality** — Facebook Advanced Matching, complete GA4 / Google Ads user data (Unicode-correct for Greek), recovered fbc/ttclid/gclid, and hashed PII throughout (never stored or logged raw). A built-in **Google tag (gtag.js) / GTM loader** fires the full GA4 ecommerce funnel with no Site Kit, and a **server-side dedup bridge** hands agency GTM setups Rooster One's own event ids so the browser hit collapses against Rooster One's server send.
- **Consent / GDPR CMP** — a lightweight, first-party cookie-consent banner (no external CMP, no IAB TCF bloat): rich message, Accept / Decline / Customize with a per-category preferences panel, per-button theming with an equal-prominence guard, two layouts, and a re-openable "Cookie settings" control positionable per device. It drives **Google Consent Mode v2** with region-aware, cache-safe defaults, carries consent **in-band** on every server event (so a declined category down-scopes the conversion at the ad platform, not only the browser), keeps an IP/UA-hashed proof-of-consent audit log, and includes a **cookie scanner** that classifies the services your storefront sets. Rooster One's render-critical consent and measurement scripts are kept out of WP Rocket's delay/defer so a delayed banner never becomes a compliance gap.
- **ROI Wizard & UTM Explorer** — one cockpit for "what actually drove the sale": pick a type (recommendation engine, offer, channel, campaign, creative), a value and a period, and see orders, revenue, cost, net, ROAS and ROI %, with period-over-period comparison. A cascading UTM drill-down (Source → Medium → Campaign → Term → Content) with fast searchable pickers, and a friendly Channel dimension, keep paid and organic cleanly separated.
- **Ad-spend ledger + connectors** — enter spend, bulk-import a CSV, or connect Google Ads / Meta / TikTok through a guided wizard to pull campaign spend nightly, so ROI becomes automatic. One canonical source of truth for each order's revenue and marketing channel ties it all together.
- **Landing pages, campaigns & exit pages** — every session's landing URL is parsed once into a clean path plus UTM parameters (per-click junk like fbclid dropped), rolled up per day by campaign and landing page into a durable table, with an exit-page report split by whether the visitor converted first, and one **session-value ladder** (purchase > cart > goal > engaged > pageview) that makes shop and content sites comparable.
- **Conversion goals for content & catalogue sites** — choose which Gravity Forms (plus the Newsletter plugin, LearnDash, or any custom `Rooster One_goal` action) count as conversions, and see goals by traffic source — so portals and publishers get a real conversion story, not just a shop's.
- **Attribution in your emails** — staff new-order emails carry an "Order origin & attribution" block (marketplace or channel + all five UTMs, now including cheque / bank-transfer / COD orders), and Gravity Forms staff notifications get the same — channel, five UTMs, gclid, landing page and referrer — with no hidden form fields or per-site code.
- **Session × attribution analytics** — engagement (scroll/time/activity) joined to conversion through one session id; blog-post attribution; abandoned-cart and cart-removal analysis; rating- and need-vs-conversion correlation — pre-aggregated for millisecond reports.

### Merchandising, pricing & product display
- **Pricing engine** — per-role price overrides (CSV, with a PRO badge and "log in to see prices"), time-windowed brand/product discounts, loyalty-class percentages and a built-in **points & rewards** balance, all stacked so each customer always sees the strongest applicable price, precomputed for near-zero front-end cost.
- **Offers** — brand free-gift thresholds, free-shipping rules with per-product exclusions, product/category/brand/need targeting with proper exclusion vetoes, and a configurable **exit-intent** modal.
- **Product swatches** — image / button / colour swatches with per-variation descriptions, an optional multi-select batch add-to-cart, and an "Rooster One colour context" flag that turns any swatch attribute into a real product colour for schema and feeds.
- **Product display, your way** — a drag-and-drop layout builder for the whole product info column (block + classic themes), renamable **Custom Tabs** interleaved with WooCommerce's own tabs, Product Needs as list or pills, trust badges, payment logos, and a master **Button Styles** control (colours, padding, sizing, glass) every storefront button inherits.
- **More on the product & shop pages** — SALE / NEW / Hot image labels, per-product add-to-cart button text with a quantity badge, a SKU + barcode strip, per-variation image galleries, a complementary-products picker, a configurable price block with EU Omnibus lowest-price message, and full control of the archive card (element order, visibility, equal-height buy button, Quick View).

### Cart, checkout & wishlist
- A floating **side / mini-cart** with "you might like" recommendations and a **free-shipping progress bar**, plus a **sticky add-to-cart** bar on product pages.
- **Saved & abandoned carts** — shoppers save, share and resume carts (cookieless share-restore that survives CDN/edge caching, restoring items, variations, quantities and coupons), backed by a permanent abandoned-cart log with outcomes, KPIs and Excel export.
- **Wishlist** with analytics, and a **"notify me when back in stock"** waitlist with automatic stock-watcher emails.
- **Checkout tuning** — an opt-in distraction-free checkout with built-in A/B assignment stamped on the order, minimum-order enforcement (classic + block/Store API), and Greek professional-invoice (τιμολόγιο) fields with AADE lookup on both checkouts.
- Full **WooCommerce block cart & checkout parity** via the WordPress Interactivity API — every surface works identically on block-based and classic shortcode cart/checkout.

### Fulfilment & operations
- **Marketplace order importer** — orders from **Skroutz, Shopflix, eMAG, eFood, Wolt, Etsy and Amazon** (Selling Partner API) flow into WooCommerce as native orders — by polling or signed webhook per marketplace — so stock, attribution, customer profiles and fulfilment stay unified; per-marketplace switches, rotatable webhook tokens, configurable SKU lookup and a retrying inbound log.
- **Catalogue Importer** — the mirror of the feeds: enter your eFood / Etsy / Wolt / Amazon keys and Rooster One recreates the products in your store, auto-building categories, attributes and food option-groups, sideloading images, and matching on SKU so a re-run updates in place — with Draft-and-new-only, Create+Update, Update-only and an **Enrich** mode that fills gaps (e.g. barcodes) without overwriting.
- **Streaming feed generator** (XML / CSV) for 35k-product catalogues, with Google Shopping / Google Local / Skroutz / BestPrice / Shopflix / Meta / Amazon templates plus eFood / Wolt / Etsy exports, and a reusable product/variation picker.
- **Courier fulfilment drivers** for **ACS, BoxNow, Courier Center, ELTA, Geniki, Speedex** and a **Custom** driver — vouchers, labels, COD and tracking from the order, bulk printing and per-courier daily closings — plus **COD and payment-method gating** by destination country or chosen courier, a **Local Pickup hybrid** (legacy + Blocks) with cash-on-pickup, and delivery economics that compute a real break-even free-shipping threshold from your carrier costs (with a retrospective shipping-cost scanner and a per-carrier × zone P&L report).
- **Operational intelligence** — Physical-Demand Stock Recovery (auto-restock products the stores still sell), Missing Hot Sellers (in-store best-sellers not yet live online), a self-tuning sales / out-of-stock predictor, and a multi-branch physical-store stock / supplier / barcode-scanning / preorder system — all reading from one materialised data layer, with optional ERP integration.

### Built for the Greek & Cypriot market
First-class support for the couriers, marketplaces and payment habits Greek shoppers actually use — not generic US/UK defaults.

- **Greek courier fulfilment drivers.** Issue vouchers, print labels, set COD and track shipments straight from the order for **ACS**, **BoxNow**, **Courier Center**, **ELTA Courier**, **Geniki Taxydromiki** and **Speedex** — plus a **Custom** driver for any other carrier. Bulk voucher printing, per-courier daily closings (Geniki close API, Courier Center manifest, or a local manifest) and per-courier documents are built in.
- **Greek marketplace order import.** Orders from **Skroutz**, **Shopflix**, **eMAG**, **eFood**, **Wolt**, **Etsy** and **Amazon** arrive in WooCommerce as native orders, so stock, attribution, customer profiles and fulfilment stay unified — with per-vendor rotatable webhook tokens and configurable SKU lookup.
- **Greek marketplace product feeds.** Ready-made, streaming XML / CSV feeds for **Skroutz**, **BestPrice**, **Shopflix** and **eMAG**, alongside **Google Shopping**, **Google Local**, **Meta (Facebook) catalog**, **Amazon** and **Tolstoy** — built to handle 35k-product catalogues.
- **Cash on Delivery, the Greek way.** Enable or disable **COD** by destination country (e.g. on for Greece, off for Cyprus) or by the chosen courier (e.g. no COD when Box Now is selected), live on both classic and block checkout — and disable any payment method by country too.
- **Honest shipping from the first click.** A postcode-less cart shows the real minimum carrier rate ("Carrier (από X,XX €)") instead of a placeholder that looks free, and a margin-aware calculator sets your free-shipping threshold from real courier costs.
- **Greek-native end to end.** A complete Greek admin + storefront translation, and a Greek-aware in-house SEO engine (titles, meta, schema and one-click AI Assist).

### Content, events & site tools
- **Content vitals** — the content twin of product vitals: every post, page and custom type gets daily reach, engagement, freshness and a 0–100 content-demand score, with the same time-of-day / day-of-week consumption bands the shop side uses for buyers — surfaced in a content-analytics dashboard and the insights chat.
- **Events** (beta) — a block-editor Event type with schedule, RSVP deadline, venue and Maps link, participant import from XLSX/CSV, one-click tokenised RSVP, newsletter invitations, front-end self-registration and an attendance panel with XLSX export.
- **Competitions** — run prize giveaways off any Gravity Form, each with a ready-made landing page, desktop/mobile creatives and one-click social share links, with entrant-revenue insights precomputed so the page opens instantly.
- **FAQ manager** — a self-contained FAQ type with drag-and-drop groups and a `[faq]` accordion shortcode scoped by group or entry.
- **Custom Post Types hub & Store Pages** — one admin home for FAQ, Events, Competitions, Locations & Reviews, Food & Beverages and Store Pages, keeping them out of the WordPress sidebar.
- **Food & Beverages option groups** (opt-in) — reusable modifiers (sizes, toppings, with/without) with min/max, per-option pricing, free allowances and a live running total, carried through cart, checkout and the order.
- **Media Cleanup** — a resumable tool for large libraries that reclaims disk from stale thumbnail sizes, true orphans and deleted-product images (WebP/AVIF included), quarantining first and never touching a file referenced anywhere on the site.
- **Scheduled Google-review refresh**, an **admin usage dashboard**, and a per-user **My Settings** landing page round out the operator tools.

### Customer intelligence & engagement
- An **omnichannel customer view** (eshop + in-store) as a single source of truth, with behavioural segments (top, lost, lookalike, abandoned-cart, reactivation, competition-participant), recomputed nightly from a pre-built data warehouse.
- **AI Chat Analytics (Pro)** — a customer-profiling dashboard that turns storefront chat history into a searchable log, volume and happiness trends, the page each chat started from, catalogue gaps (questions that surfaced no products), and chat-assisted conversions and revenue.
- **Triggered web-push** flows (welcome, reactivation, price-drop, back-in-stock) with a full dispatch log and click attribution.
- **Customer survey intelligence** (Gravity Forms ingest, NPS / satisfaction / priorities / discovery / gift / profile metrics and a composite VoC score).
- **Star ratings** with `AggregateRating` schema (native, or bridged into AIOSEO / Yoast / RankMath) so reviews show as Google rich results.

### Insights Chat & analytics
- **Insights Chat** — ask your shop questions in plain language from inside wp-admin, powered by the Claude key you already have and dozens of purpose-built, read-only data abilities (orders, products, attribution, recommendations, ratings, blog engagement, customer profiles, ranked keywords, striking-distance opportunities, landing-page campaigns and exit pages). Customers are pseudonymised, and every ability is registered on the WordPress Abilities API. No third-party BI subscription, no data export.
- **Advanced session analytics** — custom class-based event tracking, click throttling, image-click tracking, duplicate-event protection and aggressive cache-busting, compatible with Nginx, Varnish, Redis, WP Rocket and Cloudflare.
- **Insights remote-DB streaming (Pro)** — stream raw analytics to your own operator-owned MariaDB / MySQL for unbounded BI, reusing the encrypted ERP connection registry, with a local-purge failsafe so nothing is deleted until the remote confirms receipt.

### Gutenberg blocks — a large native library
Dozens of native block-editor blocks, most **server-rendered** (dynamic, so they stay fast and cache-friendly) and all available from your editor's block inserter:

- **Local & Google business** — Google Reviews (ratings), Business Info, Opening Hours, Store Hero, Store Info (address / contact), **Store Locator** and **Store Map** — everything for a complete local-SEO store page, plus a `LocalBusiness`-schema store post type.
- **Product & PDP** — Product Slider, Recommendations, Product Needs (same-need alternatives), Product Card Swatches, Product Variations Gallery, Lowest-Price (EU Omnibus) Message, Sale-Eligibility Message, Free Shipping (PDP progress bar), Product Meta (SKU + barcodes), Loyalty Connection and Professional (B2B) Signup.
- **Brand** — Brand Rails, Brand Slider, Brand A-Z Index, Brand Story, Brand Related and Brand Archive Hero.
- **Content, blog & archives** — Latest Posts Overlay, Breadcrumb, Category Hero / Lead / Chips / Footer Hero, Page Hero, Blog Hero, Blog Subcategories, Taxonomy Archive Hero / Footer, Taxonomy Related Articles, and Post Related Brands / Product Categories / Needs.
- **Events & competitions** — Competition and Event Registration blocks, each self-binding to the page they're placed on.
- **Layout** — Custom Slot regions to drop rich HTML, WooCommerce shortcodes or a Tolstoy video-shopping widget between the recommendation rails.

### Built for speed & resilience
- The expensive work (catalogue vitals, SEO head, sitemap, swatch caches, analytics rollups) is pre-computed on a schedule into flat tables; the storefront reads single, cached rows.
- A thin **front-end runtime plugin** serves the storefront features, SEO head, sitemap and redirects even when the admin plugin is trimmed from a request, and a build step ships **minified CSS/JS** for every asset across both plugins.
- **Self-healing background jobs** re-arm themselves if an update or a wiped cron table drops them, stay dormant until their feature is in use, and collapse runaway third-party scheduled tasks to keep the queue clean.

== Privacy & the recommendations service ==
For WooCommerce stores, product recommendations are produced by our graph-database service at https://eshop-optimizer.com. It is **privacy-centric**: you can opt out of sharing product/category names and prices with limited impact on quality, and withhold customer IDs for anonymity. Our company, Oxford Metadata Ltd, maintains privacy provisions approved by both Google and Facebook — see https://eshop-optimizer.com/compliance.

== How to Use ==

- **Export & back up your current pairings.** Safely export existing up-sells and cross-sells (a reliable back-up); the Pro version factors your current selections into the AI's output.
- **Accelerated order export (HPOS).** Export up to 100,000 order items (Pro lifts the cap), excluding titles/prices or customer IDs at will, with optional seasonal analysis.
- **Refine your data with our AI engine.** Register at eshop-optimizer.com and submit your data to receive refined up-sell / cross-sell strategies for your leading products (full-catalogue analysis in Pro).
- **Import tailored strategies.** Apply the AI-crafted suggestions via a simple CSV upload.
- **Watch sales grow.** Measure the lift with the built-in ROI Wizard and UTM tracking — and we offer a free initial analysis, because we're confident you'll want more.

For any queries or support, contact us at [support@eshop-optimizer.com](mailto:support@eshop-optimizer.com).

---
Website: (https://eshop-optimizer.com)

== Installation ==

Extract the contents of this plugin zip file into your wp-content/plugins/ directory locally.
Upload the extracted folder to your website.
Navigate to wp-admin/plugins.php on your dashboard.
Find 'Rooster One' and activate the plugin.
Alternatively, install directly through WordPress:

Go to the 'Plugins' menu in WordPress.
Click 'Add New' and search for 'Rooster One.'
Install and activate directly from your dashboard.

== Changelog ==

= 9.4 - 2026-07-23 =
**Correctness hardening for the faster price lookup introduced in 9.3.**

* **Fixed: the faster price lookup could show the wrong price on a multi-currency store.** Currency plugins that convert prices after WooCommerce has gathered them — including WooCommerce Multilingual — were not detected, so a shop could display an unconverted price. The check now recognises them and falls back to the slower, always-correct calculation whenever any pricing extension is involved.
* **Fixed: the same lookup could show a stale or truncated price.** WooCommerce keeps a summary of each variable product's price range, and that summary can fall behind if prices are imported without it being refreshed, or be misread when a price is stored with a comma as the decimal separator. The price shown is now cross-checked against the product's own variations, and anything that disagrees falls back to the full calculation.
* **Fixed: prices stored with comma decimals are now read correctly.** On European stores a price saved as "24,99" could be read as 24.00 by parts of the system that read the database directly, understating the price. Values are now interpreted using the store's own number format.

* **Fixed: deleting a colour or size no longer leaves stale swatches behind.** Removing an attribute term did not refresh the products that used it, so their swatches could keep showing the removed option until each product was next saved. Deletions now refresh the affected products, as edits already did.
* **Faster attribute edits during imports.** Editing attribute terms — which product imports do constantly — used to run one database query per affected variation. The affected products are now found in a single query and refreshed once per import run rather than once per edit.

= 9.3 - 2026-07-22 =
**Faster variable-product pricing, and correct prices for professional customers after a price import.**

* **Fixed: professional customers could see outdated prices for up to 30 days after a role-price import.** WooCommerce caches the price range of a variable product, and the cache key recorded who was viewing but not which version of the role-price data was in force. Uploading a new role-price CSV therefore left professionals on the previous cached prices until each product happened to be re-saved. The role-price data version is now part of the key, so an import takes effect immediately. Public prices are unaffected and their caches are left intact.
* **Faster storefront pages for logged-in customers.** The same cache key was being varied by every role a customer holds, including roles that have no effect on price at all — so ordinary customers, loyalty members and newsletter subscribers each caused the shop to recalculate a variable product's price range from scratch, arriving at exactly the same answer as for a logged-out visitor. The key now varies only by the roles that actually change the price, so those customers share the public result.
* **Faster recommendation and side-cart cards.** Building a card for a variable product meant loading every one of its variations to work out the price range — on a product with 150 variations that is substantial work, repeated per card. Where it is safe to do so, the range now comes from the index WooCommerce already maintains for exactly this purpose. Products with role-based pricing, and stores that display tax-inclusive prices, keep the previous behaviour.
* **Fixed: prices shown in product labels and structured data ignored tax display settings.** Discount labels and the price range published in structured data were built from raw prices rather than the prices shoppers actually see, which on a tax-inclusive store meant both were understated. They now match the displayed price.
* **Reduced repeated settings lookups on price-heavy pages.** The plugin's settings tree was being rebuilt from scratch on every internal lookup, which on a large variable product could happen several hundred times in a single page render. It is now built once per request.

= 9.2 - 2026-07-21 =
**Analytics and nightly jobs now repair their own database routines.**

* **Fixed: nightly jobs could fail forever after a site restore or migration.** Database backups exclude stored routines unless explicitly asked for, so restoring a site could silently drop the procedures that power surveys, web-push customer intelligence, product needs and session analytics — while the plugin still believed they were installed. The affected jobs then failed every night with "PROCEDURE … does not exist", and reinstalling or reactivating the plugin did not help, because the check was based on a stored version number rather than on whether the routines actually existed.
* **Now self-healing.** Each job detects a missing routine at the moment it needs it, reinstalls it and retries once. This costs nothing on normal page loads — there is no extra check on storefront requests — and it repairs itself inside the nightly job or an admin action instead of needing manual intervention.
* Covers the survey ingest/intelligence procedures, the web-push customer-intelligence recompute and segment assignment, product-needs population, and the session-analytics aggregation, ranking, summary and cleanup routines.

= 9.1 - 2026-07-20 =
**Stability release — three fixes worth updating for, one of them urgent.**

* **Fixed: a fatal error that could break logging in.** On sites using the identity/attribution layer, the `wp_login` handler called an internal helper it wasn't allowed to reach, which raised a PHP fatal during sign-in — affecting the standard login form, "My account", and passwordless/magic-link sign-in. If you were seeing 500s on login, this is the fix.
* **Fixed: AI credit balance over-reported when you held a top-up.** The remaining balance added your top-up on top of the monthly cap, but the cap already includes it — so the figure could read as much as double. This under-fired the low-balance alert and let the assistant hit its limit while the meter still showed credit. The credit meter now reads "incl. $X top-up" rather than "+ $X" to match how the cap is actually composed.
* **Removed a latent fatal on the paid-order path.** The Meta CAPI purchase-event builder contained an unreachable branch that would have raised the same class of fatal as the login bug if ever taken. Removed rather than left as a landmine.

= 9.0 - 2026-07-20 =
**The plugin is now Rooster One.**

* **New name.** "AI eShop Optimizer" is now **Rooster One** (the front-end companion is "Rooster One — Runtime"). Only the display name changes: your settings, data, shortcodes and block names are all untouched, and updating is a normal plugin update with nothing to reconfigure.
* **One checkout newsletter opt-in instead of two.** A single box now registers new subscribers, with per-list control for shop managers, and customers manage newsletter and offers independently from their account.
* **Tidier checkout birthday field** — day, month and year sit on one row with a full-width explanatory note and a configurable highlight colour.
* **Accessibility fixes** — corrected ARIA usage on rating stars and gave promo and product-card links proper accessible names.
* **Faster perceived loading on category, page and blog pages** — the above-the-fold hero image is now prioritised, improving Largest Contentful Paint. Below-the-fold heroes stay lazy.

= 8.7 - 2026-07-13 =
**Block-library discoverability, plus a clearer block name.**

* **More native blocks now surface in the block editor and on the plugin page.** Recommendations, Product Slider and Product Variations Gallery gained a block-editor registration (they were front-end-render-only before), so they now appear in the inserter with a labelled placeholder and are listed among the blocks this plugin provides. Their front-end output is unchanged.
* **The full block library is documented** in the plugin description — brand, product, local-business (Google Reviews, Store Locator / Map, Opening Hours, Business Info…), content and archive blocks, grouped by purpose.
* **"Post Related Categories" is now "Post Related Product Categories"** to make clear it lists related WooCommerce product categories, not blog categories.

= 8.6 - 2026-07-13 =
**Your admin chat now fixes SEO for you — plus Google Search Console, backlink & disavow tools, a sharper and more relevant storefront assistant, lower AI/embedding costs, and a faster engine that shrugs off aggressive crawlers.**

* **Sales predictor rebuilt to run in seconds, not minutes.** The backtest accuracy step and the per-batch variation build joined the full order-line history on a computed key (`COALESCE(variation_id, product_id)`) that no index could serve, forcing MariaDB into full×full block-nested-loop scans of ~2–5 billion row-pairs per run (300–500s each). Order-line analytics now carry an indexed `effective_pid` column, the backtest is pre-aggregated once instead of a correlated per-row subquery, and every freshly-rebuilt staging table is `ANALYZE`d before it is joined — so the optimiser always picks an indexed nested-loop. Output is byte-for-byte identical (verified across every history row on live data); the nightly job just stops churning the database into swap.
* **Same fix applied across the physical-recovery and monolithic predictor paths.** The five stock-recovery-outcome joins and the legacy monolithic predictor now use the indexed `effective_pid` too.
* **Customer cumulative order-stats no longer stall.** The per-customer lifetime spend/items rollup was a `customeremail` self-join that flipped to a quadratic multi-minute scan whenever the underlying order table had just been rebuilt (stale statistics). It is now a single pre-aggregate pass — structurally impossible to flip — with fresh statistics forced before it runs.
* **Product Data Prep (vitals) rebuilt for speed and stability.** The nightly Data Prep run that computes every product's vitals — the metrics behind recommendations, badges, swatches, archives and analytics — could flip into multi-hundred-second full-table scans right after a staging table was rebuilt, because stale table statistics made MariaDB mis-plan the joins (the classic "n_rows reads as ~1" trap). Every vitals stage now refreshes its statistics and pins the correct index with typed join keys before it joins, so it stays on a fast indexed path; a built-in circuit breaker caps any single query's temp-table size and run time, and a plan-flip detector flags a regressing stage instead of letting it churn the database into swap. Identical output, a fraction of the time — and no more midnight swap spikes on large catalogues.

* **Sitemap & robots.txt scheme fix.** The XML sitemap and managed robots.txt are built offline (cron / WP-CLI), where WordPress cannot detect that the live request is HTTPS. On a site served over https but whose stored WordPress Address is http:// (the classic Cloudflare "Flexible" SSL / http-origin proxy setup), every sitemap `<loc>`, image URL and the robots.txt `Sitemap:` line could be written as http:// — so search engines were handed http canonicals for an https site. Every same-site URL emitted by the sitemap and robots.txt is now normalised to https (overridable via the new `Rooster One_seo_sitemap_scheme` filter for a genuinely http-only origin).

* **SEO Auto-Fix Assistant, in your admin chat.** Ask the Rooster One Insights chat to "fix my top pages" and it now works in two tiers, free before paid. **Free (no AI credits):** it sets the canonical URL and fills the focus keyphrase from the page's own top-ranking Google keyword — structural fixes that need no copywriting, applied instantly and re-scored, with one-click undo; it can also clear an accidental noindex on request. **AI credits:** the content-writing fixes — a SERP-aware SEO title + meta description, descriptive alt text for images missing it, and richer body content (drafted for review; approving saves a WordPress revision so you can roll back) — are written by the AI, drafted for your review by default. The assistant always tries the free fixes first and tells you the credit cost before writing across more than a few pages. A nightly free Autopilot can keep the structural fixes flowing (off by default, opt-in).

* **Google Search Console — your true traffic (new).** Connect Search Console (SEO → Search Queries) and see the real queries and pages that bring you Google organic clicks, impressions, CTR and average position — straight from Google — beside the DataForSEO ranked-keyword view. High impressions with low CTR flag a title/description the AI can rewrite.

* **Backlinks & toxic-link disavow (new).** SEO → Backlinks pulls your referring domains and their spam score from DataForSEO, flags the toxic ones, and generates a ready-to-upload Google disavow file — kept in sync as new bad links appear. (Google provides no API to submit a disavow, so you upload the file once at the Search Console Disavow Tool; we link you straight there.)

* **Content ideas from your customers (new).** The questions shoppers ask your storefront AI that it answers poorly — no matching products, or a low rating — are distilled into a demand-ranked list of content gaps, so you know exactly what to write next. Your customer assistant only surfaces the signal; it never changes your site.

* **Storefront AI assistant — more relevant answers, fewer wrong turns.** The product cards shown alongside a chat answer are now always tied to what the shopper actually asked, with a relevant-product fallback so the assistant never pads a reply with off-topic links. It understands your own Table Rate Shipping rules when answering delivery questions, and a configurable recency boost lets newer arrivals win when a shopper asks "what's new" or browses a fast-moving category (set your "new product" window under Merchandising → Badges). Answers also run to full length by default for more complete replies.

* **Lower AI costs — the semantic index only embeds what changed.** Building your recommendation & search index now embeds only the products, posts and pages that are new or have changed since the last run, instead of re-embedding the whole catalogue every time — a large saving on embedding spend for big or frequently-updated stores. (Switching the embedding model still rebuilds everything, as it must.) Product text is read from the pre-computed product vitals first and only reaches into the full content for the description, so each run is faster too — and the automatic nightly re-embed schedule now runs reliably.

* **Faster and more resilient under heavy crawling.** A few storefront helpers used to make a small uncached background request on every page view — the swatch add-to-cart nonce refresh, recommendation-impression logging, and the free-shipping progress bar's cart check. Under an aggressive SEO crawler those could multiply into a needless server-load spike. They now fire only on genuine shopper interaction (or only when there is actually a cart to sync), and automated JS-rendering crawlers are skipped outright — no change to what shoppers see or do, just no wasted load from bots.

* **Cookie scanner: off by default, on demand instead.** The consent banner's live per-visitor cookie-discovery sweep is now off by default. Your cookie & third-party-service inventory is built from the built-in database plus the on-demand "Re-scan storefront now" button (Consent → Cookie inventory), which loads your key pages in the background whenever you add a new service — so nothing scans on every visitor. Continuous live discovery can be switched back on any time.

= 8.5 - 2026-07-05 =
**SEO grows beyond the shop: site profiles for content & catalogue sites, Google-data-driven AI titles, conversion goals, campaign & exit-page analytics, and complete attribution in your order and form emails.**

* **Site profiles (new).** Tell Rooster One what your site IS — shop, catalogue (products presented as content, without checkout), or content/publisher — or let it auto-detect. Every SEO metric adapts: opportunity scoring, pillar pages and demand now work properly on content and catalogue sites instead of assuming a shop.
* **Content vitals (new).** The per-product health metrics gain a content twin: every post, page and custom type gets daily reach, engagement, freshness and demand scores — including reader time-of-day and day-of-month consumption patterns, the same lens the shop side has for buyers.
* **DataForSEO integration (new).** Connect a DataForSEO account per site (SEO → General) and Rooster One pulls a weekly snapshot of every Google keyword you rank for, computes striking-distance opportunities (positions 8–20 by search volume) and shows them on the Opportunities card — under a monthly spend cap you control.
* **AI titles & descriptions with live SERP context (new).** A nightly queue drafts new SEO titles and descriptions for your highest-ROI pages using the actual Google results for the target keyword — written to win the click against the competitors really shown there. Drafts wait for approval on SEO → Health, or switch on Autopilot.
* **Conversion goals (new).** Choose which Gravity Forms (plus the Newsletter plugin) count as conversions per site. Rooster One's AI reads each form and derives its goal context, which feeds the SEO descriptions of the pages hosting that form — and goal conversions flow into content demand and the new campaign analytics.
* **Campaign attribution in form notification emails (new).** Gravity Forms staff notifications can include the full campaign story — channel, all five utm parameters, landing page and original referrer — with no hidden form fields or per-site code snippets. Visitor autoresponders are never touched, utm form fields auto-prefill, and the page URL sent to HubSpot is cleaned of tracking parameters.
* **Order attribution emails, completed.** The "Order origin & attribution" block in staff new-order emails now always lists all five utm parameters — and it now also appears on orders paid by cheque, bank transfer or COD, which previously missed it on speed-optimised checkouts.
* **Landing pages & campaigns, canonicalised (new).** Session analytics now parse every visitor's landing page into a clean path plus utm parameters (per-click junk such as fbclid is dropped), with a durable per-day campaign × landing-page rollup: sessions, cart adds and goal conversions per campaign.
* **Exit pages (new).** See where sessions end, split by whether the visitor converted first — separating natural end-of-journey pages from the pages that bleed visitors.
* **Ask the insights chat.** New chat skills: ranked keywords, the striking-distance list, the content-vitals leaderboard, landing-page campaigns and exit pages.
* **Redirect import safeguards.** Imports now verify that every redirect target exists on THIS site and refuse any rule that would create a redirect loop at any depth.
* **Cookie consent: position the floating button per device.** The floating "Cookie settings" button can now be placed Left, Centre or Right with exact pixel offsets from the edge and the bottom — separately for desktop and mobile — so it aligns cleanly with other floating widgets (chat bubbles, scroll-to-top). When the Side Cart bottom navigator is active, its coordinated styling automatically takes precedence on mobile.
* **Search Console fixes.** Paginated pages emit correct self-canonicals and sensible robots defaults, addressing "Alternative page with proper canonical tag" and "Duplicate without user-selected canonical" warnings on content sites.

= 8.4 - 2026-07-04 =
**A media-library cleanup tool, a per-user landing page that can resume where you left off, an admin usage dashboard, a managed robots.txt, and more resilient background jobs.**

* **Media Cleanup (new).** A Tools & Settings tool that reclaims disk space by finding and removing image files your site no longer needs — thumbnail sizes your current theme doesn't register, true orphans with no media-library record, and images left behind by products you deleted. It scans in resumable batches (built for libraries with hundreds of thousands of files), moves everything it flags to a recoverable quarantine first, and only deletes for good when you choose to empty the quarantine — with removing the matching media-library records kept as a separate, off-by-default opt-in. A file is only ever touched when nothing on the site references it anywhere — product galleries, variation swatches, brand logos, page/post content, widgets, menus and theme options are all checked, WebP and AVIF included — so an image still in use is never removed.
* **Choose where you land — or pick up where you left off.** A new My Settings card lets each user set which e-shop Manager card the page opens on, instead of always landing on the same default. Pick any card, or choose "continue where I left off" and Rooster One returns you to the last card you were working in.
* **Admin usage dashboard (new, administrators only).** A Tools & Settings panel, visible only to site administrators, that reports how the Rooster One admin is actually used — page views, active users, sessions and most-opened cards — in total and per user, over a time window you select. Lightweight, self-pruning (kept for 180 days), and never shown to non-admins.
* **Managed robots.txt (new).** The built-in SEO engine can now manage your robots.txt alongside the XML sitemap: it serves a correct, sitemap-referencing robots.txt (honouring "Discourage search engines"), lets you add your own custom rules from SEO → Redirects, and writes a static file at the web root so your server can serve it directly. It only ever acts when Rooster One SEO is switched on and no other SEO plugin (Yoast, Rank Math, AIOSEO) is handling robots — and it never overwrites a robots.txt it didn't create.
* **More reliable background jobs.** The protection that stops a mis-behaving recurring task from piling up thousands of duplicate scheduled actions now covers the full set of AutomateWoo jobs and WPForms' spam-purge and form-locator tasks — not just log cleanup — so low-traffic sites keep a clean, fast Action Scheduler queue.
* **Fixes & polish.** The image picker on the SEO → Schema and Social cards now opens reliably (it previously failed to attach on pages where the media library loaded late). Greek translations refreshed, including the Amazon Selling-Partner catalogue and order-import strings.

= 8.3 - 2026-06-26 =
**One-click product import from your marketplaces, an AI-chat analytics dashboard, and a single unified admin navigation.**

* **Catalogue Importer (new) — import your products from eFood, Etsy, Wolt and Amazon.** The mirror image of the marketplace catalogue exports: enter your marketplace API keys, choose a source, and Rooster One recreates the products in your store with one click — auto-building the category tree, product attributes and food option-groups each product references, sideloading its images, and matching on SKU so a re-run updates products in place instead of duplicating them. Imports as Draft + new-only by default (each a per-run toggle, alongside Create + Update and Update-only). A new **Enrich** mode fills gaps on existing products without overwriting anything you already have — so you can, for example, create products from Wolt (for their ingredient / topping option-groups) and then enrich from eFood or Amazon to fill in barcodes. Amazon reads your own Seller listings through the Selling Partner API (no extra AWS keys needed); eFood, Etsy and Wolt use their catalogue APIs.
* **AI Chat Analytics (new, Pro).** A Customer-Profiling dashboard that turns your AI chat history into insight: a searchable conversation log plus aggregate metrics — which page each conversation was opened from (read from the existing Session Tracker, not a second tracker), question volume and topics, the satisfaction ratings customers leave, and chat-assisted conversions (orders that followed a chat, precomputed and cached the same way Competition conversions are — never calculated live on page load). Conversation-history retention is configurable, 90 days by default.
* **Unified admin navigation.** The three Rooster One admin pages — Analytics & Shop Recommendations, e-shop Manager and AI Chat — now share a single menu bar that highlights the section you're in, replacing the old top tab-strip and the separate per-page tables of contents. New "Set Up" and "AI Chat" menu groups deep-link straight to each page's individual cards, so everything is one click away from anywhere.
* **Quick Navigator finds features by what they do.** The Ctrl/Cmd-K Quick Navigator now matches synonyms and capability terms as well as names — so "amazon", "barcodes" or "import" jump to the Catalogue Importer and "happiness" or "sentiment" to AI Chat Analytics — and cross-page results now show the correct section badge.
* **Fixes & polish.** The SEO → Redirects "Rebuild SEO index" card now remembers the object types you last rebuilt (Posts / Pages / Products / Attributes as well as the taxonomies) and pre-ticks them on your next visit, instead of always resetting to the terms-only default.

= Earlier versions =

8.2 and earlier are listed in changelog.txt, which ships with the plugin.

== Upgrade Notice ==

= 9.2 =
Recommended if your site has ever been restored, migrated or cloned. Database backups omit stored routines by default, which could leave the surveys, web-push, product-needs and session-analytics jobs failing every night with "PROCEDURE … does not exist" — permanently, since reactivating the plugin did not rebuild them. Those jobs now detect and repair their own routines, with no added cost on storefront requests.

= 9.1 =
Recommended for everyone. Fixes a PHP fatal that could break sign-in (login form, My account, and magic-link) on sites using the identity/attribution layer, corrects an AI credit balance that over-reported when a top-up was held, and removes a latent fatal on the paid-order path.

= 9.0 =
The plugin is now called Rooster One. Display name only — settings, data, shortcodes and block names are unchanged, and there is nothing to reconfigure. Also: one unified checkout newsletter opt-in instead of two, a tidier birthday field, accessibility fixes on ratings and promo links, and faster Largest Contentful Paint on category, page and blog heroes.

= 8.7 =
Makes more of Rooster One's native blocks (Recommendations, Product Slider, Product Variations Gallery) discoverable in the block editor and on the plugin page, documents the full block library, and clarifies the "Post Related Product Categories" block name. No front-end changes.

= 8.6 =
New: an in-chat SEO Auto-Fix Assistant with Google Search Console plus backlinks & disavow, a sharper and more relevant storefront assistant, and lower embedding costs. Much faster nightly Data Prep, vitals and analytics queries — no more billion-row scans or midnight swap spikes — and more resilient under heavy crawling. Note: the consent cookie scanner now defaults to off — rebuild the inventory on demand via "Re-scan storefront now".
