=== AddonLogic Anti-Spam Math Question ===
Contributors: snehalpancholi
Tags: anti-spam, comment spam, math captcha, captcha, spam protection
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds a simple arithmetic CAPTCHA to the comment form — no external service required.

== Description ==

AddonLogic Anti-Spam Math Question stops automated comment spam by requiring visitors to solve a basic addition or subtraction problem before their comment is accepted.

No third-party services, no cookies, no trackers — just a serverless arithmetic challenge generated fresh for every page load.

**How it works:**
1. A random arithmetic question (e.g. "What is 7 + 3?") appears in the comment form.
2. The expected answer is salted with the site URL and the current hour, then hashed.
3. On submission the submitted answer is re-hashed and compared — no database writes needed.
4. Wrong answers are rejected with a friendly error before the comment is stored.

= Features =
* No external API calls or third-party services
* Stateless verification — no sessions, no cookies
* Configurable max operand size (2–20)
* Optional subtraction questions
* Skip CAPTCHA for logged-in users
* Custom question label and error message

== Installation ==
1. Upload the `anti-spam-math-question` folder to `/wp-content/plugins/`.
2. Activate via **Plugins → Installed Plugins**.
3. Go to **Settings → Math Captcha** to configure the challenge.

== Frequently Asked Questions ==

= Does this break compatibility with comment caching? =
The CAPTCHA hash is tied to the current hour, so cached pages that serve the same CAPTCHA for up to one hour work correctly. The plugin accepts both the current and previous hour's hash to handle boundary edge cases.

= Can logged-in users skip the CAPTCHA? =
Yes, by default. Uncheck "Skip Logged-In Users" if you want to challenge all commenters.

= Is this accessible? =
Yes. The field uses `<label>`, has `aria-required="true"`, and `inputmode="numeric"` for mobile keyboards.

== Changelog ==

= 1.0.0 =
* Initial release.

== Screenshots ==

1. Comment form with the math question field added below the standard fields.
2. Settings page — operand range, label text, and error message.
