=== BragDeal Spam Guard ===
Contributors: bragdeal
Tags: spam, antispam, comments, forms, moderation
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.4.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Block form and comment spam with keyword, email and injection rules, validation and moderation. No account, no API key, no external service.

== Description ==

Spam Guard filters spam out of your WordPress forms and article comments using rules that run entirely on your own site. There is no account to create, no API key, and no external service: every check happens locally, and nothing about your visitors is sent anywhere.

It protects the forms you already have. Submissions to supported form plugins and to ordinary public forms in your theme are checked before they are stored or emailed, and blocked submissions show a message you write yourself. Article comments get their own page, with manual approval switched on by default so nothing appears on your site until you have seen it.

Every rule is fully editable. Add or remove keywords, phrases and email domains, tune the validation limits and write your own messages, as often as you like. There is no limit on how many forms it protects, no trial period, and no expiry.

The plugin also publishes a small set of actions and filters, so developers can extend the scan with their own signals.

= Features =

* Native protection for major WordPress form plugins and for custom public forms in your theme
* Keyword, phrase, email-domain and email-suffix blocking
* Unsafe script and code-injection rules that are always enforced
* Server-side validation of required fields, email addresses, URLs, phone numbers and numbers, backed by matching checks in the browser
* Payload safety limits for field count, field length and total size
* Optional name-plus-number Outlook address rule, off by default
* Automatic North American phone-number formatting while typing, on by default
* Dedicated Comments page with manual approval enabled by default
* Pingback and trackback blocking for article posts
* Custom blocked-submission and validation messages

= Supported form plugins =

Contact Form 7, Gravity Forms, WPForms, MetForm, Ninja Forms, Formidable Forms, Fluent Forms, Forminator, Elementor Forms, Everest Forms, JetFormBuilder, HappyForms, SureForms, WS Form, Bit Form, weForms, Jetpack Forms, Quform, ARForms, Kali Forms, FormCraft, Divi Forms, Mailchimp for WordPress, Newsletter, Advanced Forms, BuddyForms, Kadence Forms, Bricks Forms, Breakdance Forms, Spectra Forms, WordPress comments, and public forms in your theme.

= Built to stay fast =

Every check runs at submission time on your own server. The small browser script is only loaded while validation or phone formatting is switched on, and nothing else is added to your front end.

= Privacy =

Spam Guard does not collect any data, does not phone home, and does not contact any external server. Everything it does happens on your own site. The plugin stores only its settings and a short scan result on each moderated comment; it does not record submissions, IP addresses or user agents.

== Installation ==

1. Upload the plugin through Plugins > Add New > Upload Plugin, or install it from the WordPress plugin directory.
2. Activate it.
3. Open **Spam Guard** in the admin menu.
4. Review the protection switches, keyword and email rules and the blocked-submission message on the Configure tab, then choose whether article comments need manual approval on the Comments tab.

== Frequently Asked Questions ==

= Does Spam Guard send anything to an external service? =

No. Every check runs on your own server. There is no account, no API key and no remote call.

= Which forms are protected? =

Any supported form plugin that is active, plus ordinary public forms in your theme that post a name, email, phone or message field. Submissions from logged-in administrators are treated like any other submission.

= Why was a legitimate submission blocked? =

Open Spam Guard > Configure and review the blocked keywords and email rules. A blocked submission always matches one of your rules or the built-in unsafe-code check. Remove or narrow the rule and save.

= Can I change the message visitors see? =

Yes. Both the blocked-submission message and the validation message are editable under Spam Guard > Configure.

= What happens to comments? =

New comments on article posts stay pending until an administrator approves them, and pingbacks and trackbacks are blocked. Both behaviours can be switched off on the Spam Guard > Comments page, and saving that page keeps the matching WordPress Discussion setting in sync.

= Does it slow my site down? =

No. Checks run only when a form or comment is submitted, and the browser script is only loaded while validation or phone formatting is switched on.

= Where do I get help? =

Questions about this plugin are welcome on its WordPress.org support forum, where answers help everyone who reads them.

== Changelog ==

= 3.4.1 =
* Hardened how request data is handled: every read of the request now goes through a single audited gateway that unslashes on the way in and sanitizes for the context it is used in.
* The browser validation schema is now signed with a nonce and is ignored unless it verifies, so it can no longer be supplied by anyone but this plugin's own script.
* Administrator settings saves now check the capability and the nonce together.
* Removed the file-wide coding-standard suppressions in favour of documented, per-case justifications.

= 3.4.0 =
* A dismissible prompt asks for a WordPress.org review after a day of use. It appears on Spam Guard's own screens only, and every button settles it for good or for a week.
* Streamlined the plugin to the features described on this page, with actions and filters for developers who want to extend the scan.
* Added a support-forum link to the settings header and aligned the plugin and author links with the other BragDeal plugins.
* Removed the unused admin script.

= 3.3.5 =
* Added the Spam Guard logo to the admin menu, toolbar and settings header.
* Bundled keyword and email rules are now seeded once on first install; rules you delete no longer return after an update. Removed company-specific and overly broad default entries, and the default `.io` email rule.
* The plugin no longer changes the WordPress "comment must be manually approved" setting on activation. Saving the Comments page still keeps it in sync, and the page now says so.
* Visitor-facing validation messages, menu labels and toolbar labels are translatable.
* The optional Outlook address rule shows a generic, translatable message.
* Pingbacks are approved normally when pingback blocking is switched off.
* Toolbar styling is added through the admin-bar stylesheet instead of inline output.
* Sanitized request headers used for route detection and removed unused code.

= 3.3.4 =
* Bare http:// and https:// keyword rules no longer match. They flagged every submission containing a link; existing saved rules are cleaned once on upgrade. The unsafe-code rules are unchanged.
* Added an optional name-plus-number Outlook address rule under Configure > Form Validation, off by default because legitimate customers can match it.
* Added automatic North American phone-number formatting, on by default with its own toggle. International numbers, extensions and number inputs are left alone; set data-bdsg-phone-format="off" on a field to opt out.
* Keyword reasons no longer repeat the "Blocked keyword or phrase" prefix.

= 3.3.3 =
* Added a Description section, tags and a license URI to the readme for the WordPress.org listing.
* Added the missing License URI plugin header.

= 3.3.2 =
* Improved database query preparation, readme metadata and text-domain consistency.

= 3.3.1 =
* Added the dedicated Comments page and enabled manual approval by default.
* Added secure article-comment validation and pingback/trackback blocking.
* Added bounded input handling for submitted data.
