=== Tadrik Payment Recovery – Failed & Pending Payment Reminders for WooCommerce ===
Contributors: tadrik
Tags: woocommerce, failed orders, pending payment, payment reminder, abandoned checkout
Requires at least: 6.5
Requires PHP: 7.4
Requires Plugins: woocommerce
Tested up to: 7.1
WC requires at least: 8.6
WC tested up to: 11.3
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Emails customers whose WooCommerce payment failed or was never finished a one-click link to pay, and shows the money it brought back.

== Description ==

A customer chose the products, filled in checkout and clicked "Place order", and then the payment didn't go through. WooCommerce handles these orders badly:

* **Payment not finished** (the customer closed the PayPal window, quit the bank's card check, or left Klarna or iDEAL): the order stays "Pending payment", the customer gets nothing, and WooCommerce cancels the order about an hour later.
* **Card declined**: the order goes "Failed" and WooCommerce's own email tells the customer to "return to the site and try again", with no link to their order, no reminder and no tracking.

Tadrik Payment Recovery sends these customers one email with their order and a **Complete your payment** button. One click opens WooCommerce's own payment page for that order, ready to pay, with any payment method your store offers.

= What it does =

* **Finds failed and unfinished payments** every 15 minutes: orders in "Pending payment" or "Failed" placed through your checkout (classic or block checkout).
* **One reminder**, by default 1 hour after the order, and never while the customer is still trying to pay. The email uses your store's WooCommerce email design and lists the order lines and total.
* **Keeps the order payable.** WooCommerce cancels unpaid orders after its "Hold stock" time. Reminded orders stay open for 3 days instead (you choose 1–14), then WooCommerce cancels them as before. Stock is checked again before payment, so you never sell what you no longer have.
* **One click, no extra steps.** The link skips WooCommerce's "confirm your email address" step for guests (the link was sent to that address). Customers with an account log in as usual.
* **A way out.** Every email has a "Not going ahead? Cancel this order" link. Cancelling asks for a confirmation click, so email security scanners that open links can't cancel orders.
* **Leaves the right orders alone:** bank transfer, cheque and cash on delivery (normally unpaid at first; you can change this), orders you created in the admin, subscription renewals, zero-total orders, customers who already placed a new order, the older of two unpaid orders from the same customer, orders whose items are now out of stock, and every order placed before you activated the plugin.
* **Shows what came back:** "Recovered this month" on the plugin page and in a WordPress dashboard widget, the number of reminders and opened links, a list of the latest reminders, and the unpaid checkout orders of the last 30 days, so you see the size of the problem on day one.

Every reminder, kept order and recovered payment is also written as a note on the order.

Works with HPOS (High-Performance Order Storage) and the block cart and checkout. Made by Tadrik, the small-tools company behind Tadrik Stock Digest and Tadrik Checkout Rules. Questions: hello@tadrik.com.

== Installation ==

1. Install and activate WooCommerce (8.6 or later).
2. Install this plugin from the Plugins screen (search for "Tadrik Payment Recovery"), or upload it to `/wp-content/plugins/tadrik-payment-recovery`, and activate it.
3. Go to **WooCommerce > Payment Recovery**. Reminders are on from the start; the Settings tab has the timing, the payment methods and the email text.
4. Click **Send "payment not finished"** on the Settings tab to see the email in your own inbox.

== Frequently Asked Questions ==

= Which payment methods does it work with? =

Any payment method that leaves the order "Pending payment" or "Failed" when the payment doesn't go through: Stripe, WooPayments, PayPal, Mollie, Klarna, iDEAL and most others. The reminder sends the customer to WooCommerce's own order payment page, so they can pay with any method your store offers there.

= Will customers who already paid get a reminder? =

No. The plugin checks the order again right before sending, skips customers who placed a new paid (or on-hold) order after the failed one, and sends at most one reminder per unpaid order (three in Pro).

= What about bank transfer and cash on delivery? =

Those orders are normally unpaid at first, so they get no reminder by default. You can tick them on the Settings tab if you want reminders for them.

= Does WooCommerce still send its own "Failed order" email? =

Yes, if it is turned on under WooCommerce > Settings > Emails. Ours follows later with a direct payment link. You can turn WooCommerce's one off if you prefer a single email.

= Does it work with WooCommerce Subscriptions? =

Subscription renewal orders are skipped: WooCommerce Subscriptions retries those payments itself.

= What does "Recovered" mean? =

An order that was paid (Processing or Completed) after at least one reminder. It is counted once, in the month it was paid, with its order total.

= Can I change the email? =

Yes: the subject and the opening text for each kind of email (payment not finished, payment declined), with the placeholders {first_name}, {site_title}, {order_number} and {order_total}. The order lines, the button and the cancel link are always there. The email uses your WooCommerce email colours, header and footer.

= What happens when I deactivate it? =

The checks stop and WooCommerce's own unpaid-order cancel works as before. Deleting the plugin removes its settings and counts; the notes on your orders stay.

= Does it work with HPOS? =

Yes. The plugin reads and writes orders only through WooCommerce (`wc_get_orders()` and the order object).

== Screenshots ==

1. The Overview: recovered this month, reminders sent and opened, unpaid checkout orders of the last 30 days, and the latest reminders.
2. The reminder email: the order, a "Complete your payment" button and a cancel link, in your store's email design.
3. The Settings tab: when to send, how long to keep orders payable, which payment methods, and the email text.

== External services ==

Reminders are sent through your own site's email (WooCommerce's mailer and wp_mail) to the customer's billing email address on the order. The plugin sends no other data anywhere while you use it. The one exception is optional: when you deactivate it, the Plugins screen asks why. Only if you click "Send & deactivate" does it send your chosen reason, your optional note (up to 500 characters) and the plugin, WordPress, WooCommerce and PHP versions to Tadrik's feedback service at ops.tadrik.com. It never sends your site address, your email address or any other personal data, and "Skip & deactivate" sends nothing. Privacy: https://tadrik.com/privacy.html.

== Privacy ==

The plugin emails the billing address of an order that was placed through your checkout and not paid, about that order only, and every email has a link to cancel the order. It stores on each order when reminders were sent and whether the link was opened. It adds no cookies of its own; when a guest opens a payment link, WooCommerce's own session cookie remembers their email address so its payment page doesn't ask for it again.

The Plugins screen shows a short question when you deactivate this plugin: why are you deactivating? It is optional. Only if you click "Send & deactivate" does the plugin send your chosen reason, your optional note (up to 500 characters) and the plugin, WordPress, WooCommerce and PHP versions to Tadrik's feedback service at ops.tadrik.com. It never sends your site address, your email address or any other personal data, and "Skip & deactivate" sends nothing. Privacy: https://tadrik.com/privacy.html.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
