=== EU Withdrawal Button for Woo ===
Contributors: manapoint
Tags: withdrawal button, consumer rights, legal compliance, omnibus directive, woocommerce compliance
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.2
License: GPLv2 or later

A strict, lightweight, HPOS-native solution to comply with the EU Directive 2023/2673 (Withdrawal Button) starting June 19, 2026.

== Description ==

Starting June 19, 2026, the EU Directive 2023/2673 requires e-commerce stores selling to EU consumers to provide an easy-to-use 2-click withdrawal button (Kündigungsbutton) for order cancellations. 

This micro-plugin strictly solves this legal requirement without adding unnecessary weight to your site. 

Important notice: This plugin is provided 100% free of charge to help the wp community.
If you install it, you accept it as it is, with no dedicated technical support.
If you encounter bugs, please feel free to report them, but active troubleshooting or custom support will not be provided, instead we will release a general update. 
If you don't like this policy, please feel free to choose another plugin. If you love it, a 5-star review is highly appreciated to support our free effort!

= Core Features =

* **2-Click Cancellation:** Injects a native, accessible HTML5 `<dialog>` in the My Account area for eligible orders (completed within the last 14 days).
* **Immutable Legal Logs:** Maintains a cryptographically hashed log (SHA-256) of all withdrawal requests in an isolated custom table for legal proof.
* **100% HPOS Compatible:** Built entirely for WooCommerce High-Performance Order Storage.
* **No-Code Styling:** Includes a lightweight backend panel to match the button colors and shape (rounded/square) to your theme.
* **Zero-Bloat:** No jQuery, no heavy frameworks. Just vanilla JS and native browser APIs.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/eu-withdrawal-button-lite` directory, or install through the WordPress plugins screen.
2. Activate the plugin.
3. Navigate to WooCommerce > EU Withdrawal to customize your button appearance.
4. **For Logged-in Customers:** The button automatically appears for eligible orders in the My Account section.
5. **For Guest Users:** Create a new page (e.g., "Withdrawal Request"), paste the shortcode `[mpeu_withdrawal_form]` inside it, and add the link to your website's footer.

== External services ==

This plugin does not use any third-party or external services. All data processing is handled locally.

== Changelog ==

= 1.2.2 =
* Added `[mpeu_withdrawal_form]` shortcode to support guest users and ensure 100% legal compliance.
* Updated security checks to validate guest withdrawal requests via Order ID and Billing Email match.

= 1.2.1 =
* Added automatic admin email notifications for incoming withdrawal requests.

= 1.2.0 =
* **Major Update:** Integrated Professional features into the base version.
* Added Immutable SHA-256 Legal Logs for audit compliance.
* Added No-Code Styling panel under WooCommerce > EU Withdrawal.
* Updated Plugin Name to "EU Withdrawal Button for Woo".
* Improved security with rigorous sanitization and nonce checks.
* Enhanced UI using native HTML5 Dialog API and CSS Variables.

= 1.1.1 =
* Full compatibility with WordPress 7.0.
* Official declaration of WooCommerce HPOS compatibility.
* Improved HTML output security and string escaping.
* Added WC_Order integrity checks for more robust AJAX handling.
* Asset versioning synchronization (v1.1.1).