Gatekeeper 1.5 RC1

Published 19 years, 1 month past

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.


Comments (12)

  1. You may want to add theme root support.

    line 438:

    change 'wp-content/themes/' to 'get_theme_root().'/'

  2. Line 438 now reads:

    $comment_form = file_get_contents(get_theme_root(). '/' . $gk_template = get_settings('template') . '/comments.php','r+');

    It seems to be working in my local build. Thanks, Terrence!

  3. When I add a question to the plugin, where is that info stored? Because when I deleted the plugin and re-installed it, the questions I added were still there.

    Please help.

    Thanks,
    Andy

  4. 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.

  5. I think a Reset to Default function might be nice, though a delete function may not be very useful to most.

    I wanted a reset to default last night as when I installed, and was tinkering around with the questions, I found a box with random text was being inserted just below the question itself.

    Hopefully that will be fixed now that I found the table where the info was being stored and I can start over.

    Thanks!

  6. 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.

    :/

  7. 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!

  8. I can re-create it if you like. Or I have a screenshot of the admin and user side results.

  9. Nice work.

    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.

  10. Good catch, ColdForged. I probably missed that because my comment form already has the function call, so it bailed for that reason. It’s fixed in the local copy, and will be in RC2.

  11. No problem, glad I could help. Not having used output buffering, this is a good example of what’s possible and gives me a lot of ideas for future development of my own plugins, so thanks!

  12. Interesting plugin, I’ll give it a try.

Add Your Thoughts

Meyerweb dot com reserves the right to edit or remove any comment, especially when abusive or irrelevant to the topic at hand.

HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <em> <i> <q cite=""> <s> <strong> <pre class=""> <kbd>


if you’re satisfied with it.

Comment Preview