=== Frommwah Reveals ===
Contributors: simon19
Tags: woocommerce, unboxing, video, personalization, packaging
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 6.0
Stable tag: 1.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends customers a branded unboxing reveal video as soon as they pay for their WooCommerce order.

== Description ==

Frommwah Reveals connects your WooCommerce store to Frommwah, a service that generates a short branded
"unboxing" video for each completed order and sends it to the customer by email, along with a shareable
reveal page.

When an order is paid (status Processing, or Completed for virtual and downloadable orders), the plugin sends the order's product, customer, and total information
to Frommwah, which generates the reveal and returns a link. That link is saved on the order, shown to the
customer on the thank-you page and in their account order history, and shown to you on the order's admin
page.

Setup takes two steps:

1. Go to Settings > Frommwah Reveals in your WordPress admin and click Connect. This creates your account
   and pulls your store's branding (name, logo, colour) automatically — no manual entry needed.
2. That's it. Every paid order from then on triggers a reveal automatically.

If a reveal ever fails to generate, it's logged to WooCommerce's own logs (WooCommerce > Status > Logs >
frommwah-reveals) and never blocks or delays the order itself.

== External services ==

This plugin connects to Frommwah's backend (hosted on Supabase, at eoyyoolfytvyhecnroqy.supabase.co) to
provide its functionality. It cannot generate reveals without this connection.

These calls are made:

1. **On connecting** (Settings > Frommwah Reveals > Connect): your site's URL and the email address you
   enter are sent to Frommwah to create your account and fetch your store's public branding.
   Service: Frommwah (https://frommwah.com). Terms: https://frommwah.com/terms. Privacy:
   https://frommwah.com/privacy.

2. **On each paid order**: the order ID, product name/image/URL, order total, and the customer's
   name, email, and phone number (if provided at checkout) are sent to Frommwah so it can generate and
   email the reveal. No payment or card information is ever sent.

3. **Billing** (only if you choose a paid plan or credit pack): your Frommwah account key is sent to Frommwah,
   which creates a Stripe checkout or billing-portal session and returns its link. Payment happens on Stripe
   (https://stripe.com). Stripe terms: https://stripe.com/legal. Stripe privacy: https://stripe.com/privacy.


== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/frommwah-reveals` directory, or install the zip
   directly through the Plugins screen in WordPress.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to Settings > Frommwah Reveals and click Connect.

== Frequently Asked Questions ==

= Does this cost anything? =

The free plan sends up to 20 reveals a month. Optional paid plans and one-off credit packs are available
from the Billing section; payment is taken by Stripe on Stripe's own checkout page. This plugin never sees or
stores card details.

= Does this slow down checkout? =

No. The reveal is generated after the order has been placed and paid, not during checkout, and never
blocks the order from being placed or processed.

= What happens if the reveal fails to generate? =

The failure is logged to WooCommerce's own log viewer and the order is completely unaffected — no error is
shown to the customer.

= Where can I see the generated reveal? =

On the order's admin page, on the customer's order-received (thank-you) page, and in the customer's My
Account order history — all show a "View Your Reveal" / "Open reveal" link once it's generated.

== Screenshots ==

1. The reveal your customer opens on their phone, with share buttons.
2. Your box, branded with your own logo and colour.
3. The branded box a customer sees when the lid opens.

== Changelog ==

= 1.5.1 =
* Security hardening: nonce checks on billing links, settings scripts moved to an enqueued file,
  user-supplied text is never inserted as HTML.
* No longer loads fonts from Google.

= 1.5.0 =
* The reveal now sends as soon as payment clears (order status "processing"),
  not when the order is marked completed. Previously a customer did not get
  their reveal until the parcel shipped, sometimes days later.
* Virtual and downloadable orders, which skip "processing", still send on
  "completed" as before. An order can never receive two reveals.

= 1.2.0 =
* Paid plan upgrades (Starter/Growth/Pro) via Stripe Checkout, with a 14-day trial.
* Manage billing link (Stripe's own hosted portal — cancel, update card, view invoices).
* Premium Custom Box enquiry form (£199 one-off, hands-designed box).

= 1.1.0 =
* Self-serve connect flow with automatic brand detection.
* HPOS (High-Performance Order Storage) compatible.
* Duplicate-send guard for orders that change status more than once.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Improves compatibility with newer WooCommerce order storage and adds a self-serve connect flow.
