Email Encoder Bundle – Protect Email Address - Version 1.0.2

Version Description

  • Solved bug wrong "settings" link
  • Solved bug removing shortcodes RSS feed
Download this release

Release Info

Developer freelancephp
Plugin Icon 128x128 Email Encoder Bundle – Protect Email Address
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

email-encoder-bundle.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php defined('ABSPATH') OR die('No direct access.');
2
  /*
3
- Plugin Name: Email Encoder Bundle - Protect Emailaddresses
4
  Plugin URI: http://www.freelancephp.net/email-encoder-php-class-wp-plugin/
5
  Description: Protect email addresses on your site and hide them from spambots by using an encoding method. Easy to use, flexible .
6
  Author: Victor Villaverde Laan
7
- Version: 1.0.1
8
  Author URI: http://www.freelancephp.net
9
  License: Dual licensed under the MIT and GPL licenses
10
  Text Domain: email-encoder-bundle
@@ -18,7 +18,7 @@ if (!defined('EMAIL_ENCODER_BUNDLE_FILE')) {
18
 
19
  // plugin version
20
  if (!defined('EMAIL_ENCODER_BUNDLE_VERSION')) {
21
- define('EMAIL_ENCODER_BUNDLE_VERSION', '1.0.1');
22
  }
23
 
24
  // plugin key
1
  <?php defined('ABSPATH') OR die('No direct access.');
2
  /*
3
+ Plugin Name: Email Encoder Bundle - Protect Email Address
4
  Plugin URI: http://www.freelancephp.net/email-encoder-php-class-wp-plugin/
5
  Description: Protect email addresses on your site and hide them from spambots by using an encoding method. Easy to use, flexible .
6
  Author: Victor Villaverde Laan
7
+ Version: 1.0.2
8
  Author URI: http://www.freelancephp.net
9
  License: Dual licensed under the MIT and GPL licenses
10
  Text Domain: email-encoder-bundle
18
 
19
  // plugin version
20
  if (!defined('EMAIL_ENCODER_BUNDLE_VERSION')) {
21
+ define('EMAIL_ENCODER_BUNDLE_VERSION', '1.0.2');
22
  }
23
 
24
  // plugin key
includes/class-eeb-admin.php CHANGED
@@ -225,7 +225,8 @@ class Eeb_Admin {
225
  */
