=== HULO Checkout Guard ===
Contributors: huloglobal
Tags: card testing, rate limit, login protection, payments, security
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Stops card testing on payment forms, limits failed logins and lists card holds. Works on any WordPress site, with or without a shop.

== Description ==

Checkout Guard protects the places where money and passwords change hands on a WordPress site. It works on any WordPress site. With WooCommerce it also guards the shop checkout. Everything below works on its own, with no account, no licence and no calls to outside services.

**Card-testing gate.** Carders run stolen cards through a donation or payment form until one works. Checkout Guard logs every declined payment with the payer's IP and payment. Once one connection has 4 declines in an hour, its payment attempts are refused for 12 hours. Once one payment has 3 declines, no further attempt is taken on it. With the free [HULO Payments](https://huloglobal.com/wordpress-plugins/payments/) plugin, the refusal happens before the card is charged, through its pre-charge check. The thresholds are adjustable, and you can unblock a connection from the admin page.

**Rate limits.** Each visitor IP gets a limited number of payment-form submissions and payment sessions on the hosted pay page. IPv6 visitors are counted per /64. The counters live in the database, or in your persistent object cache, so they hold across PHP workers.

**Login guard.** After 5 failed logins in 15 minutes from one connection, further logins from it are refused until the window ends, even with the right password. This covers both the login form and XML-RPC.

**Trusted client IP.** Forwarding headers are read only from the proxies and CDN ranges you list, so a visitor cannot fake their address. A headless front end can also send a signed header.

**Card holds.** When HULO Payments takes card payments with "Capture: Manual (authorise only)", Checkout Guard lists every open hold. Each one shows when Stripe will cancel it (7 days after authorisation), with Capture and Release buttons. Without HULO Payments, the Holds tab says so and everything else keeps working.

**Payment-event log and payment funnel.** Declines appear with their provider, code, amount and IP. The payment-form funnel is recorded on the server, with no tracking script: form seen → payment started → paid, with drop-off and decline rate.

**With WooCommerce it also:**

* applies the rate limits and the card-testing gate to the shop: classic checkout, the Checkout block (Store API), pay-for-order, add-payment-method, coupons and order lookups;
* binds guest "order received" and "pay for order" pages to the browser that placed the order. Any other browser must confirm the billing e-mail first;
* stores the real visitor IP on new orders;
* runs bank transfer (BACS) properly: who may choose it (minimum/maximum total, guests, roles), a pay-by date and reference on the order page and e-mail, tracking of every transfer, and "money received" / "cancel" buttons;
* lists holds on orders paid through HULO Payments, and records the shop funnel (cart → checkout → address → pay → placed).

**Dashboard.** You get a HULO → Checkout Guard page with an overview, holds, payment events, the funnel and settings, plus a set-up checklist and a dashboard widget. Site administrators can use the REST API at `/wp-json/hulo-checkout-guard/v1`, and so can shop managers when WooCommerce runs.

= Checkout Guard Pro =

The optional Pro add-on automates and reports:

* Holds on autopilot: automatic capture of small payments, a safety capture before Stripe's 7-day window closes, and expired-hold detection
* Nightly Stripe reconciliation through HULO Payments: finds charges with no paid payment, and amounts that differ
* A log of payments that fail later (webhooks, renewals)
* Alerts to Slack, Microsoft Teams, Discord, Telegram, a signed webhook or e-mail, and a weekly report
* With WooCommerce: bank-transfer expiry with reminder and "payment not received" e-mails, and an amount-drift guard on edited orders

Pro starts with a 14-day evaluation, no card needed: [huloglobal.com/wordpress-plugins/checkout-guard](https://huloglobal.com/wordpress-plugins/checkout-guard/).

== Installation ==

1. Install HULO Checkout Guard from Plugins → Add New, or upload the zip, and activate it.
2. Open HULO → Checkout Guard and work through the set-up checklist.
3. If your site sits behind Cloudflare, a load balancer or a reverse proxy, list them under Settings → Client IP.
4. Optional: install the free HULO Payments plugin for payment forms, pay links and holds. WooCommerce is optional too.

== Frequently Asked Questions ==

= Do I need WooCommerce? =

No. The login guard, the rate limits and the card-testing gate on HULO Payments forms, holds, the decline log and the funnel all work on a plain WordPress site. With WooCommerce, the shop protections switch on as well.

= Do I need HULO Payments? =

The login guard works without it. The payment protections, holds and the payment funnel use HULO Payments' payments. In a WooCommerce shop, the gate and rate limits also work with any other gateway.

= Will real visitors be blocked? =

The limits are generous for people and tight for scripts: 6 payment submissions per minute per IP, and 5 failed logins per 15 minutes. The card-testing gate only reacts to repeated declines. Everything is adjustable, and a blocked connection can be released from the overview.

= All my visitors show the same IP =

Your site is behind a proxy. List the proxy addresses (or your CDN's ranges) under Settings → Client IP. Until then, the limits count everyone together.

= Does it talk to Stripe or any other service? =

No. The free plugin never calls an outside service. Capture and release are handed to HULO Payments, which talks to the provider.

= Is HPOS supported? =

Yes, when WooCommerce is active, both order storage modes are supported.

= What is removed on uninstall? =

Nothing, unless you tick "Delete Checkout Guard's tables and settings when the plugin is deleted" in the settings.

== Screenshots ==

1. Overview: set-up checklist and headline numbers.
2. Open holds with their capture-by dates.
3. Payment events.
4. Payment funnel.
5. Settings: rate limits, login guard, card-testing gate, client IP.

== Changelog ==

= 0.1.0 =
* First release: rate limits and a card-testing gate on HULO Payments forms and pay pages (with a pre-charge refusal), a login guard for wp-login and XML-RPC, trusted client IP, a hold list with capture/release through HULO Payments, a decline log, a payment funnel, an admin page under HULO, a dashboard widget and a REST API. With WooCommerce: shop checkout limits and gate, session-bound guest order pages, bank-transfer eligibility, pay-by dates and tracking, order holds and the shop funnel.
