=== Web Queenz Withdrawal Manager for WooCommerce ===
Contributors: webqueenz
Tags: woocommerce, withdrawal, cancellation, refund, gdpr
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WC requires at least: 7.0
WC tested up to: 9.9

A professional-grade free WooCommerce plugin for EU withdrawal and cancellation directive compliance (EU Directive 2011/83/EU).

== Description ==

**Web Queenz Withdrawal Manager for WooCommerce** is a production-quality WooCommerce plugin that implements the EU consumer withdrawal right workflow directly inside your store — for both registered customers and guests.

Built to comply with **EU Directive 2011/83/EU** and the new **Directive (EU) 2023/2673 "Withdrawal Button" requirement** (effective June 19, 2026), the plugin provides a complete withdrawal management system with the mandated two-step confirmation flow, a professional admin dashboard, automated email notifications, and GDPR-ready data handling.

= Core Features =

**Customer Workflow**

* "Withdraw From Contract Here" button on My Account orders and order detail pages, per Article 11a labelling requirements
* Two-step withdrawal flow — statement step followed by a separate "Confirm Withdrawal" function, satisfying the Article 11a two-step pattern
* Eligibility validation — 14-day window, order status checks, item-level availability
* Product-level and partial withdrawal support
* Refund or exchange selection
* Optional customer reason field
* My Account → Withdrawals history tab

**Guest Withdrawal Portal**

* Dedicated guest withdrawal page (auto-created on activation)
* Secure order ID + billing email validation
* Enumeration protection — generic error messages prevent order/email fishing
* Session-based secure multi-step flow

**Admin Dashboard**

* Operational dashboard with status counts (Pending, Approved, Completed, Rejected)
* Full requests list table with search, filters, sorting, and pagination
* Single request detail view — customer info, order link, item snapshots, timeline
* Controlled status transitions (pending → approved → completed etc.)
* Internal admin notes system (append-only, never shown to customers)
* Activity timeline — full audit log per request
* Bulk actions (approve, reject, complete) with validation and feedback

**Email Notifications**

* Admin notification on new request submission
* Customer confirmation email with reference number
* Customer status update emails for approved, rejected, and completed requests
* Template-based HTML emails — theme-overridable

**Settings**

* Configurable withdrawal window (minimum 14 days — EU law enforced)
* Guest withdrawals toggle
* Exchange option toggle
* Required reason toggle
* Admin notification email
* Customer email toggles
* Data retention on uninstall setting

**Technical**

* WooCommerce HPOS compatible (High Performance Order Storage)
* Modern OOP PHP architecture
* Translation ready
* GDPR data export and erasure support
* WordPress privacy policy content integration
* Secure — nonce verification, capability checks, sanitization, escaping throughout

= Developer Notes =

The plugin is built with a clean modular architecture:

* Entity/repository pattern for withdrawal records
* Centralized eligibility validation engine
* Event-driven email architecture
* Append-only timeline and notes storage
* Controlled status transition system
* Core services loaded on all request contexts (frontend, admin, AJAX)

= About =

