KB Plugins

The best Wordpress plugins are free

FYI, this is the blog archives you're looking at, not the most recent posts.

Back to KB Plugins main page

Print this post

Updating KB Easy PicasaWeb

As of version 1.1 of the plugin (available today), you no longer need PHP 5.

Get it here .

Print this post

WP SpamFree: A nice idea, but it won’t last

Recently, Scott Allen released WP SpamFree , claiming that it “virtually eliminates automated comment spam from bots.” It does so by using JavaScript to send a cookie to the commenter’s browser. Since most bots ignore javascript, Scott reasons, then this should eliminate automated comment spam.

There’s only one problem: The plugin is way, way, waaay too easy to defeat.

(Want to read the rest of this post? Click here.)

Print this post

Released today: KB Advanced RSS 2.1

The newest version of the my RSS widget for WordPress integrates several suggestions made by commenters on this post. Among the changes:

  • A checkbox to reverse the order of the feed’s contents
  • An option to hide that annoying “the feed is down” error message when the feed is empty
  • Options to bypass the script stripping, so you can allow javascript in feeds you trust.

Download now

Print this post

New plugin: KB Spam Blacklist

As if there weren’t enough anti-spam plugins, right? Actually, this isn’t a traditional anti-spam plugin. This is a regular-expression based blacklist plugin. And by blacklist, I mean blacklist. If a comment matches one of your regexes, it gets deleted immediately, not sent to moderation.

Why use this plugin?

So why would you want this? I don’t know about you, but 90% of my Akismet spam is really obvious spam. It contains obscenities, BB code ([url...]), “payday loan” offers, and other things that are really obvious. I don’t want this stuff in my spam queue–I want it shot on sight. That way, the spam queue only has stuff in it that might actually be genuine comments that were miscategorized as spam.

How it works

In short, this plugin takes some of the load off of Akismet by looking for really obvious stuff. It’s easy to use. Just activate the plugin–that’s all. It comes with four regular expressions. You can add to, modify, or remove these if you want. This is the default blacklist:

<?php $kb_spamBlacklist = array(
	// First, let's check for [url]...[/url] markup, a sure sign of a spammer (unless you're using a bb code plugin)
	'~\[[^\]]*url[^\]]*\]http[^\[]+\[/url[^\]]*]~i',

	// profanity and obscenity. Remember that spammers use ! for i, @ for a, * for u. 
	// Also, most of these get surrounded in \W so that, e.g. ASSume doesn't get mistaken for profanity.
	'~(\Wf[u\*]ck|x{3,}|\Ws[u\*]ck[i!]ng|\Wt[i!]ts?\W|\W[a@]s{2}\W|v[a@]g[i!]n[a@]|\Wc[u\*]nt|pen+[i!]s)~i',	// depending on your audience, you might not want this one

	// Now let's check for ... interesting ... pharmaceutical offers
	'~(c[i!][a@]l[i!]s|v[i!][a@]gr[i!]?[a@])~i',	// remember that they sometimes use ! for i and @ for a

	// payday loans, anyone?
	'~(credit|loans?).*(credit|loans?).*(credit|loans?)~Usi',	// if they use "credit" or "loans" too many times in their comment, kill it.
); ?>

Try it out

If a comment gets caught by one of those regexes (or by another that you add), the commenter sees an error message. If you want to try it, write a comment that uses viagra, cialis, or [url]http://buy-junk.com[/url] in it and see what happens.

Also includes a widget, if you’re into that. Look in the sidebar.

Download it

Download KB Spam Blacklist v1.0

Print this post

I’m Feeling Lucky! Update

The previous release of KB I’m Feeling Lucky worked fine for recent versions of WP, but one very minor change makes it work all the way back through WP 2.0.

Here’s the most recent version, 1.01. Just put this into a PHP file, upload, and activate.

<?php
/*
Plugin Name: KB I'm Feeling Lucky
Plugin URI: http://adambrown.info/b/widgets/category/kb-im-feeling-lucky/
Description: If there's only one search result, redirect to it rather than displaying the results page.
Author: Adam R. Brown
Author URI: http://adambrown.info/
Version: 1.01
*/

// To use: Upload to your plugins folder and activate!

function kb_feelingLucky(){
	if (!is_search())
		return;
	global $wp_query;
	if (1 != $wp_query->post_count)
		return;

	// so get_permalink will work:
	the_post();

	// redirection:
	header("Location: " . get_permalink() ); // will work in most cases, but just in case, let's also use a JS redirect:
	echo '
		<html>
			<head>
				<title>Redirecting...</title>
			</head>
			<body>
				<script type="text/javascript"><!–
				window.location = "'.get_permalink().'";
				// –>
				</script>
				<h2>Oops!</h2>
				<h3>Looks like you are using a non-javascript browser.</h3>
				<p>To find the article you searched for, go <a href="'.get_permalink().'">here</a>.</p>
			</body>
		</html>
	';
	die();
}

// makes it work:
add_action('template_redirect','kb_feelingLucky');


?>
Print this post

Announcing KB Easy PicasaWeb

Announcing KB Easy PicasaWeb, a new plugin for WordPress and WPMU, the simplest way to display a Picasa album inside a page or post. Just put a link to your album in a post; this plugin does the rest.

(Want to read the rest of this post? Click here.)

Print this post

Improving the PHP tutorial

I spend way too much time answering questions at the WordPress support forums (see? ). Because of repeated questions on the same topics, I eventually wrote my easy PHP tutorial for WP users.

I cleaned it up a bit today. If there’s something in particular that I should change or add, drop a line.

Print this post

Improving the WP Hooks Database

After announcing the WordPress hooks database last night, I went back and made several fixes and improvements.

The biggest improvement: When viewing information about a single hook, my site automatically scrapes the official WordPress codex (don’t worry automattic, it’s cached). If it finds an entry for that hook, it displays it right there above the hook’s version history.

Another big improvement: Not only do you get to see the codex’s documentation (if it exists for the hook), but my site will also generate a list of (possibly) related hooks. Don’t you hate it when you think you found the right hook, but it turns out to be not quite what you needed? Well, there you go–check out the related hooks.

With these two features, the database is now a fully featured, automatic alternative to the previous attempt to make a hooks database (over at flatearth.org ), which appears to have been abandoned.

I also squashed some bugs. There were a couple 404s in the database that shouldn’t have been there, and the feedback link was broken initially, and there were some minor HTML validation errors.

I’ve been getting lots of hits, and it looks folks are linking to it from the codex and from del.icio.us, but I have yet to hear much feedback. Don’t be a lurker, mate…

« Earlier Entries Later Entries »