=== Email Validation for WooCommerce Orders (email-validation.org) ===
Tags: email validation, email verification, woocommerce, orders, bulk
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.1
License: MIT
License URI: https://opensource.org/licenses/MIT

Check the billing address of every WooCommerce order, guest orders included, and keep the result on the order.

== Description ==

An add-on to **email-validation.org – Email Validation for Forms**, which checks the email address at WooCommerce checkout (the classic checkout and the Checkout block) and at registration, and cleans the addresses of your registered customers. This add-on does the part that plugin leaves out: **the orders you already have.**

**WooCommerce → Check order addresses** checks the billing address of every order, guest orders included, as one bulk list with the [email-validation.org](https://email-validation.org/) API, and keeps each result on its order. The orders screen gets an **Email check** column.

Every result is one of five statuses: `valid`, `invalid`, `catch_all`, `unknown` or `disposable`.

* **Asks before it spends.** The orders are counted on your site first (nothing is sent); you confirm at most one credit per order. Each distinct address is charged once, orders without an address cost nothing, and the list is started only if it needs no more than you confirmed.
* **Runs in the background** in small batches (Action Scheduler), so you can close the page; it survives a PHP time limit and is never uploaded or started twice by itself. Cancel at any time: unused credits come back.
* **Changes nothing but the result.** The status, reason and date are kept as hidden order meta through WooCommerce's order API (High-Performance Order Storage and the legacy storage). No order, customer or user is deleted or changed, the order is not saved again (no "Order updated" webhooks), and no email is sent.
* **Checked again only when needed.** A second check leaves out orders whose address already has a result, unless you ask to check them again.
* **Your API key stays where the main plugin keeps it.** This add-on has no key field of its own and never shows, logs or sends the key anywhere but to the API.

= Requirements =

* WooCommerce 8.8 or later.
* email-validation.org – Email Validation for Forms 1.1.2 or later, with an API key that has the **Bulk lists** permission.

== Installation ==

1. Install and activate WooCommerce and email-validation.org – Email Validation for Forms, and set your API key under Settings → Email validation (a key with the "Bulk lists" permission).
2. Install and activate this add-on.
3. Go to WooCommerce → Check order addresses, press **Count the orders**, tick the box with the credits shown and press **Check the orders**.

== Frequently Asked Questions ==

= Does it check the checkout? =

No: email-validation.org – Email Validation for Forms does, on the classic checkout and the Checkout block, with the statuses you choose to stop. This add-on adds no checkout hook, so an address is never checked or charged twice.

= Does it delete or cancel orders with a bad address? =

No. It only keeps the result on the order. You decide what to do with it.

= What does it log? =

Counts, the job id and error codes, under WooCommerce → Status → Logs (source `email-validation-org-woocommerce`). Never an address or the key.

= Does it store the addresses? =

Only while a check needs them: the list and the results are private files in your uploads folder, deleted after the upload and after the results are saved. The result on an order holds the status, the reason, the date and a hash of the address it belongs to.

= What happens when I uninstall it? =

The check's own data (its progress, files and scheduled tasks) is removed. The results stay on your orders as hidden order meta.

== External services ==

This add-on sends the billing addresses of your orders to the email-validation.org API to check them:

* **What is sent:** a list of your orders' billing email addresses, each with a reference made of the order's id (`o123`), and your API key in the request header. Nothing else about the order or the buyer.
* **When:** when you confirm a check on WooCommerce → Check order addresses (then the add-on also asks for the list's progress, starts it, and downloads its results), and when that screen shows your balance.
* **Where:** `https://api.email-validation.org`, or `https://api-eu.email-validation.org` when EU data residency is chosen in email-validation.org – Email Validation for Forms.

The service is provided by email-validation.org: [Terms of Service](https://email-validation.org/legal/terms/), [Privacy Policy](https://email-validation.org/legal/privacy/).

== Changelog ==

= 1.0.1 =

* Needs email-validation.org – Email Validation for Forms 1.1.2 or later, which never hands back a value that quotes the API key.
* The main plugin is named by its new name, email-validation.org – Email Validation for Forms.
* WooCommerce → Check order addresses on PHP 8.1 and 8.2: the list's size is read from the open file, never from PHP's stat cache.

= 1.0.0 =

* First release: WooCommerce → Check order addresses, results as order meta, an Email check column on the orders screen.
