=== WildRock ===
Contributors: wildrock
Tags: woocommerce, search, ai search, product search, analytics
Requires at least: 4.9
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 0.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI search that understands what shoppers mean, plus store analytics. One thin plugin; all the AI runs in the WildRock cloud.

== Description ==

WildRock adds an **AI-powered search** to your WooCommerce store that understands intent — not just keywords. Shoppers can type the way they talk ("a gift for a Goku fan", typos included) and find the right products. It also connects your store to **WildRock Insights** for real-time analytics (orders, carts, visits, conversion).

This is a **thin client**: the plugin only (1) syncs your catalog to the WildRock API and (2) injects the search widget on your site. All the AI, indexing and analytics run in the WildRock cloud — nothing heavy runs on your server, so your store stays fast.

**What you get**

* Semantic AI search: intent, synonyms and typo tolerance.
* Embeddable search widget (compact or full-screen), customizable color and logo — no code.
* Storefront, sale badges and merchandising controls from a dashboard.
* GEO: product feeds, sitemaps and llms.txt to improve visibility in AI answers.
* WildRock Insights: real-time store analytics on the same account.

**How it works**

1. Create a free account and get your two API keys at https://app.wildrock.io
2. Install this plugin, paste your keys and press *Sync*.
3. The search widget appears on your store; analytics start flowing.

A WildRock account is required (free tier available). See pricing at https://wildrock.io

== External services ==

This plugin connects to the **WildRock** cloud service to provide search and analytics. It is required for the plugin to work.

Nothing is sent anywhere until you paste your own API key in the settings screen. Without a key the plugin does nothing at all.

**1. Search service — required, and it is what the plugin is for**

* **Catalog sync** — when you press *Sync* (and automatically when a product changes), your product data (title, description, price, stock, images, categories) is sent to `https://app.wildrock.io/api/ingest` so it can be indexed. This is store data, not personal data.
* **Search** — the search widget on your storefront sends the shopper's query to `https://app.wildrock.io/api/search` to get results back. Queries are stored anonymized so you can see what your shoppers look for.
* **Sales attribution** — when an order is placed by a shopper who used the search, the order id, the order total and an anonymous session pseudonym are sent to `https://app.wildrock.io/api/attribute`, so your dashboard can show how much revenue the search generated. No personal data, no names, no email addresses.

**2. Analytics (WildRock Insights) — OFF by default, opt-in only**

This is disabled out of the box and stays disabled until you tick an explicit consent checkbox in *WooCommerce → WildRock*, next to a plain-language description of exactly what leaves your site. If you never tick it, none of the following is ever sent, and the search works normally.

If you do enable it, order, cart and visit events are sent to `https://insights.wildrock.io/api/helper/ingest`. **This includes personal data of your shoppers**: billing and shipping name, email, phone, address and IP address on orders; email, name and phone on carts; and the page visited plus an anonymous session id on visits. Each of the three (orders, carts, visits) can also be turned off individually.

Before enabling it, make sure your own privacy policy covers this processing. Depending on where you sell, you may need to inform your shoppers or obtain their consent.

The service is provided by WildRock.
Terms of Service: https://www.wildrock.io/terminos
Privacy Policy: https://www.wildrock.io/privacidad

== Installation ==

1. In your WordPress admin: Plugins → Add New → Upload Plugin, choose the WildRock zip, Install and Activate.
2. Create your account and copy your keys at https://app.wildrock.io
3. Go to Settings → WildRock, paste your API URL and keys, and press *Sync now*.
4. Done — the AI search appears on your store and syncs automatically from then on.

== Frequently Asked Questions ==

= Do I need to know how to code? =
No. Install the plugin, paste two keys and press a button.

= Does it slow down my store? =
No. The plugin is light and all the intelligence runs in the WildRock cloud; your store only sends its catalog.

= Is a paid account required? =
A WildRock account is required, and there is a free tier. Paid plans unlock more products and WildRock Insights. See https://wildrock.io

= What data is sent to WildRock? =
Your product catalog (for indexing), shopper search queries (anonymized), and — only if you enable analytics — order/cart/visit events. See the "External services" section.

== Changelog ==

= 0.5.1 =
* Passes Plugin Check with no errors, verified on a clean WordPress 6.9 + WooCommerce 11 install with `WP_DEBUG` on: added a missing translators comment, declared version and footer placement on a registered script, and documented why two admin-screen reads of `$_GET` need no nonce (they only choose which notice to display and are sanitized and escaped).

