=== Floxaro for WooCommerce ===
Contributors: moormandigital
Developer: Moorman Digital Services
Tags: woocommerce, analytics, conversion, revenue, ecommerce
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.2
WC requires at least: 7.0
WC tested up to: 9.0
Stable tag: 0.6.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Revenue intelligence for WooCommerce. Floxaro tells you where your store is leaving money on the table, and what to do about it.

== Description ==

Floxaro is not a generic analytics plugin. It analyzes your WooCommerce store's own data: product views, add-to-cart activity, orders, refunds, coupon usage, and shipping configuration, and surfaces concrete, ranked opportunities:

* Products getting traffic but not converting
* Products added to cart often but rarely purchased
* Products with no cross-sells configured, despite frequently being bought together with other products
* A store-wide low cart-to-order rate
* Missing or poorly placed free shipping thresholds
* Heavy discount/coupon dependency
* Good-selling products about to run out of stock
* Products with stock sitting unsold (dead stock)
* New products barely getting any views
* Coupons expiring unused, or expired but still published
* Well-selling products with almost no reviews

Every opportunity comes with an honest, range-based impact estimate (never a fake precise number), a confidence level, and a concrete recommended action, never just a statistic.

= What's included in Floxaro Free =

* Dashboard with store metrics and top opportunities
* Full opportunity engine (11 scanners: Product Performance, Upsell, Cart, Shipping, Discount, Stock-out Risk, Reviews, Dead Stock, New Product Visibility, Coupon Expiry, Smart Bundles)
* Store Health Score: one 0-100 number on the dashboard, derived entirely from your currently open opportunities
* Product-level analytics with filters and product detail pages
* Weekly/monthly email reports
* Demo mode: try Floxaro immediately, even on a brand new store with no products yet
* Privacy-first tracking: no personal data collected, anonymized daily-rotating session hashes only
* Full data retention and deletion controls

= Floxaro Pro =

Floxaro Pro (sold separately, not required) adds AI-powered analysis, automated recommendations, cart recovery, advanced upsells, automated reporting, and integrations with Google Analytics, Meta Ads, Google Ads and Klaviyo.

= Privacy =

Floxaro does not collect personally identifiable information. Product views and add-to-cart events are recorded against a non-reversible, daily-rotating hash used only to avoid double-counting, never against an IP address, account, or persistent identifier. All tracking can be disabled from Floxaro → Settings, and analytics data can be deleted at any time.

== Installation ==

1. Upload the `floxaro` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin.
2. Activate Floxaro through the "Plugins" screen.
3. Make sure WooCommerce is installed and active.
4. Go to Floxaro in the admin menu and click "Start analysis".

== Frequently Asked Questions ==

= Does Floxaro require WooCommerce? =

Yes. Floxaro will show an admin notice and stay inactive if WooCommerce is not active.

= Does Floxaro slow down my store? =

No. Analysis runs on a daily WP-Cron job, never on frontend page loads. The only frontend-side work is recording a view/add-to-cart event, a single lightweight database insert.

= Is Floxaro compatible with WooCommerce High-Performance Order Storage (HPOS)? =

Yes. Floxaro reads order data exclusively through WooCommerce's own CRUD APIs and declares HPOS compatibility.

= What happens to my data if I uninstall Floxaro? =

Deactivating Floxaro never deletes data. Deleting the plugin only removes Floxaro's analytics tables if you explicitly enabled "Delete all Floxaro analytics data when the plugin is deleted" in Settings.

== Screenshots ==

1. Dashboard with store metrics and top opportunities
2. Opportunity detail card with recommended action
3. Product analytics table with filters
4. Onboarding screen

== Changelog ==

= 0.6.0 =
* Demo mode now also works for a brand new store with zero products: if your catalog is empty when you turn it on, Floxaro creates a handful of clearly labeled "[Demo]" products (flagged and reversible) to seed 30 days of synthetic activity against, so a first-time user always has something to see immediately. A store that already has real products is never touched — demo mode continues to use your existing catalog exactly as before.
* Turning demo mode back off removes both the synthetic events and any demo products it created, nothing else.
* Added a "Try it with demo data" link on the first-run onboarding screen, pointing straight at the Demo mode setting.

= 0.5.0 =
* Added a Store Health Score to the dashboard: one 0-100 number, derived entirely from your currently open opportunities (never a separate heuristic), so it can never disagree with what the opportunity cards below it say.
* Added Smart Bundles: a step beyond the existing cross-sell scanner — finds sets of three products frequently bought together and suggests a bundled offer, not just a pairwise cross-sell link.
* Fixed the admin CSS, admin JS, and wordpress.org icon still referencing the plugin's old "Sellora" name internally (class names, a REST namespace check, an SVG gradient id) — left over from the rename, and the reason the "Start analysis" rescan button and all admin screen styling were silently broken.
* Added unit tests for Store Health Score and Smart Bundles.

