Rot13 Email Protection for Wordpress, protects all email addresses and mailto: links on your blog from email harvesters using rot13 encryption and/or text mode.
Inspired by ROT13 encryption on Textmate;

I’ve developed this plugin a while ago, i’ve now updated it to a releasable version, already working up to wordpress 2.5.1

ROT13 Email Protection at Worpress Plugins

Download ROT13 Email Protection Plugin v0.1!

In order to install it, as most wordpress plugins, just put the rot13_email_protection.php file  inside your /wp-content/plugins folder.

Any bugs, give me a comment, i’ll check on it.

[del.icio.us] [Digg] [Facebook] [Twitter]

20 Responses

  1. oledole Says:

    Hi,
    Looks like a greate plugin. However, when I activate the plugin in a WP 2.6 installation all text in post that contains links of any kind disapears. This happens for both post and pages. Any idea how to fix this?

  2. Tony Says:

    Yeah, same thing happens to me. It does seem great and I hope you have a chance to update it. Thanks for the work either way. :)

  3. Rot13 Email Protection Says:

    [...] Rot13 Email Protection for Wordpress, protects all email addresses and mailto: links on your blog from email harvesters using rot13 encryption and/or text mode. By 9tree. Download Plugin! Version 0.1 Last Updated: June 30, 2008 Visit Plugin’s Home Visit Plugin @ WordPress.com [...]

  4. Nicole Says:

    Great plugin – but it seems to have problems when there’s an excerpt that contains a link (not a mailto link). Then it times out. Any ideas?

  5. Bob Says:

    I also experienced the issue with content disappearing. I made the following change and all seems well:

    function rot13_email_protection($text) {
    global $ROT13_EP_GEN_PATTERN;
    $replacement = preg_replace_callback($ROT13_EP_GEN_PATTERN, “rot13_protection_callback”, $text);

    if ($replacement) {
    return $replacement;
    } else {
    return $text;
    }
    }

    YMMV. Hope this helps someone.

  6. joel Says:

    Bob, I tried your code, and the only thing that did was return the text without the rot13 encoded email.

    This maybe a problem with PHP 5.2+, when pcre.backtrack_limit was introduced . I ran preg_last_error(); after the preg_replace_callback, and it was returning “PREG_BACKTRACK_LIMIT_ERROR”. I ended up rewriting the regex to something simpler, and it works without issue now.

  7. Mike Williams Says:

    I had the disappearing page problem as well, only stranger. With a blog installed on my test domain (1and1 host), afaik wp2.7, it worked fine. On my client’s domain (BlueHost), also with wp2.7, it blanked several pages, both with mailto links and some with individual particular standard (not mailto) links.

  8. Nick Says:

    Joel, what did you change? I’m having the same problem as Mike, pages with regular links are blanked out.

  9. Zak Says:

    It seems in my case that the blanking pages is caused by php5. Using php4 fixes the problem.

    Any idea why the plugin doesn’t work correctly with php5?

  10. Chris Says:

    Null is returned when preg_replace_callback fails so to test against it and output is a failsafe (Bob’s comment). This then won’t convert the Email but will display the page. Simplest way is to simplify ROT13_EP_GEN_PATTERN to be less greedy and fit your needs (Joel’s comment).

  11. Joel Says:

    Nick, here is the regex I used. I’m not a regex expert by any means, but this is what worked for me in the blog I was creating. So you may need to customize if it doesn’t work.

    Starting on line 34, replace the following variable (goes to line 35):

    $ROT13_EP_GEN_PATTERN=”/(<a.*?mailto)(.*?)/i”;

    Hope this helps!

  12. Volker E. Says:

    I’ve tested it with Joel’s changed code at a hoster, where I ran into the white screen problem. And now it works like a charm.

  13. Nick Says:

    Joel, you are a life saver! That works great. I had to type it in since copying the text caused an error (because of the quotes) but it worked fine after that.

    Now we can use some PHP5-based plugins we couldn’t use before.

    Thanks!

  14. Jeff Byrnes Says:

    Hey there, tried Joel’s solution, and while the content outputs, it mangles the email addresses & links. Here’s what comes out:

    /* =(c=c.charCodeAt(0)+13)?c:c-26);})); /* ]]-> */ :email@email.com”>email@email.com

    Viewing source shows me this:

    <script type="text/javascript">
    /* <![CDATA[ */
    document.write("<n uers=\"znvygb".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
    /* ]]-> */
    </script>:email@email.com”>email@email.com</a>

  15. Jeff Byrnes Says:

    Whoops, forgot to finish that thought. Anybody have any ideas on how to make it work? Running PHP5, FYI.

  16. Jeff Byrnes Says:

    Wait, got it. Here’s the RegEx that worked for me:
    $ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?)%i';

  17. Jeff Byrnes Says:

    Stupid copy not working *grumble grumble* Here it is:
    $ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?)%i';

  18. Jeff Byrnes Says:

    Or this blog is eating my code. And now, correctly escaped to avoid being eaten:
    $ROT13_EP_GEN_PATTERN='%(<a.*?mailto)(.*?</a>)%i';

  19. Zak Says:

    Jeff,

    To fix the problem you are having, replace Joel’s solution with the following:

    $ROT13_EP_GEN_PATTERN=”/(<a.*?mailto)(.*?)()/i”;

  20. Zak Says:

    OK. Apparently this blog filters certain content in the comments. For the fix, visit the link below…

    http://docs.google.com/View?id=dcbd9g22_51ftbrkkhf

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.