=== Revoker for WooCommerce ===
Contributors: kommers
Tags: woocommerce, withdrawal, revocation, eu, consumer rights, gdpr, refund, right of withdrawal
Requires at least: 6.0
Tested up to: 6.9
Stable tag: 1.0.5
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

EU-compliant withdrawal button for WooCommerce – enables customers to easily revoke orders in accordance with EU Directive 2023/2673.

== Description ==

**Revoker for WooCommerce** adds a legally compliant withdrawal button to your WooCommerce store. Customers can revoke orders directly from their account area – fully compliant with EU Directive 2023/2673 and applicable consumer protection laws.

= Why Revoker? =

Starting in 2026, online merchants in the EU are required to provide consumers with an easy way to exercise their right of withdrawal. Revoker implements this requirement elegantly and user-friendly.

= Key Features =

* **Withdrawal Button** – Automatically appears on the order details page in customer accounts
* **Two-Step Process** – Button → Confirmation page prevents accidental withdrawals
* **Deadline Calculation** – Automatic calculation of remaining withdrawal period
* **Partial Withdrawal** – Customers can withdraw individual items from an order
* **Guest Support** – Withdrawal without customer account via order number + email
* **Email Notifications** – Automatic confirmation to customer and shop admin
* **Withdrawal Log** – Complete overview of all withdrawals in the backend
* **Product Exceptions** – Exclude categories, individual products, or digital downloads
* **Customizable** – Button text, style, and withdrawal period individually configurable
* **PDF Confirmation** – Generate PDF documents for withdrawal confirmations
* **Gutenberg Block** – Add withdrawal policy information easily to any page

= Legal Compliance =

* EU Directive 2023/2673
* Consumer Rights Directive 2011/83/EU
* GDPR compliant

= Pro Version =

Need advanced features? [Revoker Pro](https://kommers.io/plugins/revoker) offers:

* **Dashboard & Statistics** – Withdrawal rates, trends, top products
* **Automatic Refunds** – Integration with WooCommerce Refunds
* **Notifications** – Slack, Microsoft Teams, Custom Webhooks
* **REST API** – Complete API for external integrations
* **Rules Engine** – Advanced exception rules (geo, price, time, etc.)
* **UI Builder** – Visual editor for button and modal
* **Return Labels** – Integration with DHL, DPD, GLS
* **Accounting Export** – DATEV, lexoffice, sevDesk export
* **Fraud Detection** – Protect against abuse
* **Multilingual** – 6 languages including legally compliant translations
* **Legal Updates** – Automatic updates for regulatory changes

== Installation ==

= Automatic Installation =

1. Go to **Plugins → Add New** in your WordPress admin
2. Search for "Revoker for WooCommerce"
3. Click **Install Now** and then **Activate**

= Manual Installation =

1. Download the plugin as a ZIP file
2. Go to **Plugins → Add New → Upload Plugin**
3. Select the ZIP file and click **Install Now**
4. Activate the plugin

= After Installation =

1. Go to **WooCommerce → Withdrawal Button**
2. Configure the withdrawal period (default: 14 days)
3. Customize button text and style as desired
4. Optional: Exclude specific categories or products

== Frequently Asked Questions ==

= Is the plugin GDPR compliant? =

Yes. The plugin only stores data necessary for the withdrawal process and respects all data protection requirements. Withdrawal data is stored together with the order.

= Does the plugin work with my theme? =

Revoker is designed to work with all WooCommerce-compatible themes. The button automatically adapts to your theme's styling.

= Can I customize the withdrawal period? =

Yes. Under **WooCommerce → Withdrawal Button → Settings** you can set the period between 7 and 365 days. The EU standard is 14 days.

= Can guests also withdraw? =

Yes. Using the shortcode `[revoker_withdrawal_search]` guests can find their order by order number and email address and submit a withdrawal.

= Which products can I exclude from withdrawal? =

You can exclude:
* Complete categories
* Individual products
* All digital/downloadable products

= Are emails sent automatically? =

Yes. For each withdrawal, a confirmation is automatically sent to the customer. Optionally, the shop admin can also be notified.

= Is the plugin compatible with HPOS? =

Yes. Revoker fully supports WooCommerce's High-Performance Order Storage (HPOS) feature.

= In which languages is the plugin available? =

The plugin is developed with full internationalization support and includes translations for:
* German (de_DE)
* English (en_US)
* French (fr_FR)
* Italian (it_IT)
* Spanish (es_ES)
* Dutch (nl_NL)

= How do I add the withdrawal policy to a page? =

You can use the Gutenberg block "Withdrawal Policy" or the shortcode `[revoker_withdrawal_policy]` to display the legally required withdrawal information on any page.

== Changelog ==

= 1.0.5 =
* Fixed: Withdrawal log table was never created on activation, causing "Error saving the withdrawal." for all withdrawals. The activation hook was registered too late (on `plugins_loaded`) to fire during plugin activation.
* Added: Self-healing database check that creates the table on existing installs affected by the activation bug, with no manual reactivation required.

= 1.0.4 =
* Changed: Source language switched from German to English for WordPress.org GlotPress compatibility
* Added: German (de_DE) translation file with 100% coverage
* Updated: French (fr_FR), Spanish (es_ES), Italian (it_IT), Dutch (nl_NL) translations to 100% coverage
* Improved: All translatable strings now use English as source language (msgid)

= 1.0.3 =
* Fixed: Database insert failure when saving withdrawals (NULL datetime handling)
* Fixed: Modal on order confirmation page now shows item checkboxes for selection
* Fixed: Modal withdrawal submission now correctly sends selected items
* Added: Dedicated return address settings (company name, address, postcode, city)
* Improved: Return address in forms, emails, and withdrawal policy uses custom settings with WooCommerce fallback
* Improved: Error logging for failed database operations when WP_DEBUG is enabled

= 1.0.2 =
* Fixed: Escape all $withdrawal_period variables with absint()
* Fixed: Escape all $days_remaining variables with absint()
* Fixed: Escape $deadline and $withdrawal_url in plain text emails
* Fixed: Move PDF styles to external CSS file to avoid inline <style> tag

= 1.0.1 =
* Fixed: Proper escaping of date_i18n() outputs
* Fixed: Use wp_enqueue functions for scripts and styles
* Fixed: Plugin URI now points to valid URL
* Added: Requires Plugins header for WooCommerce dependency
* Removed: WordPress.org directory assets from plugin package

= 1.0.0 =
* Initial stable release
* Withdrawal button on order details page
* Two-step withdrawal process
* Partial withdrawal of individual items
* Guest support via order search
* Email notifications (customer & admin)
* Withdrawal log in backend
* Product and category exceptions
* Exclude digital downloads
* Customizable button style (standard, outline, text link)
* Configurable withdrawal period (7-365 days)
* PDF generation for withdrawal confirmations
* Gutenberg block for withdrawal policy
* Withdrawal reason selection
* HPOS compatibility
* Translations for 6 languages

== Upgrade Notice ==

= 1.0.0 =
Initial stable release of Revoker for WooCommerce.

== Additional Info ==

= Minimum Requirements =

* WordPress 6.0 or higher
* WooCommerce 7.0 or higher
* PHP 7.4 or higher

= Privacy =

This plugin:
* Stores withdrawal data locally in your WordPress database
* Does not send data to external servers
* Is fully GDPR compliant

The Pro version communicates with kommers.io for license validation and updates.