= 0.4.0 =
* Added four new scanners: Reviews (well-selling products with almost no reviews), Dead Stock (the mirror of Stock-out Risk — stock sitting unsold), New Product Visibility (recently published products barely getting any views), and Coupon Expiry (coupons expiring unused, or already expired but still published).
* Added unit tests for all four new scanners, and extended the WooCommerce test stand-ins (tests/wc-stubs.php) with review, coupon, and product-creation-date support.

= 0.3.0 =
* Added a sixth scanner: Stock-out Risk. Flags products selling well enough that current stock will run out within 14 days, using the same 30-day sales-velocity data every other scanner already relies on — no forecasting service, no invented numbers. Only products that actively manage stock in WooCommerce and don't allow backorders are considered, since a backorderable product running out isn't a hard stop.
* Added unit tests for the new scanner (priority thresholds, backorders, already-out-of-stock, variable products) and extended the WooCommerce test stand-ins (tests/wc-stubs.php) with stock-related methods.

= 0.2.0 =
* Added a self-hosted update checker. Floxaro now checks for and installs updates from your own server instead of wordpress.org. See docs/PRO.md for the endpoint contract.
* Added `Floxaro\Core\UpdateChecker` as a reusable base class Floxaro Pro's own update checker extends.

= 0.1.0 =
* Initial release: dashboard, opportunity engine (5 scanners), product analytics, product detail, reports, settings, privacy controls, HPOS compatibility.
* Fixed a fatal activation error caused by namespaced constants (FLOXARO_VERSION / FLOXARO_DB_VERSION) not resolving from subnamespaces.
* Added safe, non-destructive one-click actions to opportunity cards (edit product, configure cross-sell, open shipping/checkout/coupon settings).
* Added an optional local-environment-only demo data generator under Settings → Advanced, for previewing the dashboard before real traffic arrives.
* Fixed Products screen pagination and the "Lowest conversion" / "No sales" filters to operate on the full dataset instead of only the current page.
* Fixed the report frequency setting ("Weekly"/"Monthly"/"Off") to actually control the cron schedule, instead of always sending weekly.
* Added Conversion Rate and Revenue per Visit to the dashboard, shown only once enough tracking data is available.
* Added a generated translation template (languages/floxaro.pot).
* Fixed the Settings screen registering its save/delete-data/demo-data hooks twice (once per admin page load).
* Added wordpress.org listing assets: plugin icon and banners (.wordpress-org/, not part of the installable plugin).
* Added a `floxaro_opportunity_action_link` filter so opportunities registered by other plugins (e.g. Floxaro Pro) can supply their own 1-click action links.
* Floxaro Pro (separate plugin, sold separately) now ships with a first real feature: automated cart recovery emails. See floxaro-pro/readme.txt and docs/PRO.md.
* Added `Opportunity::with_actions()` so a third-party plugin (e.g. Floxaro Pro) can attach a 1-click action to an opportunity a Free scanner already produced, via the existing `floxaro_opportunities` filter.
* Floxaro Pro now also ships a real "Apply cross-sell now" one-click fix on the cross-sell opportunity, on top of cart recovery.
* Added `OpportunityRepository::history()`/`count_history()`, read-only access to every opportunity ever found (not just currently open ones), for a Pro/third-party History screen.
* Added a `floxaro_opportunities_persisted` action, fired once per scanner run with the opportunities it just persisted, so a listener (e.g. Floxaro Pro's alerts) can react to genuinely new opportunities without guessing from timestamps.
* Floxaro Pro now also ships AI Insights (bring-your-own OpenAI/Anthropic key), instant high-priority alerts (email/Slack), and an Opportunity History screen.
* Added a `floxaro_report_body` filter so Floxaro Pro (or a third party) can append its own stats to the existing weekly/monthly report email.
* Fixed the Product Detail screen showing a generic, always-identical "Recommended actions" list instead of the actual opportunities Floxaro found for that specific product. Added `OpportunityRepository::for_product()` for this.
* Fixed the Products list's "Opportunity" column using its own hardcoded heuristic (or a product had 0 orders and any views at all) instead of querying what the Opportunity Engine actually flagged, so it could show for products the engine never flagged, and miss products with a real (e.g. cross-sell) opportunity.
* Added unit tests for all five scanners (Product Performance, Upsell, Cart, Shipping, Discount) against minimal WooCommerce stand-ins (tests/wc-stubs.php), so their decision logic (priority, thresholds, confidence) is actually verified rather than only exercised by hand.
* Demo mode is now a real, reversible on/off toggle in Settings, available on any site (previously it only appeared when `WP_ENVIRONMENT_TYPE` was "local", and could only be run once with no way to undo it). Every demo-generated event is flagged `is_demo` in the database; turning demo mode off removes exactly that synthetic data and rebuilds your real stats from what's left, and never touches real tracked activity, and still never creates fake products or orders.

== Upgrade Notice ==

= 0.2.0 =
Adds self-hosted automatic updates. No action needed. This is the last time you'll need to update manually via wp-admin's plugin upload if your server's update endpoint is configured.

= 0.1.0 =
Initial release.
