Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/aligneo/comment-shield-ai/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Automate WordPress comment moderation with the Google Perspective API.
Mark comments automatically as approved or spam based on toxicity scores.
✨ Features
- Automatic AI moderation via Perspective
- Cron-based scanning (hourly by default)
- Toxicity score per comment shown in the Comments overview
- Meta box on “Edit Comment” to override AI decisions
- Fully configurable thresholds
- Safe fallback (no score → no automated status change)
- Optional error logging to
error_log()for production diagnostics - No extra database tables
- Localization-ready (English default, Spanish and other languages via translation files)
📦 Installation
- Download the plugin folder
comment-shield-ai. - Upload it to
wp-content/plugins/or symlink via your local dev environment. - Activate the plugin in the WordPress Dashboard.
- Go to Settings → Comment Shield AI and enter your API key.
⚙️ Settings
- Perspective API Key
- Spam threshold (score ≥ X → spam)
- Auto-approve threshold (score ≤ Y → approved)
- Batch size per cron run
- Languages for Perspective (e.g.
en, nl, es) - Enable error logging (on/off)
🧩 How it works
- New comments arrive as “Pending” (or hold).
- WP-Cron runs periodically and processes a batch of pending comments.
- Each comment is scored via Perspective.
- The response determines the status:
- Score ≥ spam threshold → spam
- Score ≤ auto-approve threshold → approved
- Everything in between stays in moderation
🧪 Debugging
On errors (timeouts, API failures, malformed responses) the plugin can log to:
error_log()
Most hosting environments expose this via:
/wp-content/debug.log, php-error.log, or a server log viewer.
🌍 Localization
The plugin ships with:
- English source strings (default)
- A
.potfile for translators - A starter Spanish translation file (
es_ES)
Use standard WordPress tooling (e.g. wp i18n make-pot, Poedit, or Loco Translate) to extend or customize translations.
🧹 Uninstall
When uninstalling the plugin:
- All plugin settings are removed.
- All stored toxicity scores are removed from comment meta.
📄 License
GPL v2 or later.