=== OrderGrace: Self-Service Order Editor for WooCommerce ===
Contributors: rabby5
Tags: woocommerce, order management, customer experience, post purchase, order editing
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Give customers a secure post-purchase correction window for WooCommerce orders, reducing support tickets and fulfillment mistakes.

== Description ==

OrderGrace adds a controlled edit window after checkout so customers can fix common mistakes without contacting support.

When eligible payment is completed, the order enters a temporary "Hold for Editing" stage. During this grace period, customers can use a secure editor from the thank-you page or a secure magic link. Once the timer expires (or the customer confirms early), OrderGrace releases the order for normal fulfillment.

This plugin is built for stores that want fewer manual edits, fewer fulfillment errors, and a better post-purchase experience.

== Why OrderGrace Is Unique ==

* Dedicated "Hold for Editing" order status for operational control
* Secure token-based edit access for guests and logged-in customers
* Automatic timed release to fulfillment with Action Scheduler and WP-Cron fallback
* Strict country and state validation using WooCommerce location data
* Optional shipping-rate recalculation after address updates
* Optional customer cancellation with full refund attempt (gateway dependent)
* WooCommerce-native audit notes for traceability and accountability

== Key Features ==

* Post-purchase editing timer on thank-you page
* Secure magic-link editing entry point
* Shipping and billing address edits (configurable)
* Order note editing (configurable)
* Variation swapping inside the same variable product (configurable)
* Optional same-price restriction for variation swaps
* Optional customer cancellation during grace period
* Dashboard stats for operational visibility

== What It Solves ==

* Wrong shipping address after checkout
* Incorrect billing details
* Customer note corrections
* Variation choice mistakes on variable products
* Support-team workload from avoidable post-purchase corrections

== Usage Flow ==

1. Customer completes checkout and payment.
2. Eligible order enters Hold for Editing.
3. Customer opens the editor from thank-you page or secure magic link.
4. Customer saves corrections, cancels order (if enabled), or confirms early.
5. Order releases to fulfillment automatically when timer ends or immediately on manual lock.

== Configuration ==

Go to:

WooCommerce > Settings > OrderGrace Editor

You can configure:

* Grace period duration and unit
* Whether orders are routed into Hold for Editing
* Excluded product categories
* Which fields are editable
* Shipping recalculation behavior
* Cancellation availability
* Email timer display
* Customer-facing heading and message
* Audit note logging

== Security and Privacy ==

OrderGrace uses:

* WordPress nonces for AJAX requests
* Per-order secure tokens for edit authorization
* Server-side edit-window validation
* Server-side country/state validation

OrderGrace does not send customer data to third-party services.

== Compatibility ==

* WordPress 6.0+
* WooCommerce 7.0+
* PHP 7.4+
* HPOS compatibility declared

== Frequently Asked Questions ==

= Does this plugin work for guest checkout orders? =

Yes. Secure tokenized links support guest editing safely during the grace window.

= Can customers edit any order forever? =

No. Editing is strictly limited to the configured grace period.

= Can I choose what customers are allowed to edit? =

Yes. Each editable area is configurable in settings.

= Does cancellation always issue a refund automatically? =

Refund behavior depends on your payment gateway's WooCommerce refund support.

= Will this impact fulfillment automation? =

Orders stay in Hold for Editing during the grace period, then return to normal fulfillment flow when released.

== Screenshots ==

1. OrderGrace dashboard with operational metrics
2. WooCommerce settings tab for grace window and allowed edits
3. Thank-you page panel with timer and secure edit actions
4. Customer editor modal with address, variation, and note editing

== Changelog ==
= 1.0.2 =

* Loaded plugin translations with load_plugin_textdomain for full localization support.
* Hardened AJAX context refresh handling when order reload fails unexpectedly.
* Sanitized rendered order item meta HTML before returning it in AJAX payloads.
* Cleared pending Action Scheduler and WP-Cron release jobs on uninstall.



= 1.0.1 =

* Fixed shipping-rate recalculation lookup to prevent false "no shipping rates" errors.
* Added My Account order action and order-details panel entry for active edit window orders.
* Resolved frontend public class syntax issues and improved action label clarity.

= 1.0.0 =

* Initial stable release
* Secure post-purchase editing workflow for WooCommerce
* Hold for Editing status and timed release automation
* Customer editor via thank-you page and secure magic link
* Address, notes, variation, shipping, and cancellation controls
* Admin dashboard metrics and onboarding flow

== Upgrade Notice ==

= 1.0.0 =

First public release of OrderGrace.
