Version Description
- Feature: Integration for Divi Theme included
- Tweak: Optimize Jetpack integration to also filter against image attribute description tags
- Tweak: Soft-filter html placeholder tags
- Tweak: Allow template tags to work as well with the plugin settings set to "Do nothing"
- Fix: Only one match of the soft attributes was soft encoded properly
- Fix: The escape js function stripped away all zeros from emails
Download this release
Release Info
Developer | ironikus |
Plugin | Email Encoder Bundle – Protect Email Address |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- core/includes/classes/class-email-encoder-bundle-run.php +5 -9
- core/includes/classes/class-email-encoder-bundle-settings.php +2 -0
- core/includes/classes/class-email-encoder-bundle-validate.php +2 -2
- core/includes/integrations/classes/divi_theme.php +99 -0
- core/includes/integrations/loader.php +2 -1
- email-encoder-bundle.php +2 -2
- readme.txt +16 -2
core/includes/classes/class-email-encoder-bundle-run.php
CHANGED
@@ -201,16 +201,12 @@ class Email_Encoder_Run{
|
|
201 |
$without_javascript = (string) EEB()->settings->get_setting( 'protect_using', true );
|
202 |
$footer_scripts = (bool) EEB()->settings->get_setting( 'footer_scripts', true );
|
203 |
|
204 |
-
if( $
|
205 |
-
|
206 |
-
if( $without_javascript !== 'without_javascript' ){
|
207 |
-
wp_enqueue_script( 'eeb-js-frontend', EEB_PLUGIN_URL . 'core/includes/assets/js/custom.js', array( 'jquery' ), $js_version, $footer_scripts );
|
208 |
-
}
|
209 |
-
|
210 |
-
wp_register_style( 'eeb-css-frontend', EEB_PLUGIN_URL . 'core/includes/assets/css/style.css', false, $css_version );
|
211 |
-
wp_enqueue_style ( 'eeb-css-frontend' );
|
212 |
-
|
213 |
}
|
|
|
|
|
|
|
214 |
|
215 |
if( (string) EEB()->settings->get_setting( 'show_encoded_check', true ) === '1' ){
|
216 |
wp_enqueue_style('dashicons');
|
201 |
$without_javascript = (string) EEB()->settings->get_setting( 'protect_using', true );
|
202 |
$footer_scripts = (bool) EEB()->settings->get_setting( 'footer_scripts', true );
|
203 |
|
204 |
+
if( $without_javascript !== 'without_javascript' ){
|
205 |
+
wp_enqueue_script( 'eeb-js-frontend', EEB_PLUGIN_URL . 'core/includes/assets/js/custom.js', array( 'jquery' ), $js_version, $footer_scripts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
+
|
208 |
+
wp_register_style( 'eeb-css-frontend', EEB_PLUGIN_URL . 'core/includes/assets/css/style.css', false, $css_version );
|
209 |
+
wp_enqueue_style ( 'eeb-css-frontend' );
|
210 |
|
211 |
if( (string) EEB()->settings->get_setting( 'show_encoded_check', true ) === '1' ){
|
212 |
wp_enqueue_style('dashicons');
|
core/includes/classes/class-email-encoder-bundle-settings.php
CHANGED
@@ -67,6 +67,8 @@ class Email_Encoder_Settings{
|
|
67 |
$this->email_regex = '([_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,}))';
|
68 |
$this->soft_attribute_regex = array(
|
69 |
'woocommerce_variation_attribute_tag' => '/data-product_variations="([^"]*)"/i',
|
|
|
|
|
70 |
);
|
71 |
|
72 |
//Load data
|
67 |
$this->email_regex = '([_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,}))';
|
68 |
$this->soft_attribute_regex = array(
|
69 |
'woocommerce_variation_attribute_tag' => '/data-product_variations="([^"]*)"/i',
|
70 |
+
'jetpack_carousel_image_attribute_tag' => '/data-image-meta="([^"]*)"/i',
|
71 |
+
'html_placeholder_tag' => '/placeholder="([^"]*)"/i',
|
72 |
);
|
73 |
|
74 |
//Load data
|
core/includes/classes/class-email-encoder-bundle-validate.php
CHANGED
@@ -298,7 +298,7 @@ class Email_Encoder_Validate{
|
|
298 |
foreach( $soft_attributes as $ident => $regex ){
|
299 |
|
300 |
$array = array();
|
301 |
-
|
302 |
|
303 |
foreach( $array as $single ){
|
304 |
$content = str_replace( $single, $this->filter_plain_emails( $single, null, $protection_method, false ), $content );
|
@@ -411,7 +411,7 @@ class Email_Encoder_Validate{
|
|
411 |
|
412 |
foreach( $split as $c ) {
|
413 |
// preg split will return empty first and last characters, check for them and ignore
|
414 |
-
if( ! empty( $c ) ) {
|
415 |
$out .= '%' . dechex( ord( $c ) );
|
416 |
}
|
417 |
}
|
298 |
foreach( $soft_attributes as $ident => $regex ){
|
299 |
|
300 |
$array = array();
|
301 |
+
preg_match_all( $regex, $content, $array ) ;
|
302 |
|
303 |
foreach( $array as $single ){
|
304 |
$content = str_replace( $single, $this->filter_plain_emails( $single, null, $protection_method, false ), $content );
|
411 |
|
412 |
foreach( $split as $c ) {
|
413 |
// preg split will return empty first and last characters, check for them and ignore
|
414 |
+
if( ! empty( $c ) || $c === '0' ) {
|
415 |
$out .= '%' . dechex( ord( $c ) );
|
416 |
}
|
417 |
}
|
core/includes/integrations/classes/divi_theme.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly.
|
4 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
5 |
+
|
6 |
+
if( ! class_exists( 'Email_Encoder_Integration_Divi' ) ){
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Email_Encoder_Integration_Divi
|
10 |
+
*
|
11 |
+
* This class integrates support for the divi themes https://www.elegantthemes.com/gallery/divi/
|
12 |
+
*
|
13 |
+
* @since 2.0.0
|
14 |
+
* @package EEB
|
15 |
+
* @author Ironikus <info@ironikus.com>
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Email_Encoder_Integration_Divi{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The main page name for our admin page
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
* @since 2.0.0
|
25 |
+
*/
|
26 |
+
private $page_name;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* The main page title for our admin page
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
* @since 2.0.0
|
33 |
+
*/
|
34 |
+
private $page_title;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Our Email_Encoder_Run constructor.
|
38 |
+
*/
|
39 |
+
function __construct(){
|
40 |
+
$this->page_name = EEB()->settings->get_page_name();
|
41 |
+
$this->page_title = EEB()->settings->get_page_title();
|
42 |
+
$this->add_hooks();
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Define all of our necessary hooks
|
47 |
+
*/
|
48 |
+
private function add_hooks(){
|
49 |
+
add_filter( 'eeb/settings/fields', array( $this, 'deactivate_logic' ), 10 );
|
50 |
+
add_action( 'init', array( $this, 'reload_settings_before_divi_builder' ), 5 );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* ######################
|
55 |
+
* ###
|
56 |
+
* #### HELPERS
|
57 |
+
* ###
|
58 |
+
* ######################
|
59 |
+
*/
|
60 |
+
|
61 |
+
public function is_divi_active(){
|
62 |
+
return defined( 'ET_BUILDER_VERSION' );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* ######################
|
67 |
+
* ###
|
68 |
+
* #### SCRIPTS & STYLES
|
69 |
+
* ###
|
70 |
+
* ######################
|
71 |
+
*/
|
72 |
+
|
73 |
+
public function reload_settings_before_divi_builder(){
|
74 |
+
EEB()->settings->reload_settings();
|
75 |
+
}
|
76 |
+
|
77 |
+
public function deactivate_logic( $fields ){
|
78 |
+
|
79 |
+
if( $this->is_divi_active() ){
|
80 |
+
if( isset( $_GET['et_fb'] ) && $_GET['et_fb'] == '1' ){
|
81 |
+
if( is_array( $fields ) ){
|
82 |
+
if( isset( $fields[ 'protect' ] ) ){
|
83 |
+
if( isset( $fields[ 'protect' ]['value'] ) ){
|
84 |
+
$fields[ 'protect' ]['value'] = 3;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
return $fields;
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
new Email_Encoder_Integration_Divi();
|
99 |
+
}
|
core/includes/integrations/loader.php
CHANGED
@@ -23,8 +23,9 @@ class EEB_Integrations_Loader{
|
|
23 |
|
24 |
$plugins = array(
|
25 |
'maintenance' => 'maintenance.php',
|
|
|
26 |
);
|
27 |
-
|
28 |
if( $disable_marketing ){
|
29 |
$marketing = array();
|
30 |
}
|
23 |
|
24 |
$plugins = array(
|
25 |
'maintenance' => 'maintenance.php',
|
26 |
+
'divi_theme' => 'divi_theme.php',
|
27 |
);
|
28 |
+
|
29 |
if( $disable_marketing ){
|
30 |
$marketing = array();
|
31 |
}
|
email-encoder-bundle.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Email Encoder - Protect Email Addresses
|
4 |
-
* Version: 2.0.
|
5 |
* Plugin URI: https://wordpress.org/plugins/email-encoder-bundle/
|
6 |
* Description: Protect email addresses on your site and hide them from spambots. Easy to use & flexible.
|
7 |
* Author: Ironikus
|
@@ -22,7 +22,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
22 |
define( 'EEB_NAME', 'Email Encoder' );
|
23 |
|
24 |
// Plugin version.
|
25 |
-
define( 'EEB_VERSION', '2.0.
|
26 |
|
27 |
// Determines if the plugin is loaded
|
28 |
define( 'EEB_SETUP', true );
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Email Encoder - Protect Email Addresses
|
4 |
+
* Version: 2.0.3
|
5 |
* Plugin URI: https://wordpress.org/plugins/email-encoder-bundle/
|
6 |
* Description: Protect email addresses on your site and hide them from spambots. Easy to use & flexible.
|
7 |
* Author: Ironikus
|
22 |
define( 'EEB_NAME', 'Email Encoder' );
|
23 |
|
24 |
// Plugin version.
|
25 |
+
define( 'EEB_VERSION', '2.0.3' );
|
26 |
|
27 |
// Determines if the plugin is loaded
|
28 |
define( 'EEB_SETUP', true );
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Email Encoder - Protect Email Addresses ===
|
2 |
Contributors: ironikus
|
3 |
-
Tags:
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.1
|
6 |
Tested up to: 5.2.3
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,6 +31,12 @@ Also protext phone numbers or any other text using our integrated `[eeb_protect_
|
|
31 |
* Also supports special chars, like é, â, ö, Chinese characters etcetera
|
32 |
* Use the Encoder Form to manually create encoded scripts
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
= Free Website Check =
|
35 |
We offer you a free tool to test if your website contains unprotected emails. You can use our website checker by [clicking here](https://ironikus.com/email-checker/)
|
36 |
|
@@ -115,6 +121,14 @@ Yes, since version 1.3.0 also special characters are supported.
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
= 2.0.2 =
|
119 |
* Feature: New settings item to include custom scripts within the footer and not in the header
|
120 |
* Feature: Support for the "Maintenance" plugin from WP Maintenance
|
1 |
=== Email Encoder - Protect Email Addresses ===
|
2 |
Contributors: ironikus
|
3 |
+
Tags: anti spam, protect, encode, encrypt, hide, antispam, mailto, spambot, secure, e-mail, email, mail
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.1
|
6 |
Tested up to: 5.2.3
|
7 |
+
Stable tag: 2.0.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
* Also supports special chars, like é, â, ö, Chinese characters etcetera
|
32 |
* Use the Encoder Form to manually create encoded scripts
|
33 |
|
34 |
+
= Compatibilities =
|
35 |
+
* The plugin works with mostly any theme and plugin. Some special ones needed special treatment. Doen below you can learn more about that.
|
36 |
+
* Compatible with the Maintenance plugin from WP Maintenance
|
37 |
+
* Divi Theme is fully integrated as well
|
38 |
+
* Jetpack Image carousel is compatible as well
|
39 |
+
|
40 |
= Free Website Check =
|
41 |
We offer you a free tool to test if your website contains unprotected emails. You can use our website checker by [clicking here](https://ironikus.com/email-checker/)
|
42 |
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 2.0.3 =
|
125 |
+
* Feature: Integration for Divi Theme included
|
126 |
+
* Tweak: Optimize Jetpack integration to also filter against image attribute description tags
|
127 |
+
* Tweak: Soft-filter html placeholder tags
|
128 |
+
* Tweak: Allow template tags to work as well with the plugin settings set to "Do nothing"
|
129 |
+
* Fix: Only one match of the soft attributes was soft encoded properly
|
130 |
+
* Fix: The escape js function stripped away all zeros from emails
|
131 |
+
|
132 |
= 2.0.2 =
|
133 |
* Feature: New settings item to include custom scripts within the footer and not in the header
|
134 |
* Feature: Support for the "Maintenance" plugin from WP Maintenance
|