Email Address Encoder - Version 1.0.10

Version Description

  • Added option to disable notices and promotions
  • Added activation and uninstall callbacks
  • Added $hex parameter to eae_encode_str() method
  • Added ability to turn off email encoding
  • Various code and UI improvements
Download this release

Release Info

Developer tillkruess
Plugin Icon 128x128 Email Address Encoder
Version 1.0.10
Comparing to
See all releases

Code changes from version 1.0.9 to 1.0.10

email-address-encoder.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Email Address Encoder
4
  Plugin URI: https://encoder.till.im/
5
  Description: A lightweight plugin to protect email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
6
- Version: 1.0.9
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  Text Domain: email-address-encoder
@@ -14,27 +14,35 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
17
- /**
18
- * Load admin related code.
19
- */
20
- require_once __DIR__ . '/includes/admin.php';
21
-
22
  /**
23
  * Define filter-priority constant, unless it has already been defined.
24
  */
25
  if ( ! defined( 'EAE_FILTER_PRIORITY' ) ) {
26
- define(
27
  'EAE_FILTER_PRIORITY',
28
- get_option( 'eae_filter_priority', 1000 )
29
  );
30
  }
31
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * Register filters to encode plain email addresses in posts, pages, excerpts,
34
  * comments and text widgets.
35
  */
36
- foreach ( array( 'the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt' ) as $filter ) {
37
- add_filter( $filter, 'eae_encode_emails', EAE_FILTER_PRIORITY );
 
 
38
  }
39
 
40
  /**
@@ -48,9 +56,9 @@ add_action( 'init', 'eae_register_shortcode', 1000 );
48
  * @return void
49
  */
50
  function eae_register_shortcode() {
51
- if ( ! shortcode_exists( 'encode' ) ) {
52
- add_shortcode( 'encode', 'eae_shortcode' );
53
- }
54
  }
55
 
56
  /**
@@ -77,43 +85,41 @@ function eae_shortcode( $attributes, $content = '' ) {
77
  * @return string Given text with encoded email addresses
78
  */
