=== OrderMender ===
Contributors: swayambhageria
Tags: woocommerce, order editing, order management, post-purchase, customer experience
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let customers fix address and note mistakes themselves right after checkout, inside a store-controlled editing window.

== Description ==

Wrong shipping addresses are one of the most common support requests stores receive, and they usually arrive when it is already too late.

OrderMender adds a short, configurable **editing window** right after checkout. While the window is open the order sits in a dedicated "Hold for Editing" status so fulfillment automation knows not to touch it, and the customer gets a simple form where they can:

* Correct their shipping address
* Correct their billing address (the billing email stays locked)
* Update the customer-provided order note

When the window closes, or the customer confirms early, the order releases back to processing automatically and normal fulfillment continues.

= How it works =

1. An eligible order moves to "Hold for Editing" after checkout.
2. The thank-you page (and My Account) shows a countdown with an edit button.
3. Guest customers get a secure, single-order magic link - no account needed.
4. Every change is logged as an order note and admins can be notified by email.
5. The order releases itself when the timer ends or the customer clicks confirm.

= Built for reliability =

* Compatible with WooCommerce High-Performance Order Storage (HPOS)
* Compatible with Checkout Blocks
* Releases run through Action Scheduler with a WP-Cron fallback plus an init-time safety sweep, so held orders never get stuck
* Editing access is protected by per-order tokens and nonces, and re-validated server-side on every request

= Privacy =

This plugin does not connect to any external service and does not send data anywhere. All edits happen on your own site.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin files to `/wp-content/plugins/ordermender`, or install through the WordPress plugins screen.
3. Activate the plugin through the 'Plugins' screen.
4. Configure the window under WooCommerce > Settings > Order Editing.

== Frequently Asked Questions ==

= Which orders get held? =

By default every order that transitions into Processing enters the window once. Enable "Require completed payment" if you only want paid orders held (useful with pay-on-delivery methods).

Digital-only orders that complete instantly are never affected.

= What happens when the window ends? =

The order returns to Processing automatically and receives an order note. Nothing else about the order changes.

= Can customers change items, quantities, or prices? =

Not in this version. This plugin intentionally limits edits to addresses and notes so totals, taxes, stock, and payments always stay consistent.

= Is the billing email editable? =

No. Changing the email tied to an order would break receipts and password flows, so it is deliberately excluded.

= What if my site uses pay-on-delivery? =

Turn off "Require completed payment" in settings so unpaid COD-style orders also get a window before you ship.

== Screenshots ==

1. The thank-you page panel: a countdown and an "Edit my order" button while the editing window is open.
2. The self-service editor opened from a secure guest magic link: correct the shipping or billing address, or the order note.
3. The settings screen under WooCommerce > Settings > Order Editing.

== Changelog ==

= 1.0.0 =
* First release: post-checkout editing window, secure guest magic links, address and note editing, automatic release via Action Scheduler with WP-Cron fallback, HPOS compatibility.
