Email Address Encoder

Описание

A lightweight plugin to protect plain email addresses and mailto links from email-harvesting robots by encoding them into decimal and hexadecimal entities. Has effect on the posts, pages, comments, excerpts and text widgets. No UI, no JavaScript — just simple spam protection.

Установка

For detailed installation instructions, please read the standard installation procedure for WordPress plugins.

  1. Upload the /email-address-encoder/ directory and its contents to /wp-content/plugins/.
  2. Login to your WordPress installation and activate the plugin through the Plugins menu.
  3. Done. This plugin has no user interface or configuration options.

Часто задаваемые вопросы

Installation Instructions

For detailed installation instructions, please read the standard installation procedure for WordPress plugins.

  1. Upload the /email-address-encoder/ directory and its contents to /wp-content/plugins/.
  2. Login to your WordPress installation and activate the plugin through the Plugins menu.
  3. Done. This plugin has no user interface or configuration options.
What does this plugin do?

This plugin hooks into the WordPress filters like the_content, widget_text and others (additional filters can be added). On each filter a quick (disableable) search for an @-sign is performed. If an @-sign is found, a (overridable) regular expression looks for plain text email addresses. Found email addresses are replaced with the return value of eae_encode_str() (changeable), which obfuscates the email addresses to protect it from being read by email-harvesting robots. This function is slightly faster than WP’s built-in antispambot() and uses additional hexadecimal entities.

Alternatively, you can use the [encode] shortcode: [encode]+1 (234) 567-8900[/encode]

How can I make sure the plugin works?

You cannot use Firebug, Web Inspector or Dragonfly, because they decode decimal/hexadecimal entities into plain text. To make sure email addresses are encoded, right-/secondary-click the page, click «View Source», «View Page Source» or «Source» and search for any plain text email addresses. In Firefox, be sure to test with «View Source» not «View Selection Source».

How can I use WP’s built-in `antispambot()` function instead?

You specify any valid callback function with the eae_method filter to apply to found email addresses: add_filter('eae_method', function() { return 'antispambot'; });

How can I filter other parts of my site?
  • If the content supports WordPress filters, register the eae_encode_emails() function to it: add_filter( $tag, 'eae_encode_emails' );
  • If the content is a PHP string, run it through the eae_encode_emails() function: $text = eae_encode_emails( $text );
  • If you want to encode a single email address, use the eae_encode_str() function: <?php echo eae_encode_str( 'name@domain.com' ); ?>

This plugin doesn’t encode the entire website for performance reasons, it encodes only the content of the following WordPress filters the_content, the_excerpt, widget_text, comment_text, comment_excerpt.

How can I change the regular expression pattern?

You can override the pattern with the eae_regexp filter: add_filter( 'eae_regexp', function () { return '/^pattern$/'; } );

How can I change the priority of the default filters?

The default filter priority is 1000 and you can adjust it by defining the EAE_FILTER_PRIORITY constant: define( 'EAE_FILTER_PRIORITY', 99999 );. The constant has to be defined before this plugin is loaded, e.g. in your wp-config.php or in Must-use plugin (a.k.a. mu-plugin).

How can I disable the @-sign check?

Like this: add_filter( 'eae_at_sign_check', '__return_false' );

Отзывы

Works fine — need to View Source not Inspect

Thanks again to the developer, Till, for making time and having the patience to review what I sent him, when I thought this was not working.

When I right-clicked on the email address itself, the popup menu did not include View Source as an option, so I kept using Inspect and thinking that the encoder was not working because I could read the mailto tag and address just fine.

When I right-clicked the background of the page, instead, the popup menu included both View Page Source and Inspect. As per the FAQ entry for, «How do I know it is working» — I now choose View Page Source.

I wonder whether the FAQ could be even more clear, to help us «noobs» who are not familiar with Browser tools & terminologies?

Does exactly NOTHING

By far the most useless plugin ever. Installed it on WP 4.9.4–de_DE. It has no configuration interface and does NOT change a single email address. Even a ‘Hello world’ plugin does more. Thanks for wasting my time. Uninstalled.

Fails in Android — mailto function

I installed this on a number of websites just recently to replace a «mailing service» that closed without notice.

It worked well on initial examination, however has totally failed on any Android device I view a website on. The ‘mailto’ function simply gets lost on a blank page.

Back to an older not update «Cloak Front End Email» plugin, that is still working.

Regards, DG

Посмотреть все 97 отзывов

Участники и разработчики

«Email Address Encoder» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

«Email Address Encoder» переведён на 6 языков. Благодарим переводчиков за их работу.

Перевести «Email Address Encoder» на ваш язык.

Заинтересованы в разработке?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Журнал изменений

1.0.7

  • Prevent potential compatibility issue with other plugins or themes

1.0.6

  • Added [encode] shortcode
  • Require PHP 5.3 to fix deprecation warning

1.0.5

  • Prevented error when eae_encode_emails() doesn’t receive a string

1.0.4

  • Added EAE_FILTER_PRIORITY constant to adjust default filter priority

1.0.3

  • Added filter to override the encoding function
  • Improved randomness of encode-function
  • Improved speed by doing fast @-sign existence check

1.0.2

  • Added filter to override the regular expression.

1.0.1

  • Effects now also page, post and comment excerpts

1.0

  • Initial release