=== Yuzool Commerce ===
Contributors: yuzool
Tags: ecommerce, stripe, digital products, simple store, buy button
Requires at least: 5.9
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a store in 60 seconds. Sell digital and simple physical products with Stripe links, cart checkout, and individual product pages.

== Description ==

Yuzool Commerce is built for people who want a simple store without heavyweight ecommerce setup.

V1 scope:

* Digital products
* Simple physical items
* Stripe payment links

Features:

* Product list
* Pricing
* Buy button
* Checkout redirect to Stripe or PayPal
* Order notification email on success return
* Image/video per product (URL or WordPress media URL)
* Optional cart mode with multi-item checkout
* Optional individual product pages
* Built-in SEO metadata + schema markup for store/product output
* Built-in store health checks, config rollback snapshots, and orders CSV export
* Optional storefront fragment cache for faster repeated page views
* Per-product billing mode: one-time or subscription
* Subscription lifecycle capture via Stripe webhooks
* Entitlement shortcode gate for premium content
* Role-based and combined role+subscription gate modes
* Gutenberg visual gate block inserter
* Open-source core with optional upgrade path to hosted Yuzool tools

No inventory engine, no tax engine, no shipping logic.

Want done-for-you templates and hosted creator tooling?
* Yuzool Widgets: `https://www.yuzool.com/widgets/`

Use shortcode:

`[yuzool_commerce_store]`

Gutenberg block:

* **Yuzool Commerce Store**

== External services ==

This plugin can connect to external services when configured by the site owner.

Stripe:
* Service used: Stripe Payment Links (`https://stripe.com/payments/payment-links`)
* Purpose: hosted checkout when visitors click Buy buttons.
* Data sent and when: when a visitor clicks a Stripe buy link or cart checkout button, their browser is redirected to Stripe and/or the site requests Stripe Checkout Session creation via Stripe API. Standard request data and checkout details entered on Stripe are sent to Stripe.
* Stripe terms: `https://stripe.com/legal`
* Stripe privacy: `https://stripe.com/privacy`

PayPal:
* Service used: PayPal Payment Links (`https://www.paypal.com/us/business/accept-payments/payment-links`)
* Purpose: hosted checkout when visitors use PayPal buy options.
* Data sent and when: when a visitor clicks a PayPal checkout link, the browser connects directly to PayPal and sends normal request metadata and checkout details entered on PayPal.
* PayPal terms: `https://www.paypal.com/us/legalhub/paypal/useragreement-full`
* PayPal privacy: `https://www.paypal.com/us/legalhub/privacy-full`

Yuzool:
* Service used: Yuzool policy pages/documentation links
* Purpose: references in plugin UI/readme.
* Data sent and when: only when an admin or visitor clicks Yuzool links.
* Yuzool policies: `https://www.yuzool.com/policies`

== Installation ==

1. Upload the `yuzool-commerce` folder to `/wp-content/plugins/`.
2. Activate **Yuzool Commerce** in WordPress admin.
3. Open **Yuzool Commerce** in sidebar.
4. Add products, prices, and Stripe links.
5. Click **Create Store Page in 60 Seconds**.

== Frequently Asked Questions ==

= Is this a full WooCommerce replacement? =

No. It is intentionally focused and simple for quick store launches.

= Does it calculate taxes or shipping? =

No. V1 intentionally excludes inventory, tax, and shipping logic.

= How do order notifications work? =

Configure your Stripe success URL to return to your site with:
`?yzc_order=success&yzc_product=PRODUCT_SLUG&yzc_session=ORDER_ID`

When that URL is loaded, the plugin sends a notification email to the configured admin email.

== Changelog ==

= 1.8.1 =
* Removed hardcoded demo Pro key requirement path and switched to open-source core behavior.
* Removed local Pro activation UI dependency from admin flow.
* Added clearer upgrade traffic path to `https://www.yuzool.com/widgets/`.

= 1.8.0 =
* Added subscription recovery analytics in admin (failed renewals, recovered renewals, recovery rate by product).
* Added Gutenberg visual gate block (`Yuzool Commerce Gate`) with role/subscription mode controls and live preview.
* Added event-type persistence on webhook order rows for stronger subscription analytics accuracy.