226
  public function plugin_action_links($links, $file) {
227
  if ($file == plugin_basename(EMAIL_ENCODER_BUNDLE_FILE)) {
228
- $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/options-general.php?page=' . $this->page_hook . '">' . __('Settings', EMAIL_ENCODER_BUNDLE_DOMAIN) . '</a>';
 
229
  array_unshift($links, $settings_link);
230
  }
231
 
@@ -310,7 +311,7 @@ class Eeb_Admin {
310
  ?>
311
  <div class="wrap">
312
  <div class="icon32" id="icon-options-custom" style="background:url(<?php echo plugins_url('images/icon-email-encoder-bundle.png', EMAIL_ENCODER_BUNDLE_FILE) ?>) no-repeat 50% 50%"><br></div>
313
- <h2><?php echo get_admin_page_title() ?> - <em><small><?php _e('Protect Emailaddresses', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></small></em></h2>
314
 
315
  <?php if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $this->options['own_admin_menu']): ?>
316
  <div class="updated settings-error" id="setting-error-settings_updated">
@@ -380,7 +381,7 @@ class Eeb_Admin {
380
  <span><?php _e('Protect mailto links, like f.e. <code>&lt;a href="info@myemail.com"&gt;My Email&lt;/a&gt;</code>', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
381
  <br/><label><input type="checkbox" id="encode_emails" name="<?php echo $this->options_name ?>[encode_emails]" value="1" <?php checked('1', (int) $options['encode_emails']); ?> disabled="disabled" />
382
  <span><?php _e('Replace plain email addresses to protected mailto links.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
383
- <span class="description notice-form-field-bug"><br/><?php _e('Notice: be carefull with this option when using emailaddresses on form fields, please <a href="http://wordpress.org/extend/plugins/email-encoder-bundle/faq/" target="_blank">check the FAQ</a> for more info.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
384
  </label>
385
  <br/>
386
  </td>
@@ -450,7 +451,7 @@ class Eeb_Admin {
450
  <tr>
451
  <th><?php _e('Set protection text in RSS feeds', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></th>
452
  <td><label><input type="text" id="protection_text" class="regular-text" name="<?php echo $this->options_name ?>[protection_text_rss]" value="<?php echo $options['protection_text_rss']; ?>" />
453
- <br/><span class="description"><?php _e('Used as replacement for emailaddresses in RSS feeds.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
454
  </label>
455
  </td>
456
  </tr>
@@ -651,7 +652,7 @@ class Eeb_Admin {
651
  . '<p>Encode mailto links and (plain) email addresses on your site and hide them from spambots. Easy to use, plugin works directly when activated.</p>'
652
  . '<h4>Features</h4>'
653
  . '<ul>'
654
- . '<li>Protect mailto links and plain emailaddresses</li>'
655
  . '<li>Automatically or with shortcodes</li>'
656
  . '<li>Scan posts, widgets and comments</li>'
657
  . '<li>Also protect RSS feeds</li>'
@@ -711,7 +712,7 @@ if (function_exists('eeb_content')) {
711
  <p>You can pas an extra optional param: <code>method</code></p>
712
 
713
  <h4>eeb_email_filter()</h4>
714
- <p>Filter given content and encode all emailaddresses or mailto links:</p>
715
  <pre><code><&#63;php
716
  if (function_exists('eeb_email_filter')) {
717
  echo eeb_email_filter('Some content with email like info@somedomein.com or a mailto link');
225
  */
226
  public function plugin_action_links($links, $file) {
227
  if ($file == plugin_basename(EMAIL_ENCODER_BUNDLE_FILE)) {
228
+ $page = ($this->options['own_admin_menu']) ? 'admin.php' : 'options-general.php';
229
+ $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/' . $page . '?page=email-encoder-bundle-settings">' . __('Settings', EMAIL_ENCODER_BUNDLE_DOMAIN) . '</a>';
230
  array_unshift($links, $settings_link);
231
  }
232
 
311
  ?>
312
  <div class="wrap">
313
  <div class="icon32" id="icon-options-custom" style="background:url(<?php echo plugins_url('images/icon-email-encoder-bundle.png', EMAIL_ENCODER_BUNDLE_FILE) ?>) no-repeat 50% 50%"><br></div>
314
+ <h2><?php echo get_admin_page_title() ?> - <em><small><?php _e('Protect Email Addresses', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></small></em></h2>
315
 
316
  <?php if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $this->options['own_admin_menu']): ?>
317
  <div class="updated settings-error" id="setting-error-settings_updated">
381
  <span><?php _e('Protect mailto links, like f.e. <code>&lt;a href="info@myemail.com"&gt;My Email&lt;/a&gt;</code>', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
382
  <br/><label><input type="checkbox" id="encode_emails" name="<?php echo $this->options_name ?>[encode_emails]" value="1" <?php checked('1', (int) $options['encode_emails']); ?> disabled="disabled" />
383
  <span><?php _e('Replace plain email addresses to protected mailto links.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
384
+ <span class="description notice-form-field-bug"><br/><?php _e('Notice: be carefull with this option when using email addresses on form fields, please <a href="http://wordpress.org/extend/plugins/email-encoder-bundle/faq/" target="_blank">check the FAQ</a> for more info.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
385
  </label>
386
  <br/>
387
  </td>
451
  <tr>
452
  <th><?php _e('Set protection text in RSS feeds', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></th>
453
  <td><label><input type="text" id="protection_text" class="regular-text" name="<?php echo $this->options_name ?>[protection_text_rss]" value="<?php echo $options['protection_text_rss']; ?>" />
454
+ <br/><span class="description"><?php _e('Used as replacement for email addresses in RSS feeds.', EMAIL_ENCODER_BUNDLE_DOMAIN) ?></span>
455
  </label>
456
  </td>
457
  </tr>
652
  . '<p>Encode mailto links and (plain) email addresses on your site and hide them from spambots. Easy to use, plugin works directly when activated.</p>'
653
  . '<h4>Features</h4>'
654
  . '<ul>'
655
+ . '<li>Protect mailto links and plain email addresses</li>'
656
  . '<li>Automatically or with shortcodes</li>'
657
  . '<li>Scan posts, widgets and comments</li>'
658
  . '<li>Also protect RSS feeds</li>'
712
  <p>You can pas an extra optional param: <code>method</code></p>
713
 
714
  <h4>eeb_email_filter()</h4>
715
+ <p>Filter given content and encode all email addresses or mailto links:</p>
716
  <pre><code><&#63;php
717
  if (function_exists('eeb_email_filter')) {
718
  echo eeb_email_filter('Some content with email like info@somedomein.com or a mailto link');
includes/class-eeb-site.php CHANGED
@@ -37,11 +37,15 @@ class EebSite extends Eeb_Admin {
37
 
38
  if (is_feed()) {
39
  // rss feed
40
- if ($this->options['filter_rss']) {
41
- $rss_filters = array('the_title', 'the_content', 'the_excerpt', 'the_title_rss', 'the_content_rss', 'the_excerpt_rss',
42
- 'comment_text_rss', 'comment_author_rss', 'the_category_rss', 'the_content_feed', 'author_feed_link', 'feed_link');
43
 
44
- foreach($rss_filters as $filter) {
 
 
 
 
 
45
  add_filter($filter, array($this, 'callback_filter_rss'), 100);
46
  }
47
  }
@@ -144,6 +148,15 @@ CSS;
144
  public function callback_filter_rss($content) {
145
  $content = preg_replace($this->regexp_patterns, $this->options['protection_text_rss'], $content);
146
 
 
 
 
 
 
 
 
 
 
147
  // strip shortcodes like [eeb_content], [eeb_form]
148
  $content = strip_shortcodes($content);
149
 
37
 
38
  if (is_feed()) {
39
  // rss feed
40
+ $rss_filters = array('the_title', 'the_content', 'the_excerpt', 'the_title_rss', 'the_content_rss', 'the_excerpt_rss',
41
+ 'comment_text_rss', 'comment_author_rss', 'the_category_rss', 'the_content_feed', 'author_feed_link', 'feed_link');
 
42
 
43
+ foreach($rss_filters as $filter) {
44
+ if ($this->options['remove_shortcodes_rss']) {
45
+ add_filter($filter, array($this, 'callback_rss_remove_shortcodes'), 9);
46
+ }
47
+
48
+ if ($this->options['filter_rss']) {
49
  add_filter($filter, array($this, 'callback_filter_rss'), 100);
50
  }
51
  }
148
  public function callback_filter_rss($content) {
149
  $content = preg_replace($this->regexp_patterns, $this->options['protection_text_rss'], $content);
150
 
151
+ return $content;
152
+ }
153
+
154
+ /**
155
+ * RSS Callback Remove shortcodes
156
+ * @param string $content
157
+ * @return string
158
+ */
159
+ public function callback_rss_remove_shortcodes($content) {
160
  // strip shortcodes like [eeb_content], [eeb_form]
161
  $content = strip_shortcodes($content);
162
 
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
- === Email Encoder Bundle - Protect Emailaddresses ===
2
  Contributors: freelancephp
3
  Tags: email address, protect, antispam, mailto, spambot, secure, e-mail, email, mail, obfuscate, encode, encoder, encrypt, hide, bot, crawl, spider, robots, spam, protection, harvest, harvesting, security
4
  Requires at least: 3.4.0
5
  Tested up to: 3.8.0
6
- Stable tag: 1.0.1
7
 
8
- Encode mailto links, emailaddresses or any text and hide them from spambots. Easy to use, plugin works directly when activated.
9
 
10
  == Description ==
11
 
12
- Encode mailto links, emailaddresses or any text and hide them from spambots. Easy to use, plugin works directly when activated.
13
 
14
  = Features =
15
- * Protect mailto links and plain emailaddresses
16
  * Automatically or with shortcodes
17
  * Scan posts, widgets and comments
18
  * Also protect RSS feeds
@@ -43,7 +43,7 @@ Please [rate this plugin](http://wordpress.org/support/view/plugin-reviews/email
43
 
44
  == Frequently Asked Questions ==
45
 
46
- = How do I encode my emailaddress(es)? =
47
 
48
  In the posts you can use this shortcode:
49
  `[eeb_email email="myname@test.nl" display="My Email"]`
@@ -54,11 +54,11 @@ By default mailto links like this will also be encoded:
54
  The default method is `JS Rot13` the following output will be created in the source code of the page:
55
  `<script type="text/javascript">/*<![CDATA[*/ML="mo@k<insc:r.y=-Ehe a\">f/lMt";MI="4CB8HC77=D0C5HJ1>H563DB@:AF=D0C5HJ190<6C0A2JA7J;6HDBBJ5JHA=DI<B?0C5HDEI<B?0C5H4GCE";OT="";for(j=0;j<MI.length;j++){OT+=ML.charAt(MI.charCodeAt(j)-48);}document.write(OT);/*]]>*/</script><noscript>*protected email*</noscript>`
56
 
57
- This code is not readable by spambots and protects your emailaddress.
58
 
59
- = Emailaddress in a form field is being encoded in a strange way. What to do? =
60
 
61
- An emailaddress in a form field will not be encoded correctly.
62
  There are 2 ways to solve this problem:
63
 
64
  1. Turn of the option "Replace plain email addresses to protected mailto links". Keep in mind that this will be the case for the whole site.
@@ -121,12 +121,15 @@ It's possible to filter all widgets by using the Widget Logic plugin and activat
121
 
122
  == Changelog ==
123
 
 
 
 
 
124
  = 1.0.1 =
125
  * Fixed PHP support (same as WordPress)
126
- * Solved bug wrong "settings" link
127
 
128
  = 1.0.0 =
129
- * NOW ONLY SUPPORT FOR PHP 5.4+ and WP 3.4.0+
130
  * Solved bug deleting setting values when unregister (will now be deleted on uninstall)
131
  * Solved bug also possible to set protection text when RSS disabled
132
  * Solved bug saving metaboxes settings
1
+ === Email Encoder Bundle - Protect Email Address ===
2
  Contributors: freelancephp
3
  Tags: email address, protect, antispam, mailto, spambot, secure, e-mail, email, mail, obfuscate, encode, encoder, encrypt, hide, bot, crawl, spider, robots, spam, protection, harvest, harvesting, security
4
  Requires at least: 3.4.0
5
  Tested up to: 3.8.0
6
+ Stable tag: 1.0.2
7
 
8
+ Encode mailto links, email addresses or any text and hide them from spambots. Easy to use, plugin works directly when activated.
9
 
10
  == Description ==
11
 
12
+ Encode mailto links, email addresses or any text and hide them from spambots. Easy to use, plugin works directly when activated.
13
 
14
  = Features =
15
+ * Protect mailto links and plain email addresses
16
  * Automatically or with shortcodes
17
  * Scan posts, widgets and comments
18
  * Also protect RSS feeds
43
 
44
  == Frequently Asked Questions ==
45
 
46
+ = How do I encode my email address(es)? =
47
 
48
  In the posts you can use this shortcode:
49
  `[eeb_email email="myname@test.nl" display="My Email"]`
54
  The default method is `JS Rot13` the following output will be created in the source code of the page:
55
  `<script type="text/javascript">/*<![CDATA[*/ML="mo@k<insc:r.y=-Ehe a\">f/lMt";MI="4CB8HC77=D0C5HJ1>H563DB@:AF=D0C5HJ190<6C0A2JA7J;6HDBBJ5JHA=DI<B?0C5HDEI<B?0C5H4GCE";OT="";for(j=0;j<MI.length;j++){OT+=ML.charAt(MI.charCodeAt(j)-48);}document.write(OT);/*]]>*/</script><noscript>*protected email*</noscript>`
56
 
57
+ This code is not readable by spambots and protects your email address.
58
 
59
+ = Email address in a form field is being encoded in a strange way. What to do? =
60
 
61
+ An email address in a form field will not be encoded correctly.
62
  There are 2 ways to solve this problem:
63
 
64
  1. Turn of the option "Replace plain email addresses to protected mailto links". Keep in mind that this will be the case for the whole site.
121
 
122
  == Changelog ==
123
 
124
+ = 1.0.2 =
125
+ * Solved bug wrong "settings" link
126
+ * Solved bug removing shortcodes RSS feed
127
+
128
  = 1.0.1 =
129
  * Fixed PHP support (same as WordPress)
 
130
 
131
  = 1.0.0 =
132
+ * NOW ONLY SUPPORT FOR WP 3.4.0+
133
  * Solved bug deleting setting values when unregister (will now be deleted on uninstall)
134
  * Solved bug also possible to set protection text when RSS disabled
135
  * Solved bug saving metaboxes settings