Exploration

Now playing: WP-Gatekeeper 1.5 RC1, a complete overhaul of the Gatekeeper plugin. This version is compatible with WordPress 1.5, and is basically plug-and-play. Why “basically”? Because like Windows, there are situations where the plug doesn’t lead straight to play—but more on those in a bit.

First, if you’re using the default WordPress template or a template that uses the same markup, then literally all you have to do is install and activate the plugin. The challenge will be placed into the comment form using the same markup patterns used for the other inputs (name, email, and so on). In fact, this will happen for any theme that uses the same markup as the WP 1.5 default. In cases where the plugin can’t find the appropriate markup pattern, it will insert the challenge just after after the textarea element in the comment form.

So suppose that you’ve completely altered your comment form markup, and what’s more, you don’t want the challenge appearing after the textarea element. No problem: insert a call to gatekeeper_pose_challenge at whatever point in the form you want the challenge to appear, surround it with whatever markup is needed, and you’ll be good to go. That’s the kind of situation where you have to do a little more work than simple plug-and-play. Otherwise, the installation should be quick and painless.

There is a potential exception: non-UNIX servers. I think I have things set up so it shouldn’t matter, but I may well be wrong, not having other servers on which to test. So if you run into trouble, disable the plugin and everything should go back to normal (unless you added gatekeeper_pose_challenge to your comment forms, in which case you’ll have to remove those too). Let me know if you hit trouble, and we’ll see about getting it fixed before going final.

I’m running GK 1.5 on meyerweb now, and everything seems to be proceeding without incident. My upgrade problems earlier today were due to forgetting to pull out the hooks I’d hacked into wp-comments-post.php and other files for the old version of Gatekeeper. Those hooks are no longer needed in GK 1.5, and leaving them in place broke commenting.

If you were thinking about using Gatekeeper but were put off by the long DIY instructions in the old version, then now’s the time to try it out. It’s easy to install, and even easier to back out if you run into trouble.

I’d like to thank Scott Sauyet for helping me with a number of the new routines and features in GK 1.5, including the use of the built-in options table instead of having to set up a separate table for Gatekeeper, the form-scanning routines, and more.

In version 1.5, they’re stored in the options table of the WP database. There isn’t currently a way to remove all of the challenges in one shot, although you can delete them individually through the plugin interface, or else do it through MySQL. Since they don’t do any harm staying in the table if the plugin is uninstalled, I don’t see a huge amount of utility for a “delete all” function, but I’ll consider adding that and a “reset to default” function if people think it would be a good idea.

In version 1.0b1 (the WP 1.2 version), they were stored in their own table. If that’s the version you used to run, you’ll either have to blow away the old table through MySQL, or else wait for me to write a cleanup script.

Well, I figured out my problem — not the how, but why. Don’t know if this will be much use to you, but here it is.

I installed the plugin and got it up and running. But the text to the question was smaller than the rest of the text in the comment area. So I removed the SMALL attribute from the default template. But for some reason, that reformatted the template.

It turned ” into ” and caused an extra text area to appear, I’m guessing this was the hidden key area.

So I went back to change it, and it didn’t help. I had to go into the table in MySQL and replace all the ” or ” with ‘ and it works now.

Hm, that sounds like I bungled my stripslash/addslash calls. I’ll mess around and see if I can trigger the same problem. If anyone else manages to do so, please let me know the steps that triggered it, so I’ll have more test cases. Thanks!

Seems like it may be missing a global $user_ID in gatekeeper_comment_form_filter(), though. If I don’t include it I get a challenge even when logged in whereas if I include the global reference I don’t get the challenge.

Remember to encode character entities if you're posting markup examples! Management reserves the right to edit or remove any comment—especially those that are abusive, irrelevant to the topic at hand, or made by anonymous posters—although honestly, most edits are a matter of fixing mangled markup. Thus the note about encoding your entities. If you're satisfied with what you've written, then go ahead...