=== Attackfee ===
Tags: comments, login, forms, rest-api, security
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Attackfee puts a cost on logins and form posts, so scripted abuse gets slow and expensive. Visitors read free and post without solving anything.

== Description ==

Attackfee checks writes, not page views. Leave public pages open so people and answer engines can read you. Turn Attackfee on for comments, forms, logins, and APIs.

== Installation ==

1. In Plugins > Add New, search for Attackfee, or upload the attackfee folder to /wp-content/plugins/.
2. Activate Attackfee.
3. Open Settings > Attackfee and choose which forms Attackfee checks.

== External services ==

By default Attackfee connects to no outside service. The check runs in the visitor's browser and is verified on your own site, under /wp-json/attackfee/v1/.

The plugin calls one outside address only when you choose it: in Settings > Attackfee, choose "Payment server" and enter that server's address. The payment server is an Attackfee issuer that you run, or that someone you choose runs for you. It is not run by the plugin authors. Every call sends the server key you entered, so the server knows the request is from your site. No names, email addresses, comment text, passwords, or full IP addresses are sent.

What is sent, and when:

* GET /v1/owner/balance, when you open Settings > Attackfee with "Collect usage payouts" on: the server key only.
* POST /v1/owner/withdraw, when you withdraw with "Collect usage payouts" on: the server key and the withdrawal text you pasted.
* GET /v1/owner/price?net=1, when anyone loads /.well-known/attackfee.json or /wp-json/attackfee/v1/price with payouts on and that answer is not already cached (about 30 seconds): the server key only. The net=1 on this address means the site can send a coarse network later. This call does not send one.
* POST /v1/owner/quote, when anyone opens /wp-json/attackfee/v1/price with payouts on and the server has said the price can rise with load: the server key, the action (for example "write"), and, when it can be worked out, the visitor's coarse network (the address with its last part removed, such as 203.0.113.0/24).
* POST /v1/owner/offers, when an automated client (not a person in a browser) posts to a checked form with payouts on, and when that client requests /wp-json/attackfee/v1/challenge (not when the request sets offers=0): the server key, the action, and, when it can be worked out, the visitor's coarse network, so the server can return payment offers.
* POST /v1/owner/redeem, when a client pays an offer and a payment server address is saved: the server key, the offer_id, the kind, the payment proof the client sent, and, when it can be worked out, the visitor's coarse network.
* POST /v1/owner/cashu, when a client retries with a payment string in the X-Cashu header and a payment server address is saved: the server key, that payment string, the action, and, when it can be worked out, the visitor's coarse network.

Terms of use: https://attackfee.dev/terms
Privacy policy: https://attackfee.dev/privacy
The operator of the address you enter applies their own terms of use and privacy policy to what that server stores.

== Changelog ==

= 0.1.1 =
* Payment server addresses that contain percent-encoding are kept as written.
* Each outbound call the plugin makes is named in the readme's External services section.
* Plugin Check passes with no errors.

= 0.1.0 =
* First release.
