=== WorkWilla Recommendations ===
Contributors: workwilla, psprog
Tags: woocommerce, recommendations, machine learning, cross-sell, upsell
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.3.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered product recommendations for WooCommerce. Each store gets its own ML model trained on catalog and order data.

== Description ==

WorkWilla Recommendations adds personalized product blocks to your WooCommerce storefront — on product pages and optionally in the cart. The plugin connects your store to the [WorkWilla](https://workwilla.ru) cloud platform where a dedicated model is trained on your catalog and anonymized order history.

**Key features**

* Personalized recommendations on product pages and optionally in the cart
* Separate ML model per store — your data is never mixed with other shops
* Anonymized user identifiers — no raw emails or phone numbers leave your site
* Optional lazy loading via AJAX
* Replace or supplement WooCommerce related products
* Guest recommendations with session-based signals
* Export and retrain from the WordPress admin

**External service**

This plugin requires a free or paid [WorkWilla](https://workwilla.ru) account. After activation, open **WooCommerce → WorkWilla**, review the connection form, and click **Connect** to register your store.

Machine learning training and live recommendations are performed on WorkWilla servers. The plugin sends your full catalog and order export when you run **Export and train**; WorkWilla applies plan quotas on the server side (for example, how much data is used for training or how many API requests are served per month). Billing and plan details are managed on the WorkWilla dashboard — the plugin itself does not lock or disable built-in features.

* [Privacy Policy](https://workwilla.ru/privacy)
* [Terms of Use](https://workwilla.ru/terms)

**Developer customization**

The plugin exposes WordPress filters and actions for titles, limits, payloads, product IDs, and HTTP headers. See the **Developer hooks** section on the plugin settings page in WooCommerce → WorkWilla.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install the ZIP from WordPress.org.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Ensure WooCommerce is active.
4. Open **WooCommerce → WorkWilla**, accept the Privacy Policy and Terms of Use, and click **Connect**.
5. Run **Export and train** to build your first recommendation model.

== Privacy and data sent to WorkWilla ==

**When the store administrator connects the plugin**, WorkWilla receives:

* Store domain
* Administrator email address
* WordPress, WooCommerce, PHP, and MySQL version metadata

**When recommendations are enabled**, the plugin may send to WorkWilla:

* Product catalog data (titles, categories, stock status) when you run export/training
* Anonymized order history (hashed customer identifiers, line items, dates) when you run export/training
* Recommendation request context (cart contents, recently viewed product IDs, anonymized session or user keys)
* Interaction events (product views, add-to-cart, purchases, recommendation block impressions and clicks)

Raw customer email addresses and phone numbers are hashed on your site before transmission. The plugin does not contact WorkWilla until an administrator explicitly connects the store.

As a store owner, you are responsible for informing your customers about data processing required for personalized recommendations, in line with your local privacy laws.

Full details: [WorkWilla Privacy Policy](https://workwilla.ru/privacy)

== Frequently Asked Questions ==

= Does this plugin work without WooCommerce? =

No. WooCommerce 3.0 or newer is required.

= Does the plugin contact external servers before I connect? =

No. External requests start only after an administrator submits the Connect form on the WorkWilla settings page.

= Is customer personal data sent to the cloud? =

Only anonymized identifiers and catalog/order data required for recommendations. Emails and phone numbers are hashed on the plugin side before export.

= Can I use the same account on staging and production? =

Yes. Staging subdomains such as `test.`, `dev.`, `stage.`, and `demo.` are treated as the same site family as your production domain.

= How do I customize block titles or product count? =

Use the settings page or the `workwilla_recommendations_pdp_title`, `workwilla_recommendations_cart_title`, and `workwilla_recommendations_product_limit` filters.

= Is there a free plan? =

Yes. WorkWilla offers a free starter tier. Usage quotas (API requests, training data volume) are enforced on the WorkWilla service, not by disabling plugin code. Paid plans are optional and managed on [workwilla.ru](https://workwilla.ru).

== Screenshots ==

1. Recommendation block on a product page
2. Plugin settings and export panel

== Changelog ==

= 1.3.7 =
* Export sends the full catalog and order history from the store; plan quotas are enforced only on the WorkWilla server
* Optional cart recommendations block (admin setting)
* Recommendations exclude out-of-stock products using live WooCommerce stock status
* Contributors list updated for WordPress.org

= 1.3.6 =
* Optional cart recommendations block controlled by admin checkbox

= 1.3.5 =
* Recommendations exclude out-of-stock products using live WooCommerce stock status

= 1.3.4 =
* Improved export progress and plan usage display in admin

= 1.3.3 =
* Export log: localized messages, clearer server errors, auto-scroll to latest line
* Connect form reliability fix on the WorkWilla admin page

= 1.3.2 =
* Connect form runs on the correct admin page load hook (fixes silent Connect button)

= 1.3.1 =
* Explicit opt-in connection: no automatic registration on plugin activation
* Production WorkWilla URL by default; privacy policy and terms links in Connect form
* Privacy and external-service documentation in readme; GPL license.txt added

= 1.3.0 =
* HMAC request signing for platform and ML API calls
* Domain binding via X-Store-Domain header
* Plugin Check and WordPress.org coding standards compliance

= 1.2.1 =
* Plugin slug renamed to `workwilla-recommendations` for WordPress.org
* WordPress coding standards: class file names, hooks, text domain, constants
* Legacy `cbsr_*` options and cron hooks migrated automatically

= 1.2.0 =
* Guest recommendations toggle
* Block impression and click tracking
* Developer hooks documentation in admin
* Domain binding for API requests
* Improved export progress UI

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.3.7 =
WordPress.org compliance: full export from the plugin; service-side plan quotas unchanged.

= 1.3.3 =
Improved export/training log (Russian UI strings) and Connect form reliability.

= 1.3.1 =
Connection now requires explicit administrator consent on the WorkWilla settings page.

= 1.2.0 =
Adds domain validation, developer hooks reference, and guest recommendation settings.