= 1.7.1 =
* Added richer access-control modes in `yuzool_commerce_gate`: `subscription`, `role`, `both`, `either`.
* Added role-based gating support (`role="subscriber,editor"`).
* Added gate helper UI in admin to generate embed-ready gated shortcodes.

= 1.7.0 =
* Added entitlement enforcement shortcode: `[yuzool_commerce_gate product="slug"]...[/yuzool_commerce_gate]`.
* Added grace-period policy for `past_due` subscriptions.
* Added manual admin override UI for subscription access states (save/delete).
* Added dunning email templates (subject/body) configurable in settings.

= 1.6.1 =
* Added dunning layer: auto email retry instructions on `invoice.payment_failed`.
* Added subscription access-state tracking (`active`, `past_due`, `canceled`) from webhook lifecycle events.
* Added admin panel section for subscription access states.

= 1.6.0 =
* Added per-product billing mode (`one-time` / `subscription`) and interval display label.
* Added Stripe subscription checkout session mode for subscription carts.
* Added mixed-cart guardrail: blocks one-time + subscription items in the same checkout.
* Added automatic customer lookup from checkout session to improve billing-portal flow.
* Added recurring Stripe webhook lifecycle capture (`invoice.payment_succeeded`, `invoice.payment_failed`, `customer.subscription.created/updated/deleted`).

= 1.5.1 =
* Added lightweight uptime/error log panel in admin for support triage.
* Added structured event logging for checkout, portal, and Stripe webhook flows.
* Added one-click log clearing action in admin.

= 1.5.0 =
* Added performance-first fragment cache (configurable TTL) for storefront rendering.
* Added automatic safe config snapshots (last 5) with one-click rollback.
* Added built-in store health checks to reduce setup and maintenance complexity.
* Added orders CSV export (no extra plugin needed).
* Added stricter save workflow method checks and automatic cache-version bump on setting changes/import/restore.
* Added lazy-loading images in storefront cards for better Core Web Vitals.

= 1.4.0 =
* Added privacy/compliance controls: retention days, checkout privacy notice, and privacy policy URL.
* Added WordPress privacy exporter/eraser integration for stored order data.
* Added automatic old-order purge based on retention period.
* Hardened request handling with explicit POST-method checks and checkout/portal rate limiting.
* Hardened webhook verification with Stripe signature timestamp tolerance checks.
* Hardened config import sanitization for all core settings and products.

= 1.3.1 =
* Added dual cart checkout mode to show both Stripe and PayPal checkout buttons.
* Hid demo Pro key from plugin admin UI (key-only activation remains supported).
* Added CI workflow for WordPress Plugin Check and WPCS on push/PR.

= 1.3.0 =
* Added PayPal checkout options (per-product PayPal links + PayPal cart checkout URL mode).
* Added built-in SEO support: product-page title tuning, meta descriptions, Open Graph description, and schema.org ItemList/Product JSON-LD.
* Added clearer testing links for generated individual product pages.

= 1.2.1 =
* Replaced `mt_rand()` usage with WordPress-preferred `wp_rand()` for Plugin Check compliance.

= 1.0.1 =
* Added Gutenberg block wrapper for the storefront shortcode.
* Added Stripe-link host validation and stronger input hardening.

= 1.2.0 =
* Added customer portal session launcher (Stripe billing portal) from storefront.
* Added receipt retrieval link from Stripe checkout session on success returns.
* Added granular analytics: product conversion and coupon usage tables.
* Added email templates, digital delivery template fields, and resend-email action per order.
* Added one-click import/export of store configuration JSON.
* Added direct test links for individual product pages in admin.
* Switched Pro activation to key-only mode (license server URL hidden).

= 1.1.0 =
* Added product image/video support (URL or WordPress media URL).
* Added optional cart mode for multi-item checkout using Stripe Checkout Sessions.
* Added optional individual product page generation (`/product/{slug}`).
* Added Stripe webhook verification endpoint and order history capture.
* Added license activation endpoint support for Pro mode.
* Added per-product success/cancel URL overrides and tracking tags.
* Added coupon/promotion support for Pro cart flows.

= 1.0.0 =
* Initial release.
* Free mode (3 products) and Pro mode gates.
* Stripe-link checkout redirect flow.
* Product list, pricing, buy buttons, and order notification flow.
* Optional Pro analytics and upsell blocks.
