PluginProbe ʕ •ᴥ•ʔ
Check & Log Email – Easy Email Testing & Mail logging / 2.0.5.1
Check & Log Email – Easy Email Testing & Mail logging v2.0.5.1
1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.13.2 2.0.14 2.0.2 2.0.3 2.0.4 2.0.5 2.0.5.1 2.0.6 2.0.7 2.0.8 2.0.9 trunk 0.5.7 0.6.0 0.6.1 0.6.2 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.12.1 1.0.13 1.0.13.1 1.0.2 1.0.3
check-email / include / Check_Email_Encode_Tab.php
check-email / include Last commit date
Core 1 year ago Util 1 year ago Check_Email_Encode_Tab.php 1 year ago Check_Email_Notify_Tab.php 1 year ago Check_Email_SMTP_Tab.php 1 year ago class-check-email-header-parser.php 1 year ago class-check-email-log-autoloader.php 1 year ago class-check-email-newsletter.php 1 year ago deactivate-feedback.php 1 year ago helper-function.php 1 year ago install.php 1 year ago
Check_Email_Encode_Tab.php
169 lines
1 <?php namespace CheckEmail;
2 defined( 'ABSPATH' ) || exit; // Exit if accessed directly
3
4 /**
5 * @class Check_Email_SMTP_Tab
6 * @since 2.0
7 */
8 /**
9 * Its functionality is inspired by Email encode address
10 */
11 class Check_Email_Encode_Tab {
12
13 private $encode_options;
14 private $is_enable;
15
16 public function __construct() {
17 add_action( 'init', array( $this, 'init' ) );
18 }
19
20 public function init() {
21 if ( ! is_admin() ) {
22 return;
23 }
24 $this->setup_vars();
25
26 add_action( 'check_mail_email_encode', array($this, 'load_email_encode_settings'));
27 add_action('admin_init', array($this, 'check_mail_encode_submission_handler'));
28
29 }
30
31
32 /**
33 * Get smtp options
34 *
35 * @return void
36 * @since 1.0.12
37 */
38 public function setup_vars(){
39 $this->encode_options = get_option('check-email-email-encode-options', true);
40 }
41
42 public function load_email_encode_settings(){
43
44 if (isset($this->encode_options['email_using']) && !empty( $this->encode_options['email_using'] ) ) {
45 $email_using_radio = $this->encode_options['email_using'];
46 }else{
47 $email_using_radio = 'filters';
48 }
49 if (isset($this->encode_options['email_technique']) && !empty( $this->encode_options['email_technique'] ) ) {
50 $email_technique_radio = $this->encode_options['email_technique'];
51 }else{
52 $email_technique_radio = 'html_entities';
53 }
54
55 ?>
56
57 <form action="" method="post" >
58 <div>
59 <table class="form-table" role="presentation">
60 <thead>
61 <tr>
62 <th scope="row"><label for="check-email-email-encode-options-is_enable" class="check-email-opt-labels"><?php esc_html_e( 'Email Encoder', 'check-email' ); ?></label></th>
63 <td>
64 <input class="" type="checkbox" id="check-email-email-encode-options-is_enable" name="check-email-email-encode-options[is_enable]" value="1" <?php echo (isset($this->encode_options['is_enable'])) && $this->encode_options['is_enable'] ? "checked" : ''; ?>>
65 </td>
66 </tr>
67 <tr class="check-email-etr" style="<?php echo (isset($this->encode_options['is_enable'])) && $this->encode_options['is_enable'] ? "" : 'display:none;'; ?>">
68 <th scope="row" style="padding-left: 10px;;"><label class="check-email-opt-labels"><?php esc_html_e( 'Search for emails using', 'check-email' ); ?></label></th>
69 <td>
70 <label for="check-email-email-encode-options-filter" class="check-email-opt-labels-encoder">
71 <input id="check-email-email-encode-options-filter" type="radio" name="check-email-email-encode-options[email_using]" value="filters" <?php echo $email_using_radio == 'filters' ? "checked" : ''; ?>>
72 <?php esc_html_e( 'WordPress Filters', 'check-email' ); ?></label>
73 <small><?php esc_html_e( 'Scan for protection in wordpress filters only.', 'check-email' ); ?></small>
74
75 <label for="check-email-email-encode-options-full_page" class="check-email-opt-labels-encoder">
76 <input id="check-email-email-encode-options-full_page" type="radio" name="check-email-email-encode-options[email_using]" value="full_page" <?php echo $email_using_radio == 'full_page' ? "checked" : ''; ?>>
77 <?php esc_html_e( 'Full-Page Scanner', 'check-email' ); ?></label>
78 <small><?php esc_html_e( 'Scan for protection on entire page.', 'check-email' ); ?></small>
79 </td>
80 </tr>
81 <tr class="check-email-etr" style="<?php echo (isset($this->encode_options['is_enable'])) && $this->encode_options['is_enable'] ? "" : 'display:none;'; ?>">
82 <th scope="row" style="padding-left: 10px;;"><label class="check-email-opt-labels"><?php esc_html_e( 'Protect emails using', 'check-email' ); ?></label></th>
83 <td>
84 <label for="check-email-email-encode-options-html-entities" class="check-email-opt-labels-encoder">
85 <input id="check-email-email-encode-options-html-entities" type="radio" name="check-email-email-encode-options[email_technique]" value="html_entities" <?php echo $email_technique_radio == 'html_entities' ? "checked" : ''; ?>>
86 <?php esc_html_e( 'Html Entities', 'check-email' ); ?></label>
87 <small><?php esc_html_e( 'Provides reliable protection and suits most situations.', 'check-email' ); ?></small>
88
89
90
91 <label for="check-email-email-encode-options-css_direction" class="check-email-opt-labels-encoder">
92 <input id="check-email-email-encode-options-css_direction" type="radio" name="check-email-email-encode-options[email_technique]" value="css_direction" <?php echo $email_technique_radio == 'css_direction' ? "checked" : ''; ?>> <?php esc_html_e( 'CSS Direction', 'check-email' ); ?></label>
93 <small><?php esc_html_e( 'Shields from intelligent bots without requiring JavaScript.', 'check-email' ); ?></small>
94
95 <label for="check-email-email-encode-options-rot_13" class="check-email-opt-labels-encoder">
96 <input id="check-email-email-encode-options-rot_13" type="radio" name="check-email-email-encode-options[email_technique]" value="rot_13" <?php echo $email_technique_radio == 'rot_13' ? "checked" : ''; ?>> <?php esc_html_e( 'ROT13 Encoding', 'check-email' ); ?></label>
97 <small><?php esc_html_e( 'Shields from intelligent bots but needs JavaScript.', 'check-email' ); ?></small>
98
99 <label for="check-email-email-encode-options-rot_47" class="check-email-opt-labels-encoder">
100 <input id="check-email-email-encode-options-rot_47" type="radio" name="check-email-email-encode-options[email_technique]" value="rot_47" <?php echo $email_technique_radio == 'rot_47' ? "checked" : ''; ?>>
101 <?php esc_html_e( 'Polymorphous ROT47/CSS', 'check-email' ); ?></label>
102 <small><?php esc_html_e( 'Top-tier security against sophisticated bots, but JavaScript is necessary.', 'check-email' ); ?></small>
103 </td>
104 </tr>
105 <tr>
106 <th scope="row"><label class="check-email-opt-labels"><?php esc_html_e( 'Mobile / Phone Encoder', 'check-email' ); ?></label></th>
107 <td>
108 <p><?php esc_html_e( 'Other content ( like phone numbers ) can be protected using [checkmail-encode] shortcode', 'check-email' ); ?></p></br>
109 <code>
110 [checkmail-encode]+1 (555) 123-4569[/checkmail-encode]</code> <br/>
111 <code>
112 [checkmail-encode link="tel:+15551234569"]+1 (555) 123-4569[/checkmail-encode]
113 </code>
114 </td>
115 </tr>
116 </thead>
117
118 </table>
119 </div>
120 <?php wp_nonce_field('check_mail_email_encode_nonce','check_mail_email_encode_nonce'); ?>
121 <p class="submit"><input type="submit" name="check_mail_email_encode_submit" id="check_mail_email_encode_submit" class="button button-primary" value="<?php esc_attr_e( 'Save', 'check-email' ); ?>"></p>
122 </form>
123 <?php
124 }
125
126 /**
127 * Save SMTP options
128 *
129 * @return void
130 * @since 1.0.12
131 */
132
133 public function check_mail_encode_submission_handler(){
134
135 if(isset($_POST['check_mail_email_encode_submit']) && $_POST['check_mail_email_encode_submit'] == 'Save'){
136 if(!isset($_POST['check_mail_email_encode_nonce'])){
137 return;
138 }
139
140 if ( !wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['check_mail_email_encode_nonce'] ) ), 'check_mail_email_encode_nonce' ) ){
141 return;
142 }
143
144 if ( ! current_user_can( 'manage_check_email' ) ) {
145 return;
146 }
147 $email_encode_option['is_enable'] = 0;
148 if ( isset($_POST['check-email-email-encode-options']['is_enable'] ) ) {
149 $email_encode_option['is_enable'] = 1;
150 }
151 if ( isset($_POST['check-email-email-encode-options']['email_using'] ) ) {
152 $email_encode_option['email_using'] = sanitize_text_field( wp_unslash( $_POST['check-email-email-encode-options']['email_using'] ) );
153 }else{
154 $email_encode_option['email_using'] = 'filters';
155 }
156 if ( isset($_POST['check-email-email-encode-options']['email_technique'] ) ) {
157 $email_encode_option['email_technique'] = sanitize_text_field( wp_unslash( $_POST['check-email-email-encode-options']['email_technique'] ) );
158 }else{
159 $email_encode_option['email_technique'] = 'html_entities';
160 }
161
162 update_option('check-email-email-encode-options', $email_encode_option);
163
164 wp_safe_redirect(admin_url('admin.php?page=check-email-settings&tab=email-encode'));
165 }
166 }
167
168 }
169