Web Queenz Withdrawal Manager for WooCommerce is developed by **Ali Adeel** and maintained by [Web Queenz](https://webqueenz.com).

== Installation ==

= Automatic Installation =

1. Log in to your WordPress admin panel
2. Navigate to **Plugins → Add New**
3. Search for "Web Queenz Withdrawal Manager"
4. Click **Install Now** then **Activate**

= Manual Installation =

1. Download the plugin zip file
2. Log in to your WordPress admin panel
3. Navigate to **Plugins → Add New → Upload Plugin**
4. Upload the zip file and click **Install Now**
5. Click **Activate Plugin**

= After Activation =

1. Go to **Settings → Permalinks** and click **Save Changes** — this is required once to register the My Account withdrawals endpoint
2. A "Withdrawal Requests" page will be automatically created containing the guest withdrawal portal
3. Go to **EU Withdrawals → Settings** to configure the plugin for your store

== Frequently Asked Questions ==

= What EU law does this plugin support? =

The plugin is designed to help merchants comply with **EU Directive 2011/83/EU** on consumer rights, specifically the 14-day right of withdrawal for online purchases.

= Does this satisfy the new June 19, 2026 "Withdrawal Button" law? =

Yes. Directive (EU) 2023/2673 requires a visible, easy-to-use "Withdrawal Button" on all online interfaces. This plugin implements the specific two-step confirmation process required by the new law to ensure your store remains compliant before the deadline.

= Does this plugin automatically process refunds? =

No. The plugin manages the withdrawal request workflow — receiving, tracking, approving, and communicating with customers. The actual refund processing is handled separately through WooCommerce's standard refund system by the store administrator.

= Can guest customers (without accounts) submit withdrawal requests? =

Yes. The plugin includes a dedicated guest withdrawal portal. Guests verify their identity using their Order ID and billing email address. The portal can be disabled in settings if not required.

= What is the minimum withdrawal window? =

EU Directive 2011/83/EU requires a minimum of 14 days. The plugin enforces this minimum — if you enter a lower value in settings it will automatically be corrected to 14 days.

= Is this plugin compatible with WooCommerce HPOS? =

Yes. The plugin is fully compatible with WooCommerce High Performance Order Storage (Custom Order Tables). All WooCommerce order operations use WooCommerce-native APIs.

= Can customers withdraw only part of their order? =

Yes. The product selection system supports partial withdrawals — customers can select individual items and quantities from their order.

= Does the plugin send emails automatically? =

Yes. The plugin sends three types of emails: an admin notification when a new request is submitted, a customer confirmation with a reference number, and a customer notification when their request status changes. All emails can be enabled or disabled individually in settings.

= What happens to withdrawal data when I uninstall the plugin? =

By default, all withdrawal request data is preserved when the plugin is uninstalled. This protects your operational and compliance records from accidental deletion. If you want data to be deleted on uninstall, enable the "Delete plugin data on uninstall" option in Settings → Advanced before uninstalling.

= Is this plugin GDPR compliant? =

The plugin provides technical tools to support GDPR compliance including personal data export and erasure (anonymization) support through WordPress and WooCommerce privacy tools. Merchants remain responsible for their own privacy policies and legal compliance obligations.

= Where is withdrawal data stored? =

All data is stored locally in your WordPress database. The plugin does not send any customer data to external servers.

= Can I customize the email templates? =

Yes. Email templates can be overridden by placing custom versions in your theme under `your-theme/euwm/emails/`. The same applies to all frontend templates.

= The "Withdrawals" tab is not appearing in My Account. What should I do? =

Go to **Settings → Permalinks** and click **Save Changes**. This flushes WordPress rewrite rules and registers the new endpoint. This is required after installation or major updates.

== Screenshots ==

1. **Admin Dashboard** — Operational overview with status counts and recent requests
2. **Requests List Table** — All withdrawal requests with search, filters, and bulk actions
3. **Single Request View** — Full request detail with customer info, items, timeline, and admin tools
4. **Status Management** — Controlled status transitions with optional note
5. **Activity Timeline** — Append-only audit log per request
6. **Customer Withdrawal Form** — Product selection, request type, and reason
7. **Guest Withdrawal Portal** — Secure order ID + email validation
8. **My Account Withdrawals** — Customer-facing withdrawal history tab
9. **Email Notifications** — HTML email templates for admin and customer
10. **Settings Page** — Configurable options with EU law enforcement

== Changelog ==

= 1.0.0 =
* Initial release
* Complete EU withdrawal request workflow for WooCommerce
* Article 11a (Directive (EU) 2023/2673) two-step withdrawal flow — "Withdraw From Contract Here" statement step followed by a separate "Confirm Withdrawal" function
* Customer withdrawal buttons on My Account and order detail pages
* 14-day eligibility validation with configurable window
* Item-level and partial withdrawal support
* Guest withdrawal portal with secure order ID + email validation
* Admin dashboard with requests list table and status management
* Controlled status transition system
* Append-only activity timeline and admin notes
* Bulk actions with validation and feedback
* Event-driven email notifications (admin + customer)
* HTML email templates with theme override support
* WooCommerce HPOS compatibility
* GDPR personal data export and erasure support
* WordPress privacy policy content integration
* Configurable settings panel with EU law enforcement
* Data retention setting — preserve or delete on uninstall
* Auto-created guest portal page on activation
* My Account withdrawal history tab
* WooCommerce order notes integration
* Version migration system for safe upgrades
* Full security hardening — nonces, capabilities, sanitization, escaping

== Upgrade Notice ==

= 1.0.0 =
Initial release. After activation, please go to Settings → Permalinks and click Save Changes to activate the My Account Withdrawals endpoint.
