Version Description
- Feature: Fully integrated with Foggy Email to protect your real email address: https://foggy.email/
- Feature: We fully removed all external marketing advertisements! Enjoy our plugin without distrations! :)
- Feature: Full support for Oxygen builder
- Tweak: Optimize PHPDocs and comments
- Tweak: Optimize is_post_excluded functionality
- Dev: New filter: eeb/validate/filter_page_content - https://ironikus.com/docs/knowledge-base/filter-to-manipulate-raw-page-content/
- Dev: New filter: eeb/validate/filter_content_content - https://ironikus.com/docs/knowledge-base/filter-to-manipulate-raw-hook-content/
- Dev: New filter: eeb/validate/is_post_excluded - https://ironikus.com/docs/knowledge-base/filter-excluded-posts-list/
- Dev: New filter: eeb/settings/pre_filter_fields - https://ironikus.com/docs/knowledge-base/pre-filter-email-encoder-settings/
Download this release
Release Info
Developer | ironikus |
Plugin | Email Encoder Bundle – Protect Email Address |
Version | 2.0.6 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.6
- core/includes/classes/class-email-encoder-bundle-settings.php +1 -13
- core/includes/classes/class-email-encoder-bundle-validate.php +14 -5
- core/includes/integrations/classes/foggy_email.php +297 -0
- core/includes/integrations/classes/mailoptin.php +0 -151
- core/includes/integrations/classes/oxygen_builder.php +99 -0
- core/includes/integrations/loader.php +6 -10
- email-encoder-bundle.php +2 -2
- readme.txt +17 -1
core/includes/classes/class-email-encoder-bundle-settings.php
CHANGED
@@ -290,18 +290,6 @@ class Email_Encoder_Settings{
|
|
290 |
'description' => __('This forces every script to be enqueued within the footer.', 'email-encoder-bundle')
|
291 |
),
|
292 |
|
293 |
-
'disable_marketing' => array(
|
294 |
-
'fieldset' => array( 'slug' => 'main', 'label' => 'Label' ),
|
295 |
-
'id' => 'disable_marketing',
|
296 |
-
'type' => 'checkbox',
|
297 |
-
'advanced' => true,
|
298 |
-
'title' => __('Disable Marketing', 'email-encoder-bundle'),
|
299 |
-
'label' => __('Disable all marketing notifications', 'email-encoder-bundle'),
|
300 |
-
'placeholder' => '',
|
301 |
-
'required' => false,
|
302 |
-
'description' => __('If you are not satisfied with our marketing recommendations, check this box.', 'email-encoder-bundle')
|
303 |
-
),
|
304 |
-
|
305 |
'show_encoded_check' => array(
|
306 |
'fieldset' => array( 'slug' => 'main', 'label' => 'Label' ),
|
307 |
'id' => 'show_encoded_check',
|
@@ -357,7 +345,7 @@ class Email_Encoder_Settings{
|
|
357 |
|
358 |
);
|
359 |
|
360 |
-
|
361 |
|
362 |
$default_values = array(
|
363 |
'protect' => 1,
|
290 |
'description' => __('This forces every script to be enqueued within the footer.', 'email-encoder-bundle')
|
291 |
),
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
'show_encoded_check' => array(
|
294 |
'fieldset' => array( 'slug' => 'main', 'label' => 'Label' ),
|
295 |
'id' => 'show_encoded_check',
|
345 |
|
346 |
);
|
347 |
|
348 |
+
$fields = apply_filters( 'eeb/settings/pre_filter_fields', $fields );
|
349 |
|
350 |
$default_values = array(
|
351 |
'protect' => 1,
|
core/includes/classes/class-email-encoder-bundle-validate.php
CHANGED
@@ -55,6 +55,9 @@ class Email_Encoder_Validate{
|
|
55 |
* @return string - The filtered content
|
56 |
*/
|
57 |
public function filter_page( $content, $protect_using ){
|
|
|
|
|
|
|
58 |
|
59 |
$content = $this->filter_soft_dom_attributes( $content, 'char_encode' );
|
60 |
|
@@ -104,6 +107,9 @@ class Email_Encoder_Validate{
|
|
104 |
$encode_mailtos = (bool) EEB()->settings->get_setting( 'encode_mailtos', true, 'filter_body' );
|
105 |
$convert_plain_to_image = (bool) EEB()->settings->get_setting( 'convert_plain_to_image', true, 'filter_body' );
|
106 |
|
|
|
|
|
|
|
107 |
//Soft attributes always need to be protected using only the char encode method since otherwise the logic breaks
|
108 |
$filtered = $this->filter_soft_attributes( $filtered, 'char_encode' );
|
109 |
|
@@ -162,7 +168,7 @@ class Email_Encoder_Validate{
|
|
162 |
break;
|
163 |
}
|
164 |
|
165 |
-
//Revalidate filtered emails that should not
|
166 |
$filtered = $this->temp_encode_at_symbol( $filtered, true );
|
167 |
|
168 |
return $filtered;
|
@@ -218,11 +224,13 @@ class Email_Encoder_Validate{
|
|
218 |
} elseif( $protection_method === 'use_css' ){
|
219 |
$protection_text = __( EEB()->settings->get_setting( 'protection_text', true ), 'email-encoder-bundle' );
|
220 |
$protected_return = $this->encode_email_css( $matches[0], $protection_text );
|
|
|
|
|
221 |
} else {
|
222 |
$protected_return = $replace_by;
|
223 |
}
|
224 |
|
225 |
-
// mark link as
|
226 |
if ( current_user_can( EEB()->settings->get_admin_cap( 'frontend-display-security-check' ) ) && $show_encoded_check ) {
|
227 |
$protected_return .= '<i class="eeb-encoded dashicons-before dashicons-lock" title="' . __( 'Email encoded successfully!', 'email-encoder-bundle' ) . '"></i>';
|
228 |
}
|
@@ -882,6 +890,7 @@ FORM;
|
|
882 |
|
883 |
public function is_post_excluded( $post_id = null ){
|
884 |
|
|
|
885 |
$skip_posts = (string) EEB()->settings->get_setting( 'skip_posts', true );
|
886 |
if( ! empty( $skip_posts ) ){
|
887 |
|
@@ -905,12 +914,12 @@ FORM;
|
|
905 |
}
|
906 |
|
907 |
if ( in_array( $post_id, $exclude_pages_validated ) ) {
|
908 |
-
return true;
|
909 |
}
|
910 |
}
|
911 |
|
912 |
}
|
913 |
-
|
914 |
-
return
|
915 |
}
|
916 |
}
|
55 |
* @return string - The filtered content
|
56 |
*/
|
57 |
public function filter_page( $content, $protect_using ){
|
58 |
+
|
59 |
+
//Added in 2.0.6
|
60 |
+
$content = apply_filters( 'eeb/validate/filter_page_content', $content, $protect_using );
|
61 |
|
62 |
$content = $this->filter_soft_dom_attributes( $content, 'char_encode' );
|
63 |
|
107 |
$encode_mailtos = (bool) EEB()->settings->get_setting( 'encode_mailtos', true, 'filter_body' );
|
108 |
$convert_plain_to_image = (bool) EEB()->settings->get_setting( 'convert_plain_to_image', true, 'filter_body' );
|
109 |
|
110 |
+
//Added in 2.0.6
|
111 |
+
$filtered = apply_filters( 'eeb/validate/filter_content_content', $filtered, $protect_using );
|
112 |
+
|
113 |
//Soft attributes always need to be protected using only the char encode method since otherwise the logic breaks
|
114 |
$filtered = $this->filter_soft_attributes( $filtered, 'char_encode' );
|
115 |
|
168 |
break;
|
169 |
}
|
170 |
|
171 |
+
//Revalidate filtered emails that should not be encoded
|
172 |
$filtered = $this->temp_encode_at_symbol( $filtered, true );
|
173 |
|
174 |
return $filtered;
|
224 |
} elseif( $protection_method === 'use_css' ){
|
225 |
$protection_text = __( EEB()->settings->get_setting( 'protection_text', true ), 'email-encoder-bundle' );
|
226 |
$protected_return = $this->encode_email_css( $matches[0], $protection_text );
|
227 |
+
} elseif( $protection_method === 'no_encoding' ){
|
228 |
+
$protected_return = $matches[0];
|
229 |
} else {
|
230 |
$protected_return = $replace_by;
|
231 |
}
|
232 |
|
233 |
+
// mark link as successfully encoded (for admin users)
|
234 |
if ( current_user_can( EEB()->settings->get_admin_cap( 'frontend-display-security-check' ) ) && $show_encoded_check ) {
|
235 |
$protected_return .= '<i class="eeb-encoded dashicons-before dashicons-lock" title="' . __( 'Email encoded successfully!', 'email-encoder-bundle' ) . '"></i>';
|
236 |
}
|
890 |
|
891 |
public function is_post_excluded( $post_id = null ){
|
892 |
|
893 |
+
$return = false;
|
894 |
$skip_posts = (string) EEB()->settings->get_setting( 'skip_posts', true );
|
895 |
if( ! empty( $skip_posts ) ){
|
896 |
|
914 |
}
|
915 |
|
916 |
if ( in_array( $post_id, $exclude_pages_validated ) ) {
|
917 |
+
$return = true;
|
918 |
}
|
919 |
}
|
920 |
|
921 |
}
|
922 |
+
|
923 |
+
return apply_filters( 'eeb/validate/is_post_excluded', $return, $post_id, $skip_posts );
|
924 |
}
|
925 |
}
|
core/includes/integrations/classes/foggy_email.php
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly.
|
4 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
5 |
+
|
6 |
+
if( ! class_exists( 'Email_Encoder_Integration_FoggyEmail' ) ){
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Email_Encoder_Integration_FoggyEmail
|
10 |
+
*
|
11 |
+
* This class integrates support for the oxygen page builder https://oxygenbuilder.com/
|
12 |
+
*
|
13 |
+
* @since 2.0.6
|
14 |
+
* @package EEB
|
15 |
+
* @author Ironikus <info@ironikus.com>
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Email_Encoder_Integration_FoggyEmail{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The main page name for our admin page
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
* @since 2.0.6
|
25 |
+
*/
|
26 |
+
private $page_name;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* The main page title for our admin page
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
* @since 2.0.6
|
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->foggy_key = 'foggy_email_emails';
|
43 |
+
$this->foggy_emails = $this->load_foggy_emails();
|
44 |
+
$this->api_endpoint = 'https://foggy.email/api/';
|
45 |
+
$this->add_hooks();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* ######################
|
50 |
+
* ###
|
51 |
+
* #### HELPERS
|
52 |
+
* ###
|
53 |
+
* ######################
|
54 |
+
*/
|
55 |
+
|
56 |
+
public function is_active(){
|
57 |
+
$foggy_email_api_key = (string) EEB()->settings->get_setting( 'foggy_email_api_key', true );
|
58 |
+
|
59 |
+
return ( ! empty( $foggy_email_api_key ) );
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* ######################
|
64 |
+
* ###
|
65 |
+
* #### FOGGY EMAILS
|
66 |
+
* ###
|
67 |
+
* ######################
|
68 |
+
*/
|
69 |
+
|
70 |
+
public function load_foggy_emails(){
|
71 |
+
|
72 |
+
$return = array();
|
73 |
+
$emails = get_option( $this->foggy_key );
|
74 |
+
if( ! empty( $emails ) && is_array( $emails ) ){
|
75 |
+
$return = $emails;
|
76 |
+
} else {
|
77 |
+
if( ! is_array( $emails ) ){
|
78 |
+
$emails = array();
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
return $return;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Define all of our necessary hooks
|
87 |
+
*/
|
88 |
+
private function add_hooks(){
|
89 |
+
add_filter( 'eeb/settings/pre_filter_fields', array( $this, 'load_foggy_email_settings' ), 10 );
|
90 |
+
add_filter( 'eeb/validate/filter_page_content', array( $this, 'disguise_emails' ), 10, 2 );
|
91 |
+
add_filter( 'eeb/validate/filter_content_content', array( $this, 'disguise_emails' ), 10, 2 );
|
92 |
+
add_action( 'init', array( $this, 'maybe_deactivate_foggy_email' ), 5 );
|
93 |
+
#add_action( 'init', array( $this, 'reload_settings' ), 5 );
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* ######################
|
98 |
+
* ###
|
99 |
+
* #### CORE LOGIC
|
100 |
+
* ###
|
101 |
+
* ######################
|
102 |
+
*/
|
103 |
+
|
104 |
+
public function maybe_deactivate_foggy_email(){
|
105 |
+
$foggy_email_api_key = (string) EEB()->settings->get_setting( 'foggy_email_api_key', true );
|
106 |
+
$emails = get_option( $this->foggy_key );
|
107 |
+
|
108 |
+
//Make sure after deactivating the logic, the emails get removed as well
|
109 |
+
if( empty( $foggy_email_api_key ) && ! empty( $emails ) ){
|
110 |
+
|
111 |
+
if( is_array( $emails ) ){
|
112 |
+
foreach( $emails as $key => $mail ){
|
113 |
+
if( isset( $mail['alias'] ) && isset( $mail['api_key'] ) ){
|
114 |
+
$alias = $mail['alias'];
|
115 |
+
$api_key = base64_decode( $mail['api_key'] );
|
116 |
+
|
117 |
+
if( ! empty( $alias ) && ! empty( $api_key ) ){
|
118 |
+
$check = $this->delete_foggy_email( $api_key, $alias );
|
119 |
+
if( $check ){
|
120 |
+
unset( $emails[ $key ] );
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
if( empty( $emails ) ){
|
128 |
+
delete_option( $this->foggy_key );
|
129 |
+
} else {
|
130 |
+
update_option( $this->foggy_key, $emails );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
public function disguise_emails( $content, $protect_using ){
|
136 |
+
$foggy_email_api_key = (string) EEB()->settings->get_setting( 'foggy_email_api_key', true );
|
137 |
+
|
138 |
+
//Shorten circuit if nothing is set
|
139 |
+
if( empty( $foggy_email_api_key ) ){
|
140 |
+
return $content;
|
141 |
+
}
|
142 |
+
|
143 |
+
$self = $this;
|
144 |
+
$content = EEB()->validate->filter_plain_emails( $content, function ( $match ) use ( $self ) {
|
145 |
+
return $self->get_disguised_email( $match[0] );
|
146 |
+
}, 'no_encoding', false);
|
147 |
+
|
148 |
+
return $content;
|
149 |
+
}
|
150 |
+
|
151 |
+
public function get_disguised_email( $email ){
|
152 |
+
|
153 |
+
if( ! is_email( $email ) || strpos( $email, 'neat.email' ) !== FALSE ){
|
154 |
+
return $email;
|
155 |
+
}
|
156 |
+
|
157 |
+
$email_key = base64_encode( $email );
|
158 |
+
if( isset( $this->foggy_emails[ $email_key ] ) ){
|
159 |
+
$alias_email = $this->foggy_emails[ $email_key ]['alias_email'];
|
160 |
+
|
161 |
+
if( ! empty( $alias_email ) ){
|
162 |
+
if( is_email( $alias_email ) ){
|
163 |
+
$email = $alias_email;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
} else {
|
167 |
+
$email = $this->create_foggy_email( $email );
|
168 |
+
}
|
169 |
+
|
170 |
+
return $email;
|
171 |
+
}
|
172 |
+
|
173 |
+
public function create_foggy_email( $email ){
|
174 |
+
$foggy_email_api_key = (string) EEB()->settings->get_setting( 'foggy_email_api_key', true );
|
175 |
+
|
176 |
+
$return = $email;
|
177 |
+
$args = array(
|
178 |
+
'foggyemail_api' => 'create_alias'
|
179 |
+
);
|
180 |
+
$endpoint = EEB()->helpers->built_url( $this->api_endpoint, $args );
|
181 |
+
|
182 |
+
$http_args = array(
|
183 |
+
'method' => 'POST',
|
184 |
+
'timeout' => 45,
|
185 |
+
'blocking' => true,
|
186 |
+
'headers' => array(
|
187 |
+
'Content-Type' => 'application/json'
|
188 |
+
),
|
189 |
+
'body' => json_encode( array(
|
190 |
+
'foggyemail_ussauth' => $foggy_email_api_key,
|
191 |
+
'email' => $email,
|
192 |
+
) ),
|
193 |
+
'cookies' => array()
|
194 |
+
);
|
195 |
+
$response = wp_remote_post( $endpoint, $http_args );
|
196 |
+
|
197 |
+
if ( ! is_wp_error( $response ) && isset( $response['body'] ) ) {
|
198 |
+
$response_data = json_decode( $response['body'], true );
|
199 |
+
if( ! empty( $response_data ) ){
|
200 |
+
if( isset( $response_data['success'] ) && $response_data['success'] == 'true' ){
|
201 |
+
if( isset( $response_data['data'] ) && isset( $response_data['data']['alias'] ) && isset( $response_data['data']['domain'] ) ){
|
202 |
+
$email_key = base64_encode( $email );
|
203 |
+
$this->foggy_emails[ $email_key ] = array(
|
204 |
+
'email' => $email,
|
205 |
+
'alias' => $response_data['data']['alias'],
|
206 |
+
'alias_email' => $response_data['data']['alias_email'],
|
207 |
+
'domain' => $response_data['data']['domain'],
|
208 |
+
'date' => date( "Y-m-d H:i:s" ),
|
209 |
+
'api_key' => base64_encode( $foggy_email_api_key )
|
210 |
+
);
|
211 |
+
|
212 |
+
update_option( $this->foggy_key, $this->foggy_emails );
|
213 |
+
$return = $response_data['data']['alias_email'];
|
214 |
+
}
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
return $return;
|
220 |
+
}
|
221 |
+
|
222 |
+
public function delete_foggy_email( $foggy_email_api_key, $alias ){
|
223 |
+
|
224 |
+
$return = false;
|
225 |
+
$args = array(
|
226 |
+
'foggyemail_api' => 'delete_alias'
|
227 |
+
);
|
228 |
+
$endpoint = EEB()->helpers->built_url( $this->api_endpoint, $args );
|
229 |
+
|
230 |
+
$http_args = array(
|
231 |
+
'method' => 'POST',
|
232 |
+
'timeout' => 45,
|
233 |
+
'blocking' => true,
|
234 |
+
'headers' => array(
|
235 |
+
'Content-Type' => 'application/json'
|
236 |
+
),
|
237 |
+
'body' => json_encode( array(
|
238 |
+
'foggyemail_ussauth' => $foggy_email_api_key,
|
239 |
+
'alias' => $alias,
|
240 |
+
) ),
|
241 |
+
'cookies' => array()
|
242 |
+
);
|
243 |
+
$response = wp_remote_post( $endpoint, $http_args );
|
244 |
+
|
245 |
+
if ( ! is_wp_error( $response ) && isset( $response['body'] ) ) {
|
246 |
+
$response_data = json_decode( $response['body'], true );
|
247 |
+
if( ! empty( $response_data ) ){
|
248 |
+
if( isset( $response_data['success'] ) && $response_data['success'] == 'true' ){
|
249 |
+
$return = true;
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
return $return;
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* ######################
|
259 |
+
* ###
|
260 |
+
* #### SCRIPTS & STYLES
|
261 |
+
* ###
|
262 |
+
* ######################
|
263 |
+
*/
|
264 |
+
|
265 |
+
public function reload_settings(){
|
266 |
+
EEB()->settings->reload_settings();
|
267 |
+
}
|
268 |
+
|
269 |
+
public function load_foggy_email_settings( $fields ){
|
270 |
+
|
271 |
+
$slug = 'foggy_email_api_key';
|
272 |
+
$new_field = array(
|
273 |
+
'fieldset' => array( 'slug' => 'main', 'label' => 'Label' ),
|
274 |
+
'id' => $slug,
|
275 |
+
'type' => 'text',
|
276 |
+
'advanced' => false,
|
277 |
+
'title' => __('Foggy Email API Key', 'email-encoder-bundle'),
|
278 |
+
'placeholder' => '',
|
279 |
+
'required' => false,
|
280 |
+
'description' => __('Create anonymous emails using <a title="Visit Foggy Email" target="_blank" href="https://foggy.email">https://foggy.email</a> - This will turn every of your emails into a disguised email. For example: <strong>you@example.com</strong> turns into <strong>luhhsd@neat.email</strong>, which will forward every email to <strong>you@example.com</strong>', 'email-encoder-bundle')
|
281 |
+
);
|
282 |
+
|
283 |
+
if( is_array( $fields ) ){
|
284 |
+
if( ! isset( $fields[ $slug ] ) ){
|
285 |
+
$fields[ $slug ] = $new_field;
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
return $fields;
|
290 |
+
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
}
|
295 |
+
|
296 |
+
new Email_Encoder_Integration_FoggyEmail();
|
297 |
+
}
|
core/includes/integrations/classes/mailoptin.php
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Exit if accessed directly.
|
4 |
-
if ( !defined( 'ABSPATH' ) ) exit;
|
5 |
-
|
6 |
-
if ( ! class_exists( 'MO_Admin_Notice' ) ) {
|
7 |
-
class MO_Admin_Notice {
|
8 |
-
public function __construct() {
|
9 |
-
add_action( 'admin_notices', array( $this, 'admin_notice' ) );
|
10 |
-
add_action( 'network_admin_notices', array( $this, 'admin_notice' ) );
|
11 |
-
add_action( 'admin_init', array( $this, 'dismiss_admin_notice' ) );
|
12 |
-
}
|
13 |
-
public function dismiss_admin_notice() {
|
14 |
-
if ( ! isset( $_GET['mo-adaction'] ) || $_GET['mo-adaction'] != 'mo_dismiss_adnotice' ) {
|
15 |
-
return;
|
16 |
-
}
|
17 |
-
$url = admin_url();
|
18 |
-
update_option( 'mo_dismiss_adnotice', 'true' );
|
19 |
-
wp_redirect( $url );
|
20 |
-
exit;
|
21 |
-
}
|
22 |
-
public function admin_notice() {
|
23 |
-
global $pagenow;
|
24 |
-
if($pagenow == 'index.php' || (isset($_GET['page']) && strpos($_GET['page'], 'email-encoder-bundle-option-page') !== false)) {
|
25 |
-
if (get_option('mo_dismiss_adnotice', 'false') == 'true') {
|
26 |
-
return;
|
27 |
-
}
|
28 |
-
if ($this->is_plugin_installed() && $this->is_plugin_active()) {
|
29 |
-
return;
|
30 |
-
}
|
31 |
-
$dismiss_url = esc_url_raw(
|
32 |
-
add_query_arg(
|
33 |
-
array(
|
34 |
-
'mo-adaction' => 'mo_dismiss_adnotice'
|
35 |
-
),
|
36 |
-
admin_url()
|
37 |
-
)
|
38 |
-
);
|
39 |
-
$this->notice_css();
|
40 |
-
$install_url = wp_nonce_url(
|
41 |
-
admin_url('update.php?action=install-plugin&plugin=mailoptin'),
|
42 |
-
'install-plugin_mailoptin'
|
43 |
-
);
|
44 |
-
$activate_url = wp_nonce_url(admin_url('plugins.php?action=activate&plugin=mailoptin%2Fmailoptin.php'), 'activate-plugin_mailoptin/mailoptin.php');
|
45 |
-
?>
|
46 |
-
<div class="mo-admin-notice notice notice-success">
|
47 |
-
<div class="mo-notice-first-half">
|
48 |
-
<p>
|
49 |
-
<?php
|
50 |
-
printf(
|
51 |
-
__('Free optin form plugin that will %1$sincrease your email list subscribers%2$s and keep them engaged with %1$sautomated and schedule newsletters%2$s.'),
|
52 |
-
'<span class="mo-stylize"><strong>', '</strong></span>');
|
53 |
-
?>
|
54 |
-
</p>
|
55 |
-
<p style="text-decoration: underline;font-size: 12px;">Recommended by Email Encoder plugin</p>
|
56 |
-
</div>
|
57 |
-
<div class="mo-notice-other-half">
|
58 |
-
<?php if ( ! $this->is_plugin_installed()) : ?>
|
59 |
-
<a class="button button-primary button-hero" id="mo-install-mailoptin-plugin" href="<?php echo $install_url; ?>">
|
60 |
-
<?php _e('Install MailOptin Now for Free!'); ?>
|
61 |
-
</a>
|
62 |
-
<?php endif; ?>
|
63 |
-
<?php if ($this->is_plugin_installed() && ! $this->is_plugin_active()) : ?>
|
64 |
-
<a class="button button-primary button-hero" id="mo-activate-mailoptin-plugin" href="<?php echo $activate_url; ?>">
|
65 |
-
<?php _e('Activate MailOptin Now!'); ?>
|
66 |
-
</a>
|
67 |
-
<?php endif; ?>
|
68 |
-
<div class="mo-notice-learn-more">
|
69 |
-
<a target="_blank" href="https://mailoptin.io">Learn more</a>
|
70 |
-
</div>
|
71 |
-
</div>
|
72 |
-
<a href="<?php echo $dismiss_url; ?>">
|
73 |
-
<button type="button" class="notice-dismiss">
|
74 |
-
<span class="screen-reader-text"><?php _e('Dismiss this notice'); ?>.</span>
|
75 |
-
</button>
|
76 |
-
</a>
|
77 |
-
</div>
|
78 |
-
<?php
|
79 |
-
}
|
80 |
-
}
|
81 |
-
public function current_admin_url() {
|
82 |
-
$parts = parse_url( home_url() );
|
83 |
-
$uri = $parts['scheme'] . '://' . $parts['host'];
|
84 |
-
if ( array_key_exists( 'port', $parts ) ) {
|
85 |
-
$uri .= ':' . $parts['port'];
|
86 |
-
}
|
87 |
-
$uri .= add_query_arg( array() );
|
88 |
-
return $uri;
|
89 |
-
}
|
90 |
-
public function is_plugin_installed() {
|
91 |
-
$installed_plugins = get_plugins();
|
92 |
-
return isset( $installed_plugins['mailoptin/mailoptin.php'] );
|
93 |
-
}
|
94 |
-
public function is_plugin_active() {
|
95 |
-
return is_plugin_active( 'mailoptin/mailoptin.php' );
|
96 |
-
}
|
97 |
-
public function notice_css() {
|
98 |
-
?>
|
99 |
-
<style type="text/css">
|
100 |
-
.mo-admin-notice {
|
101 |
-
background: #fff;
|
102 |
-
color: #000;
|
103 |
-
border-left-color: #46b450;
|
104 |
-
position: relative;
|
105 |
-
}
|
106 |
-
.mo-admin-notice .notice-dismiss:before {
|
107 |
-
color: #72777c;
|
108 |
-
}
|
109 |
-
.mo-admin-notice .mo-stylize {
|
110 |
-
line-height: 2;
|
111 |
-
}
|
112 |
-
.mo-admin-notice .button-primary {
|
113 |
-
background: #006799;
|
114 |
-
text-shadow: none;
|
115 |
-
border: 0;
|
116 |
-
box-shadow: none;
|
117 |
-
}
|
118 |
-
.mo-notice-first-half {
|
119 |
-
width: 66%;
|
120 |
-
display: inline-block;
|
121 |
-
margin: 10px 0;
|
122 |
-
}
|
123 |
-
.mo-notice-other-half {
|
124 |
-
width: 33%;
|
125 |
-
display: inline-block;
|
126 |
-
padding: 20px 0;
|
127 |
-
position: absolute;
|
128 |
-
text-align: center;
|
129 |
-
}
|
130 |
-
.mo-notice-first-half p {
|
131 |
-
font-size: 14px;
|
132 |
-
}
|
133 |
-
.mo-notice-learn-more a {
|
134 |
-
margin: 10px;
|
135 |
-
}
|
136 |
-
.mo-notice-learn-more {
|
137 |
-
margin-top: 10px;
|
138 |
-
}
|
139 |
-
</style>
|
140 |
-
<?php
|
141 |
-
}
|
142 |
-
public static function instance() {
|
143 |
-
static $instance = null;
|
144 |
-
if ( is_null( $instance ) ) {
|
145 |
-
$instance = new self();
|
146 |
-
}
|
147 |
-
return $instance;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
MO_Admin_Notice::instance();
|
151 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
core/includes/integrations/classes/oxygen_builder.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_Oxygen' ) ){
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Email_Encoder_Integration_Oxygen
|
10 |
+
*
|
11 |
+
* This class integrates support for the oxygen page builder https://oxygenbuilder.com/
|
12 |
+
*
|
13 |
+
* @since 2.0.6
|
14 |
+
* @package EEB
|
15 |
+
* @author Ironikus <info@ironikus.com>
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Email_Encoder_Integration_Oxygen{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The main page name for our admin page
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
* @since 2.0.6
|
25 |
+
*/
|
26 |
+
private $page_name;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* The main page title for our admin page
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
* @since 2.0.6
|
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_oxygen_builder' ), 5 );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* ######################
|
55 |
+
* ###
|
56 |
+
* #### HELPERS
|
57 |
+
* ###
|
58 |
+
* ######################
|
59 |
+
*/
|
60 |
+
|
61 |
+
public function is_oxygen_active(){
|
62 |
+
return defined( 'CT_VERSION' );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* ######################
|
67 |
+
* ###
|
68 |
+
* #### SCRIPTS & STYLES
|
69 |
+
* ###
|
70 |
+
* ######################
|
71 |
+
*/
|
72 |
+
|
73 |
+
public function reload_settings_before_oxygen_builder(){
|
74 |
+
EEB()->settings->reload_settings();
|
75 |
+
}
|
76 |
+
|
77 |
+
public function deactivate_logic( $fields ){
|
78 |
+
|
79 |
+
if( $this->is_oxygen_active() ){
|
80 |
+
if( isset( $_GET['ct_builder'] ) && $_GET['ct_builder'] === 'true' ){
|
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_Oxygen();
|
99 |
+
}
|
core/includes/integrations/loader.php
CHANGED
@@ -15,22 +15,18 @@ class EEB_Integrations_Loader{
|
|
15 |
}
|
16 |
|
17 |
public function load_integrations(){
|
18 |
-
$disable_marketing = (bool) EEB()->settings->get_setting( 'disable_marketing', true );
|
19 |
-
|
20 |
-
$marketing = array(
|
21 |
-
'mailoptin' => 'mailoptin.php',
|
22 |
-
);
|
23 |
|
24 |
$plugins = array(
|
25 |
'maintenance' => 'maintenance.php',
|
26 |
'divi_theme' => 'divi_theme.php',
|
|
|
|
|
|
|
|
|
|
|
27 |
);
|
28 |
-
|
29 |
-
if( $disable_marketing ){
|
30 |
-
$marketing = array();
|
31 |
-
}
|
32 |
|
33 |
-
$integrations = array_merge( $
|
34 |
|
35 |
foreach ( $integrations as $plugin_id => $plugin_file ) :
|
36 |
|
15 |
}
|
16 |
|
17 |
public function load_integrations(){
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
$plugins = array(
|
20 |
'maintenance' => 'maintenance.php',
|
21 |
'divi_theme' => 'divi_theme.php',
|
22 |
+
'oxygen_builder' => 'oxygen_builder.php',
|
23 |
+
);
|
24 |
+
|
25 |
+
$services = array(
|
26 |
+
'foggy_email' => 'foggy_email.php'
|
27 |
);
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
$integrations = array_merge( $plugins, $services );
|
30 |
|
31 |
foreach ( $integrations as $plugin_id => $plugin_file ) :
|
32 |
|
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.6
|
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.6' );
|
26 |
|
27 |
// Determines if the plugin is loaded
|
28 |
define( 'EEB_SETUP', true );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: anti spam, protect, encode, encrypt, hide, antispam, mailto, spambot, secu
|
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.1
|
6 |
Tested up to: 5.3.2
|
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,11 @@ 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 |
= 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
|
@@ -121,6 +126,17 @@ Yes, since version 1.3.0 also special characters are supported.
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
= 2.0.5 =
|
125 |
* Feature: Soft-Encode all HTML tags + new settings item (This will prevent complex plugins from breaking)
|
126 |
* Dev: New filter for randomization of javascript escaping methods
|
4 |
Requires at least: 4.7
|
5 |
Requires PHP: 5.1
|
6 |
Tested up to: 5.3.2
|
7 |
+
Stable tag: 2.0.6
|
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 |
+
= Foggy Email Integration =
|
35 |
+
This plugin is fully integrated with [foggy.email](https://foggy.email/) to protect your emails on the next level.
|
36 |
+
Foggy Email allows you to create protected emails to hide your real email address. In combination with Email Encoder, it will create for each email on your website a protected email address to hide your real one.
|
37 |
+
Example: me@myemail.com will be converted to hgulo@foggy.email - Your website visitor will see hgulo@foggy.email on your website instead your real email. Once they send an email to this address, it gets automatically forwarded to your inbox.
|
38 |
+
|
39 |
= Compatibilities =
|
40 |
* The plugin works with mostly any theme and plugin. Some special ones needed special treatment. Doen below you can learn more about that.
|
41 |
* Compatible with the Maintenance plugin from WP Maintenance
|
126 |
|
127 |
== Changelog ==
|
128 |
|
129 |
+
= 2.0.6 =
|
130 |
+
* Feature: Fully integrated with Foggy Email to protect your real email address: https://foggy.email/
|
131 |
+
* Feature: We fully removed all external marketing advertisements! Enjoy our plugin without distrations! :)
|
132 |
+
* Feature: Full support for Oxygen builder
|
133 |
+
* Tweak: Optimize PHPDocs and comments
|
134 |
+
* Tweak: Optimize is_post_excluded functionality
|
135 |
+
* Dev: New filter: eeb/validate/filter_page_content - https://ironikus.com/docs/knowledge-base/filter-to-manipulate-raw-page-content/
|
136 |
+
* Dev: New filter: eeb/validate/filter_content_content - https://ironikus.com/docs/knowledge-base/filter-to-manipulate-raw-hook-content/
|
137 |
+
* Dev: New filter: eeb/validate/is_post_excluded - https://ironikus.com/docs/knowledge-base/filter-excluded-posts-list/
|
138 |
+
* Dev: New filter: eeb/settings/pre_filter_fields - https://ironikus.com/docs/knowledge-base/pre-filter-email-encoder-settings/
|
139 |
+
|
140 |
= 2.0.5 =
|
141 |
* Feature: Soft-Encode all HTML tags + new settings item (This will prevent complex plugins from breaking)
|
142 |
* Dev: New filter for randomization of javascript escaping methods
|