PluginProbe ʕ •ᴥ•ʔ
Email Encoder – Protect Email Addresses and Phone Numbers / 1.51
Email Encoder – Protect Email Addresses and Phone Numbers v1.51
2.5.0 2.4.8 trunk 0.10 0.11 0.12 0.20 0.21 0.22 0.30 0.31 0.32 0.40 0.41 0.42 0.50 0.60 0.70 0.71 0.80 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5 1.5.2 1.51 1.53 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7
email-encoder-bundle / email-encoder-bundle.php
email-encoder-bundle Last commit date
images 7 years ago includes 7 years ago js 10 years ago email-encoder-bundle.php 7 years ago readme.txt 7 years ago
email-encoder-bundle.php
75 lines
1 <?php
2 /*
3 Plugin Name: Email Encoder - Protect Email Address
4 Plugin URI: https://wordpress.org/plugins/email-encoder-bundle/
5 Description: Protect email addresses on your site and hide them from spambots by encoding them. Easy to use & flexible.
6 Author: WebFactory Ltd
7 Version: 1.51
8 Author URI: https://www.webfactoryltd.com/
9 License: Dual licensed under the MIT and GPL licenses
10 Text Domain: email-encoder-bundle
11 */
12
13 // this is an include only WP file
14 if (!defined('ABSPATH')) {
15 die;
16 }
17
18 // constants
19 if (!defined('EMAIL_ENCODER_BUNDLE_VERSION')) { define('EMAIL_ENCODER_BUNDLE_VERSION', '1.5'); }
20 if (!defined('EMAIL_ENCODER_BUNDLE_FILE')) { define('EMAIL_ENCODER_BUNDLE_FILE', defined('TEST_EEB_PLUGIN_FILE') ? TEST_EEB_PLUGIN_FILE : __FILE__); }
21 if (!defined('EMAIL_ENCODER_BUNDLE_KEY')) { define('EMAIL_ENCODER_BUNDLE_KEY', 'WP_Email_Encoder_Bundle'); }
22 if (!defined('EMAIL_ENCODER_BUNDLE_OPTIONS_NAME')) { define('EMAIL_ENCODER_BUNDLE_OPTIONS_NAME', 'WP_Email_Encoder_Bundle_options'); }
23 if (!defined('EMAIL_ENCODER_BUNDLE_ADMIN_PAGE')) { define('EMAIL_ENCODER_BUNDLE_ADMIN_PAGE', 'email-encoder-bundle-settings'); }
24
25 // wp_version var was used by older WP versions
26 if (!isset($wp_version)) {
27 $wp_version = get_bloginfo('version');
28 }
29
30 // check plugin compatibility
31 if (version_compare($wp_version, '3.6', '>=') && version_compare(phpversion(), '5.2.4', '>=')) {
32
33 // include classes
34 require_once('includes/class-eeb-admin.php');
35 require_once('includes/class-eeb-site.php');
36 require_once('includes/template-functions.php');
37
38 // create instance
39 $Eeb_Site = Eeb_Site::getInstance();
40
41 // handle AJAX request
42 // input vars
43 if (!empty($_POST['eebActionEncodeEmail'])) {
44 $eebActionEncodeEmail = sanitize_text_field($_POST['eebActionEncodeEmail']);
45 $method = sanitize_text_field($_POST['eebMethod']);
46 $email = sanitize_email($_POST['eebEmail']);
47 $display = wp_kses_post($_POST['eebDisplay']);
48
49 if (empty($display)) {
50 $display = $email;
51 }
52
53 echo $Eeb_Site->encode_email($email, $display, '', $method, true);
54 exit;
55 }
56
57 } else {
58
59 // set error message
60 if (!function_exists('eeb_error_notice')):
61 function eeb_error_notice() {
62 $plugin_title = get_admin_page_title();
63
64 echo '<div class="error">'
65 . sprintf(__('<p>Warning - The plugin <strong>%s</strong> requires PHP 5.2.4+ and WP 3.6+. Please upgrade your PHP and/or WordPress.'
66 . '<br/>Disable the plugin to remove this message.</p>'
67 , 'email-encoder-bundle'), $plugin_title)
68 . '</div>';
69 }
70
71 add_action('admin_notices', 'eeb_error_notice');
72 endif;
73
74 }
75