KB Plugins

The best Wordpress plugins are free

You are viewing the archive for March 2008.

Back to KB Plugins main page

Print this post

Graphs: When Spammers Attack

These charts show when spammers like to attack the most. These charts use averages dating back to January 28th, 2008, when KB Spam Blacklist starting operating on this site. These times are in my server's time zone, where it is currently 9:09 am.

The red line indicates the number of spams stopped, on average, for each hour of each day. The blue line is the same data with smoothing applied (to make the trends more obvious).

Spammers' Favorite Days

Spammers' Favorite Hours

Want to shoot spam on site, preventing it from even showing up in your moderation queue? Try out KB Spam Blacklist.

Print this post

Plugin updates for WP 2.5

I’ve just tested all my plugins in the beta version of WordPress 2.5. They will all continue to work in 2.5 when it gets released next week or so. I did make a couple minor changes to some of my plugins. You should update to the newest versions before upgrading to 2.5.

My plugins .

Print this post

KB Comment Links

Here’s a little plugin to fix an annoying problem. Do you ever have commenters paste an entire URL into their comment as plain text, rather than putting it in <a href="..."> tags? Or if they do use the a tags, do they still use the URL as the link text?

Sure looks ugly when people do that. Here’s a little plugin to replace URLs that occur in comments with [link]. We don’t strip the URL–the word [link] will be clickable–we just make the comment prettier. Enjoy:

<?php
/*
Plugin Name: KB Comment Links
Plugin URI: http://adambrown.info/b/widgets/tag/kb-comment-links/
Description: Replaces long, ugly URLs in comments with a short link
Author: Adam R. Brown
Version: 1.0
Author URI: http://adambrown.info/
*/

function kbcl_comment_filter($comment){
	if (false===strpos($comment,'http://'))
		return $comment;
	// links in <a> tags using URL as link text
	$comment = preg_replace('~(<a[^>]+>)(http://\S+)</a>~', '$1[link]</a>', $comment);
	// links that aren't in <a> tags
	$comment = preg_replace('~(\s|<p>)(http://\S+)(\s|</p>)~', '$1<a href="$2">[link]</a>$3', $comment);
	return $comment;
}
add_filter('comment_text', 'kbcl_comment_filter');

?>