June 4th, 2008

Email Protect RC1 WordPress Plugin

by John Kolbert as WordPress | Tags:

I’m sorry for not updating the blog for the last week. I’ve had some family issues and work problems I’ve been dealing with. But to make up for it I’ve spent a few hours on Email Protect, a WordPress plugin that obfuscates email addresses into text or images automatically in posts, pages, and comments to keep them from being harvested by spam bots. That’s right. Email addresses typed into posts or pages will be converted automatically into either a protected text or image format. You choose which one in the “settings”. Email addresses typed into comments are always converted into text replacements.

Since this is a release candidate I haven’t gotten around to creating a dedicated page for the plugin (I will though). Please read the description below and test it out. If you find any errors or bugs please let me know. I recommend using this on a test site as I have not finished complete bug testing.

Important: You must have the GD PHP graphics library installed to use the image replacement method. Most hosts have this come standard, so you shouldn’t have to worry about it. But if you can’t see any images, this may be why.

So how does it protect your email addresses? For example, you could chose to obfuscate your email addresses into either of the following to styles:


junk [at] simply-basic [dot] com

The plugin is fully featured. You can customize the text used to replace the “@” and the final period if you chose text replacement. If you chose image replacement you can choose the font, font color, background color, and border color.

You can also use the plugin anywhere in your template by using the following PHP code:

<?php if(function_exists('ep_email_protect')){ ep_email_protect('email@example.com'); } ?>

If you want to specify whether the obfuscation method should be text or email (rather then the method you selected in the “settings”), enter either “text” or “image” into the code. For example:

<?php if(function_exists('ep_email_protect')){ ep_email_protect('email@example.com', 'image'); } ?>

Known Issues. There is a known compatability issue with Coffe2Code’s Preserve Code Formatting plugin. If you rely on this plugin do not use Email Protect.

Full documentation, a dedicated page, and MUCH more info will come next week when I get around to finalizing bug fixes and launching the final version. Don’t forget to report your bugs!


Download removed: please visit here for latest release

3 Responses to “Email Protect RC1 WordPress Plugin”

  1. Omari says:

    First of all, excellent plugin. I really appreciate it.

    We’ve come across a bug we were hoping you might have a solution for. On our Executive Board (http://www.iotanusigma.com/site2/about/board/) page we have an email address for “vice_president” The “president” is converted to image, but the “vice_” remained as HTML. Now at first I thought it was a coding mistake in the HTML, but that wasn’t it. Next I thought it might be the underscore, but that wasn’t it b/c we have a “social_action” address that renders just find. Then we created new addresses that removed the underscores “socialaction” and “vicepresident” The new address “vicepresident” still renders the “president” as an image and the anything before it as HTML text. I’ve even tried using the PHP code to render it correctly:

      

    Still doesn’t render correctly. Weirdest thing ever. Based on my trial and error, it seems that any text that comes before “president” does not get obfuscated.

    Any thoughts?

  2. Omari says:

    I just had a thought. At that same URL, there also exists a “president” email address. I tried removing that email address from the page and then reloaded. This time “vicepresident” renders completely as an image. Apparently you can’t have two email addresses on the same page that are composed of the same wording. I would imagine I couldn’t have “phibetasigma” and “zetaphibeta” on the same page for example.

    Any ideas on how to fix?

  3. Omari says:

    LOL OK. I should probably gather all my thoughts before I just start typing…

    Anyway, I found a work around. I’ve placed the following into the top of the Executive Board page:

    (Needless to say the [at] and [dot] are @ and .)

    At any rate, this causes the “vicepresident” image to be generated before the “president” making sure the “vicepresident” isn’t half-rendered. Presentation-wise, I’m good to go. However, this could be something to address in a future release.

    Thanks again for your excellent plugin! :)

Leave a Reply