=== AddonLogic Comment Blacklist Manager ===
Contributors: snehalpancholi
Tags: comments, spam, blacklist, moderation, security
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A visual UI to manage disallowed words, blocked email addresses, and blocked IP ranges that automatically route matching comments to spam or trash.

== Description ==

AddonLogic Comment Blacklist Manager gives you a clean, tabbed admin interface under **Comments > Blacklist Manager** to control three independent blocklists:

* **Disallowed Words** — One word or phrase per line. Matching comments are routed to trash. Your word list is also synced into WordPress core's disallowed_keys option for full compatibility.
* **Blocked Emails** — Exact addresses (user@example.com) or domain wildcards (*@example.com). Matching comments are marked as spam.
* **Blocked IPs** — IPv4 addresses or CIDR ranges (e.g. 203.0.113.0/24). Matching comments are marked as spam.

**Key features:**

* Stats bar showing total count of words, emails, and IPs in each list
* Per-list test input: type a word, email, or IP and immediately see whether it would be blocked
* One-click JSON export of all three lists
* JSON import with Merge or Replace mode
* Syncs words with WordPress core's native disallowed_keys so both systems work together
* Fully procedural PHP, no classes or bloat
* Assets loaded only on the plugin's admin page

== Installation ==

1. Upload the `comment-blacklist-manager` folder to `/wp-content/plugins/`.
2. Activate the plugin from **Plugins > Installed Plugins**.
3. Navigate to **Comments > Blacklist Manager** to configure your lists.

== Frequently Asked Questions ==

= What happens when a comment matches a blocked email or IP? =

The comment is marked as spam (`comment_approved = 'spam'`). It will appear in your Comments > Spam queue.

= What happens when a comment body contains a disallowed word? =

The comment is routed to trash (`comment_approved = 'trash'`). The word is also synced to WordPress core's disallowed_keys option, so native handling applies too.

= Does it support IPv6? =

Currently only IPv4 addresses and CIDR ranges are supported. IPv6 support is planned for a future release.

= What is the domain wildcard format for emails? =

Use `*@domain.com`. For example, `*@disposable.com` will block all comments from any address at disposable.com.

= What happens to my lists if I uninstall the plugin? =

The three option values (`addlc_cbm_words`, `addlc_cbm_emails`, `addlc_cbm_ips`) are deleted. WordPress core's `disallowed_keys` option is left intact.

= Can I import a list from another site? =

Yes. Use the Export button on one site to download a JSON file, then use Import on another site. Choose Merge to combine with existing entries, or Replace to overwrite them.

== Screenshots ==

1. Blacklist Manager admin page — stats bar and tabbed navigation.
2. Disallowed Words tab with test input.
3. Blocked Emails tab with domain wildcard support.
4. Blocked IPs tab with CIDR range support.
5. Export / Import controls in the stats bar.

== Changelog ==

= 1.0.0 =
* Initial release.
* Tabbed admin page under Comments > Blacklist Manager.
* Disallowed words list synced with WordPress core's disallowed_keys.
* Blocked emails list with exact match and domain wildcard support.
* Blocked IPs list with IPv4 and CIDR range support.
* Per-list live test tool via AJAX.
* JSON export and import (merge or replace mode).
* Stats bar showing current list counts.
* AddonLogic update server integration.

== Upgrade Notice ==

= 1.0.0 =
Initial release. No upgrade steps required.
