开发者 | Pinoy.ca |
---|---|
更新时间 | 2009年12月27日 13:42 |
捐献地址: | 去捐款 |
PHP版本: | 2.1 及以上 |
WordPress版本: | 2.9 |
spam-karma-blacklist-ban.php
to the /wp-content/plugins/
directoryNo. If you would look at your Spam Karma 2 admin screens, under "Blacklist", there is a section that instructs Spam Karma to remove blacklist entries added or last used more than x days ago with scores less than y. This is where you configure whether and which IPs are banned temporarily or permanently.
We made this with speed foremost in mind. During plugin initialization, the plugin tells MySQL to create an table index of the SK2 Blacklist table. IP lookup therefore becomes insanely fast. This plugin fires at the very first stage of the WordPress loading process, so the offender is banned there and no further WordPress processing takes place.
Two ways to do this:
wp_config.php
, or edit the plugin directly.spam_karma_blacklist_ban_count
in your theme's functions.php
. For example,add_filter( 'spam_karma_blacklist_ban_count', 'my_ban_20_count' ); function my_ban_20_count( $count ) { return $count + 5 - 20; // Only ban IPs caught more than 20 times. }
Create a filter to spam_karma_blacklist_ban_count
in your theme's functions.php
. For example,
add_filter( 'spam_karma_blacklist_ban_count', 'ban_Kevin' ); function ban_Kevin( $count ) { if ( is_this_kevin() ) return SPAM_KARMA_BLACKLIST_COUNT_TO_BAN + 1; // ban him. return $count; }
A future version will have a reporting and testing screen.