The AVH First Defense Against Spam WordPress plugin gives you the ability to block spammers before any content is served. Spammers are identified by checking if the visitors IP exists in a database served by Stop Forum Spam or Project Honey Pot or by a local blacklist.
Current Release: Version 3.6.0 Released on: May 16, 2013
The visitor’s IP can be checked at the following third parties:
- Stop Forum Spam. http://www.stopforumspam.com
- Project Honey Pot. http://www.projecthoneypot.org (An API key is needed to check the IP at this party. The key is free.)
- Spamhaus. http://www.spamhaus.org. IP’s are checked with the lists SBL and XBL.
Separate thresholds can be set for the following features:
- Send an email to the board administrator with information about the spammer.
- Block the spammer before content is server.
- Spammers can be blocked based on the information supplied by the third party or by using a local blacklist.
- Bypass the checks for the IP at the third parties and the local blacklist, based on IP in the local whitelist.
- Ability to add single IP’s and/or IP ranges to the blacklist and whitelist.
- When an IP is blocked a message can be displayed to the visitor with the reason why access was blocked.
- Report a spammer to Stop Forum Spam. A valid API key from Stop Forum Spam is necessary.
- Add a spammer to the local blacklist by clicking a link in the received email.
- Block spammers that access wp-comments-post.php directly by using a comment security check. An email can be send when the check fails.
- IP caching system
- Use a honey pot from Project Honey Pot
- Option to block spammers that access wp-comments-post.php directly by using a comment security check. An email can be send when the check fails.
Blocking a potential spammer before content is served has the following advantages:
- It saves bandwidth.
- It saves CPU cycles. The spammer is actually checked and blocked before WordPress starts building the page.
- If you keep track of how many visitors your site has, either by using Google’s Analytics, WP-Stats or any other one, it will give you a cleaner statistic of visits your site receives.
Usage terms of the 3rd Parties
The IP Caching system.
Stop Forum spam has set a limit on the amount of API calls you can make a day, currently it is set at 20,000 calls a day.
This means that if you don’t use the Blacklist and/or Whitelist you are limited to 20,000 visits/day on your site. To overcome this possible problem I wrote an IP caching system.
If you use the caching system you still have a limit with Stop Forum Spam , but the limit is set to 20,000 unique visits/day.
The following IP’s are cached locally:
- Every IP identified by a 3rd party as spam and triggering the terminate-the-connection threshold.
- Every clean IP.
Only returning IP’s that were previously identified as spammer and who’s connection was terminated will update their last seen date in the caching system.
Every day, once a day, a routine runs to remove the IP’s who’s last seen date is X amount of days older than the date the routine runs. You can set the days in the administration section of the plugin.
You can check the statistics to see how many IP’s are in the database. If you have a busy site, with a lot of unique visitors, you might have to play with the “Days to keep in cache” setting to keep the size under control.
Checking Order and Actions
The plugin checks the visiting IP in the following order, only if that feature is enabled of course.
- Whitelist – If found in the list skip the rest of the checks.
- Blacklist – If found in the list terminate the connection.
- IP Caching – If found in the list and it’s spam terminate connection otherwise if it’s clean skip the rest of the checks except when posting a comment then a Stop Forum Spam check will be done.
- Stop Forum Spam – Only when the visiting IP is posting a comment. If found and it’s spam terminate connection.
- Project Honey Pot – If found and it’s spam terminate connection, if found and it’s set to be a search enigine no further checks will be performed.
- Spamhaus – If found and it’s spam terminate connection.
This plugin is fully compatible with other anti-spam plugins, I have tested it with WP-Spamfree and Akismet.
The plugin also gives you some extra tips and tricks to stop spam by editing your htaccess file. To access them go to the settings of the plugin and click Tips and Tricksi
The AVH First Defense Against Spam plugin compatible with WordPress 2.8 and higher.
If you enjoy this plug-in please consider a donation. There are several ways you can show your appreciation:
- Amazon Wish List
You can send me something from my Amazon Wish List which is shown in the sidebar.
- Through Paypal.
Click on the Donate button and you will be directed to Paypal where you can make your donation and you don’t have to have a Paypal account.
- Download the archive and extract all in the wp-content/plugins directory.
- Go to your WordPress administration page, click on Plugins and activate it.
If you have comments/problems/suggestions, see something in the code which is not compliant to the WordPress Plugin Codex, or just want to say “Cool! It works!”, feel free to create a post at the AVH Support Forum
Is this plugin enough to block all spam? =
I don’t believe there is one solution to block all spam. Personally I have great success with the plugin in combination with Akismet.
Does it conflicts with other anti-spam solutions?
I’m currently not aware of any conflicts with other spam solutions.
- Changed behavior when spammer is detected during registration process.
The connection will no longer be terminated, but instead it will return an error to the login process. This works better when a plugin uses AJAX for their registration process.
- Add compatibility with the plugin Events Manager.
- Detecting remote IP returned wrong information when a loopback address was found.
- $wpdb->prepare fixes as per WordPress 3.5
- Reporting spam doesn’t work in WordPress 3.5
- Do check during WordPress MU user validation
- Fixes Stop Forum Spam error message reporting.
- When call to Stop Forum Spam fails on during the check, no error message is reported.
- Bugfix: If WordPress registration page is embedded in a theme page, an error could possibly occur.
- Block comments made without a referrer.
- When using the plugin Hyper Cache, pages shown to blocked visitors will not be cached. The caching caused to show the blocked page to legit visitors.
- When no email is provided in a spam comment, you can’t report it to Stop Forum Spam as this is against their policy.
- Bugfix: Problem with accessing the options pages.
- RFC: Add abillity to also check on email.
- Bugfix: Enqueue certain CSS files instead of loading them directly.
- Updated the language file.
- Bugfix: Correctly load the text domain file.
- Bugfix: HTML changes in the admin section to fit in with WordPress 3.3
- Bugfix: The columns in the admin section don’t save, making certain columns disappear.
- Change the name of the Role and removed one Role.
- Bugfix: The nonce function used by WordPress is sometime valid for less than 24 hours causing a problem with adding IP’s to the blacklist.
- Bugfix: Adding IP’s to the blacklist by clicking on the link in the email fails.
- Bugfix: Get the correct visiting IP when using CloudFlare.
- Bugfix: Fixes undefined method after WordPress 3.2 upgrade.
- Adds Immediate Actions (on-hover links) (Ham, Spam, Blacklist and Delete) to the IP Cache Log list below the IP.
- Adds bulk actions Ham, Spam and Blacklist to the IP Cache Log list.
- Adds the ability to check with Spamhaus.org
- When a spam check results in a termination of the connection, no more checks will be performed. This removes the option to receive Project Honey Pot information even when Stop Forum Spam determined the connection can be terminated.
- When Project Honey Pot determines the visiting IP is a known search engine no further checking is done.
- Removes the Screen layout option on the IP Cache Log page
- RFC: Option to add IP’s to blacklist from the comments page.
- Bugfix: Report&Delete doesn’t work on certain server configurations.
- An email is send when the report to Stop Forum Spam fails.
- Bugfix: IP is added to the cache even when the use of the IP cache is disabled.
- Bugfix: Can not add a site in WordPress Network setup when the plugin is active.
- New menu page: IP Cache Log. This gives the ability to manage the IP cache. This only works in WordPress 3.1 and higher.
- Improvement on checking for spam when a comment is posted.
- Reporting email will now say which post the spammer was trying to comment on.
- When reporting a spammer also set the offending IP as spammer in cache.
- Bugfix: When the visiting IP is not a public IP all the configured spam checks are performed. Private IP’s can be assumed to be safe.
- Bugfix: The check for Stop Forum Spam is always performed even if set not to check with Stop Forum Spam.
- Bugfix: The results of a call to Stop Forum Spam are not evaluated.
- Bugfix: When saving options the options would be erased.
- Bugfix: Don’t show the Project Honey Pot API key message when the option to check with Project Honey Pot is disabled.
- Bugfix: When the IP cache was disabled the cache would still be checked.
- Bugfix: Under certain server configurations, when Project Honey Pot could not be reached the IP to be checked was incorrect.
- Adds option for localization. Translation are done through in Launchpad.
- Bugfix: With PHP 5.3 and up there was a problem with getting the visitors IP.
- The comment nonce can be activated on the General Options page in the administration section of the plugin.
- Only show the last 12 months of spam statistics on the Overview page.
- Pages shown to blocked visitors will not be cached. This is compatible with caching plugins W3 Total cache and WP Super Cache. The caching caused to show the blocked page to legit visitors.
- Removed comment nonce check due to reported problems.
- Plugin is for PHP5 only
- RFC: Spam check is performed when a user registers.
- Important!: When using a Honey Pot URL, change the option to be a URL only, the plugin will add the neccessary HTML by default.
- Bugfix: On pages the nonce check would fail.
- Bugfix: Typo in window title for menu option overview
- Bugfix: Blogname would show up as html safe text
- Bugfix: Checking for spammers when a comment is posted did not utilize the IP cache.
- Plugin is refactored
- When an IP is reported to Stop Forum Spam, using Report & Delete, and IP caching is used, the IP is deleted from the cache as the IP is marked as ham in the cache.
- When an update is available it will show the changelog on the plugin screen of WordPress
- Bugfix: Commenting didn’t work anymore.
- Stop Forum Spam is only checked when a comment is posted. All other checks are still done before content is served. The reason for this change is the amount of traffic this plugin caused at the server of Stop Forum Spam.
- Better error messages when a problem occurs with a call to Stop Forum Spam.
- Disabled Stop Forum Spam until a better solution is created.
- Changed initial settings for email to not send E-Mail. This is better for busy sites.
- Option for using a honey pot page by Project Honey Pot.
- Change in IP caching system. Added the field lastseen. This field will be updated if an IP returns which was previously identified as spam. The daily cleaning of the IP cache database will use this field to determine if the record will be deleted.
- Bugfix: Database version was never saved.
- Bugfix: When HTP connection failed, IP was added as no-spam in cache when cache is active.
- Bugfix: Uninstall didn’t work.
- Bugfix: Validate admin fields.
- Bugfix: Settings link on plugin page was incorrect.
- Bugfix: Menu Option FAQ threw an error.
- Added an IP caching system.
- Administrative layout changes.
- Optional email can be send with information about the cron jobs of the plugin.
- Bugfix: The default setting to terminate the connection for Project Honey Pot was unrealistic.
- RFC: Optionally check the visitor at Project Honey Pot.
- RFC: Optionally receive error emails for failed calls to Stop Forum Spam. Error mails were always received.
- The plugin has a separate menu page.
- Added very simple statistics.
- Bugfix: Check Trackbacks/Pingbacks for spammers as well.
- Bugfix: Reporting a spammer without an email address failed. Stop Forum Spam changed their policy about reporting spammers without an email.
- Updated determination of users ip. Now also detects right IP if the server is running Apache with nginx proxy.
- Bugfix: HTTP Error messages didn’t work properly
- Refactoring of some of the code.
- Bugfix: Trackback and Pingback comments were blocked as well
- Better implementation for getting the remote IP.
- Added security to protect against spammers directly posting comments by accessing wp-comments-post.php.
- An email can be received of a spammer trying posting directly. The email holds a link to report the spammer at Stop Forum Spam ( an API key is required).
- The black and white list can now hold ranges besides single IP addresses.
- Some small improvements and bug fixes.
- Ability to report a spammer to Stop Forum Spam if you sign up on their website and get an API key (it’s free).
- Added a link in the emails to add an IP to the local blacklist.
- Bugfix: Uninstall did not work.
- RFC: A white list was added.
- Initial version