= 0.5.0 =
* **Analytics is now opt-in and off by default.** The WildRock Insights integration (orders, carts and visits, which include shopper personal data) no longer runs unless the store administrator ticks an explicit consent checkbox, shown next to a plain-language list of exactly what is sent and where. Previously the three tracking options defaulted to on, which made data collection opt-out. Nothing is sent without that consent, and the visit-tracking REST route is not even registered until it is given.
* Publishing `llms.txt` on your own domain is also opt-in now, instead of on by default.
* Every `register_setting()` call now names its sanitize callback literally in the call itself. The values were already sanitized, but the callbacks were resolved through a lookup array, which automated review tools cannot follow.
* Existing stores keep their current settings: this release changes what a *new* install starts with, not what you already saved.

= 0.4.4 =
* The search is now excluded from cache plugins (WP Rocket, Autoptimize, LiteSpeed). They were making a local minified copy of the widget and serving that, which froze it: improvements stopped reaching the store until someone purged the cache by hand. Also excluded from "Delay JS", which left mobile visitors without a search until they touched the screen.

= 0.4.3 =
* Fix: on themes whose mobile header has no search icon, the widget mounted invisibly and there was no way to open it. The theme search is now only treated as replaceable when it is actually visible; otherwise the floating button appears, so there is always a way in.

= 0.4.2 =
* Fix: with "replace the theme search", the search did not open on mobile. The theme builds its mobile search inside a drawer that does not exist yet when the page loads, so there was nothing to replace. Now the theme search is left where it is and tapping it opens WildRock — same behaviour on desktop and mobile, and the merchant keeps their main search box.

= 0.4.1 =
* Fix: on mobile, the search did not appear on stores using a cache plugin with "Delay JS" (WP Rocket, Autoptimize). Those plugins hold every script until the visitor interacts — a mouse move on desktop, a tap on mobile — and our boot gave up after 10 seconds, so a visitor who read for a while before tapping never got the search. It now retries for longer and also boots on that first gesture.

= 0.4.0 =
* Settings registered with explicit sanitize callbacks; plugin header description aligned with the readme; clarified that the visit-tracking REST endpoint is intentionally public.

= 0.3.9 =
* Compliance with the WordPress.org plugin checks: removed heredoc syntax, aligned plugin name and text domain, and sanitized plain-text output.

= 0.3.8 =
* AI visibility (GEO): your store now publishes its own llms.txt at yourdomain.com/llms.txt, so AI assistants (ChatGPT, Perplexity, Gemini) can discover your catalog. Cached 12h, updates itself.

= 0.3.7 =
* Fix: cart values were sent as 0 € (WooCommerce hadn't calculated totals yet when the cart was tracked). Amounts are now computed from the displayed product price, so abandoned-cart values are correct in WildRock Insights.

= 0.3.6 =
* Sales attribution: orders that started with a search are now credited to the search engine, so your dashboard shows the revenue WildRock generated. Anonymous (no personal data).

= 0.3.5 =
* Prices are now synced as displayed in your store (tax included if your shop shows tax-inclusive prices), so search results match the product page. Re-sync your catalog after updating.

= 0.3.4 =
* New "Search size" setting: full-screen (recommended, with left filters and product grid) or compact window. Default: full-screen.

= 0.3.3 =
* The plugin now updates itself from wp-admin (standard "Update" button / auto-updates) — no more manual zip uploads.

= 0.3.2 =
* Fix: the search widget now appears on sites using WP Rocket / Autoptimize "Delay JavaScript" (the boot no longer depends on the window load event, and it retries while the delayed widget script arrives).

= 0.3.1 =
* Catalog sync now runs in batches with a live progress bar ("Syncing… 1,200 / 5,342 products") instead of a silent spinner, and can't time out on large catalogs.

= 0.3.0 =
* Easy placement without touching your theme: floating button, "replace my theme's search", or manual via the "WildRock Search" block / [wildrock] shortcode.

= 0.2.0 =
* Unified plugin: AI search + WildRock Insights analytics in one install.
* Full-screen search layout with left filters; "Surprise me" and popular searches.
* Sale badge on product images; category/series filters.

= 0.1.0 =
* Initial release: catalog sync and embeddable AI search widget.

== Upgrade Notice ==

= 0.5.0 =
Analytics is now opt-in: new installs send nothing to WildRock Insights until you tick the consent box in WooCommerce → WildRock. Your existing settings are not changed.

= 0.3.5 =
Search prices now match your storefront (tax-inclusive display). Press "Sync now" after updating so indexed prices refresh.

= 0.3.2 =
Fixes the widget not appearing on stores with WP Rocket/Autoptimize "Delay JS". Update recommended.

= 0.3.1 =
Catalog sync now shows a live progress bar and won't time out on large catalogs.

= 0.3.0 =
Adds easy placement (floating button, replace theme search, block/shortcode). Pick one in Settings → WildRock.

= 0.2.0 =
Adds analytics and the full-screen search layout. Re-sync your catalog after updating.