79
  function eae_encode_emails( $string ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
- // abort if `$string` isn't a string
82
- if ( ! is_string( $string ) ) {
83
- return $string;
84
- }
85
-
86
- // abort if `eae_at_sign_check` is true and `$string` doesn't contain a @-sign
87
- if ( apply_filters( 'eae_at_sign_check', true ) && strpos( $string, '@' ) === false ) {
88
- return $string;
89
- }
90
-
91
- // override encoding function with the 'eae_method' filter
92
- $method = apply_filters( 'eae_method', 'eae_encode_str' );
93
-
94
- // override regex pattern with the 'eae_regexp' filter
95
- $regexp = apply_filters(
96
- 'eae_regexp',
97
- '{
98
- (?:mailto:)?
99
- (?:
100
- [-!#$%&*+/=?^_`.{|}~\w\x80-\xFF]+
101
- |
102
- ".*?"
103
- )
104
- \@
105
- (?:
106
- [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+
107
- |
108
- \[[\d.a-fA-F:]+\]
109
- )
110
- }xi'
111
- );
112
-
113
- return preg_replace_callback( $regexp, function ( $matches ) use ( $method ) {
114
- return $method( $matches[0] );
115
- }, $string );
116
-
117
  }
118
 
119
  /**
@@ -129,30 +135,30 @@ function eae_encode_emails( $string ) {
129
  * the BBEdit-Talk with some optimizations by Milian Wolff.
130
  *
131
  * @param string $string Text to encode
 
132
  *
133
  * @return string Encoded given text
134
  */
135
- function eae_encode_str( $string ) {
136
-
137
- $chars = str_split( $string );
138
- $seed = mt_rand( 0, (int) abs( crc32( $string ) / strlen( $string ) ) );
139
-
140
- foreach ( $chars as $key => $char ) {
141
 
142
- $ord = ord( $char );
143
 
144
- if ( $ord < 128 ) { // ignore non-ascii chars
145
 
146
- $r = ( $seed * ( 1 + $key ) ) % 100; // pseudo "random function"
147
 
148
- if ( $r > 60 && $char !== '@' && $char !== '.' ) ; // plain character (not encoded), except @-signs and dots
149
- else if ( $r < 45 ) $chars[ $key ] = '&#x' . dechex( $ord ) . ';'; // hexadecimal
150
- else $chars[ $key ] = '&#' . $ord . ';'; // decimal (ascii)
151
 
152
- }
 
 
 
153
 
154
- }
155
 
156
- return implode( '', $chars );
157
 
 
158
  }
3
  Plugin Name: Email Address Encoder
4
  Plugin URI: https://encoder.till.im/
5
  Description: A lightweight plugin to protect email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
6
+ Version: 1.0.10
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  Text Domain: email-address-encoder
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
 
 
 
 
 
17
  /**
18
  * Define filter-priority constant, unless it has already been defined.
19
  */
20
  if ( ! defined( 'EAE_FILTER_PRIORITY' ) ) {
21
+ define(
22
  'EAE_FILTER_PRIORITY',
23
+ (integer) get_option( 'eae_filter_priority', 1000 )
24
  );
25
  }
26
 
27
+ /**
28
+ * Load admin related code.
29
+ */
30
+ require_once __DIR__ . '/includes/admin.php';
31
+
32
+ /**
33
+ * Register uninstall and activation hooks.
34
+ */
35
+ register_uninstall_hook( __FILE__, 'eae_uninstall_hook' );
36
+ register_activation_hook( __FILE__, 'eae_activation_hook' );
37
+
38
  /**
39
  * Register filters to encode plain email addresses in posts, pages, excerpts,
40
  * comments and text widgets.
41
  */
42
+ if ( get_option( 'eae_search_in', 'filters' ) !== 'void' ) {
43
+ foreach ( array( 'the_content', 'the_excerpt', 'widget_text', 'comment_text', 'comment_excerpt' ) as $filter ) {
44
+ add_filter( $filter, 'eae_encode_emails', EAE_FILTER_PRIORITY );
45
+ }
46
  }
47
 
48
  /**
56
  * @return void
57
  */
58
  function eae_register_shortcode() {
59
+ if ( ! shortcode_exists( 'encode' ) ) {
60
+ add_shortcode( 'encode', 'eae_shortcode' );
61
+ }
62
  }
63
 
64
  /**
85
  * @return string Given text with encoded email addresses
86
  */
87
  function eae_encode_emails( $string ) {
88
+ // abort if `$string` isn't a string
89
+ if ( ! is_string( $string ) ) {
90
+ return $string;
91
+ }
92
+
93
+ // abort if `eae_at_sign_check` is true and `$string` doesn't contain a @-sign
94
+ if ( apply_filters( 'eae_at_sign_check', true ) && strpos( $string, '@' ) === false ) {
95
+ return $string;
96
+ }
97
+
98
+ // override encoding function with the 'eae_method' filter
99
+ $method = apply_filters( 'eae_method', 'eae_encode_str' );
100
+
101
+ // override regex pattern with the 'eae_regexp' filter
102
+ $regexp = apply_filters(
103
+ 'eae_regexp',
104
+ '{
105
+ (?:mailto:)?
106
+ (?:
107
+ [-!#$%&*+/=?^_`.{|}~\w\x80-\xFF]+
108
+ |
109
+ ".*?"
110
+ )
111
+ \@
112
+ (?:
113
+ [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+
114
+ |
115
+ \[[\d.a-fA-F:]+\]
116
+ )
117
+ }xi'
118
+ );
119
 
120
+ return preg_replace_callback( $regexp, function ( $matches ) use ( $method ) {
121
+ return $method( $matches[0] );
122
+ }, $string );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
125
  /**
135
  * the BBEdit-Talk with some optimizations by Milian Wolff.
136
  *
137
  * @param string $string Text to encode
138
+ * @param bool $hex Whether to use hex entities as well
139
  *
140
  * @return string Encoded given text
141
  */
142
+ function eae_encode_str( $string, $hex = false ) {
143
+ $chars = str_split( $string );
144
+ $seed = mt_rand( 0, (int) abs( crc32( $string ) / strlen( $string ) ) );
 
 
 
145
 
146
+ foreach ( $chars as $key => $char ) {
147
 
148
+ $ord = ord( $char );
149
 
150
+ if ( $ord < 128 ) { // ignore non-ascii chars
151
 
152
+ $r = ( $seed * ( 1 + $key ) ) % 100; // pseudo "random function"
 
 
153
 
154
+ if ( $r > 60 && $char !== '@' && $char !== '.' ) ; // plain character (not encoded), except @-signs and dots
155
+ else if ( $hex && $r < 25 ) $chars[ $key ] = '%' . bin2hex( $char ); // hex
156
+ else if ( $r < 45 ) $chars[ $key ] = '&#x' . dechex( $ord ) . ';'; // hexadecimal
157
+ else $chars[ $key ] = '&#' . $ord . ';'; // decimal (ascii)
158
 
159
+ }
160
 
161
+ }
162
 
163
+ return implode( '', $chars );
164
  }
includes/admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
- if ( ! defined( 'EAE_DISABLE_NOTICES' ) ) {
6
  include __DIR__ . '/mo-notice.php';
7
  }
8
 
@@ -60,7 +60,7 @@ function eae_load_textdomain() {
60
  * @return void
61
  */
62
  function eae_register_ui() {
63
- add_options_page(
64
  __( 'Email Address Encoder', 'email-address-encoder' ),
65
  __( 'Email Encoder', 'email-address-encoder' ),
66
  'manage_options',
@@ -75,9 +75,51 @@ function eae_register_ui() {
75
  * @return void
76
  */
77
  function eae_register_settings() {
78
- register_setting( 'email-address-encoder', 'eae_search_in' );
79
- register_setting( 'email-address-encoder', 'eae_technique' );
80
- register_setting( 'email-address-encoder', 'eae_filter_priority' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
 
83
  /**
@@ -154,14 +196,12 @@ function eae_dismiss_notice() {
154
  function eae_page_scanner_notice() {
155
  $screen = get_current_screen();
156
 
157
- if ( isset( $screen->id ) ) {
158
- if ( $screen->id === 'settings_page_email-address-encoder' ) {
159
- return;
160
- }
161
 
162
- if ( $screen->id !== 'dashboard' ) {
163
- return;
164
- }
165
  }
166
 
167
  if ( ! current_user_can( 'manage_options' ) ) {
@@ -172,6 +212,10 @@ function eae_page_scanner_notice() {
172
  return;
173
  }
174
 
 
 
 
 
175
  if ( get_user_meta( get_current_user_id(), 'eae_dismissed_page_scanner_notice', true ) === '1' ) {
176
  return;
177
  }
2
 
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
+ if ( ! defined( 'EAE_DISABLE_NOTICES' ) && time() < 1543622400 ) {
6
  include __DIR__ . '/mo-notice.php';
7
  }
8
 
60
  * @return void
61
  */
62
  function eae_register_ui() {
63
+ add_options_page(
64
  __( 'Email Address Encoder', 'email-address-encoder' ),
65
  __( 'Email Encoder', 'email-address-encoder' ),
66
  'manage_options',
75
  * @return void
76
  */
77
  function eae_register_settings() {
78
+ register_setting( 'email-address-encoder', 'eae_search_in', array(
79
+ 'type' => 'string',
80
+ 'default' => 'filters',
81
+ 'sanitize_callback' => 'sanitize_text_field',
82
+ ) );
83
+
84
+ register_setting( 'email-address-encoder', 'eae_technique', array(
85
+ 'type' => 'string',
86
+ 'default' => 'entities',
87
+ 'sanitize_callback' => 'sanitize_text_field',
88
+ ) );
89
+
90
+ register_setting( 'email-address-encoder', 'eae_filter_priority', array(
91
+ 'type' => 'integer',
92
+ 'default' => 1000,
93
+ 'sanitize_callback' => 'sanitize_text_field',
94
+ ) );
95
+
96
+ register_setting( 'email-address-encoder', 'eae_notices', array(
97
+ 'type' => 'integer',
98
+ 'default' => 0,
99
+ 'sanitize_callback' => 'intval',
100
+ ) );
101
+ }
102
+
103
+ /**
104
+ * Callback that runs when the plugin is uninstalled.
105
+ *
106
+ * @return void
107
+ */
108
+ function eae_uninstall_hook() {
109
+ delete_option( 'eae_search_in' );
110
+ delete_option( 'eae_technique' );
111
+ delete_option( 'eae_filter_priority' );
112
+ }
113
+
114
+ /**
115
+ * Callback that runs when the plugin is activated.
116
+ *
117
+ * @return void
118
+ */
119
+ function eae_activation_hook() {
120
+ update_option( 'eae_search_in', 'filters' );
121
+ update_option( 'eae_technique', 'entities' );
122
+ update_option( 'eae_filter_priority', (integer) EAE_FILTER_PRIORITY );
123
  }
124
 
125
  /**
196
  function eae_page_scanner_notice() {
197
  $screen = get_current_screen();
198
 
199
+ if ( ! isset( $screen->id ) ) {
200
+ return;
201
+ }
 
202
 
203
+ if ( $screen->id !== 'dashboard' && $screen->id !== 'edit-page' ) {
204
+ return;
 
205
  }
206
 
207
  if ( ! current_user_can( 'manage_options' ) ) {
212
  return;
213
  }
214
 
215
+ if ( get_option( 'eae_notices', '0' ) === '1' ) {
216
+ return;
217
+ }
218
+
219
  if ( get_user_meta( get_current_user_id(), 'eae_dismissed_page_scanner_notice', true ) === '1' ) {
220
  return;
221
  }
includes/dismiss-notice.js CHANGED
@@ -1,12 +1,12 @@
1
  ( function ( $ ) {
2
- $( function () {
3
- $( ".notice[data-dismissible] .notice-dismiss" ).click(function (event) {
4
- $.post( ajaxurl, {
5
- notice: $( this ).parent().attr( "data-dismissible" ),
6
- action: "eae_dismiss_notice",
7
- } );
8
 
9
- event.preventDefault();
10
- } );
11
- } );
12
  } ( jQuery ) );
1
  ( function ( $ ) {
2
+ $( function () {
3
+ $( ".notice[data-dismissible] .notice-dismiss" ).click(function (event) {
4
+ $.post( ajaxurl, {
5
+ notice: $( this ).parent().attr( "data-dismissible" ),
6
+ action: "eae_dismiss_notice",
7
+ } );
8
 
9
+ event.preventDefault();
10
+ } );
11
+ } );
12
  } ( jQuery ) );
includes/mo-notice.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  if ( ! class_exists( 'MO_Admin_Notice' ) ) :
4
 
5
  class MO_Admin_Notice
@@ -134,7 +136,7 @@ class MO_Admin_Notice
134
  float: left;
135
  width: 66%;
136
  display: block;
137
- margin: 0 0 10px 0;
138
  }
139
  .mo-notice-other-half {
140
  float: right;
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
  if ( ! class_exists( 'MO_Admin_Notice' ) ) :
6
 
7
  class MO_Admin_Notice
136
  float: left;
137
  width: 66%;
138
  display: block;
139
+ margin: 20px 0 10px 0;
140
  }
141
  .mo-notice-other-half {
142
  float: right;
includes/ui.php CHANGED
@@ -3,6 +3,20 @@
3
 
4
  <h1><?php _e( 'Email Address Encoder', 'email-address-encoder' ); ?></h1>
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  <form method="POST" action="options.php">
7
 
8
  <?php settings_fields( 'email-address-encoder' ); ?>
@@ -19,13 +33,31 @@
19
  <legend class="screen-reader-text">
20
  <span><?php _e( 'Search for emails using', 'email-address-encoder' ); ?></span>
21
  </legend>
22
- <label><input type="radio" name="eae_search_in" value="filters" checked> <?php _e( 'WordPress filters', 'email-address-encoder' ); ?></label><br>
23
- <label><input type="radio" name="eae_search_in" value="fullpage"> <?php _e( 'Full page scan', 'email-address-encoder' ); ?> (<a target="_blank" rel="noopener" href="https://encoder.till.im/?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'PRO only', 'email-address-encoder' ); ?></a>)</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </fieldset>
25
-
26
- <p class="description" style="max-width: 50em;">
27
- <?php _e( 'WordPress filters are slightly faster, but full page scans will find and protect your email addresses in unfiltered sections of your site, such as your footer, custom fields, theme components, etc.', 'email-address-encoder' ); ?>
28
- </p>
29
  </td>
30
  </tr>
31
 
@@ -40,15 +72,18 @@
40
  </legend>
41
 
42
  <label>
43
- <input type="radio" name="eae_technique" value="entities" checked> <?php _e( 'HTML entities', 'email-address-encoder' ); ?>
 
44
  <p class="description">
45
- <small><?php _e( 'Offer good protection and work in most scenarios.', 'email-address-encoder' ); ?></small>
46
  </p>
47
  </label>
48
  <br>
49
 
50
  <label>
51
- <input type="radio" name="eae_technique" value="css-direction"> <?php _e( 'CSS direction', 'email-address-encoder' ); ?> (<a target="_blank" rel="noopener" href="https://encoder.till.im/?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'PRO only', 'email-address-encoder' ); ?></a>)
 
 
52
  <p class="description">
53
  <small><?php _e( 'Protects against smart robots without the need for JavaScript.', 'email-address-encoder' ); ?></small>
54
  </p>
@@ -56,7 +91,9 @@
56
  <br>
57
 
58
  <label>
59
- <input type="radio" name="eae_technique" value="rot13"> <?php _e( 'ROT13 encoding', 'email-address-encoder' ); ?> (<a target="_blank" rel="noopener" href="https://encoder.till.im/?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'PRO only', 'email-address-encoder' ); ?></a>)
 
 
60
  <p class="description">
61
  <small><?php _e( 'Offers the best protection, but requires JavaScript.', 'email-address-encoder' ); ?></small>
62
  </p>
@@ -71,34 +108,36 @@
71
  <?php _e( 'Filter priority', 'email-address-encoder' ); ?>
72
  </th>
73
  <td>
74
- <input name="eae_filter_priority" type="number" min="1" value="<?php echo EAE_FILTER_PRIORITY; ?>" class="small-text">
75
  <p class="description" style="max-width: 40em;">
76
  <?php _e( 'The filter priority specifies when the plugin searches for and encodes email addresses. The default value of <code>1000</code> ensures that all other plugins have finished their execution and no emails are missed.', 'email-address-encoder' ); ?>
77
  </p>
78
  </td>
79
  </tr>
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  </tbody>
82
  </table>
83
 
84
  <p class="submit">
85
- <?php submit_button( null, 'primary large', 'submit', false ); ?>
86
- </p>
87
 
88
  </form>
89
 
90
- <div class="card">
91
- <h2 class="title">
92
- <?php _e( 'Page Scanner', 'email-address-encoder' ); ?>
93
- </h2>
94
- <p>
95
- <?php _e( 'For your peace of mind and a spam-free inbox, test whether email addresses are encoded on your site.', 'email-address-encoder' ); ?>
96
- </p>
97
- <p>
98
- <a class="button button-secondary" target="_blank" rel="noopener" href="https://encoder.till.im/?utm_source=wp-plugin&amp;utm_medium=banner&amp;domain=<?php echo urlencode( get_home_url() ) ?>">
99
- <?php _e( 'Open Page Scanner', 'email-address-encoder' ); ?>
100
- </a>
101
- </p>
102
- </div>
103
-
104
  </div>
3
 
4
  <h1><?php _e( 'Email Address Encoder', 'email-address-encoder' ); ?></h1>
5
 
6
+ <div class="card" style="margin-bottom: 1.5rem;">
7
+ <h2 class="title">
8
+ <?php _e( 'Page Scanner', 'email-address-encoder' ); ?>
9
+ </h2>
10
+ <p>
11
+ <?php _e( 'Scan your pages to see whether all your email addresses are protected.', 'email-address-encoder' ); ?>
12
+ </p>
13
+ <p>
14
+ <a class="button button-secondary" target="_blank" rel="noopener" href="https://encoder.till.im/scanner?utm_source=wp-plugin&amp;utm_medium=banner&amp;domain=<?php echo urlencode( get_home_url() ) ?>">
15
+ <?php _e( 'Open Page Scanner', 'email-address-encoder' ); ?>
16
+ </a>
17
+ </p>
18
+ </div>
19
+
20
  <form method="POST" action="options.php">
21
 
22
  <?php settings_fields( 'email-address-encoder' ); ?>
33
  <legend class="screen-reader-text">
34
  <span><?php _e( 'Search for emails using', 'email-address-encoder' ); ?></span>
35
  </legend>
36
+ <label>
37
+ <input type="radio" name="eae_search_in" value="filters" <?php checked( 'filters', get_option( 'eae_search_in' ) ); ?>>
38
+ <?php _e( 'WordPress filters', 'email-address-encoder' ); ?>
39
+ <p class="description">
40
+ <small><?php _e( 'Protects email addresses in filtered sections only.', 'email-address-encoder' ); ?></small>
41
+ </p>
42
+ </label>
43
+ <br>
44
+ <label>
45
+ <input type="radio" name="eae_search_in" value="filters" disabled>
46
+ <?php _e( 'Full page scan', 'email-address-encoder' ); ?>
47
+ (<a target="_blank" rel="noopener" href="https://encoder.till.im/download?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'Premium only', 'email-address-encoder' ); ?></a>)
48
+ <p class="description">
49
+ <small><?php _e( 'Protects all email addresses on your site.', 'email-address-encoder' ); ?></small>
50
+ </p>
51
+ </label>
52
+ <br>
53
+ <label>
54
+ <input type="radio" name="eae_search_in" value="void" <?php checked( 'void', get_option( 'eae_search_in' ) ); ?>>
55
+ <?php _e( 'Nothing', 'email-address-encoder' ); ?>
56
+ <p class="description">
57
+ <small><?php _e( 'Turns off email protection.', 'email-address-encoder' ); ?></small>
58
+ </p>
59
+ </label>
60
  </fieldset>
 
 
 
 
61
  </td>
62
  </tr>
63
 
72
  </legend>
73
 
74
  <label>
75
+ <input type="radio" name="eae_technique" value="entities" checked>
76
+ <?php _e( 'HTML entities', 'email-address-encoder' ); ?>
77
  <p class="description">
78
+ <small><?php _e( 'Offers good protection and works in most scenarios.', 'email-address-encoder' ); ?></small>
79
  </p>
80
  </label>
81
  <br>
82
 
83
  <label>
84
+ <input type="radio" name="eae_technique" value="css-direction" disabled>
85
+ <?php _e( 'CSS direction', 'email-address-encoder' ); ?>
86
+ (<a target="_blank" rel="noopener" href="https://encoder.till.im/download?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'Premium only', 'email-address-encoder' ); ?></a>)
87
  <p class="description">
88
  <small><?php _e( 'Protects against smart robots without the need for JavaScript.', 'email-address-encoder' ); ?></small>
89
  </p>
91
  <br>
92
 
93
  <label>
94
+ <input type="radio" name="eae_technique" value="rot13" disabled>
95
+ <?php _e( 'ROT13 encoding', 'email-address-encoder' ); ?>
96
+ (<a target="_blank" rel="noopener" href="https://encoder.till.im/download?utm_source=wp-plugin&utm_medium=setting"><?php _e( 'Premium only', 'email-address-encoder' ); ?></a>)
97
  <p class="description">
98
  <small><?php _e( 'Offers the best protection, but requires JavaScript.', 'email-address-encoder' ); ?></small>
99
  </p>
108
  <?php _e( 'Filter priority', 'email-address-encoder' ); ?>
109
  </th>
110
  <td>
111
+ <input name="eae_filter_priority" type="number" min="1" value="<?php echo esc_attr( EAE_FILTER_PRIORITY ); ?>" class="small-text">
112
  <p class="description" style="max-width: 40em;">
113
  <?php _e( 'The filter priority specifies when the plugin searches for and encodes email addresses. The default value of <code>1000</code> ensures that all other plugins have finished their execution and no emails are missed.', 'email-address-encoder' ); ?>
114
  </p>
115
  </td>
116
  </tr>
117
 
118
+ <tr>
119
+ <th scope="row">
120
+ <?php _e( 'Notices and promotions', 'email-address-encoder' ); ?>
121
+ </th>
122
+ <td>
123
+ <label for="eae_notices">
124
+ <?php if ( defined( 'EAE_DISABLE_NOTICES' ) ) : ?>
125
+ <input type="checkbox" name="eae_notices" id="eae_notices" value="1" checked disabled>
126
+ <?php else : ?>
127
+ <input type="checkbox" name="eae_notices" id="eae_notices" value="1" <?php checked( '1', get_option( 'eae_notices' ) ); ?>>
128
+ <?php endif; ?>
129
+ <?php _e( 'Hide notices and promotions for all users', 'email-address-encoder' ); ?>
130
+ </label>
131
+ </td>
132
+ </tr>
133
+
134
  </tbody>
135
  </table>
136
 
137
  <p class="submit">
138
+ <?php submit_button( null, 'primary large', 'submit', false ); ?>
139
+ </p>
140
 
141
  </form>
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  </div>
languages/email-address-encoder.pot DELETED
@@ -1,36 +0,0 @@
1
- # Copyright (C) 2016 Email Address Encoder
2
- # This file is distributed under the same license as the Email Address Encoder package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Email Address Encoder 1.0.5\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/email-address-"
7
- "encoder\n"
8
- "POT-Creation-Date: 2016-05-02 16:21:44+00:00\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
-
16
- #. Plugin Name of the plugin/theme
17
- msgid "Email Address Encoder"
18
- msgstr ""
19
-
20
- #. Plugin URI of the plugin/theme
21
- msgid "http://wordpress.org/plugins/email-address-encoder/"
22
- msgstr ""
23
-
24
- #. Description of the plugin/theme
25
- msgid ""
26
- "A lightweight plugin to protect email addresses from email-harvesting robots "
27
- "by encoding them into decimal and hexadecimal entities."
28
- msgstr ""
29
-
30
- #. Author of the plugin/theme
31
- msgid "Till Krüss"
32
- msgstr ""
33
-
34
- #. Author URI of the plugin/theme
35
- msgid "https://till.im/"
36
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -5,17 +5,32 @@ Tags: antispam, anti spam, spam, email, e-mail, mail, spider, crawler, harvester
5
  Requires at least: 2.0
6
  Tested up to: 5.0
7
  Requires PHP: 5.3
8
- Stable tag: 1.0.8
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
12
- A lightweight plugin to protect email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
13
 
14
 
15
  == Description ==
16
 
17
- 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, text widgets and other filtered content. Works without JavaScript — just simple spam protection.
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  == Installation ==
21
 
@@ -36,15 +51,30 @@ Alternatively, you can use the `[encode]` shortcode: `[encode]+1 (555) 123-4567[
36
 
37
  = How can I make sure the plugin works? =
38
 
39
- You can use the "Page Scanner" found under _Settings -> Email Encoder_ to test if your email addresses are protected. Alternatively, you can look at the "page source" if your site. **Please note Chrome's Developer Tools, Safari's Web Inspector and others, because they decode decimal and hexadecimal entities into plain text.**
 
 
40
 
41
  = How can I filter other parts of my site? =
42
 
43
  [This guide](https://encoder.till.im/guide) will help you encode all email addresses that aren’t caught.
44
 
 
 
 
 
 
45
 
46
  == Changelog ==
47
 
 
 
 
 
 
 
 
 
48
  = 1.0.9 =
49
 
50
  * Made page scanner notice dismissable
@@ -70,7 +100,7 @@ You can use the "Page Scanner" found under _Settings -> Email Encoder_ to test i
70
 
71
  = 1.0.5 =
72
 
73
- * Prevented error when `eae_encode_emails()` doesn't receive a `string`
74
 
75
  = 1.0.4 =
76
 
@@ -97,6 +127,10 @@ You can use the "Page Scanner" found under _Settings -> Email Encoder_ to test i
97
 
98
  == Upgrade Notice ==
99
 
 
 
 
 
100
  = 1.0.9 =
101
 
102
  This release includes several improvements related to admin notices.
5
  Requires at least: 2.0
6
  Tested up to: 5.0
7
  Requires PHP: 5.3
8
+ Stable tag: 1.0.10
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
12
+ A lightweight plugin that protects email addresses from email-harvesting robots, by encoding them into decimal and hexadecimal entities.
13
 
14
 
15
  == Description ==
16
 
17
+ A lightweight plugin that protects plain email addresses and mailto links from email-harvesting robots, by encoding them into decimal and hexadecimal entities. Has an effect on the posts, pages, comments, excerpts, text widgets and other filtered content. Works without JavaScript — just simple spam protection.
18
 
19
+ To see whether all your email addresses are properly protected, use the free [page scanner](https://encoder.till.im/scanner?utm_source=wp-plugin&amp;utm_medium=readme) tool.
20
+
21
+ Other content (like phone numbers) can be protected using `[encode]` shortcode:
22
+
23
+ `
24
+ [encode]+1 (555) 123-4567[/encode]
25
+ `
26
+
27
+ = Premium Features =
28
+
29
+ * **Full-page protection** that catches all email addresses
30
+ * **Hardened protection** using JavaScript and CSS techniques
31
+ * Built-in plugin support for **ACF**, **WooCommerce** and many others
32
+
33
+ Check out the [Premium](https://encoder.till.im/scanner?utm_source=wp-plugin&amp;utm_medium=readme) version of Email Address Encoder.
34
 
35
  == Installation ==
36
 
51
 
52
  = How can I make sure the plugin works? =
53
 
54
+ You can use the "Page Scanner" found under _Settings -> Email Encoder_ to see whether all your email addresses are protected. Alternatively, you can manually look at the "page source" of your site.
55
+
56
+ **Please note:** Chrome’s Developer Tools, Safari’s Web Inspector and others automatically decode decimal and hexadecimal entities. You need to look at the "plain HTML source code".
57
 
58
  = How can I filter other parts of my site? =
59
 
60
  [This guide](https://encoder.till.im/guide) will help you encode all email addresses that aren’t caught.
61
 
62
+ == Screenshots ==
63
+
64
+ 1. Settings: Configure the plugin to your needs.
65
+ 2. Protection: This is how email addresses will look like under the hood.
66
+ 3. [Premium] Hardened protection: A preview of JavaScript and CSS based techniques
67
 
68
  == Changelog ==
69
 
70
+ = 1.0.10 =
71
+
72
+ * Added option to disable notices and promotions
73
+ * Added activation and uninstall callbacks
74
+ * Added `$hex` parameter to `eae_encode_str()` method
75
+ * Added ability to turn off email encoding
76
+ * Various code and UI improvements
77
+
78
  = 1.0.9 =
79
 
80
  * Made page scanner notice dismissable
100
 
101
  = 1.0.5 =
102
 
103
+ * Prevented error when `eae_encode_emails()` doesnt receive a `string`
104
 
105
  = 1.0.4 =
106
 
127
 
128
  == Upgrade Notice ==
129
 
130
+ = 1.0.10 =
131
+
132
+ The release includes several improvements and new features.
133
+
134
  = 1.0.9 =
135
 
136
  This release includes several improvements related to admin notices.