Easy WP SMTP - Version 1.3.9.2

Version Description

  • Settings are exported in JSON format now.
  • Added additional sanitization to some actions on the settings page.
  • Regenerated .pot file.
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 Easy WP SMTP
Version 1.3.9.2
Comparing to
See all releases

Code changes from version 1.3.9.1 to 1.3.9.2

class-easywpsmtp-admin.php ADDED
@@ -0,0 +1,580 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EasyWPSMTP_Admin {
4
+
5
+ private $sd_code;
6
+
7
+ public function __construct() {
8
+ $this->sd_code = md5( uniqid( 'swpsmtp', true ) );
9
+ set_transient( 'easy_wp_smtp_sd_code', $this->sd_code, 12 * 60 * 60 );
10
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
11
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
12
+ }
13
+
14
+ public function admin_enqueue_scripts( $hook ) {
15
+ // Load only on ?page=swpsmtp_settings
16
+ if ( 'settings_page_swpsmtp_settings' !== $hook ) {
17
+ return;
18
+ }
19
+ $core = EasyWPSMTP::get_instance();
20
+ $plugin_data = get_file_data( $core->plugin_file, array( 'Version' => 'Version' ), false );
21
+ $plugin_version = $plugin_data['Version'];
22
+ wp_enqueue_style( 'swpsmtp_admin_css', plugins_url( 'css/style.css', __FILE__ ), array(), '1.0' );
23
+ wp_register_script( 'swpsmtp_admin_js', plugins_url( 'js/script.js', __FILE__ ), array(), $plugin_version, true );
24
+ $params = array(
25
+ 'sd_redir_url' => get_admin_url(),
26
+ 'sd_code' => $this->sd_code,
27
+ 'clear_log_nonce' => wp_create_nonce( 'easy-wp-smtp-clear-log' ),
28
+ 'str' => array(
29
+ 'clear_log' => __( 'Are you sure want to clear log?', 'easy-wp-smtp' ),
30
+ 'log_cleared' => __( 'Log cleared.', 'easy-wp-smtp' ),
31
+ 'error_occured' => __( 'Error occurred:', 'easy-wp-smtp' ),
32
+ 'sending' => __( 'Sending...', 'easy-wp-smtp' ),
33
+ 'confirm_self_destruct' => __( 'Are you sure you want to delete ALL your settings and deactive plugin?', 'easy-wp-smtp' ),
34
+ 'self_destruct_completed' => __( 'All settings have been deleted and plugin is deactivated.', 'easy-wp-smtp' ),
35
+ ),
36
+ );
37
+ wp_localize_script( 'swpsmtp_admin_js', 'easywpsmtp', $params );
38
+ wp_enqueue_script( 'swpsmtp_admin_js' );
39
+ }
40
+
41
+ public function admin_menu() {
42
+ add_options_page( __( 'Easy WP SMTP', 'easy-wp-smtp' ), __( 'Easy WP SMTP', 'easy-wp-smtp' ), 'manage_options', 'swpsmtp_settings', 'swpsmtp_settings' );
43
+ }
44
+ }
45
+
46
+ new EasyWPSMTP_Admin();
47
+
48
+ /**
49
+ * Renders the admin settings menu of the plugin.
50
+ * @return void
51
+ */
52
+ function swpsmtp_settings() {
53
+ $easy_wp_smtp = EasyWPSMTP::get_instance();
54
+ $enc_req_met = true;
55
+ $enc_req_err = '';
56
+ //check if OpenSSL PHP extension is loaded and display warning if it's not
57
+ if ( ! extension_loaded( 'openssl' ) ) {
58
+ $class = 'notice notice-warning';
59
+ $message = __( "PHP OpenSSL extension is not installed on the server. It's required by Easy WP SMTP plugin to operate properly. Please contact your server administrator or hosting provider and ask them to install it.", 'easy-wp-smtp' );
60
+ printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
61
+ //also show encryption error message
62
+ $enc_req_err .= __( 'PHP OpenSSL extension is not installed on the server. It is required for encryption to work properly. Please contact your server administrator or hosting provider and ask them to install it.', 'easy-wp-smtp' ) . '<br />';
63
+ $enc_req_met = false;
64
+ }
65
+
66
+ //check if server meets encryption requirements
67
+ if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
68
+ $enc_req_err = ! empty( $enc_req_err ) ? $enc_req_err .= '<br />' : '';
69
+ // translators: %s is PHP version
70
+ $enc_req_err .= sprintf( __( 'Your PHP version is %s, encryption function requires PHP version 5.3.0 or higher.', 'easy-wp-smtp' ), PHP_VERSION );
71
+ $enc_req_met = false;
72
+ }
73
+
74
+ echo '<div class="wrap" id="swpsmtp-mail">';
75
+ echo '<h2>' . esc_html( __( 'Easy WP SMTP Settings', 'easy-wp-smtp' ) ) . '</h2>';
76
+ echo '<div id="poststuff"><div id="post-body">';
77
+
78
+ $message = '';
79
+ $error = '';
80
+
81
+ $swpsmtp_options = get_option( 'swpsmtp_options' );
82
+ $smtp_test_mail = get_option( 'smtp_test_mail' );
83
+ $gag_password = '#easywpsmtpgagpass#';
84
+ if ( empty( $smtp_test_mail ) ) {
85
+ $smtp_test_mail = array(
86
+ 'swpsmtp_to' => '',
87
+ 'swpsmtp_subject' => '',
88
+ 'swpsmtp_message' => '',
89
+ );
90
+ }
91
+
92
+ if ( isset( $_POST['swpsmtp_form_submit'] ) ) {
93
+ // check nounce
94
+ if ( ! check_admin_referer( plugin_basename( __FILE__ ), 'swpsmtp_nonce_name' ) ) {
95
+ $error .= ' ' . __( 'Nonce check failed.', 'easy-wp-smtp' );
96
+ }
97
+ /* Update settings */
98
+ $swpsmtp_options['from_name_field'] = isset( $_POST['swpsmtp_from_name'] ) ? sanitize_text_field( wp_unslash( $_POST['swpsmtp_from_name'] ) ) : '';
99
+ $swpsmtp_options['force_from_name_replace'] = isset( $_POST['swpsmtp_force_from_name_replace'] ) ? 1 : false;
100
+
101
+ if ( isset( $_POST['swpsmtp_from_email'] ) ) {
102
+ if ( is_email( $_POST['swpsmtp_from_email'] ) ) {
103
+ $swpsmtp_options['from_email_field'] = sanitize_email( $_POST['swpsmtp_from_email'] );
104
+ } else {
105
+ $error .= ' ' . __( "Please enter a valid email address in the 'FROM' field.", 'easy-wp-smtp' );
106
+ }
107
+ }
108
+ if ( isset( $_POST['swpsmtp_reply_to_email'] ) ) {
109
+ $swpsmtp_options['reply_to_email'] = sanitize_email( $_POST['swpsmtp_reply_to_email'] );
110
+ }
111
+
112
+ if ( isset( $_POST['swpsmtp_email_ignore_list'] ) ) {
113
+ $swpsmtp_options['email_ignore_list'] = sanitize_text_field( $_POST['swpsmtp_email_ignore_list'] );
114
+ }
115
+
116
+ $swpsmtp_options['smtp_settings']['host'] = stripslashes( $_POST['swpsmtp_smtp_host'] );
117
+ $swpsmtp_options['smtp_settings']['type_encryption'] = ( isset( $_POST['swpsmtp_smtp_type_encryption'] ) ) ? sanitize_text_field( $_POST['swpsmtp_smtp_type_encryption'] ) : 'none';
118
+ $swpsmtp_options['smtp_settings']['autentication'] = ( isset( $_POST['swpsmtp_smtp_autentication'] ) ) ? sanitize_text_field( $_POST['swpsmtp_smtp_autentication'] ) : 'yes';
119
+ $swpsmtp_options['smtp_settings']['username'] = stripslashes( $_POST['swpsmtp_smtp_username'] );
120
+
121
+ $swpsmtp_options['smtp_settings']['enable_debug'] = isset( $_POST['swpsmtp_enable_debug'] ) ? 1 : false;
122
+ $swpsmtp_options['smtp_settings']['insecure_ssl'] = isset( $_POST['swpsmtp_insecure_ssl'] ) ? 1 : false;
123
+ $swpsmtp_options['smtp_settings']['encrypt_pass'] = isset( $_POST['swpsmtp_encrypt_pass'] ) ? 1 : false;
124
+
125
+ $smtp_password = $_POST['swpsmtp_smtp_password'];
126
+ if ( $smtp_password !== $gag_password ) {
127
+ $swpsmtp_options['smtp_settings']['password'] = $easy_wp_smtp->encrypt_password( $smtp_password );
128
+ }
129
+
130
+ if ( $swpsmtp_options['smtp_settings']['encrypt_pass'] && ! get_option( 'swpsmtp_pass_encrypted', false ) ) {
131
+ update_option( 'swpsmtp_options', $swpsmtp_options );
132
+ $pass = $easy_wp_smtp->get_password();
133
+ $swpsmtp_options['smtp_settings']['password'] = $easy_wp_smtp->encrypt_password( $pass );
134
+ update_option( 'swpsmtp_options', $swpsmtp_options );
135
+ }
136
+
137
+ $swpsmtp_options['enable_domain_check'] = isset( $_POST['swpsmtp_enable_domain_check'] ) ? 1 : false;
138
+ if ( isset( $_POST['swpsmtp_allowed_domains'] ) ) {
139
+ $swpsmtp_options['block_all_emails'] = isset( $_POST['swpsmtp_block_all_emails'] ) ? 1 : false;
140
+ $swpsmtp_options['allowed_domains'] = base64_encode( sanitize_text_field( $_POST['swpsmtp_allowed_domains'] ) ); //phpcs:ignore
141
+ } elseif ( ! isset( $swpsmtp_options['allowed_domains'] ) ) {
142
+ $swpsmtp_options['allowed_domains'] = '';
143
+ }
144
+
145
+ /* Check value from "SMTP port" option */
146
+ if ( isset( $_POST['swpsmtp_smtp_port'] ) ) {
147
+ if ( empty( $_POST['swpsmtp_smtp_port'] ) || 1 > intval( $_POST['swpsmtp_smtp_port'] ) || ( ! preg_match( '/^\d+$/', $_POST['swpsmtp_smtp_port'] ) ) ) {
148
+ $swpsmtp_options['smtp_settings']['port'] = '25';
149
+ $error .= ' ' . __( "Please enter a valid port in the 'SMTP Port' field.", 'easy-wp-smtp' );
150
+ } else {
151
+ $swpsmtp_options['smtp_settings']['port'] = sanitize_text_field( $_POST['swpsmtp_smtp_port'] );
152
+ }
153
+ }
154
+
155
+ /* Update settings in the database */
156
+ if ( empty( $error ) ) {
157
+ update_option( 'swpsmtp_options', $swpsmtp_options );
158
+ $message .= __( 'Settings saved.', 'easy-wp-smtp' );
159
+ } else {
160
+ $error .= ' ' . __( 'Settings are not saved.', 'easy-wp-smtp' );
161
+ }
162
+ }
163
+
164
+ /* Send test letter */
165
+ $swpsmtp_to = '';
166
+ if ( isset( $_POST['swpsmtp_test_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'swpsmtp_test_nonce_name' ) ) {
167
+ if ( isset( $_POST['swpsmtp_to'] ) ) {
168
+ $to_email = sanitize_text_field( $_POST['swpsmtp_to'] );
169
+ if ( is_email( $to_email ) ) {
170
+ $swpsmtp_to = $to_email;
171
+ } else {
172
+ $error .= __( 'Please enter a valid email address in the recipient email field.', 'easy-wp-smtp' );
173
+ }
174
+ }
175
+ $swpsmtp_subject = isset( $_POST['swpsmtp_subject'] ) ? sanitize_text_field( $_POST['swpsmtp_subject'] ) : '';
176
+ $swpsmtp_message = isset( $_POST['swpsmtp_message'] ) ? EasyWPSMTP_Utils::sanitize_textarea( $_POST['swpsmtp_message'] ) : '';
177
+
178
+ //Save the test mail details so it doesn't need to be filled in everytime.
179
+ $smtp_test_mail['swpsmtp_to'] = $swpsmtp_to;
180
+ $smtp_test_mail['swpsmtp_subject'] = $swpsmtp_subject;
181
+ $smtp_test_mail['swpsmtp_message'] = $swpsmtp_message;
182
+ update_option( 'smtp_test_mail', $smtp_test_mail );
183
+
184
+ if ( ! empty( $swpsmtp_to ) ) {
185
+ $test_res = $easy_wp_smtp->test_mail( $swpsmtp_to, $swpsmtp_subject, $swpsmtp_message );
186
+ }
187
+ }
188
+ ?>
189
+
190
+ <div class="updated fade" <?php echo empty( $message ) ? ' style="display:none"' : ''; ?>>
191
+ <p><strong><?php echo esc_html( $message ); ?></strong></p>
192
+ </div>
193
+ <div class="error" <?php echo empty( $error ) ? 'style="display:none"' : ''; ?>>
194
+ <p><strong><?php echo esc_html( $error ); ?></strong></p>
195
+ </div>
196
+
197
+ <div class="nav-tab-wrapper">
198
+ <a href="#smtp" data-tab-name="smtp" class="nav-tab"><?php esc_html_e( 'SMTP Settings', 'easy-wp-smtp' ); ?></a>
199
+ <a href="#additional" data-tab-name="additional" class="nav-tab"><?php esc_html_e( 'Additional Settings', 'easy-wp-smtp' ); ?></a>
200
+ <a href="#testemail" data-tab-name="testemail" class="nav-tab"><?php esc_html_e( 'Test Email', 'easy-wp-smtp' ); ?></a>
201
+ </div>
202
+
203
+ <div class="swpsmtp-settings-container">
204
+ <div class="swpsmtp-settings-grid swpsmtp-settings-main-cont">
205
+
206
+ <form autocomplete="off" id="swpsmtp_settings_form" method="post" action="">
207
+
208
+ <input type="hidden" id="swpsmtp-urlHash" name="swpsmtp-urlHash" value="">
209
+
210
+ <div class="swpsmtp-tab-container" data-tab-name="smtp">
211
+ <div class="postbox">
212
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'SMTP Configuration Settings', 'easy-wp-smtp' ); ?></label></h3>
213
+ <div class="inside">
214
+
215
+ <p><?php esc_html_e( 'You can request your hosting provider for the SMTP details of your site. Use the SMTP details provided by your hosting provider to configure the following settings.', 'easy-wp-smtp' ); ?></p>
216
+
217
+ <table class="form-table">
218
+ <tr valign="top">
219
+ <th scope="row"><?php esc_html_e( 'From Email Address', 'easy-wp-smtp' ); ?></th>
220
+ <td>
221
+ <input id="swpsmtp_from_email" type="text" name="swpsmtp_from_email" value="<?php echo isset( $swpsmtp_options['from_email_field'] ) ? esc_attr( $swpsmtp_options['from_email_field'] ) : ''; ?>" /><br />
222
+ <p class="description"><?php esc_html_e( "This email address will be used in the 'From' field.", 'easy-wp-smtp' ); ?></p>
223
+ </td>
224
+ </tr>
225
+ <tr valign="top">
226
+ <th scope="row"><?php esc_html_e( 'From Name', 'easy-wp-smtp' ); ?></th>
227
+ <td>
228
+ <input id="swpsmtp_from_name" type="text" name="swpsmtp_from_name" value="<?php echo isset( $swpsmtp_options['from_name_field'] ) ? esc_attr( $swpsmtp_options['from_name_field'] ) : ''; ?>" /><br />
229
+ <p class="description"><?php esc_html_e( "This text will be used in the 'FROM' field", 'easy-wp-smtp' ); ?></p>
230
+ <p>
231
+ <label><input type="checkbox" id="swpsmtp_force_from_name_replace" name="swpsmtp_force_from_name_replace" value="1" <?php echo ( isset( $swpsmtp_options['force_from_name_replace'] ) && ( $swpsmtp_options['force_from_name_replace'] ) ) ? ' checked' : ''; ?> /> <?php esc_html_e( 'Force From Name Replacement', 'easy-wp-smtp' ); ?></label>
232
+ </p>
233
+ <p class="description"><?php esc_html_e( "When enabled, the plugin will set the above From Name for each email. Disable it if you're using contact form plugins, it will prevent the plugin from replacing form submitter's name when contact email is sent.", 'easy-wp-smtp' ); ?>
234
+ <br />
235
+ <?php esc_html_e( "If email's From Name is empty, the plugin will set the above value regardless.", 'easy-wp-smtp' ); ?>
236
+ </p>
237
+ </td>
238
+ </tr>
239
+ <tr valign="top">
240
+ <th scope="row"><?php esc_html_e( 'Reply-To Email Address', 'easy-wp-smtp' ); ?></th>
241
+ <td>
242
+ <input id="swpsmtp_reply_to_email" type="email" name="swpsmtp_reply_to_email" value="<?php echo isset( $swpsmtp_options['reply_to_email'] ) ? esc_attr( $swpsmtp_options['reply_to_email'] ) : ''; ?>" /><br />
243
+ <p class="description"><?php esc_html_e( "Optional. This email address will be used in the 'Reply-To' field of the email. Leave it blank to use 'From' email as the reply-to value.", 'easy-wp-smtp' ); ?></p>
244
+ </td>
245
+ </tr>
246
+ <tr class="ad_opt swpsmtp_smtp_options">
247
+ <th><?php esc_html_e( 'SMTP Host', 'easy-wp-smtp' ); ?></th>
248
+ <td>
249
+ <input id='swpsmtp_smtp_host' type='text' name='swpsmtp_smtp_host' value='<?php echo isset( $swpsmtp_options['smtp_settings']['host'] ) ? esc_attr( $swpsmtp_options['smtp_settings']['host'] ) : ''; ?>' /><br />
250
+ <p class="description"><?php esc_html_e( 'Your mail server', 'easy-wp-smtp' ); ?></p>
251
+ </td>
252
+ </tr>
253
+ <tr class="ad_opt swpsmtp_smtp_options">
254
+ <th><?php esc_html_e( 'Type of Encryption', 'easy-wp-smtp' ); ?></th>
255
+ <td>
256
+ <label for="swpsmtp_smtp_type_encryption_1"><input type="radio" id="swpsmtp_smtp_type_encryption_1" name="swpsmtp_smtp_type_encryption" value='none'
257
+ <?php
258
+ if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'none' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
259
+ echo 'checked="checked"';}
260
+ ?>
261
+ /> <?php esc_html_e( 'None', 'easy-wp-smtp' ); ?></label>
262
+ <label for="swpsmtp_smtp_type_encryption_2"><input type="radio" id="swpsmtp_smtp_type_encryption_2" name="swpsmtp_smtp_type_encryption" value='ssl'
263
+ <?php
264
+ if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'ssl' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
265
+ echo 'checked="checked"';}
266
+ ?>
267
+ /> <?php esc_html_e( 'SSL/TLS', 'easy-wp-smtp' ); ?></label>
268
+ <label for="swpsmtp_smtp_type_encryption_3"><input type="radio" id="swpsmtp_smtp_type_encryption_3" name="swpsmtp_smtp_type_encryption" value='tls'
269
+ <?php
270
+ if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'tls' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
271
+ echo 'checked="checked"';}
272
+ ?>
273
+ /> <?php esc_html_e( 'STARTTLS', 'easy-wp-smtp' ); ?></label><br />
274
+ <p class="description"><?php esc_html_e( 'For most servers SSL/TLS is the recommended option', 'easy-wp-smtp' ); ?></p>
275
+ </td>
276
+ </tr>
277
+ <tr class="ad_opt swpsmtp_smtp_options">
278
+ <th><?php esc_html_e( 'SMTP Port', 'easy-wp-smtp' ); ?></th>
279
+ <td>
280
+ <input id='swpsmtp_smtp_port' type='text' name='swpsmtp_smtp_port' value='<?php echo isset( $swpsmtp_options['smtp_settings']['port'] ) ? esc_attr( $swpsmtp_options['smtp_settings']['port'] ) : ''; ?>' /><br />
281
+ <p class="description"><?php esc_html_e( 'The port to your mail server', 'easy-wp-smtp' ); ?></p>
282
+ </td>
283
+ </tr>
284
+ <tr class="ad_opt swpsmtp_smtp_options">
285
+ <th><?php esc_html_e( 'SMTP Authentication', 'easy-wp-smtp' ); ?></th>
286
+ <td>
287
+ <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_1" name="swpsmtp_smtp_autentication" value='no'
288
+ <?php
289
+ if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'no' === $swpsmtp_options['smtp_settings']['autentication'] ) {
290
+ echo 'checked="checked"';}
291
+ ?>
292
+ /> <?php esc_html_e( 'No', 'easy-wp-smtp' ); ?></label>
293
+ <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_2" name="swpsmtp_smtp_autentication" value='yes'
294
+ <?php
295
+ if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'yes' === $swpsmtp_options['smtp_settings']['autentication'] ) {
296
+ echo 'checked="checked"';}
297
+ ?>
298
+ /> <?php esc_html_e( 'Yes', 'easy-wp-smtp' ); ?></label><br />
299
+ <p class="description"><?php esc_html_e( "This options should always be checked 'Yes'", 'easy-wp-smtp' ); ?></p>
300
+ </td>
301
+ </tr>
302
+ <tr class="ad_opt swpsmtp_smtp_options">
303
+ <th><?php esc_html_e( 'SMTP Username', 'easy-wp-smtp' ); ?></th>
304
+ <td>
305
+ <input id='swpsmtp_smtp_username' type='text' name='swpsmtp_smtp_username' value='<?php echo isset( $swpsmtp_options['smtp_settings']['username'] ) ? esc_attr( $swpsmtp_options['smtp_settings']['username'] ) : ''; ?>' /><br />
306
+ <p class="description"><?php esc_html_e( 'The username to login to your mail server', 'easy-wp-smtp' ); ?></p>
307
+ </td>
308
+ </tr>
309
+ <tr class="ad_opt swpsmtp_smtp_options">
310
+ <th><?php esc_html_e( 'SMTP Password', 'easy-wp-smtp' ); ?></th>
311
+ <td>
312
+ <input id="swpsmtp_smtp_password" type="password" name="swpsmtp_smtp_password" value="<?php echo esc_attr( ( $easy_wp_smtp->get_password() !== '' ? $gag_password : '' ) ); ?>" autocomplete="new-password" /><br />
313
+ <p class="description"><?php echo esc_html( __( 'The password to login to your mail server', 'easy-wp-smtp' ) ); ?></p>
314
+ <p class="description"><b><?php echo esc_html( _x( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ) ); ?></b> <?php echo esc_html( __( 'when you click "Save Changes", your actual password is stored in the database and then used to send emails. This field is replaced with a gag (#easywpsmtpgagpass#). This is done to prevent someone with the access to Settings page from seeing your password (using password fields unmasking programs, for example).', 'easy-wp-smtp' ) ); ?></p>
315
+ </td>
316
+ </tr>
317
+ </table>
318
+ <p class="submit">
319
+ <input type="submit" id="settings-form-submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'easy-wp-smtp' ); ?>" />
320
+ <input type="hidden" name="swpsmtp_form_submit" value="submit" />
321
+ <?php wp_nonce_field( plugin_basename( __FILE__ ), 'swpsmtp_nonce_name' ); ?>
322
+ </p>
323
+ </div><!-- end of inside -->
324
+ </div><!-- end of postbox -->
325
+ </div>
326
+
327
+ <div class="swpsmtp-tab-container" data-tab-name="additional">
328
+ <div class="postbox">
329
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Additional Settings (Optional)', 'easy-wp-smtp' ); ?></label></h3>
330
+ <div class="inside">
331
+ <table class="form-table">
332
+ <tr valign="top">
333
+ <th scope="row"><?php esc_html_e( "Don't Replace \"From\" Field", 'easy-wp-smtp' ); ?></th>
334
+ <td>
335
+ <input id="swpsmtp_email_ignore_list" type="text" name="swpsmtp_email_ignore_list" value="<?php echo isset( $swpsmtp_options['email_ignore_list'] ) ? esc_attr( $swpsmtp_options['email_ignore_list'] ) : ''; ?>" /><br />
336
+ <p class="description"><?php esc_html_e( 'Comma separated emails list. Example value: email1@domain.com, email2@domain.com', 'easy-wp-smtp' ); ?></p>
337
+ <p class="description"><?php esc_html_e( "This option is useful when you are using several email aliases on your SMTP server. If you don't want your aliases to be replaced by the address specified in \"From\" field, enter them in this field.", 'easy-wp-smtp' ); ?></p>
338
+ </td>
339
+ </tr>
340
+ <tr valign="top">
341
+ <th scope="row"><?php esc_html_e( 'Enable Domain Check', 'easy-wp-smtp' ); ?></th>
342
+ <td>
343
+ <input id="swpsmtp_enable_domain_check" type="checkbox" id="swpsmtp_enable_domain_check" name="swpsmtp_enable_domain_check" value="1" <?php echo ( isset( $swpsmtp_options['enable_domain_check'] ) && ( $swpsmtp_options['enable_domain_check'] ) ) ? ' checked' : ''; ?> />
344
+ <p class="description"><?php esc_html_e( 'This option is usually used by developers only. SMTP settings will be used only if the site is running on following domain(s):', 'easy-wp-smtp' ); ?></p>
345
+ <input id="swpsmtp_allowed_domains" type="text" name="swpsmtp_allowed_domains" value="<?php echo esc_attr( EasyWPSMTP_Utils::base64_decode_maybe( $swpsmtp_options['allowed_domains'] ) ); ?>" <?php echo ( isset( $swpsmtp_options['enable_domain_check'] ) && ( $swpsmtp_options['enable_domain_check'] ) ) ? '' : ' disabled'; ?> />
346
+ <p class="description"><?php esc_html_e( 'Coma-separated domains list. Example: domain1.com, domain2.com', 'easy-wp-smtp' ); ?></p>
347
+ <p>
348
+ <label><input type="checkbox" id="swpsmtp_block_all_emails" name="swpsmtp_block_all_emails" value="1" <?php echo ( isset( $swpsmtp_options['block_all_emails'] ) && ( $swpsmtp_options['block_all_emails'] ) ) ? ' checked' : ''; ?><?php echo ( isset( $swpsmtp_options['enable_domain_check'] ) && ( $swpsmtp_options['enable_domain_check'] ) ) ? '' : ' disabled'; ?> /> <?php esc_html_e( 'Block all emails', 'easy-wp-smtp' ); ?></label>
349
+ </p>
350
+ <p class="description"><?php esc_html_e( 'When enabled, plugin attempts to block ALL emails from being sent out if domain mismtach.', 'easy-wp-smtp' ); ?></p>
351
+ </td>
352
+ </tr>
353
+ <tr valign="top">
354
+ <th scope="row"><?php esc_html_e( 'Encrypt Password', 'easy-wp-smtp' ); ?></th>
355
+ <td>
356
+ <?php if ( $enc_req_met ) { ?>
357
+ <input id="swpsmtp_encrypt_pass" type="checkbox" name="swpsmtp_encrypt_pass" value="1" <?php echo ( isset( $swpsmtp_options['smtp_settings']['encrypt_pass'] ) && ( $swpsmtp_options['smtp_settings']['encrypt_pass'] ) ) ? 'checked' : ''; ?> />
358
+ <p class="description"><?php esc_html_e( 'When enabled, your SMTP password is stored in the database using AES-256 encryption.', 'easy-wp-smtp' ); ?></p>
359
+ <?php } else { ?>
360
+ <p style="color: red;"><?php echo esc_html( $enc_req_err ); ?></p>
361
+ <?php } ?>
362
+ </td>
363
+ </tr>
364
+ <tr valign="top">
365
+ <th scope="row"><?php esc_html_e( 'Allow Insecure SSL Certificates', 'easy-wp-smtp' ); ?></th>
366
+ <td>
367
+ <input id="swpsmtp_insecure_ssl" type="checkbox" name="swpsmtp_insecure_ssl" value="1" <?php echo ( isset( $swpsmtp_options['smtp_settings']['insecure_ssl'] ) && ( $swpsmtp_options['smtp_settings']['insecure_ssl'] ) ) ? 'checked' : ''; ?> />
368
+ <p class="description"><?php esc_html_e( "Allows insecure and self-signed SSL certificates on SMTP server. It's highly recommended to keep this option disabled.", 'easy-wp-smtp' ); ?></p>
369
+ </td>
370
+ </tr>
371
+ <tr valign="top">
372
+ <th scope="row"><?php esc_html_e( 'Enable Debug Log', 'easy-wp-smtp' ); ?></th>
373
+ <td>
374
+ <input id="swpsmtp_enable_debug" type="checkbox" name="swpsmtp_enable_debug" value="1" <?php echo ( isset( $swpsmtp_options['smtp_settings']['enable_debug'] ) && ( $swpsmtp_options['smtp_settings']['enable_debug'] ) ) ? 'checked' : ''; ?> />
375
+ <p class="description"><?php esc_html_e( 'Check this box to enable mail debug log', 'easy-wp-smtp' ); ?></p>
376
+ <a href="<?php echo esc_attr( admin_url() ); ?>?swpsmtp_action=view_log" target="_blank"><?php esc_html_e( 'View Log', 'easy-wp-smtp' ); ?></a> | <a style="color: red;" id="swpsmtp_clear_log_btn" href="#0"><?php esc_html_e( 'Clear Log', 'easy-wp-smtp' ); ?></a>
377
+ </td>
378
+ </tr>
379
+ </table>
380
+ <p class="submit">
381
+ <input type="submit" id="additional-settings-form-submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'easy-wp-smtp' ); ?>" />
382
+ </p>
383
+
384
+ </div><!-- end of inside -->
385
+ </div><!-- end of postbox -->
386
+
387
+ <div class="postbox">
388
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Danger Zone', 'easy-wp-smtp' ); ?></label></h3>
389
+ <div class="inside">
390
+ <p><?php esc_html_e( 'Actions in this section can (and some of them will) erase or mess up your settings. Use it with caution.', 'easy-wp-smtp' ); ?></p>
391
+ <table class="form-table">
392
+ <tr valign="top">
393
+ <th scope="row"><?php esc_html_e( 'Export\Import Settings', 'easy-wp-smtp' ); ?></th>
394
+ <td>
395
+ <button id="swpsmtp_export_settings_btn" type="button" class="button"><?php esc_html_e( 'Export Settings', 'easy-wp-smtp' ); ?></button>
396
+ <p class="description"><?php esc_html_e( 'Use this to export plugin settings to a file.', 'easy-wp-smtp' ); ?></p>
397
+ <p></p>
398
+ <button id="swpsmtp_import_settings_btn" type="button" class="button"><?php esc_html_e( 'Import Settings', 'easy-wp-smtp' ); ?></button>
399
+ <p class="description"><?php esc_html_e( 'Use this to import plugin settings from a file. Note this would replace all your existing settings, so use with caution.', 'easy-wp-smtp' ); ?></p>
400
+ </td>
401
+ </tr>
402
+ <tr valign="top">
403
+ <th scope="row"><?php esc_html_e( 'Delete Settings and Deactivate Plugin', 'easy-wp-smtp' ); ?></th>
404
+ <td>
405
+ <button id="swpsmtp_self_destruct_btn" style="color: red;" type="button" class="button button-secondary">>>> <?php esc_html_e( 'Self-destruct', 'easy-wp-smtp' ); ?> <<<</button> <p class="description"><?php esc_html_e( "This will remove ALL your settings and deactivate the plugin. Useful when you're uninstalling the plugin and want to completely remove all crucial data stored in the database.", 'easy-wp-smtp' ); ?></p>
406
+ <p style="color: red; font-weight: bold;"><?php esc_html_e( "Warning! This can't be undone.", 'easy-wp-smtp' ); ?></p>
407
+ </td>
408
+ </tr>
409
+ </table>
410
+ </div>
411
+ </div>
412
+
413
+ </div>
414
+ </form>
415
+
416
+ <form id="swpsmtp_export_settings_frm" style="display: none;" method="POST">
417
+ <input type="hidden" name="swpsmtp_export_settings" value="1">
418
+ <?php wp_nonce_field( 'easy_wp_smtp_export_settings', 'easy_wp_smtp_export_settings_nonce' ); ?>
419
+ </form>
420
+
421
+ <form id="swpsmtp_import_settings_frm" style="display: none;" method="POST" enctype="multipart/form-data">
422
+ <input type="hidden" name="swpsmtp_import_settings" value="1">
423
+ <input id="swpsmtp_import_settings_select_file" type="file" name="swpsmtp_import_settings_file">
424
+ <?php wp_nonce_field( 'easy_wp_smtp_import_settings', 'easy_wp_smtp_import_settings_nonce' ); ?>
425
+ </form>
426
+
427
+ <div class="swpsmtp-tab-container" data-tab-name="testemail">
428
+ <div class="postbox">
429
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Test Email', 'easy-wp-smtp' ); ?></label></h3>
430
+ <div class="inside">
431
+ <div id="swpsmtp-save-settings-notice" class="swpsmtp-msg-cont msg-error"><b><?php echo esc_html( _x( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ) ); ?></b> <?php esc_html_e( 'You have unsaved settings. In order to send a test email, you need to go back to previous tab and click "Save Changes" button first.', 'easy-wp-smtp' ); ?></div>
432
+
433
+ <?php
434
+ if ( isset( $test_res ) && is_array( $test_res ) ) {
435
+ if ( isset( $test_res['error'] ) ) {
436
+ $errmsg_class = ' msg-error';
437
+ $errmsg_text = '<b>' . esc_html__( 'Following error occurred when attempting to send test email:', 'easy-wp-smtp' ) . '</b><br />' . esc_html( $test_res['error'] );
438
+ } else {
439
+ $errmsg_class = ' msg-success';
440
+ $errmsg_text = '<b>' . esc_html__( 'Test email was successfully sent. No errors occurred during the process.', 'easy-wp-smtp' ) . '</b>';
441
+ }
442
+ ?>
443
+
444
+ <div class="swpsmtp-msg-cont<?php echo esc_attr( $errmsg_class ); ?>">
445
+ <?php echo $errmsg_text; //phpcs:ignore?>
446
+
447
+ <?php
448
+ if ( isset( $test_res['debug_log'] ) ) {
449
+ ?>
450
+ <br /><br />
451
+ <a id="swpsmtp-show-hide-log-btn" href="#0"><?php esc_html_e( 'Show Debug Log', 'easy-wp-smtp' ); ?></a>
452
+ <p id="swpsmtp-debug-log-cont"><textarea rows="20" style="width: 100%;"><?php echo esc_html( $test_res['debug_log'] ); ?></textarea></p>
453
+ <script>
454
+ jQuery(function($) {
455
+ $('#swpsmtp-show-hide-log-btn').click(function(e) {
456
+ e.preventDefault();
457
+ var logCont = $('#swpsmtp-debug-log-cont');
458
+ if (logCont.is(':visible')) {
459
+ $(this).html('<?php esc_attr_e( 'Show Debug Log', 'easy-wp-smtp' ); ?>');
460
+ } else {
461
+ $(this).html('<?php esc_attr_e( 'Hide Debug Log', 'easy-wp-smtp' ); ?>');
462
+ }
463
+ logCont.toggle();
464
+ });
465
+ <?php
466
+ if ( isset( $test_res['error'] ) ) {
467
+ ?>
468
+ $('#swpsmtp-show-hide-log-btn').click();
469
+ <?php
470
+ }
471
+ ?>
472
+ });
473
+ </script>
474
+ <?php
475
+ }
476
+ ?>
477
+ </div>
478
+ <?php
479
+ }
480
+ ?>
481
+
482
+ <p><?php esc_html_e( 'You can use this section to send an email from your server using the above configured SMTP details to see if the email gets delivered.', 'easy-wp-smtp' ); ?></p>
483
+ <p><b><?php echo esc_html( _x( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ) ); ?></b> <?php esc_html_e( 'debug log for this test email will be automatically displayed right after you send it. Test email also ignores "Enable Domain Check" option.', 'easy-wp-smtp' ); ?></p>
484
+
485
+ <form id="swpsmtp_settings_test_email_form" method="post" action="">
486
+ <table class="form-table">
487
+ <tr valign="top">
488
+ <th scope="row"><?php esc_html_e( 'To', 'easy-wp-smtp' ); ?>:</th>
489
+ <td>
490
+ <input id="swpsmtp_to" type="text" class="ignore-change" name="swpsmtp_to" value="<?php echo esc_html( $smtp_test_mail['swpsmtp_to'] ); ?>" /><br />
491
+ <p class="description"><?php esc_html_e( "Enter the recipient's email address", 'easy-wp-smtp' ); ?></p>
492
+ </td>
493
+ </tr>
494
+ <tr valign="top">
495
+ <th scope="row"><?php esc_html_e( 'Subject', 'easy-wp-smtp' ); ?>:</th>
496
+ <td>
497
+ <input id="swpsmtp_subject" type="text" class="ignore-change" name="swpsmtp_subject" value="<?php echo esc_html( $smtp_test_mail['swpsmtp_subject'] ); ?>" /><br />
498
+ <p class="description"><?php esc_html_e( 'Enter a subject for your message', 'easy-wp-smtp' ); ?></p>
499
+ </td>
500
+ </tr>
501
+ <tr valign="top">
502
+ <th scope="row"><?php esc_html_e( 'Message', 'easy-wp-smtp' ); ?>:</th>
503
+ <td>
504
+ <textarea name="swpsmtp_message" id="swpsmtp_message" rows="5"><?php echo esc_textarea( stripslashes( $smtp_test_mail['swpsmtp_message'] ) ); ?></textarea><br />
505
+ <p class="description"><?php esc_html_e( 'Write your email message', 'easy-wp-smtp' ); ?></p>
506
+ </td>
507
+ </tr>
508
+ </table>
509
+ <p class="submit">
510
+ <input type="submit" id="test-email-form-submit" class="button-primary" value="<?php esc_attr_e( 'Send Test Email', 'easy-wp-smtp' ); ?>" />
511
+ <input type="hidden" name="swpsmtp_test_submit" value="submit" />
512
+ <?php wp_nonce_field( plugin_basename( __FILE__ ), 'swpsmtp_test_nonce_name' ); ?>
513
+ <span id="swpsmtp-spinner" class="spinner"></span>
514
+ </p>
515
+ </form>
516
+ </div><!-- end of inside -->
517
+ </div><!-- end of postbox -->
518
+
519
+ </div>
520
+ </div>
521
+ <div class="swpsmtp-settings-grid swpsmtp-settings-sidebar-cont">
522
+ <div class="postbox" style="min-width: inherit;">
523
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Documentation', 'easy-wp-smtp' ); ?></label></h3>
524
+ <div class="inside">
525
+ <?php
526
+ printf(
527
+ esc_html(
528
+ // translators: %s is replaced by documentation page URL
529
+ _x( "Please visit the %s plugin's documentation page to learn how to use this plugin.", '%s is replaced by <a target="_blank" href="https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197">Easy WP SMTP</a>', 'easy-wp-smtp' )
530
+ ),
531
+ '<a target="_blank" href="https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197">Easy WP SMTP</a>'
532
+ );
533
+ ?>
534
+ </div>
535
+ </div>
536
+ <div class="postbox" style="min-width: inherit;">
537
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Support', 'easy-wp-smtp' ); ?></label></h3>
538
+ <div class="inside">
539
+ <?php
540
+ printf(
541
+ esc_html(
542
+ // translators: %s is replaced by support forum URL
543
+ _x( 'Having issues or difficulties? You can post your issue on the %s', '%s is replaced by "Support Forum" link', 'easy-wp-smtp' )
544
+ ),
545
+ sprintf(
546
+ '<a href="https://wordpress.org/support/plugin/easy-wp-smtp/" target="_blank">%s</a>',
547
+ esc_html( __( 'Support Forum', 'easy-wp-smtp' ) )
548
+ )
549
+ );
550
+ ?>
551
+ </div>
552
+ </div>
553
+ <div class="postbox" style="min-width: inherit;">
554
+ <h3 class="hndle"><label for="title"><?php esc_html_e( 'Rate Us', 'easy-wp-smtp' ); ?></label></h3>
555
+ <div class="inside">
556
+ <?php
557
+ printf(
558
+ esc_html(
559
+ // translators: %s is replaced by rating link
560
+ _x( 'Like the plugin? Please give us a %s', '%s is replaced by "rating" link', 'easy-wp-smtp' )
561
+ ),
562
+ sprintf(
563
+ '<a href="https://wordpress.org/support/plugin/easy-wp-smtp/reviews/#new-post" target="_blank">%s</a>',
564
+ esc_html( __( 'rating', 'easy-wp-smtp' ) )
565
+ )
566
+ );
567
+ ?>
568
+ <div class="swpsmtp-stars-container">
569
+ <a href="https://wordpress.org/support/plugin/easy-wp-smtp/reviews/?filter=5" target="_blank"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
570
+ </a>
571
+ </div>
572
+ </div>
573
+ </div>
574
+ </div>
575
+ </div>
576
+
577
+ <?php
578
+ echo '</div></div>'; //<!-- end of #poststuff and #post-body -->
579
+ echo '</div>'; //<!-- end of .wrap #swpsmtp-mail .swpsmtp-mail -->
580
+ }
class-easywpsmtp-gag-mailer.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EasyWPSMTP_Gag_Mailer extends stdClass { //phpcs:ignore
4
+
5
+ public function Send() {
6
+ return true;
7
+ }
8
+ }
class-easywpsmtp-utils.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use ioncube\phpOpensslCryptor\Cryptor;
4
+
5
+ class EasyWPSMTP_Utils {
6
+
7
+ public $enc_key;
8
+ protected static $instance = null;
9
+
10
+ public function __construct() {
11
+ require_once 'inc/Cryptor.php';
12
+ $key = get_option( 'swpsmtp_enc_key', false );
13
+ if ( empty( $key ) ) {
14
+ $key = wp_salt();
15
+ update_option( 'swpsmtp_enc_key', $key );
16
+ }
17
+ $this->enc_key = $key;
18
+ }
19
+
20
+ public static function get_instance() {
21
+
22
+ // If the single instance hasn't been set, set it now.
23
+ if ( null === self::$instance ) {
24
+ self::$instance = new self();
25
+ }
26
+
27
+ return self::$instance;
28
+ }
29
+
30
+ public static function base64_decode_maybe( $str ) {
31
+ if ( ! function_exists( 'mb_detect_encoding' ) ) {
32
+ return base64_decode( $str ); //phpcs:ignore
33
+ }
34
+ if ( mb_detect_encoding( $str ) === mb_detect_encoding( base64_decode( base64_encode( base64_decode( $str ) ) ) ) ) { //phpcs:ignore
35
+ $str = base64_decode( $str ); //phpcs:ignore
36
+ }
37
+ return $str;
38
+ }
39
+
40
+ public function encrypt_password( $pass ) {
41
+ if ( '' === $pass ) {
42
+ return '';
43
+ }
44
+
45
+ $password = Cryptor::Encrypt( $pass, $this->enc_key );
46
+ return $password;
47
+ }
48
+
49
+ public function decrypt_password( $pass ) {
50
+ $password = Cryptor::Decrypt( $pass, $this->enc_key );
51
+ return $password;
52
+ }
53
+
54
+ /**
55
+ * Sanitizes textarea. Tries to use wp sanitize_textarea_field() function. If that's not available, uses its own methods
56
+ * @return string
57
+ */
58
+ public static function sanitize_textarea( $str ) {
59
+ if ( function_exists( 'sanitize_textarea_field' ) ) {
60
+ return sanitize_textarea_field( $str );
61
+ }
62
+ $filtered = wp_check_invalid_utf8( $str );
63
+
64
+ if ( strpos( $filtered, '<' ) !== false ) {
65
+ $filtered = wp_pre_kses_less_than( $filtered );
66
+ // This will strip extra whitespace for us.
67
+ $filtered = wp_strip_all_tags( $filtered, false );
68
+
69
+ // Use html entities in a special case to make sure no later
70
+ // newline stripping stage could lead to a functional tag
71
+ $filtered = str_replace( "<\n", "&lt;\n", $filtered );
72
+ }
73
+
74
+ $filtered = trim( $filtered );
75
+
76
+ $found = false;
77
+ while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
78
+ $filtered = str_replace( $match[0], '', $filtered );
79
+ $found = true;
80
+ }
81
+
82
+ if ( $found ) {
83
+ // Strip out the whitespace that may now exist after removing the octets.
84
+ $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
85
+ }
86
+
87
+ return $filtered;
88
+ }
89
+
90
+ }
easy-wp-smtp-admin-menu.php DELETED
@@ -1,554 +0,0 @@
1
- <?php
2
-
3
- class EasyWPSMTMAdmin {
4
-
5
- private $sd_code;
6
-
7
- function __construct() {
8
- $this->sd_code = md5( uniqid( 'swpsmtp', true ) );
9
- set_transient( 'easy_wp_smtp_sd_code', $this->sd_code, 12 * 60 * 60 );
10
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
11
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
12
- }
13
-
14
- function admin_enqueue_scripts( $hook ) {
15
- // Load only on ?page=swpsmtp_settings
16
- if ( $hook != 'settings_page_swpsmtp_settings' ) {
17
- return;
18
- }
19
- $core = EasyWPSMTP::get_instance();
20
- $plugin_data = get_file_data( $core->plugin_file, array( 'Version' => 'Version' ), false );
21
- $plugin_version = $plugin_data[ 'Version' ];
22
- wp_enqueue_style( 'swpsmtp_admin_css', plugins_url( 'css/style.css', __FILE__ ) );
23
- wp_register_script( 'swpsmtp_admin_js', plugins_url( 'js/script.js', __FILE__ ), array(), $plugin_version, true );
24
- $params = array(
25
- 'sd_redir_url' => get_admin_url(),
26
- 'sd_code' => $this->sd_code,
27
- 'str' => array(
28
- 'clear_log' => __( 'Are you sure want to clear log?', 'easy-wp-smtp' ),
29
- 'log_cleared' => __( 'Log cleared.', 'easy-wp-smtp' ),
30
- 'error_occured' => __( 'Error occurred:', 'easy-wp-smtp' ),
31
- 'sending' => __( 'Sending...', 'easy-wp-smtp' ),
32
- 'confirm_self_destruct' => __( 'Are you sure you want to delete ALL your settings and deactive plugin?', 'easy-wp-smtp' ),
33
- 'self_destruct_completed' => __( 'All settings have been deleted and plugin is deactivated.', 'easy-wp-smtp' ),
34
- )
35
- );
36
- wp_localize_script( 'swpsmtp_admin_js', 'easywpsmtp', $params );
37
- wp_enqueue_script( 'swpsmtp_admin_js' );
38
- }
39
-
40
- function admin_menu() {
41
- //add_submenu_page( 'options-general.php', __( 'Easy WP SMTP', 'easy-wp-smtp' ), __( 'Easy WP SMTP', 'easy-wp-smtp' ), $capabilities, 'swpsmtp_settings', 'swpsmtp_settings' );
42
- add_options_page( __( 'Easy WP SMTP', 'easy-wp-smtp' ), __( 'Easy WP SMTP', 'easy-wp-smtp' ), 'manage_options', 'swpsmtp_settings', 'swpsmtp_settings' );
43
- }
44
-
45
- }
46
-
47
- new EasyWPSMTMAdmin();
48
-
49
- /**
50
- * Sanitizes textarea. Tries to use wp sanitize_textarea_field() function. If that's not available, uses its own methods
51
- * @return string
52
- */
53
- function swpsmtp_sanitize_textarea( $str ) {
54
- if ( function_exists( 'sanitize_textarea_field' ) ) {
55
- return sanitize_textarea_field( $str );
56
- }
57
- $filtered = wp_check_invalid_utf8( $str );
58
-
59
- if ( strpos( $filtered, '<' ) !== false ) {
60
- $filtered = wp_pre_kses_less_than( $filtered );
61
- // This will strip extra whitespace for us.
62
- $filtered = wp_strip_all_tags( $filtered, false );
63
-
64
- // Use html entities in a special case to make sure no later
65
- // newline stripping stage could lead to a functional tag
66
- $filtered = str_replace( "<\n", "&lt;\n", $filtered );
67
- }
68
-
69
- $filtered = trim( $filtered );
70
-
71
- $found = false;
72
- while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
73
- $filtered = str_replace( $match[ 0 ], '', $filtered );
74
- $found = true;
75
- }
76
-
77
- if ( $found ) {
78
- // Strip out the whitespace that may now exist after removing the octets.
79
- $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
80
- }
81
-
82
- return $filtered;
83
- }
84
-
85
- /**
86
- * Renders the admin settings menu of the plugin.
87
- * @return void
88
- */
89
- function swpsmtp_settings() {
90
- $EasyWPSMTP = EasyWPSMTP::get_instance();
91
- $enc_req_met = true;
92
- $enc_req_err = '';
93
- //check if OpenSSL PHP extension is loaded and display warning if it's not
94
- if ( ! extension_loaded( 'openssl' ) ) {
95
- $class = 'notice notice-warning';
96
- $message = __( "PHP OpenSSL extension is not installed on the server. It's required by Easy WP SMTP plugin to operate properly. Please contact your server administrator or hosting provider and ask them to install it.", 'easy-wp-smtp' );
97
- printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
98
- //also show encryption error message
99
- $enc_req_err .= __( "PHP OpenSSL extension is not installed on the server. It is required for encryption to work properly. Please contact your server administrator or hosting provider and ask them to install it.", 'easy-wp-smtp' ) . '<br />';
100
- $enc_req_met = false;
101
- }
102
-
103
- //check if server meets encryption requirements
104
- if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
105
- $enc_req_err = ! empty( $enc_req_err ) ? $enc_req_err .= '<br />' : '';
106
- $enc_req_err .= sprintf( __( 'Your PHP version is %s, encryption function requires PHP version 5.3.0 or higher.', 'easy-wp-smtp' ), PHP_VERSION );
107
- $enc_req_met = false;
108
- }
109
-
110
- echo '<div class="wrap" id="swpsmtp-mail">';
111
- echo '<h2>' . __( "Easy WP SMTP Settings", 'easy-wp-smtp' ) . '</h2>';
112
- echo '<div id="poststuff"><div id="post-body">';
113
-
114
- $display_add_options = $message = $error = $result = '';
115
-
116
- $swpsmtp_options = get_option( 'swpsmtp_options' );
117
- $smtp_test_mail = get_option( 'smtp_test_mail' );
118
- $gag_password = '#easywpsmtpgagpass#';
119
- if ( empty( $smtp_test_mail ) ) {
120
- $smtp_test_mail = array( 'swpsmtp_to' => '', 'swpsmtp_subject' => '', 'swpsmtp_message' => '', );
121
- }
122
-
123
- if ( isset( $_POST[ 'swpsmtp_form_submit' ] ) ) {
124
- // check nounce
125
- if ( ! check_admin_referer( plugin_basename( __FILE__ ), 'swpsmtp_nonce_name' ) ) {
126
- $error .= " " . __( "Nonce check failed.", 'easy-wp-smtp' );
127
- }
128
- /* Update settings */
129
- $swpsmtp_options[ 'from_name_field' ] = isset( $_POST[ 'swpsmtp_from_name' ] ) ? sanitize_text_field( wp_unslash( $_POST[ 'swpsmtp_from_name' ] ) ) : '';
130
- $swpsmtp_options[ 'force_from_name_replace' ] = isset( $_POST[ 'swpsmtp_force_from_name_replace' ] ) ? 1 : false;
131
-
132
- if ( isset( $_POST[ 'swpsmtp_from_email' ] ) ) {
133
- if ( is_email( $_POST[ 'swpsmtp_from_email' ] ) ) {
134
- $swpsmtp_options[ 'from_email_field' ] = sanitize_email( $_POST[ 'swpsmtp_from_email' ] );
135
- } else {
136
- $error .= " " . __( "Please enter a valid email address in the 'FROM' field.", 'easy-wp-smtp' );
137
- }
138
- }
139
- if ( isset( $_POST[ 'swpsmtp_reply_to_email' ] ) ) {
140
- $swpsmtp_options[ 'reply_to_email' ] = sanitize_email( $_POST[ 'swpsmtp_reply_to_email' ] );
141
- }
142
-
143
- if ( isset( $_POST[ 'swpsmtp_email_ignore_list' ] ) ) {
144
- $swpsmtp_options[ 'email_ignore_list' ] = sanitize_text_field( $_POST[ 'swpsmtp_email_ignore_list' ] );
145
- }
146
-
147
- $swpsmtp_options[ 'smtp_settings' ][ 'host' ] = stripslashes( $_POST[ 'swpsmtp_smtp_host' ] );
148
- $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] = ( isset( $_POST[ 'swpsmtp_smtp_type_encryption' ] ) ) ? sanitize_text_field( $_POST[ 'swpsmtp_smtp_type_encryption' ] ) : 'none';
149
- $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] = ( isset( $_POST[ 'swpsmtp_smtp_autentication' ] ) ) ? sanitize_text_field( $_POST[ 'swpsmtp_smtp_autentication' ] ) : 'yes';
150
- $swpsmtp_options[ 'smtp_settings' ][ 'username' ] = stripslashes( $_POST[ 'swpsmtp_smtp_username' ] );
151
-
152
- $swpsmtp_options[ 'smtp_settings' ][ 'enable_debug' ] = isset( $_POST[ 'swpsmtp_enable_debug' ] ) ? 1 : false;
153
- $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] = isset( $_POST[ 'swpsmtp_insecure_ssl' ] ) ? 1 : false;
154
- $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] = isset( $_POST[ 'swpsmtp_encrypt_pass' ] ) ? 1 : false;
155
-
156
- $smtp_password = $_POST[ 'swpsmtp_smtp_password' ];
157
- if ( $smtp_password !== $gag_password ) {
158
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = $EasyWPSMTP->encrypt_password( $smtp_password );
159
- }
160
-
161
- if ( $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] && ! get_option( 'swpsmtp_pass_encrypted', false ) ) {
162
- update_option( 'swpsmtp_options', $swpsmtp_options );
163
- $pass = $EasyWPSMTP->get_password();
164
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = $EasyWPSMTP->encrypt_password( $pass );
165
- update_option( 'swpsmtp_options', $swpsmtp_options );
166
- }
167
-
168
-
169
- $swpsmtp_options[ 'enable_domain_check' ] = isset( $_POST[ 'swpsmtp_enable_domain_check' ] ) ? 1 : false;
170
- if ( isset( $_POST[ 'swpsmtp_allowed_domains' ] ) ) {
171
- $swpsmtp_options[ 'block_all_emails' ] = isset( $_POST[ 'swpsmtp_block_all_emails' ] ) ? 1 : false;
172
- $swpsmtp_options[ 'allowed_domains' ] = base64_encode( sanitize_text_field( $_POST[ 'swpsmtp_allowed_domains' ] ) );
173
- } else if ( ! isset( $swpsmtp_options[ 'allowed_domains' ] ) ) {
174
- $swpsmtp_options[ 'allowed_domains' ] = '';
175
- }
176
-
177
- /* Check value from "SMTP port" option */
178
- if ( isset( $_POST[ 'swpsmtp_smtp_port' ] ) ) {
179
- if ( empty( $_POST[ 'swpsmtp_smtp_port' ] ) || 1 > intval( $_POST[ 'swpsmtp_smtp_port' ] ) || ( ! preg_match( '/^\d+$/', $_POST[ 'swpsmtp_smtp_port' ] ) ) ) {
180
- $swpsmtp_options[ 'smtp_settings' ][ 'port' ] = '25';
181
- $error .= " " . __( "Please enter a valid port in the 'SMTP Port' field.", 'easy-wp-smtp' );
182
- } else {
183
- $swpsmtp_options[ 'smtp_settings' ][ 'port' ] = sanitize_text_field( $_POST[ 'swpsmtp_smtp_port' ] );
184
- }
185
- }
186
-
187
- /* Update settings in the database */
188
- if ( empty( $error ) ) {
189
- update_option( 'swpsmtp_options', $swpsmtp_options );
190
- $message .= __( "Settings saved.", 'easy-wp-smtp' );
191
- } else {
192
- $error .= " " . __( "Settings are not saved.", 'easy-wp-smtp' );
193
- }
194
- }
195
-
196
- /* Send test letter */
197
- $swpsmtp_to = '';
198
- if ( isset( $_POST[ 'swpsmtp_test_submit' ] ) && check_admin_referer( plugin_basename( __FILE__ ), 'swpsmtp_test_nonce_name' ) ) {
199
- if ( isset( $_POST[ 'swpsmtp_to' ] ) ) {
200
- $to_email = sanitize_text_field( $_POST[ 'swpsmtp_to' ] );
201
- if ( is_email( $to_email ) ) {
202
- $swpsmtp_to = $to_email;
203
- } else {
204
- $error .= __( "Please enter a valid email address in the recipient email field.", 'easy-wp-smtp' );
205
- }
206
- }
207
- $swpsmtp_subject = isset( $_POST[ 'swpsmtp_subject' ] ) ? sanitize_text_field( $_POST[ 'swpsmtp_subject' ] ) : '';
208
- $swpsmtp_message = isset( $_POST[ 'swpsmtp_message' ] ) ? swpsmtp_sanitize_textarea( $_POST[ 'swpsmtp_message' ] ) : '';
209
-
210
- //Save the test mail details so it doesn't need to be filled in everytime.
211
- $smtp_test_mail[ 'swpsmtp_to' ] = $swpsmtp_to;
212
- $smtp_test_mail[ 'swpsmtp_subject' ] = $swpsmtp_subject;
213
- $smtp_test_mail[ 'swpsmtp_message' ] = $swpsmtp_message;
214
- update_option( 'smtp_test_mail', $smtp_test_mail );
215
-
216
- if ( ! empty( $swpsmtp_to ) ) {
217
- $test_res = $EasyWPSMTP->test_mail( $swpsmtp_to, $swpsmtp_subject, $swpsmtp_message );
218
- }
219
- }
220
- ?>
221
-
222
- <div class="updated fade" <?php if ( empty( $message ) ) echo "style=\"display:none\""; ?>>
223
- <p><strong><?php echo $message; ?></strong></p>
224
- </div>
225
- <div class="error" <?php if ( empty( $error ) ) echo "style=\"display:none\""; ?>>
226
- <p><strong><?php echo $error; ?></strong></p>
227
- </div>
228
-
229
- <div class="nav-tab-wrapper">
230
- <a href="#smtp" data-tab-name="smtp" class="nav-tab"><?php _e( 'SMTP Settings', 'easy-wp-smtp' ); ?></a>
231
- <a href="#additional" data-tab-name="additional" class="nav-tab"><?php _e( 'Additional Settings', 'easy-wp-smtp' ); ?></a>
232
- <a href="#testemail" data-tab-name="testemail" class="nav-tab"><?php _e( 'Test Email', 'easy-wp-smtp' ); ?></a>
233
- </div>
234
-
235
- <div class="swpsmtp-settings-container">
236
- <div class="swpsmtp-settings-grid swpsmtp-settings-main-cont">
237
-
238
- <form autocomplete="off" id="swpsmtp_settings_form" method="post" action="">
239
-
240
- <input type="hidden" id="swpsmtp-urlHash" name="swpsmtp-urlHash" value="">
241
-
242
- <div class="swpsmtp-tab-container" data-tab-name="smtp">
243
- <div class="postbox">
244
- <h3 class="hndle"><label for="title"><?php _e( 'SMTP Configuration Settings', 'easy-wp-smtp' ); ?></label></h3>
245
- <div class="inside">
246
-
247
- <p><?php _e( 'You can request your hosting provider for the SMTP details of your site. Use the SMTP details provided by your hosting provider to configure the following settings.', 'easy-wp-smtp' ) ?></p>
248
-
249
- <table class="form-table">
250
- <tr valign="top">
251
- <th scope="row"><?php _e( "From Email Address", 'easy-wp-smtp' ); ?></th>
252
- <td>
253
- <input id="swpsmtp_from_email" type="text" name="swpsmtp_from_email" value="<?php echo isset( $swpsmtp_options[ 'from_email_field' ] ) ? esc_attr( $swpsmtp_options[ 'from_email_field' ] ) : ''; ?>"/><br />
254
- <p class="description"><?php _e( "This email address will be used in the 'From' field.", 'easy-wp-smtp' ); ?></p>
255
- </td>
256
- </tr>
257
- <tr valign="top">
258
- <th scope="row"><?php _e( "From Name", 'easy-wp-smtp' ); ?></th>
259
- <td>
260
- <input id="swpsmtp_from_name" type="text" name="swpsmtp_from_name" value="<?php echo isset( $swpsmtp_options[ 'from_name_field' ] ) ? esc_attr( $swpsmtp_options[ 'from_name_field' ] ) : ''; ?>"/><br />
261
- <p class="description"><?php _e( "This text will be used in the 'FROM' field", 'easy-wp-smtp' ); ?></p>
262
- <p>
263
- <label><input type="checkbox" id="swpsmtp_force_from_name_replace" name="swpsmtp_force_from_name_replace" value="1"<?php echo (isset( $swpsmtp_options[ 'force_from_name_replace' ] ) && ($swpsmtp_options[ 'force_from_name_replace' ])) ? ' checked' : ''; ?>/> <?php _e( "Force From Name Replacement", 'easy-wp-smtp' ); ?></label>
264
- </p>
265
- <p class="description"><?php _e( "When enabled, the plugin will set the above From Name for each email. Disable it if you're using contact form plugins, it will prevent the plugin from replacing form submitter's name when contact email is sent.", 'easy-wp-smtp' ); ?>
266
- <br />
267
- <?php _e( "If email's From Name is empty, the plugin will set the above value regardless.", 'easy-wp-smtp' ); ?>
268
- </p>
269
- </td>
270
- </tr>
271
- <tr valign="top">
272
- <th scope="row"><?php _e( "Reply-To Email Address", 'easy-wp-smtp' ); ?></th>
273
- <td>
274
- <input id="swpsmtp_reply_to_email" type="email" name="swpsmtp_reply_to_email" value="<?php echo isset( $swpsmtp_options[ 'reply_to_email' ] ) ? esc_attr( $swpsmtp_options[ 'reply_to_email' ] ) : ''; ?>"/><br />
275
- <p class="description"><?php _e( "Optional. This email address will be used in the 'Reply-To' field of the email. Leave it blank to use 'From' email as the reply-to value.", 'easy-wp-smtp' ); ?></p>
276
- </td>
277
- </tr>
278
- <tr class="ad_opt swpsmtp_smtp_options">
279
- <th><?php _e( 'SMTP Host', 'easy-wp-smtp' ); ?></th>
280
- <td>
281
- <input id='swpsmtp_smtp_host' type='text' name='swpsmtp_smtp_host' value='<?php echo isset( $swpsmtp_options[ 'smtp_settings' ][ 'host' ] ) ? esc_attr( $swpsmtp_options[ 'smtp_settings' ][ 'host' ] ) : ''; ?>' /><br />
282
- <p class="description"><?php _e( "Your mail server", 'easy-wp-smtp' ); ?></p>
283
- </td>
284
- </tr>
285
- <tr class="ad_opt swpsmtp_smtp_options">
286
- <th><?php _e( 'Type of Encryption', 'easy-wp-smtp' ); ?></th>
287
- <td>
288
- <label for="swpsmtp_smtp_type_encryption_1"><input type="radio" id="swpsmtp_smtp_type_encryption_1" name="swpsmtp_smtp_type_encryption" value='none' <?php if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) && 'none' == $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) echo 'checked="checked"'; ?> /> <?php _e( 'None', 'easy-wp-smtp' ); ?></label>
289
- <label for="swpsmtp_smtp_type_encryption_2"><input type="radio" id="swpsmtp_smtp_type_encryption_2" name="swpsmtp_smtp_type_encryption" value='ssl' <?php if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) && 'ssl' == $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) echo 'checked="checked"'; ?> /> <?php _e( 'SSL/TLS', 'easy-wp-smtp' ); ?></label>
290
- <label for="swpsmtp_smtp_type_encryption_3"><input type="radio" id="swpsmtp_smtp_type_encryption_3" name="swpsmtp_smtp_type_encryption" value='tls' <?php if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) && 'tls' == $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] ) echo 'checked="checked"'; ?> /> <?php _e( 'STARTTLS', 'easy-wp-smtp' ); ?></label><br />
291
- <p class="description"><?php _e( "For most servers SSL/TLS is the recommended option", 'easy-wp-smtp' ); ?></p>
292
- </td>
293
- </tr>
294
- <tr class="ad_opt swpsmtp_smtp_options">
295
- <th><?php _e( 'SMTP Port', 'easy-wp-smtp' ); ?></th>
296
- <td>
297
- <input id='swpsmtp_smtp_port' type='text' name='swpsmtp_smtp_port' value='<?php echo isset( $swpsmtp_options[ 'smtp_settings' ][ 'port' ] ) ? esc_attr( $swpsmtp_options[ 'smtp_settings' ][ 'port' ] ) : ''; ?>' /><br />
298
- <p class="description"><?php _e( "The port to your mail server", 'easy-wp-smtp' ); ?></p>
299
- </td>
300
- </tr>
301
- <tr class="ad_opt swpsmtp_smtp_options">
302
- <th><?php _e( 'SMTP Authentication', 'easy-wp-smtp' ); ?></th>
303
- <td>
304
- <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_1" name="swpsmtp_smtp_autentication" value='no' <?php if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) && 'no' == $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) echo 'checked="checked"'; ?> /> <?php _e( 'No', 'easy-wp-smtp' ); ?></label>
305
- <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_2" name="swpsmtp_smtp_autentication" value='yes' <?php if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) && 'yes' == $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) echo 'checked="checked"'; ?> /> <?php _e( 'Yes', 'easy-wp-smtp' ); ?></label><br />
306
- <p class="description"><?php _e( "This options should always be checked 'Yes'", 'easy-wp-smtp' ); ?></p>
307
- </td>
308
- </tr>
309
- <tr class="ad_opt swpsmtp_smtp_options">
310
- <th><?php _e( 'SMTP Username', 'easy-wp-smtp' ); ?></th>
311
- <td>
312
- <input id='swpsmtp_smtp_username' type='text' name='swpsmtp_smtp_username' value='<?php echo isset( $swpsmtp_options[ 'smtp_settings' ][ 'username' ] ) ? esc_attr( $swpsmtp_options[ 'smtp_settings' ][ 'username' ] ) : ''; ?>'/><br />
313
- <p class="description"><?php _e( "The username to login to your mail server", 'easy-wp-smtp' ); ?></p>
314
- </td>
315
- </tr>
316
- <tr class="ad_opt swpsmtp_smtp_options">
317
- <th><?php _e( 'SMTP Password', 'easy-wp-smtp' ); ?></th>
318
- <td>
319
- <input id='swpsmtp_smtp_password' type='password' name='swpsmtp_smtp_password' value='<?php echo ($EasyWPSMTP->get_password() !== '' ? $gag_password : ''); ?>' autocomplete='new-password' /><br />
320
- <p class="description"><?php _e( "The password to login to your mail server", 'easy-wp-smtp' ); ?></p>
321
- <p class="description"><b><?php _ex( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ); ?></b> <?php _e( 'when you click "Save Changes", your actual password is stored in the database and then used to send emails. This field is replaced with a gag (#easywpsmtpgagpass#). This is done to prevent someone with the access to Settings page from seeing your password (using password fields unmasking programs, for example).', 'easy-wp-smtp' ); ?></p>
322
- </td>
323
- </tr>
324
- </table>
325
- <p class="submit">
326
- <input type="submit" id="settings-form-submit" class="button-primary" value="<?php _e( 'Save Changes', 'easy-wp-smtp' ) ?>" />
327
- <input type="hidden" name="swpsmtp_form_submit" value="submit" />
328
- <?php wp_nonce_field( plugin_basename( __FILE__ ), 'swpsmtp_nonce_name' ); ?>
329
- </p>
330
- </div><!-- end of inside -->
331
- </div><!-- end of postbox -->
332
- </div>
333
-
334
- <div class="swpsmtp-tab-container" data-tab-name="additional">
335
- <div class="postbox">
336
- <h3 class="hndle"><label for="title"><?php _e( 'Additional Settings (Optional)', 'easy-wp-smtp' ); ?></label></h3>
337
- <div class="inside">
338
- <table class="form-table">
339
- <tr valign="top">
340
- <th scope="row"><?php _e( "Don't Replace \"From\" Field", 'easy-wp-smtp' ); ?></th>
341
- <td>
342
- <input id="swpsmtp_email_ignore_list" type="text" name="swpsmtp_email_ignore_list" value="<?php echo isset( $swpsmtp_options[ 'email_ignore_list' ] ) ? esc_attr( $swpsmtp_options[ 'email_ignore_list' ] ) : ''; ?>"/><br />
343
- <p class="description"><?php _e( "Comma separated emails list. Example value: email1@domain.com, email2@domain.com", "easy-wp-smtp" ); ?></p>
344
- <p class="description"><?php _e( "This option is useful when you are using several email aliases on your SMTP server. If you don't want your aliases to be replaced by the address specified in \"From\" field, enter them in this field.", 'easy-wp-smtp' ); ?></p>
345
- </td>
346
- </tr>
347
- <tr valign="top">
348
- <th scope="row"><?php _e( "Enable Domain Check", 'easy-wp-smtp' ); ?></th>
349
- <td>
350
- <input id="swpsmtp_enable_domain_check" type="checkbox" id="swpsmtp_enable_domain_check" name="swpsmtp_enable_domain_check" value="1"<?php echo (isset( $swpsmtp_options[ 'enable_domain_check' ] ) && ($swpsmtp_options[ 'enable_domain_check' ])) ? ' checked' : ''; ?>/>
351
- <p class="description"><?php _e( "This option is usually used by developers only. SMTP settings will be used only if the site is running on following domain(s):", 'easy-wp-smtp' ); ?></p>
352
- <input id="swpsmtp_allowed_domains" type="text" name="swpsmtp_allowed_domains" value="<?php echo SWPSMTPUtils::base64_decode_maybe( $swpsmtp_options[ 'allowed_domains' ] ); ?>"<?php echo (isset( $swpsmtp_options[ 'enable_domain_check' ] ) && ($swpsmtp_options[ 'enable_domain_check' ])) ? '' : ' disabled'; ?>/>
353
- <p class="description"><?php _e( "Coma-separated domains list. Example: domain1.com, domain2.com", 'easy-wp-smtp' ); ?></p>
354
- <p>
355
- <label><input type="checkbox" id="swpsmtp_block_all_emails" name="swpsmtp_block_all_emails" value="1"<?php echo (isset( $swpsmtp_options[ 'block_all_emails' ] ) && ($swpsmtp_options[ 'block_all_emails' ])) ? ' checked' : ''; ?><?php echo (isset( $swpsmtp_options[ 'enable_domain_check' ] ) && ($swpsmtp_options[ 'enable_domain_check' ])) ? '' : ' disabled'; ?>/> <?php _e( 'Block all emails', 'easy-wp-smtp' ); ?></label>
356
- </p>
357
- <p class="description"><?php _e( "When enabled, plugin attempts to block ALL emails from being sent out if domain mismtach." ); ?></p>
358
- </td>
359
- </tr>
360
- <tr valign="top">
361
- <th scope="row"><?php _e( "Encrypt Password", 'easy-wp-smtp' ); ?></th>
362
- <td>
363
- <?php if ( $enc_req_met ) { ?>
364
- <input id="swpsmtp_encrypt_pass" type="checkbox" name="swpsmtp_encrypt_pass" value="1" <?php echo (isset( $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] ) && ($swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ])) ? 'checked' : ''; ?>/>
365
- <p class="description"><?php _e( "When enabled, your SMTP password is stored in the database using AES-256 encryption.", 'easy-wp-smtp' ); ?></p>
366
- <?php } else { ?>
367
- <p style="color: red;"><?php echo $enc_req_err; ?></p>
368
- <?php } ?>
369
- </td>
370
- </tr>
371
- <tr valign="top">
372
- <th scope="row"><?php _e( "Allow Insecure SSL Certificates", 'easy-wp-smtp' ); ?></th>
373
- <td>
374
- <input id="swpsmtp_insecure_ssl" type="checkbox" name="swpsmtp_insecure_ssl" value="1" <?php echo (isset( $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] ) && ($swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ])) ? 'checked' : ''; ?>/>
375
- <p class="description"><?php _e( "Allows insecure and self-signed SSL certificates on SMTP server. It's highly recommended to keep this option disabled.", 'easy-wp-smtp' ); ?></p>
376
- </td>
377
- </tr>
378
- <tr valign="top">
379
- <th scope="row"><?php _e( "Enable Debug Log", 'easy-wp-smtp' ); ?></th>
380
- <td>
381
- <input id="swpsmtp_enable_debug" type="checkbox" name="swpsmtp_enable_debug" value="1" <?php echo (isset( $swpsmtp_options[ 'smtp_settings' ][ 'enable_debug' ] ) && ($swpsmtp_options[ 'smtp_settings' ][ 'enable_debug' ])) ? 'checked' : ''; ?>/>
382
- <p class="description"><?php _e( "Check this box to enable mail debug log", 'easy-wp-smtp' ); ?></p>
383
- <a href="<?php echo admin_url(); ?>?swpsmtp_action=view_log" target="_blank"><?php _e( 'View Log', 'easy-wp-smtp' ); ?></a> | <a style="color: red;" id="swpsmtp_clear_log_btn" href="#0"><?php _e( 'Clear Log', 'easy-wp-smtp' ); ?></a>
384
- </td>
385
- </tr>
386
- </table>
387
- <p class="submit">
388
- <input type="submit" id="additional-settings-form-submit" class="button-primary" value="<?php _e( 'Save Changes', 'easy-wp-smtp' ) ?>" />
389
- </p>
390
-
391
- </div><!-- end of inside -->
392
- </div><!-- end of postbox -->
393
-
394
- <div class="postbox">
395
- <h3 class="hndle"><label for="title"><?php _e( 'Danger Zone', 'easy-wp-smtp' ); ?></label></h3>
396
- <div class="inside">
397
- <p><?php _e( 'Actions in this section can (and some of them will) erase or mess up your settings. Use it with caution.', 'easy-wp-smtp' ); ?></p>
398
- <table class="form-table">
399
- <tr valign="top">
400
- <th scope="row"><?php _e( 'Export\Import Settings', 'easy-wp-smtp' ); ?></th>
401
- <td>
402
- <button id="swpsmtp_export_settings_btn" type="button" class="button"><?php _e( 'Export Settings', 'easy-wp-smtp' ); ?></button>
403
- <p class="description"><?php _e( "Use this to export plugin settings to a file.", 'easy-wp-smtp' ); ?></p>
404
- <p></p>
405
- <button id="swpsmtp_import_settings_btn" type="button" class="button"><?php _e( 'Import Settings', 'easy-wp-smtp' ); ?></button>
406
- <p class="description"><?php _e( "Use this to import plugin settings from a file. Note this would replace all your existing settings, so use with caution.", 'easy-wp-smtp' ); ?></p>
407
- </td>
408
- </tr>
409
- <tr valign="top">
410
- <th scope="row"><?php _e( 'Delete Settings and Deactivate Plugin', 'easy-wp-smtp' ); ?></th>
411
- <td>
412
- <button id="swpsmtp_self_destruct_btn" style="color: red;" type="button" class="button button-secondary">>>> <?php _e( 'Self-destruct', 'easy-wp-smtp' ); ?> <<<</button>
413
- <p class="description"><?php _e( "This will remove ALL your settings and deactivate the plugin. Useful when you're uninstalling the plugin and want to completely remove all crucial data stored in the database.", 'easy-wp-smtp' ); ?></p>
414
- <p style="color: red; font-weight: bold;"><?php _e( "Warning! This can't be undone.", 'easy-wp-smtp' ); ?></p>
415
- </td>
416
- </tr>
417
- </table>
418
- </div>
419
- </div>
420
-
421
- </div>
422
- </form>
423
-
424
- <form id="swpsmtp_export_settings_frm" style="display: none;" method="POST">
425
- <input type="hidden" name="swpsmtp_export_settings" value="1">
426
- </form>
427
-
428
- <form id="swpsmtp_import_settings_frm" style="display: none;" method="POST" enctype="multipart/form-data">
429
- <input type="hidden" name="swpsmtp_import_settings" value="1">
430
- <input id="swpsmtp_import_settings_select_file" type="file" name="swpsmtp_import_settings_file">
431
- </form>
432
-
433
- <div class="swpsmtp-tab-container" data-tab-name="testemail">
434
- <div class="postbox">
435
- <h3 class="hndle"><label for="title"><?php _e( 'Test Email', 'easy-wp-smtp' ); ?></label></h3>
436
- <div class="inside">
437
- <div id="swpsmtp-save-settings-notice" class="swpsmtp-msg-cont msg-error"><b><?php _ex( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ); ?></b> <?php _e( 'You have unsaved settings. In order to send a test email, you need to go back to previous tab and click "Save Changes" button first.', 'easy-wp-smtp' ); ?></div>
438
-
439
- <?php
440
- if ( isset( $test_res ) && is_array( $test_res ) ) {
441
- if ( isset( $test_res[ 'error' ] ) ) {
442
- $errmsg_class = ' msg-error';
443
- $errmsg_text = '<b>' . __( 'Following error occurred when attempting to send test email:', 'easy-wp-smtp' ) . '</b><br />' . $test_res[ 'error' ];
444
- } else {
445
- $errmsg_class = ' msg-success';
446
- $errmsg_text = '<b>' . __( 'Test email was successfully sent. No errors occurred during the process.', 'easy-wp-smtp' ) . '</b>';
447
- }
448
- ?>
449
-
450
- <div class="swpsmtp-msg-cont<?php echo $errmsg_class; ?>">
451
- <?php echo $errmsg_text; ?>
452
-
453
- <?php
454
- if ( isset( $test_res[ 'debug_log' ] ) ) {
455
- ?>
456
- <br /><br />
457
- <a id="swpsmtp-show-hide-log-btn" href="#0"><?php _e( 'Show Debug Log', 'easy-wp-smtp' ); ?></a>
458
- <p id="swpsmtp-debug-log-cont"><textarea rows="20" style="width: 100%;"><?php echo $test_res[ 'debug_log' ]; ?></textarea></p>
459
- <script>
460
- jQuery(function ($) {
461
- $('#swpsmtp-show-hide-log-btn').click(function (e) {
462
- e.preventDefault();
463
- var logCont = $('#swpsmtp-debug-log-cont');
464
- if (logCont.is(':visible')) {
465
- $(this).html('<?php echo esc_attr( __( 'Show Debug Log', 'easy-wp-smtp' ) ); ?>');
466
- } else {
467
- $(this).html('<?php echo esc_attr( __( 'Hide Debug Log', 'easy-wp-smtp' ) ); ?>');
468
- }
469
- logCont.toggle();
470
- });
471
- <?php if ( isset( $test_res[ 'error' ] ) ) {
472
- ?>
473
- $('#swpsmtp-show-hide-log-btn').click();
474
- <?php }
475
- ?>
476
- });
477
- </script>
478
- <?php
479
- }
480
- ?>
481
- </div>
482
- <?php
483
- }
484
- ?>
485
-
486
- <p><?php _e( 'You can use this section to send an email from your server using the above configured SMTP details to see if the email gets delivered.', 'easy-wp-smtp' ); ?></p>
487
- <p><b><?php _ex( 'Note:', '"Note" as in "Note: keep this in mind"', 'easy-wp-smtp' ); ?></b> <?php _e( 'debug log for this test email will be automatically displayed right after you send it. Test email also ignores "Enable Domain Check" option.', 'easy-wp-smtp' ); ?></p>
488
-
489
- <form id="swpsmtp_settings_test_email_form" method="post" action="">
490
- <table class="form-table">
491
- <tr valign="top">
492
- <th scope="row"><?php _e( "To", 'easy-wp-smtp' ); ?>:</th>
493
- <td>
494
- <input id="swpsmtp_to" type="text" class="ignore-change" name="swpsmtp_to" value="<?php echo esc_html( $smtp_test_mail[ 'swpsmtp_to' ] ); ?>" /><br />
495
- <p class="description"><?php _e( "Enter the recipient's email address", 'easy-wp-smtp' ); ?></p>
496
- </td>
497
- </tr>
498
- <tr valign="top">
499
- <th scope="row"><?php _e( "Subject", 'easy-wp-smtp' ); ?>:</th>
500
- <td>
501
- <input id="swpsmtp_subject" type="text" class="ignore-change" name="swpsmtp_subject" value="<?php echo esc_html( $smtp_test_mail[ 'swpsmtp_subject' ] ); ?>" /><br />
502
- <p class="description"><?php _e( "Enter a subject for your message", 'easy-wp-smtp' ); ?></p>
503
- </td>
504
- </tr>
505
- <tr valign="top">
506
- <th scope="row"><?php _e( "Message", 'easy-wp-smtp' ); ?>:</th>
507
- <td>
508
- <textarea name="swpsmtp_message" id="swpsmtp_message" rows="5"><?php echo stripslashes( esc_textarea( $smtp_test_mail[ 'swpsmtp_message' ] ) ); ?></textarea><br />
509
- <p class="description"><?php _e( "Write your email message", 'easy-wp-smtp' ); ?></p>
510
- </td>
511
- </tr>
512
- </table>
513
- <p class="submit">
514
- <input type="submit" id="test-email-form-submit" class="button-primary" value="<?php _e( 'Send Test Email', 'easy-wp-smtp' ) ?>" />
515
- <input type="hidden" name="swpsmtp_test_submit" value="submit" />
516
- <?php wp_nonce_field( plugin_basename( __FILE__ ), 'swpsmtp_test_nonce_name' ); ?>
517
- <span id="swpsmtp-spinner" class="spinner"></span>
518
- </p>
519
- </form>
520
- </div><!-- end of inside -->
521
- </div><!-- end of postbox -->
522
-
523
- </div>
524
- </div>
525
- <div class="swpsmtp-settings-grid swpsmtp-settings-sidebar-cont">
526
- <div class="postbox" style="min-width: inherit;">
527
- <h3 class="hndle"><label for="title"><?php _e( "Documentation", 'easy-wp-smtp' ); ?></label></h3>
528
- <div class="inside">
529
- <?php echo sprintf( _x( "Please visit the %s plugin's documentation page to learn how to use this plugin.", '%s is replaced by <a target="_blank" href="https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197">Easy WP SMTP</a>', 'easy-wp-smtp' ), '<a target="_blank" href="https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197">Easy WP SMTP</a>' ); ?>
530
- </div>
531
- </div>
532
- <div class="postbox" style="min-width: inherit;">
533
- <h3 class="hndle"><label for="title"><?php _e( "Support", 'easy-wp-smtp' ); ?></label></h3>
534
- <div class="inside">
535
- <?php echo sprintf( _x( "Having issues or difficulties? You can post your issue on the %s", '%s is replaced by "Support Forum" link', 'easy-wp-smtp' ), sprintf( '<a href="https://wordpress.org/support/plugin/easy-wp-smtp/" target="_blank">%s</a>', __( 'Support Forum', 'easy-wp-smtp' ) ) ); ?>
536
- </div>
537
- </div>
538
- <div class="postbox" style="min-width: inherit;">
539
- <h3 class="hndle"><label for="title"><?php _e( "Rate Us", 'easy-wp-smtp' ); ?></label></h3>
540
- <div class="inside">
541
- <?php echo sprintf( _x( 'Like the plugin? Please give us a %s', '%s is replaced by "rating" link', 'easy-wp-smtp' ), sprintf( '<a href="https://wordpress.org/support/plugin/easy-wp-smtp/reviews/#new-post" target="_blank">%s</a>', __( 'rating', 'easy-wp-smtp' ) ) ); ?>
542
- <div class="swpsmtp-stars-container">
543
- <a href="https://wordpress.org/support/plugin/easy-wp-smtp/reviews/?filter=5" target="_blank"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
544
- </a>
545
- </div>
546
- </div>
547
- </div>
548
- </div>
549
- </div>
550
-
551
- <?php
552
- echo '</div></div>'; //<!-- end of #poststuff and #post-body -->
553
- echo '</div>'; //<!-- end of .wrap #swpsmtp-mail .swpsmtp-mail -->
554
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
easy-wp-smtp-utils.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- use ioncube\phpOpensslCryptor\Cryptor;
4
-
5
- class SWPSMTPUtils {
6
-
7
- var $enc_key;
8
- protected static $instance = null;
9
-
10
- function __construct() {
11
- require_once('inc/Cryptor.php');
12
- $key = get_option( 'swpsmtp_enc_key', false );
13
- if ( empty( $key ) ) {
14
- $key = wp_salt();
15
- update_option( 'swpsmtp_enc_key', $key );
16
- }
17
- $this->enc_key = $key;
18
- }
19
-
20
- public static function get_instance() {
21
-
22
- // If the single instance hasn't been set, set it now.
23
- if ( null == self::$instance ) {
24
- self::$instance = new self;
25
- }
26
-
27
- return self::$instance;
28
- }
29
-
30
- static function base64_decode_maybe( $str ) {
31
- if ( ! function_exists( 'mb_detect_encoding' ) ) {
32
- return base64_decode( $str );
33
- }
34
- if ( mb_detect_encoding( $str ) === mb_detect_encoding( base64_decode( base64_encode( base64_decode( $str ) ) ) ) ) {
35
- $str = base64_decode( $str );
36
- }
37
- return $str;
38
- }
39
-
40
- function encrypt_password( $pass ) {
41
- if ( $pass === '' ) {
42
- return '';
43
- }
44
-
45
- $password = Cryptor::Encrypt( $pass, $this->enc_key );
46
- return $password;
47
- }
48
-
49
- function decrypt_password( $pass ) {
50
-
51
- $password = Cryptor::Decrypt( $pass, $this->enc_key );
52
- return $password;
53
- }
54
-
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
easy-wp-smtp.php CHANGED
@@ -1,598 +1,595 @@
1
- <?php
2
- /*
3
- Plugin Name: Easy WP SMTP
4
- Version: 1.3.9.1
5
- Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
6
- Author: wpecommerce, alexanderfoxc
7
- Author URI: https://wp-ecommerce.net/
8
- Description: Send email via SMTP from your WordPress Blog
9
- Text Domain: easy-wp-smtp
10
- Domain Path: /languages
11
- */
12
-
13
- //Prefix/Slug - swpsmtp
14
-
15
- class EasyWPSMTP {
16
-
17
- var $opts;
18
- var $plugin_file;
19
- protected static $instance = null;
20
-
21
- function __construct() {
22
- $this->opts = get_option( 'swpsmtp_options' );
23
- $this->opts = ! is_array( $this->opts ) ? array() : $this->opts;
24
- $this->plugin_file = __FILE__;
25
- require_once('easy-wp-smtp-utils.php');
26
-
27
- add_action( 'plugins_loaded', array( $this, 'plugins_loaded_handler' ) );
28
- add_filter( 'wp_mail', array( $this, 'wp_mail' ), 2147483647 );
29
- add_action( 'phpmailer_init', array( $this, 'init_smtp' ), 999 );
30
- add_action( 'admin_init', array( $this, 'admin_init' ) );
31
-
32
- if ( is_admin() && ! (defined( 'DOING_AJAX' ) && DOING_AJAX) ) {
33
- require_once('easy-wp-smtp-admin-menu.php');
34
- register_activation_hook( __FILE__, array( $this, 'activate' ) );
35
- register_uninstall_hook( __FILE__, 'swpsmtp_uninstall' );
36
- add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
37
- add_filter( 'plugin_row_meta', array( $this, 'register_plugin_links' ), 10, 2 );
38
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
39
- }
40
- }
41
-
42
- public static function get_instance() {
43
-
44
- if ( null == self::$instance ) {
45
- self::$instance = new self;
46
- }
47
-
48
- return self::$instance;
49
- }
50
-
51
- function wp_mail( $args ) {
52
- $domain = $this->is_domain_blocked();
53
- if ( $domain !== false && (isset( $this->opts[ 'block_all_emails' ] ) && $this->opts[ 'block_all_emails' ] === 1) ) {
54
- $this->log(
55
- "\r\n------------------------------------------------------------------------------------------------------\r\n" .
56
- "Domain check failed: website domain (" . $domain . ") is not in allowed domains list.\r\n" .
57
- "Following email not sent (block all emails option is enabled):\r\n" .
58
- "To: " . $args[ 'to' ] . "; Subject: " . $args[ 'subject' ] . "\r\n" .
59
- "------------------------------------------------------------------------------------------------------\r\n\r\n" );
60
- }
61
- return $args;
62
- }
63
-
64
- function init_smtp( &$phpmailer ) {
65
- //check if SMTP credentials have been configured.
66
- if ( ! $this->credentials_configured() ) {
67
- return;
68
- }
69
- //check if Domain Check enabled
70
- $domain = $this->is_domain_blocked();
71
- if ( $domain !== false ) {
72
- //domain check failed
73
- //let's check if we have block all emails option enabled
74
- if ( isset( $this->opts[ 'block_all_emails' ] ) && $this->opts[ 'block_all_emails' ] === 1 ) {
75
- // it's enabled. Let's use gag mailer class that would prevent emails from being sent out.
76
- $phpmailer = new swpsmtp_gag_mailer();
77
- } else {
78
- // it's disabled. Let's write some info to the log
79
- $this->log(
80
- "\r\n------------------------------------------------------------------------------------------------------\r\n" .
81
- "Domain check failed: website domain (" . $domain . ") is not in allowed domains list.\r\n" .
82
- "SMTP settings won't be used.\r\n" .
83
- "------------------------------------------------------------------------------------------------------\r\n\r\n" );
84
- }
85
- return;
86
- }
87
-
88
- /* Set the mailer type as per config above, this overrides the already called isMail method */
89
- $phpmailer->IsSMTP();
90
- if ( isset( $this->opts[ 'force_from_name_replace' ] ) && $this->opts[ 'force_from_name_replace' ] === 1 ) {
91
- $from_name = $this->opts[ 'from_name_field' ];
92
- } else {
93
- $from_name = ! empty( $phpmailer->FromName ) ? $phpmailer->FromName : $this->opts[ 'from_name_field' ];
94
- }
95
- $from_email = $this->opts[ 'from_email_field' ];
96
- //set ReplyTo option if needed
97
- //this should be set before SetFrom, otherwise might be ignored
98
- if ( ! empty( $this->opts[ 'reply_to_email' ] ) ) {
99
- $phpmailer->AddReplyTo( $this->opts[ 'reply_to_email' ], $from_name );
100
- }
101
- // let's see if we have email ignore list populated
102
- if ( isset( $this->opts[ 'email_ignore_list' ] ) && ! empty( $this->opts[ 'email_ignore_list' ] ) ) {
103
- $emails_arr = explode( ',', $this->opts[ 'email_ignore_list' ] );
104
- if ( is_array( $emails_arr ) && ! empty( $emails_arr ) ) {
105
- //we have coma-separated list
106
- } else {
107
- //it's single email
108
- unset( $emails_arr );
109
- $emails_arr = array( $this->opts[ 'email_ignore_list' ] );
110
- }
111
- $from = $phpmailer->From;
112
- $match_found = false;
113
- foreach ( $emails_arr as $email ) {
114
- if ( strtolower( trim( $email ) ) === strtolower( trim( $from ) ) ) {
115
- $match_found = true;
116
- break;
117
- }
118
- }
119
- if ( $match_found ) {
120
- //we should not override From and Fromname
121
- $from_email = $phpmailer->From;
122
- $from_name = $phpmailer->FromName;
123
- }
124
- }
125
- $phpmailer->From = $from_email;
126
- $phpmailer->FromName = $from_name;
127
- $phpmailer->SetFrom( $phpmailer->From, $phpmailer->FromName );
128
- //This should set Return-Path header for servers that are not properly handling it, but needs testing first
129
- //$phpmailer->Sender = $phpmailer->From;
130
- /* Set the SMTPSecure value */
131
- if ( $this->opts[ 'smtp_settings' ][ 'type_encryption' ] !== 'none' ) {
132
- $phpmailer->SMTPSecure = $this->opts[ 'smtp_settings' ][ 'type_encryption' ];
133
- }
134
-
135
- /* Set the other options */
136
- $phpmailer->Host = $this->opts[ 'smtp_settings' ][ 'host' ];
137
- $phpmailer->Port = $this->opts[ 'smtp_settings' ][ 'port' ];
138
-
139
- /* If we're using smtp auth, set the username & password */
140
- if ( 'yes' == $this->opts[ 'smtp_settings' ][ 'autentication' ] ) {
141
- $phpmailer->SMTPAuth = true;
142
- $phpmailer->Username = $this->opts[ 'smtp_settings' ][ 'username' ];
143
- $phpmailer->Password = $this->get_password();
144
- }
145
- //PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate.
146
- $phpmailer->SMTPAutoTLS = false;
147
-
148
- if ( isset( $this->opts[ 'smtp_settings' ][ 'insecure_ssl' ] ) && $this->opts[ 'smtp_settings' ][ 'insecure_ssl' ] !== false ) {
149
- // Insecure SSL option enabled
150
- $phpmailer->SMTPOptions = array(
151
- 'ssl' => array(
152
- 'verify_peer' => false,
153
- 'verify_peer_name' => false,
154
- 'allow_self_signed' => true
155
- ) );
156
- }
157
-
158
- if ( isset( $this->opts[ 'smtp_settings' ][ 'enable_debug' ] ) && $this->opts[ 'smtp_settings' ][ 'enable_debug' ] ) {
159
- $phpmailer->Debugoutput = function($str, $level) {
160
- $this->log( $str );
161
- };
162
- $phpmailer->SMTPDebug = 1;
163
- }
164
- //set reasonable timeout
165
- $phpmailer->Timeout = 10;
166
- }
167
-
168
- function test_mail( $to_email, $subject, $message ) {
169
- $ret = array();
170
- if ( ! $this->credentials_configured() ) {
171
- return false;
172
- }
173
-
174
- require_once( ABSPATH . WPINC . '/class-phpmailer.php' );
175
- $mail = new PHPMailer( true );
176
-
177
- try {
178
-
179
- $charset = get_bloginfo( 'charset' );
180
- $mail->CharSet = $charset;
181
-
182
- $from_name = $this->opts[ 'from_name_field' ];
183
- $from_email = $this->opts[ 'from_email_field' ];
184
-
185
- $mail->IsSMTP();
186
-
187
- // send plain text test email
188
- $mail->ContentType = 'text/plain';
189
- $mail->IsHTML( false );
190
-
191
- /* If using smtp auth, set the username & password */
192
- if ( 'yes' == $this->opts[ 'smtp_settings' ][ 'autentication' ] ) {
193
- $mail->SMTPAuth = true;
194
- $mail->Username = $this->opts[ 'smtp_settings' ][ 'username' ];
195
- $mail->Password = $this->get_password();
196
- }
197
-
198
- /* Set the SMTPSecure value, if set to none, leave this blank */
199
- if ( $this->opts[ 'smtp_settings' ][ 'type_encryption' ] !== 'none' ) {
200
- $mail->SMTPSecure = $this->opts[ 'smtp_settings' ][ 'type_encryption' ];
201
- }
202
-
203
- /* PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate. */
204
- $mail->SMTPAutoTLS = false;
205
-
206
- if ( isset( $this->opts[ 'smtp_settings' ][ 'insecure_ssl' ] ) && $this->opts[ 'smtp_settings' ][ 'insecure_ssl' ] !== false ) {
207
- // Insecure SSL option enabled
208
- $mail->SMTPOptions = array(
209
- 'ssl' => array(
210
- 'verify_peer' => false,
211
- 'verify_peer_name' => false,
212
- 'allow_self_signed' => true
213
- ) );
214
- }
215
-
216
- /* Set the other options */
217
- $mail->Host = $this->opts[ 'smtp_settings' ][ 'host' ];
218
- $mail->Port = $this->opts[ 'smtp_settings' ][ 'port' ];
219
- if ( ! empty( $this->opts[ 'reply_to_email' ] ) ) {
220
- $mail->AddReplyTo( $this->opts[ 'reply_to_email' ], $from_name );
221
- }
222
- $mail->SetFrom( $from_email, $from_name );
223
- //This should set Return-Path header for servers that are not properly handling it, but needs testing first
224
- //$mail->Sender = $mail->From;
225
- $mail->Subject = $subject;
226
- $mail->Body = $message;
227
- $mail->AddAddress( $to_email );
228
- global $debugMSG;
229
- $debugMSG = '';
230
- $mail->Debugoutput = function($str, $level) {
231
- global $debugMSG;
232
- $debugMSG .= $str;
233
- };
234
- $mail->SMTPDebug = 1;
235
- //set reasonable timeout
236
- $mail->Timeout = 10;
237
-
238
- /* Send mail and return result */
239
- $mail->Send();
240
- $mail->ClearAddresses();
241
- $mail->ClearAllRecipients();
242
- } catch ( Exception $e ) {
243
- $ret[ 'error' ] = $mail->ErrorInfo;
244
- }
245
-
246
- $ret[ 'debug_log' ] = $debugMSG;
247
-
248
- return $ret;
249
- }
250
-
251
- function admin_init() {
252
- if ( current_user_can( 'manage_options' ) ) {
253
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
254
- add_action( 'wp_ajax_swpsmtp_clear_log', array( $this, 'clear_log' ) );
255
- add_action( 'wp_ajax_swpsmtp_self_destruct', array( $this, 'self_destruct_handler' ) );
256
- }
257
- //view log file
258
- if ( isset( $_GET[ 'swpsmtp_action' ] ) ) {
259
- if ( $_GET[ 'swpsmtp_action' ] === 'view_log' ) {
260
- $log_file_name = $this->opts[ 'smtp_settings' ][ 'log_file_name' ];
261
- if ( ! file_exists( plugin_dir_path( __FILE__ ) . $log_file_name ) ) {
262
- if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n" ) === false ) {
263
- wp_die( 'Can\'t write to log file. Check if plugin directory (' . plugin_dir_path( __FILE__ ) . ') is writeable.' );
264
- };
265
- }
266
- $logfile = fopen( plugin_dir_path( __FILE__ ) . $log_file_name, 'rb' );
267
- if ( ! $logfile ) {
268
- wp_die( 'Can\'t open log file.' );
269
- }
270
- header( 'Content-Type: text/plain' );
271
- fpassthru( $logfile );
272
- die;
273
- }
274
- }
275
-
276
- //check if this is export settings request
277
- $is_export_settings = filter_input( INPUT_POST, 'swpsmtp_export_settings', FILTER_SANITIZE_NUMBER_INT );
278
- if ( $is_export_settings ) {
279
- $data = array();
280
- $opts = get_option( 'swpsmtp_options', array() );
281
- $data[ 'swpsmtp_options' ] = $opts;
282
- $swpsmtp_pass_encrypted = get_option( 'swpsmtp_pass_encrypted', false );
283
- $data[ 'swpsmtp_pass_encrypted' ] = $swpsmtp_pass_encrypted;
284
- if ( $swpsmtp_pass_encrypted ) {
285
- $swpsmtp_enc_key = get_option( 'swpsmtp_enc_key', false );
286
- $data[ 'swpsmtp_enc_key' ] = $swpsmtp_enc_key;
287
- }
288
- $smtp_test_mail = get_option( 'smtp_test_mail', array() );
289
- $data[ 'smtp_test_mail' ] = $smtp_test_mail;
290
- $out = array();
291
- $out[ 'data' ] = serialize( $data );
292
- $out[ 'ver' ] = 1;
293
- $out[ 'checksum' ] = md5( $out[ 'data' ] );
294
-
295
- $filename = 'easy_wp_smtp_settings.txt';
296
- header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
297
- header( 'Content-Type: text/plain' );
298
- echo serialize( $out );
299
- exit;
300
- }
301
-
302
- $is_import_settings = filter_input( INPUT_POST, 'swpsmtp_import_settings', FILTER_SANITIZE_NUMBER_INT );
303
- if ( $is_import_settings ) {
304
- $err_msg = __( 'Error occurred during settings import', 'easy-wp-smtp' );
305
- if ( empty( $_FILES[ 'swpsmtp_import_settings_file' ] ) ) {
306
- echo $err_msg;
307
- wp_die();
308
- }
309
- $in_raw = file_get_contents( $_FILES[ 'swpsmtp_import_settings_file' ][ 'tmp_name' ] );
310
- try {
311
- $in = unserialize( $in_raw );
312
- if ( empty( $in[ 'data' ] ) ) {
313
- echo $err_msg;
314
- wp_die();
315
- }
316
- if ( empty( $in[ 'checksum' ] ) ) {
317
- echo $err_msg;
318
- wp_die();
319
- }
320
- if ( md5( $in[ 'data' ] ) !== $in[ 'checksum' ] ) {
321
- echo $err_msg;
322
- wp_die();
323
- }
324
- $data = unserialize( $in[ 'data' ] );
325
- update_option( 'swpsmtp_options', $data[ 'swpsmtp_options' ] );
326
- update_option( 'swpsmtp_pass_encrypted', $data[ 'swpsmtp_pass_encrypted' ] );
327
- if ( $data[ 'swpsmtp_pass_encrypted' ] ) {
328
- update_option( 'swpsmtp_enc_key', $data[ 'swpsmtp_enc_key' ] );
329
- }
330
- update_option( 'smtp_test_mail', $data[ 'smtp_test_mail' ] );
331
- set_transient( 'easy_wp_smtp_settings_import_success', true, 60 * 60 );
332
- $url = admin_url() . 'options-general.php?page=swpsmtp_settings';
333
- wp_safe_redirect( $url );
334
- exit;
335
- } catch ( Exception $ex ) {
336
- echo $err_msg;
337
- wp_die();
338
- }
339
- }
340
- }
341
- }
342
-
343
- function admin_notices() {
344
- if ( ! $this->credentials_configured() ) {
345
- $settings_url = admin_url() . 'options-general.php?page=swpsmtp_settings';
346
- ?>
347
- <div class="error">
348
- <p><?php printf( __( 'Please configure your SMTP credentials in the <a href="%s">settings menu</a> in order to send email using Easy WP SMTP plugin.', 'easy-wp-smtp' ), esc_url( $settings_url ) ); ?></p>
349
- </div>
350
- <?php
351
- }
352
-
353
- $settings_import_notice = get_transient( 'easy_wp_smtp_settings_import_success' );
354
- if ( $settings_import_notice ) {
355
- delete_transient( 'easy_wp_smtp_settings_import_success' );
356
- ?>
357
- <div class="updated">
358
- <p><?php _e( 'Settings have been imported successfully.', 'easy-wp-smtp' ); ?></p>
359
- </div>
360
- <?php
361
- }
362
- }
363
-
364
- function clear_log() {
365
- if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n", true ) !== false ) {
366
- echo '1';
367
- } else {
368
- echo 'Can\'t clear log - log file is not writeable.';
369
- }
370
- die;
371
- }
372
-
373
- function log( $str, $overwrite = false ) {
374
- if ( isset( $this->opts[ 'smtp_settings' ] [ 'log_file_name' ]
375
- ) ) {
376
- $log_file_name = $this->
377
- opts[ 'smtp_settings' ][ 'log_file_name' ];
378
- } else {
379
- // let's generate log file name
380
- $log_file_name = uniqid() . '_debug_log.txt';
381
- $this->opts[ 'smtp_settings' ][ 'log_file_name' ] = $log_file_name;
382
- update_option( 'swpsmtp_options', $this->opts );
383
- file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, "Easy WP SMTP debug log file\r\n\r\n" );
384
- }
385
- return(file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, $str, ( ! $overwrite ? FILE_APPEND : 0 ) ));
386
- }
387
-
388
- function plugin_action_links( $links, $file ) {
389
- if ( $file == plugin_basename( $this->plugin_file ) ) {
390
- $settings_link = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
391
- array_unshift( $links, $settings_link );
392
- }
393
- return $links;
394
- }
395
-
396
- function register_plugin_links( $links, $file ) {
397
- if ( $file == plugin_basename( $this->plugin_file ) ) {
398
- $links[] = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
399
- }
400
- return $links;
401
- }
402
-
403
- function plugins_loaded_handler() {
404
- load_plugin_textdomain( 'easy-wp-smtp', false, dirname( plugin_basename( $this->plugin_file ) ) . '/languages/' );
405
- }
406
-
407
- function is_domain_blocked() {
408
- //check if Domain Check enabled
409
- if ( isset( $this->opts[ 'enable_domain_check' ] ) && $this->opts[ 'enable_domain_check' ] ) {
410
- //check if allowed domains list is not blank
411
- if ( isset( $this->opts[ 'allowed_domains' ] ) && ! empty( $this->opts[ 'allowed_domains' ] ) ) {
412
- $this->opts[ 'allowed_domains' ] = SWPSMTPUtils::base64_decode_maybe( $this->opts[ 'allowed_domains' ] );
413
- //let's see if we have one domain or coma-separated domains
414
- $domains_arr = explode( ',', $this->opts[ 'allowed_domains' ] );
415
- if ( is_array( $domains_arr ) && ! empty( $domains_arr ) ) {
416
- //we have coma-separated list
417
- } else {
418
- //it's single domain
419
- unset( $domains_arr );
420
- $domains_arr = array( $this->opts[ 'allowed_domains' ] );
421
- }
422
- $site_domain = parse_url( get_site_url(), PHP_URL_HOST );
423
- $match_found = false;
424
- foreach ( $domains_arr as $domain ) {
425
- if ( strtolower( trim( $domain ) ) === strtolower( trim( $site_domain ) ) ) {
426
- $match_found = true;
427
- break;
428
- }
429
- }
430
- if ( ! $match_found ) {
431
- return $site_domain;
432
- }
433
- }
434
- }
435
- return false;
436
- }
437
-
438
- function get_password() {
439
- $temp_password = isset( $this->opts[ 'smtp_settings' ][ 'password' ] ) ? $this->opts[ 'smtp_settings' ][ 'password' ] : '';
440
- if ( $temp_password == '' ) {
441
- return '';
442
- }
443
-
444
- try {
445
-
446
- if ( get_option( 'swpsmtp_pass_encrypted' ) ) {
447
- //this is encrypted password
448
- $cryptor = SWPSMTPUtils::get_instance();
449
- $decrypted = $cryptor->decrypt_password( $temp_password );
450
- //check if encryption option is disabled
451
- if ( empty( $this->opts[ 'smtp_settings' ][ 'encrypt_pass' ] ) ) {
452
- //it is. let's save decrypted password
453
- $this->opts[ 'smtp_settings' ][ 'password' ] = $this->encrypt_password( addslashes( $decrypted ) );
454
- update_option( 'swpsmtp_options', $this->opts );
455
- }
456
- return $decrypted;
457
- }
458
- } catch ( Exception $e ) {
459
- $this->log( $e->getMessage() );
460
- return '';
461
- }
462
-
463
- $password = "";
464
- $decoded_pass = base64_decode( $temp_password );
465
- /* no additional checks for servers that aren't configured with mbstring enabled */
466
- if ( ! function_exists( 'mb_detect_encoding' ) ) {
467
- return $decoded_pass;
468
- }
469
- /* end of mbstring check */
470
- if ( base64_encode( $decoded_pass ) === $temp_password ) { //it might be encoded
471
- if ( false === mb_detect_encoding( $decoded_pass ) ) { //could not find character encoding.
472
- $password = $temp_password;
473
- } else {
474
- $password = base64_decode( $temp_password );
475
- }
476
- } else { //not encoded
477
- $password = $temp_password;
478
- }
479
- return stripslashes( $password );
480
- }
481
-
482
- function encrypt_password( $pass ) {
483
- if ( $pass === '' ) {
484
- return '';
485
- }
486
-
487
- if ( empty( $this->opts[ 'smtp_settings' ][ 'encrypt_pass' ] ) || ! extension_loaded( 'openssl' ) ) {
488
- // no openssl extension loaded - we can't encrypt the password
489
- $password = base64_encode( $pass );
490
- update_option( 'swpsmtp_pass_encrypted', false );
491
- } else {
492
- // let's encrypt password
493
- $cryptor = SWPSMTPUtils::get_instance();
494
- $password = $cryptor->encrypt_password( $pass );
495
- update_option( 'swpsmtp_pass_encrypted', true );
496
- }
497
- return $password;
498
- }
499
-
500
- function credentials_configured() {
501
- $credentials_configured = true;
502
- if ( ! isset( $this->opts[ 'from_email_field' ] ) || empty( $this->opts[ 'from_email_field' ] ) ) {
503
- $credentials_configured = false;
504
- }
505
- if ( ! isset( $this->opts[ 'from_name_field' ] ) || empty( $this->opts[ 'from_name_field' ] ) ) {
506
- $credentials_configured = false;
507
- }
508
- return $credentials_configured;
509
- }
510
-
511
- function activate() {
512
- $swpsmtp_options_default = array(
513
- 'from_email_field' => '',
514
- 'from_name_field' => '',
515
- 'force_from_name_replace' => 0,
516
- 'smtp_settings' => array(
517
- 'host' => 'smtp.example.com',
518
- 'type_encryption' => 'none',
519
- 'port' => 25,
520
- 'autentication' => 'yes',
521
- 'username' => '',
522
- 'password' => ''
523
- )
524
- );
525
-
526
- /* install the default plugin options if needed */
527
- if ( empty( $this->opts ) ) {
528
- $this->opts = $swpsmtp_options_default;
529
- }
530
- $this->opts = array_merge( $swpsmtp_options_default, $this->opts );
531
- update_option( 'swpsmtp_options', $this->opts, 'yes' );
532
- //add current domain to allowed domains list
533
- if ( ! isset( $this->opts[ 'allowed_domains' ] ) ) {
534
- $domain = parse_url( get_site_url(), PHP_URL_HOST );
535
- if ( $domain ) {
536
- $this->opts[ 'allowed_domains' ] = base64_encode( $domain );
537
- update_option( 'swpsmtp_options', $this->opts );
538
- }
539
- } else { // let's check if existing value should be base64 encoded
540
- if ( ! empty( $this->opts[ 'allowed_domains' ] ) ) {
541
- if ( SWPSMTPUtils::base64_decode_maybe( $this->opts[ 'allowed_domains' ] ) === $this->opts[ 'allowed_domains' ] ) {
542
- $this->opts[ 'allowed_domains' ] = base64_encode( $this->opts[ 'allowed_domains' ] );
543
- update_option( 'swpsmtp_options', $this->opts );
544
- }
545
- }
546
- }
547
- // Encrypt password if needed
548
- if ( ! get_option( 'swpsmtp_pass_encrypted' ) ) {
549
- if ( extension_loaded( 'openssl' ) ) {
550
- if ( $this->opts[ 'smtp_settings' ][ 'password' ] !== '' ) {
551
- $this->opts[ 'smtp_settings' ][ 'password' ] = $this->encrypt_password( $this->get_password() );
552
- update_option( 'swpsmtp_options', $this->opts );
553
- }
554
- }
555
- }
556
- }
557
-
558
- function self_destruct_handler() {
559
- $err_msg = __( 'Please refresh the page and try again.', 'easy-wp-smtp' );
560
- $trans = get_transient( 'easy_wp_smtp_sd_code' );
561
- if ( empty( $trans ) ) {
562
- echo $err_msg;
563
- exit;
564
- }
565
- $sd_code = filter_input( INPUT_POST, 'sd_code', FILTER_SANITIZE_STRING );
566
- if ( $trans !== $sd_code ) {
567
- echo $err_msg;
568
- exit;
569
- }
570
- delete_site_option( 'swpsmtp_options' );
571
- delete_option( 'swpsmtp_options' );
572
- delete_site_option( 'smtp_test_mail' );
573
- delete_option( 'smtp_test_mail' );
574
- delete_site_option( 'swpsmtp_pass_encrypted' );
575
- delete_option( 'swpsmtp_pass_encrypted' );
576
- delete_option( 'swpsmtp_enc_key' );
577
- echo 1;
578
- deactivate_plugins( __FILE__ );
579
- exit;
580
- }
581
-
582
- }
583
-
584
- EasyWPSMTP::get_instance();
585
-
586
- function swpsmtp_uninstall() {
587
- // Don't delete plugin options. It is better to retain the options so if someone accidentally deactivates, the configuration is not lost.
588
- //delete_site_option('swpsmtp_options');
589
- //delete_option('swpsmtp_options');
590
- }
591
-
592
- class swpsmtp_gag_mailer extends stdClass {
593
-
594
- public function Send() {
595
- return true;
596
- }
597
-
598
- }
1
+ <?php
2
+ /*
3
+ Plugin Name: Easy WP SMTP
4
+ Version: 1.3.9.2
5
+ Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
6
+ Author: wpecommerce, alexanderfoxc
7
+ Author URI: https://wp-ecommerce.net/
8
+ Description: Send email via SMTP from your WordPress Blog
9
+ Text Domain: easy-wp-smtp
10
+ Domain Path: /languages
11
+ */
12
+
13
+ //Prefix/Slug - swpsmtp
14
+
15
+ class EasyWPSMTP {
16
+
17
+ public $opts;
18
+ public $plugin_file;
19
+ protected static $instance = null;
20
+
21
+ public function __construct() {
22
+ $this->opts = get_option( 'swpsmtp_options' );
23
+ $this->opts = ! is_array( $this->opts ) ? array() : $this->opts;
24
+ $this->plugin_file = __FILE__;
25
+ require_once 'class-easywpsmtp-utils.php';
26
+
27
+ add_action( 'plugins_loaded', array( $this, 'plugins_loaded_handler' ) );
28
+ add_filter( 'wp_mail', array( $this, 'wp_mail' ), 2147483647 );
29
+ add_action( 'phpmailer_init', array( $this, 'init_smtp' ), 999 );
30
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
31
+
32
+ if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
33
+ require_once 'class-easywpsmtp-admin.php';
34
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
35
+ register_uninstall_hook( __FILE__, 'swpsmtp_uninstall' );
36
+ add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2 );
37
+ add_filter( 'plugin_row_meta', array( $this, 'register_plugin_links' ), 10, 2 );
38
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
39
+ }
40
+ }
41
+
42
+ public static function get_instance() {
43
+ if ( null === self::$instance ) {
44
+ self::$instance = new self();
45
+ }
46
+ return self::$instance;
47
+ }
48
+
49
+ public function wp_mail( $args ) {
50
+ $domain = $this->is_domain_blocked();
51
+ if ( false !== $domain && ( isset( $this->opts['block_all_emails'] ) && 1 === $this->opts['block_all_emails'] ) ) {
52
+ $this->log(
53
+ "\r\n------------------------------------------------------------------------------------------------------\r\n" .
54
+ 'Domain check failed: website domain (' . $domain . ") is not in allowed domains list.\r\n" .
55
+ "Following email not sent (block all emails option is enabled):\r\n" .
56
+ 'To: ' . $args['to'] . '; Subject: ' . $args['subject'] . "\r\n" .
57
+ "------------------------------------------------------------------------------------------------------\r\n\r\n"
58
+ );
59
+ }
60
+ return $args;
61
+ }
62
+
63
+ public function init_smtp( &$phpmailer ) {
64
+ //check if SMTP credentials have been configured.
65
+ if ( ! $this->credentials_configured() ) {
66
+ return;
67
+ }
68
+ //check if Domain Check enabled
69
+ $domain = $this->is_domain_blocked();
70
+ if ( false !== $domain ) {
71
+ //domain check failed
72
+ //let's check if we have block all emails option enabled
73
+ if ( isset( $this->opts['block_all_emails'] ) && 1 === $this->opts['block_all_emails'] ) {
74
+ // it's enabled. Let's use gag mailer class that would prevent emails from being sent out.
75
+ require_once 'class-easywpsmtp-gag-mailer.php';
76
+ $phpmailer = new EasyWPSMTP_Gag_Mailer();
77
+ } else {
78
+ // it's disabled. Let's write some info to the log
79
+ $this->log(
80
+ "\r\n------------------------------------------------------------------------------------------------------\r\n" .
81
+ 'Domain check failed: website domain (' . $domain . ") is not in allowed domains list.\r\n" .
82
+ "SMTP settings won't be used.\r\n" .
83
+ "------------------------------------------------------------------------------------------------------\r\n\r\n"
84
+ );
85
+ }
86
+ return;
87
+ }
88
+
89
+ /* Set the mailer type as per config above, this overrides the already called isMail method */
90
+ $phpmailer->IsSMTP();
91
+ if ( isset( $this->opts['force_from_name_replace'] ) && 1 === $this->opts['force_from_name_replace'] ) {
92
+ $from_name = $this->opts['from_name_field'];
93
+ } else {
94
+ $from_name = ! empty( $phpmailer->FromName ) ? $phpmailer->FromName : $this->opts['from_name_field'];
95
+ }
96
+ $from_email = $this->opts['from_email_field'];
97
+ //set ReplyTo option if needed
98
+ //this should be set before SetFrom, otherwise might be ignored
99
+ if ( ! empty( $this->opts['reply_to_email'] ) ) {
100
+ $phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
101
+ }
102
+ // let's see if we have email ignore list populated
103
+ if ( isset( $this->opts['email_ignore_list'] ) && ! empty( $this->opts['email_ignore_list'] ) ) {
104
+ $emails_arr = explode( ',', $this->opts['email_ignore_list'] );
105
+ $from = $phpmailer->From;
106
+ $match_found = false;
107
+ foreach ( $emails_arr as $email ) {
108
+ if ( strtolower( trim( $email ) ) === strtolower( trim( $from ) ) ) {
109
+ $match_found = true;
110
+ break;
111
+ }
112
+ }
113
+ if ( $match_found ) {
114
+ //we should not override From and Fromname
115
+ $from_email = $phpmailer->From;
116
+ $from_name = $phpmailer->FromName;
117
+ }
118
+ }
119
+ $phpmailer->From = $from_email;
120
+ $phpmailer->FromName = $from_name;
121
+ $phpmailer->SetFrom( $phpmailer->From, $phpmailer->FromName );
122
+ //This should set Return-Path header for servers that are not properly handling it, but needs testing first
123
+ //$phpmailer->Sender = $phpmailer->From;
124
+ /* Set the SMTPSecure value */
125
+ if ( 'none' !== $this->opts['smtp_settings']['type_encryption'] ) {
126
+ $phpmailer->SMTPSecure = $this->opts['smtp_settings']['type_encryption'];
127
+ }
128
+
129
+ /* Set the other options */
130
+ $phpmailer->Host = $this->opts['smtp_settings']['host'];
131
+ $phpmailer->Port = $this->opts['smtp_settings']['port'];
132
+
133
+ /* If we're using smtp auth, set the username & password */
134
+ if ( 'yes' === $this->opts['smtp_settings']['autentication'] ) {
135
+ $phpmailer->SMTPAuth = true;
136
+ $phpmailer->Username = $this->opts['smtp_settings']['username'];
137
+ $phpmailer->Password = $this->get_password();
138
+ }
139
+ //PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate.
140
+ $phpmailer->SMTPAutoTLS = false;
141
+
142
+ if ( isset( $this->opts['smtp_settings']['insecure_ssl'] ) && false !== $this->opts['smtp_settings']['insecure_ssl'] ) {
143
+ // Insecure SSL option enabled
144
+ $phpmailer->SMTPOptions = array(
145
+ 'ssl' => array(
146
+ 'verify_peer' => false,
147
+ 'verify_peer_name' => false,
148
+ 'allow_self_signed' => true,
149
+ ),
150
+ );
151
+ }
152
+
153
+ if ( isset( $this->opts['smtp_settings']['enable_debug'] ) && $this->opts['smtp_settings']['enable_debug'] ) {
154
+ $phpmailer->Debugoutput = function ( $str, $level ) {
155
+ $this->log( $str );
156
+ };
157
+ $phpmailer->SMTPDebug = 1;
158
+ }
159
+ //set reasonable timeout
160
+ $phpmailer->Timeout = 10;
161
+ }
162
+
163
+ public function test_mail( $to_email, $subject, $message ) {
164
+ $ret = array();
165
+ if ( ! $this->credentials_configured() ) {
166
+ return false;
167
+ }
168
+
169
+ require_once ABSPATH . WPINC . '/class-phpmailer.php';
170
+ $mail = new PHPMailer( true );
171
+
172
+ try {
173
+
174
+ $charset = get_bloginfo( 'charset' );
175
+ $mail->CharSet = $charset;
176
+
177
+ $from_name = $this->opts['from_name_field'];
178
+ $from_email = $this->opts['from_email_field'];
179
+
180
+ $mail->IsSMTP();
181
+
182
+ // send plain text test email
183
+ $mail->ContentType = 'text/plain';
184
+ $mail->IsHTML( false );
185
+
186
+ /* If using smtp auth, set the username & password */
187
+ if ( 'yes' === $this->opts['smtp_settings']['autentication'] ) {
188
+ $mail->SMTPAuth = true;
189
+ $mail->Username = $this->opts['smtp_settings']['username'];
190
+ $mail->Password = $this->get_password();
191
+ }
192
+
193
+ /* Set the SMTPSecure value, if set to none, leave this blank */
194
+ if ( 'none' !== $this->opts['smtp_settings']['type_encryption'] ) {
195
+ $mail->SMTPSecure = $this->opts['smtp_settings']['type_encryption'];
196
+ }
197
+
198
+ /* PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate. */
199
+ $mail->SMTPAutoTLS = false;
200
+
201
+ if ( isset( $this->opts['smtp_settings']['insecure_ssl'] ) && false !== $this->opts['smtp_settings']['insecure_ssl'] ) {
202
+ // Insecure SSL option enabled
203
+ $mail->SMTPOptions = array(
204
+ 'ssl' => array(
205
+ 'verify_peer' => false,
206
+ 'verify_peer_name' => false,
207
+ 'allow_self_signed' => true,
208
+ ),
209
+ );
210
+ }
211
+
212
+ /* Set the other options */
213
+ $mail->Host = $this->opts['smtp_settings']['host'];
214
+ $mail->Port = $this->opts['smtp_settings']['port'];
215
+ if ( ! empty( $this->opts['reply_to_email'] ) ) {
216
+ $mail->AddReplyTo( $this->opts['reply_to_email'], $from_name );
217
+ }
218
+ $mail->SetFrom( $from_email, $from_name );
219
+ //This should set Return-Path header for servers that are not properly handling it, but needs testing first
220
+ //$mail->Sender = $mail->From;
221
+ $mail->Subject = $subject;
222
+ $mail->Body = $message;
223
+ $mail->AddAddress( $to_email );
224
+ global $debug_msg;
225
+ $debug_msg = '';
226
+ $mail->Debugoutput = function ( $str, $level ) {
227
+ global $debug_msg;
228
+ $debug_msg .= $str;
229
+ };
230
+ $mail->SMTPDebug = 1;
231
+ //set reasonable timeout
232
+ $mail->Timeout = 10;
233
+
234
+ /* Send mail and return result */
235
+ $mail->Send();
236
+ $mail->ClearAddresses();
237
+ $mail->ClearAllRecipients();
238
+ } catch ( Exception $e ) {
239
+ $ret['error'] = $mail->ErrorInfo;
240
+ }
241
+
242
+ $ret['debug_log'] = $debug_msg;
243
+
244
+ return $ret;
245
+ }
246
+
247
+ public function admin_init() {
248
+ if ( current_user_can( 'manage_options' ) ) {
249
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
250
+ add_action( 'wp_ajax_swpsmtp_clear_log', array( $this, 'clear_log' ) );
251
+ add_action( 'wp_ajax_swpsmtp_self_destruct', array( $this, 'self_destruct_handler' ) );
252
+ }
253
+ //view log file
254
+ if ( isset( $_GET['swpsmtp_action'] ) ) {
255
+ if ( 'view_log' === $_GET['swpsmtp_action'] ) {
256
+ $log_file_name = $this->opts['smtp_settings']['log_file_name'];
257
+ if ( ! file_exists( plugin_dir_path( __FILE__ ) . $log_file_name ) ) {
258
+ if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n" ) === false ) {
259
+ wp_die( esc_html( sprintf( 'Can\'t write to log file. Check if plugin directory (%s) is writeable.', plugin_dir_path( __FILE__ ) ) ) );
260
+ };
261
+ }
262
+ $logfile = fopen( plugin_dir_path( __FILE__ ) . $log_file_name, 'rb' ); //phpcs:ignore
263
+ if ( ! $logfile ) {
264
+ wp_die( 'Can\'t open log file.' );
265
+ }
266
+ header( 'Content-Type: text/plain' );
267
+ fpassthru( $logfile );
268
+ die;
269
+ }
270
+ }
271
+
272
+ //check if this is export settings request
273
+ $is_export_settings = filter_input( INPUT_POST, 'swpsmtp_export_settings', FILTER_SANITIZE_NUMBER_INT );
274
+ if ( $is_export_settings ) {
275
+ check_admin_referer( 'easy_wp_smtp_export_settings', 'easy_wp_smtp_export_settings_nonce' );
276
+ $data = array();
277
+ $opts = get_option( 'swpsmtp_options', array() );
278
+ $data['swpsmtp_options'] = $opts;
279
+ $swpsmtp_pass_encrypted = get_option( 'swpsmtp_pass_encrypted', false );
280
+ $data['swpsmtp_pass_encrypted'] = $swpsmtp_pass_encrypted;
281
+ if ( $swpsmtp_pass_encrypted ) {
282
+ $swpsmtp_enc_key = get_option( 'swpsmtp_enc_key', false );
283
+ $data['swpsmtp_enc_key'] = $swpsmtp_enc_key;
284
+ }
285
+ $smtp_test_mail = get_option( 'smtp_test_mail', array() );
286
+ $data['smtp_test_mail'] = $smtp_test_mail;
287
+ $out = array();
288
+ $out['data'] = wp_json_encode( $data );
289
+ $out['ver'] = 2;
290
+ $out['checksum'] = md5( $out['data'] );
291
+
292
+ $filename = 'easy_wp_smtp_settings.json';
293
+ header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
294
+ header( 'Content-Type: application/json' );
295
+ echo wp_json_encode( $out );
296
+ exit;
297
+ }
298
+
299
+ $is_import_settings = filter_input( INPUT_POST, 'swpsmtp_import_settings', FILTER_SANITIZE_NUMBER_INT );
300
+ if ( $is_import_settings ) {
301
+ check_admin_referer( 'easy_wp_smtp_import_settings', 'easy_wp_smtp_import_settings_nonce' );
302
+ $err_msg = __( 'Error occurred during settings import', 'easy-wp-smtp' );
303
+ if ( empty( $_FILES['swpsmtp_import_settings_file'] ) ) {
304
+ echo esc_html( $err_msg );
305
+ wp_die();
306
+ }
307
+ $in_raw = file_get_contents( $_FILES['swpsmtp_import_settings_file']['tmp_name'] ); //phpcs:ignore
308
+ try {
309
+ $in = json_decode( $in_raw, true );
310
+ if ( json_last_error() !== 0 ) {
311
+ $in = unserialize( $in_raw ); //phpcs:ignore
312
+ }
313
+ if ( empty( $in['data'] ) ) {
314
+ echo esc_html( $err_msg );
315
+ wp_die();
316
+ }
317
+ if ( empty( $in['checksum'] ) ) {
318
+ echo esc_html( $err_msg );
319
+ wp_die();
320
+ }
321
+ if ( md5( $in['data'] ) !== $in['checksum'] ) {
322
+ echo esc_html( $err_msg );
323
+ wp_die();
324
+ }
325
+ $data = json_decode( $in['data'], true );
326
+ if ( json_last_error() !== 0 ) {
327
+ $data = unserialize( $in['data'] ); //phpcs:ignore
328
+ }
329
+ update_option( 'swpsmtp_options', $data['swpsmtp_options'] );
330
+ update_option( 'swpsmtp_pass_encrypted', $data['swpsmtp_pass_encrypted'] );
331
+ if ( $data['swpsmtp_pass_encrypted'] ) {
332
+ update_option( 'swpsmtp_enc_key', $data['swpsmtp_enc_key'] );
333
+ }
334
+ update_option( 'smtp_test_mail', $data['smtp_test_mail'] );
335
+ set_transient( 'easy_wp_smtp_settings_import_success', true, 60 * 60 );
336
+ $url = admin_url() . 'options-general.php?page=swpsmtp_settings';
337
+ wp_safe_redirect( $url );
338
+ exit;
339
+ } catch ( Exception $ex ) {
340
+ echo esc_html( $err_msg );
341
+ wp_die();
342
+ }
343
+ }
344
+ }
345
+ }
346
+
347
+ public function admin_notices() {
348
+ if ( ! $this->credentials_configured() ) {
349
+ $settings_url = admin_url() . 'options-general.php?page=swpsmtp_settings';
350
+ ?>
351
+ <div class="error">
352
+ <p>
353
+ <?php
354
+ printf( __( 'Please configure your SMTP credentials in the <a href="%s">settings menu</a> in order to send email using Easy WP SMTP plugin.', 'easy-wp-smtp' ), esc_url( $settings_url ) );
355
+ ?>
356
+ </p>
357
+ </div>
358
+ <?php
359
+ }
360
+
361
+ $settings_import_notice = get_transient( 'easy_wp_smtp_settings_import_success' );
362
+ if ( $settings_import_notice ) {
363
+ delete_transient( 'easy_wp_smtp_settings_import_success' );
364
+ ?>
365
+ <div class="updated">
366
+ <p><?php echo esc_html( __( 'Settings have been imported successfully.', 'easy-wp-smtp' ) ); ?></p>
367
+ </div>
368
+ <?php
369
+ }
370
+ }
371
+
372
+ public function clear_log() {
373
+ if ( ! check_ajax_referer( 'easy-wp-smtp-clear-log', 'nonce', false ) ) {
374
+ echo esc_html( __( 'Nonce check failed.', 'easy-wp-smtp' ) );
375
+ exit;
376
+ };
377
+ if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n", true ) !== false ) {
378
+ echo '1';
379
+ } else {
380
+ echo esc_html( __( "Can't clear log - file is not writeable.", 'easy-wp-smtp' ) );
381
+ }
382
+ die;
383
+ }
384
+
385
+ public function log( $str, $overwrite = false ) {
386
+ if ( isset( $this->opts['smtp_settings']['log_file_name'] ) ) {
387
+ $log_file_name = $this->opts['smtp_settings']['log_file_name'];
388
+ } else {
389
+ // let's generate log file name
390
+ $log_file_name = uniqid() . '_debug_log.txt';
391
+ $this->opts['smtp_settings']['log_file_name'] = $log_file_name;
392
+ update_option( 'swpsmtp_options', $this->opts );
393
+ file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, "Easy WP SMTP debug log file\r\n\r\n" ); //phpcs:ignore
394
+ }
395
+ return ( file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, $str, ( ! $overwrite ? FILE_APPEND : 0 ) ) ); //phpcs:ignore
396
+ }
397
+
398
+ public function plugin_action_links( $links, $file ) {
399
+ if ( plugin_basename( $this->plugin_file ) === $file ) {
400
+ $settings_link = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
401
+ array_unshift( $links, $settings_link );
402
+ }
403
+ return $links;
404
+ }
405
+
406
+ public function register_plugin_links( $links, $file ) {
407
+ if ( plugin_basename( $this->plugin_file ) === $file ) {
408
+ $links[] = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
409
+ }
410
+ return $links;
411
+ }
412
+
413
+ public function plugins_loaded_handler() {
414
+ load_plugin_textdomain( 'easy-wp-smtp', false, dirname( plugin_basename( $this->plugin_file ) ) . '/languages/' );
415
+ }
416
+
417
+ public function is_domain_blocked() {
418
+ //check if Domain Check enabled
419
+ if ( isset( $this->opts['enable_domain_check'] ) && $this->opts['enable_domain_check'] ) {
420
+ //check if allowed domains list is not blank
421
+ if ( isset( $this->opts['allowed_domains'] ) && ! empty( $this->opts['allowed_domains'] ) ) {
422
+ $this->opts['allowed_domains'] = EasyWPSMTP_Utils::base64_decode_maybe( $this->opts['allowed_domains'] );
423
+ //let's see if we have one domain or coma-separated domains
424
+ $domains_arr = explode( ',', $this->opts['allowed_domains'] );
425
+ //TODO: Change parse_url() to wp_parse_url() and bump required WP version to 4.4.0
426
+ $site_domain = parse_url( get_site_url(), PHP_URL_HOST ); //phpcs:ignore
427
+ $match_found = false;
428
+ foreach ( $domains_arr as $domain ) {
429
+ if ( strtolower( trim( $domain ) ) === strtolower( trim( $site_domain ) ) ) {
430
+ $match_found = true;
431
+ break;
432
+ }
433
+ }
434
+ if ( ! $match_found ) {
435
+ return $site_domain;
436
+ }
437
+ }
438
+ }
439
+ return false;
440
+ }
441
+
442
+ public function get_password() {
443
+ $temp_password = isset( $this->opts['smtp_settings']['password'] ) ? $this->opts['smtp_settings']['password'] : '';
444
+ if ( '' === $temp_password ) {
445
+ return '';
446
+ }
447
+
448
+ try {
449
+
450
+ if ( get_option( 'swpsmtp_pass_encrypted' ) ) {
451
+ //this is encrypted password
452
+ $cryptor = EasyWPSMTP_Utils::get_instance();
453
+ $decrypted = $cryptor->decrypt_password( $temp_password );
454
+ //check if encryption option is disabled
455
+ if ( empty( $this->opts['smtp_settings']['encrypt_pass'] ) ) {
456
+ //it is. let's save decrypted password
457
+ $this->opts['smtp_settings']['password'] = $this->encrypt_password( addslashes( $decrypted ) );
458
+ update_option( 'swpsmtp_options', $this->opts );
459
+ }
460
+ return $decrypted;
461
+ }
462
+ } catch ( Exception $e ) {
463
+ $this->log( $e->getMessage() );
464
+ return '';
465
+ }
466
+
467
+ $password = '';
468
+ $decoded_pass = base64_decode( $temp_password ); //phpcs:ignore
469
+ /* no additional checks for servers that aren't configured with mbstring enabled */
470
+ if ( ! function_exists( 'mb_detect_encoding' ) ) {
471
+ return $decoded_pass;
472
+ }
473
+ /* end of mbstring check */
474
+ if ( base64_encode( $decoded_pass ) === $temp_password ) { //phpcs:ignore
475
+ //it might be encoded
476
+ if ( false === mb_detect_encoding( $decoded_pass ) ) { //could not find character encoding.
477
+ $password = $temp_password;
478
+ } else {
479
+ $password = base64_decode( $temp_password ); //phpcs:ignore
480
+ }
481
+ } else { //not encoded
482
+ $password = $temp_password;
483
+ }
484
+ return stripslashes( $password );
485
+ }
486
+
487
+ public function encrypt_password( $pass ) {
488
+ if ( '' === $pass ) {
489
+ return '';
490
+ }
491
+
492
+ if ( empty( $this->opts['smtp_settings']['encrypt_pass'] ) || ! extension_loaded( 'openssl' ) ) {
493
+ // no openssl extension loaded - we can't encrypt the password
494
+ $password = base64_encode( $pass ); //phpcs:ignore
495
+ update_option( 'swpsmtp_pass_encrypted', false );
496
+ } else {
497
+ // let's encrypt password
498
+ $cryptor = EasyWPSMTP_Utils::get_instance();
499
+ $password = $cryptor->encrypt_password( $pass );
500
+ update_option( 'swpsmtp_pass_encrypted', true );
501
+ }
502
+ return $password;
503
+ }
504
+
505
+ public function credentials_configured() {
506
+ $credentials_configured = true;
507
+ if ( ! isset( $this->opts['from_email_field'] ) || empty( $this->opts['from_email_field'] ) ) {
508
+ $credentials_configured = false;
509
+ }
510
+ if ( ! isset( $this->opts['from_name_field'] ) || empty( $this->opts['from_name_field'] ) ) {
511
+ $credentials_configured = false;
512
+ }
513
+ return $credentials_configured;
514
+ }
515
+
516
+ public function activate() {
517
+ $swpsmtp_options_default = array(
518
+ 'from_email_field' => '',
519
+ 'from_name_field' => '',
520
+ 'force_from_name_replace' => 0,
521
+ 'smtp_settings' => array(
522
+ 'host' => 'smtp.example.com',
523
+ 'type_encryption' => 'none',
524
+ 'port' => 25,
525
+ 'autentication' => 'yes',
526
+ 'username' => '',
527
+ 'password' => '',
528
+ ),
529
+ );
530
+
531
+ /* install the default plugin options if needed */
532
+ if ( empty( $this->opts ) ) {
533
+ $this->opts = $swpsmtp_options_default;
534
+ }
535
+ $this->opts = array_merge( $swpsmtp_options_default, $this->opts );
536
+ update_option( 'swpsmtp_options', $this->opts, 'yes' );
537
+ //add current domain to allowed domains list
538
+ if ( ! isset( $this->opts['allowed_domains'] ) ) {
539
+ //TODO: Change parse_url() to wp_parse_url() and bump required WP version to 4.4.0
540
+ $domain = parse_url( get_site_url(), PHP_URL_HOST ); //phpcs:ignore
541
+ if ( $domain ) {
542
+ $this->opts['allowed_domains'] = base64_encode( $domain ); //phpcs:ignore
543
+ update_option( 'swpsmtp_options', $this->opts );
544
+ }
545
+ } else { // let's check if existing value should be base64 encoded
546
+ if ( ! empty( $this->opts['allowed_domains'] ) ) {
547
+ if ( EasyWPSMTP_Utils::base64_decode_maybe( $this->opts['allowed_domains'] ) === $this->opts['allowed_domains'] ) {
548
+ $this->opts['allowed_domains'] = base64_encode( $this->opts['allowed_domains'] ); //phpcs:ignore
549
+ update_option( 'swpsmtp_options', $this->opts );
550
+ }
551
+ }
552
+ }
553
+ // Encrypt password if needed
554
+ if ( ! get_option( 'swpsmtp_pass_encrypted' ) ) {
555
+ if ( extension_loaded( 'openssl' ) ) {
556
+ if ( '' !== $this->opts['smtp_settings']['password'] ) {
557
+ $this->opts['smtp_settings']['password'] = $this->encrypt_password( $this->get_password() );
558
+ update_option( 'swpsmtp_options', $this->opts );
559
+ }
560
+ }
561
+ }
562
+ }
563
+
564
+ public function self_destruct_handler() {
565
+ $err_msg = __( 'Please refresh the page and try again.', 'easy-wp-smtp' );
566
+ $trans = get_transient( 'easy_wp_smtp_sd_code' );
567
+ if ( empty( $trans ) ) {
568
+ echo esc_html( $err_msg );
569
+ exit;
570
+ }
571
+ $sd_code = filter_input( INPUT_POST, 'sd_code', FILTER_SANITIZE_STRING );
572
+ if ( $trans !== $sd_code ) {
573
+ echo esc_html( $err_msg );
574
+ exit;
575
+ }
576
+ delete_site_option( 'swpsmtp_options' );
577
+ delete_option( 'swpsmtp_options' );
578
+ delete_site_option( 'smtp_test_mail' );
579
+ delete_option( 'smtp_test_mail' );
580
+ delete_site_option( 'swpsmtp_pass_encrypted' );
581
+ delete_option( 'swpsmtp_pass_encrypted' );
582
+ delete_option( 'swpsmtp_enc_key' );
583
+ echo 1;
584
+ deactivate_plugins( __FILE__ );
585
+ exit;
586
+ }
587
+ }
588
+
589
+ EasyWPSMTP::get_instance();
590
+
591
+ function swpsmtp_uninstall() {
592
+ // Don't delete plugin options. It is better to retain the options so if someone accidentally deactivates, the configuration is not lost.
593
+ //delete_site_option('swpsmtp_options');
594
+ //delete_option('swpsmtp_options');
595
+ }
 
 
 
js/script.js CHANGED
@@ -1,15 +1,15 @@
1
  function parseHash(hash) {
2
- hash = hash.substring(1, hash.length);
3
 
4
- var hashObj = [];
5
 
6
- hash.split('&').forEach(function (q) {
7
- if (typeof q !== 'undefined') {
8
- hashObj.push(q);
9
- }
10
- });
11
 
12
- return hashObj;
13
  }
14
 
15
  var swpsmtp_urlHash = 'smtp';
@@ -17,108 +17,108 @@ var swpsmtp_focusObj = false;
17
  var swpsmtp_urlHashArr = parseHash(window.location.hash);
18
 
19
  if (swpsmtp_urlHashArr[0] !== '') {
20
- swpsmtp_urlHash = swpsmtp_urlHashArr[0];
21
  }
22
 
23
  if (swpsmtp_urlHashArr[1] !== "undefined") {
24
- swpsmtp_focusObj = swpsmtp_urlHashArr[1];
25
  }
26
 
27
  jQuery(function ($) {
28
- var swpsmtp_activeTab = "";
29
- $('a.nav-tab').click(function (e) {
30
- if ($(this).attr('data-tab-name') !== swpsmtp_activeTab) {
31
- $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').hide();
32
- $('a.nav-tab[data-tab-name="' + swpsmtp_activeTab + '"]').removeClass('nav-tab-active');
33
- swpsmtp_activeTab = $(this).attr('data-tab-name');
34
- $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').show();
35
- $(this).addClass('nav-tab-active');
36
- $('input#swpsmtp-urlHash').val(swpsmtp_activeTab);
37
- if (window.location.hash !== swpsmtp_activeTab) {
38
- window.location.hash = swpsmtp_activeTab;
39
- }
40
- if (swpsmtp_focusObj) {
41
- $('html, body').animate({
42
- scrollTop: $('#' + swpsmtp_focusObj).offset().top
43
- }, 'fast', function () {
44
- $('#' + swpsmtp_focusObj).focus();
45
- swpsmtp_focusObj = false;
46
- });
47
- }
48
- }
49
- });
50
- $('a.nav-tab[data-tab-name="' + swpsmtp_urlHash + '"]').trigger('click');
51
  });
52
 
53
  jQuery(function ($) {
54
- $('#swpsmtp-mail input').not('.ignore-change').change(function () {
55
- $('#swpsmtp-save-settings-notice').show();
56
- $('#test-email-form-submit').prop('disabled', true);
57
- });
58
- $('#swpsmtp_enable_domain_check').change(function () {
59
- $('input[name="swpsmtp_allowed_domains"]').prop('disabled', !$(this).is(':checked'));
60
- $('input[name="swpsmtp_block_all_emails"]').prop('disabled', !$(this).is(':checked'));
61
- });
62
- $('#swpsmtp_clear_log_btn').click(function (e) {
63
- e.preventDefault();
64
- if (confirm(easywpsmtp.str.clear_log)) {
65
- var req = jQuery.ajax({
66
- url: ajaxurl,
67
- type: "post",
68
- data: {action: "swpsmtp_clear_log"}
69
- });
70
- req.done(function (data) {
71
- if (data === '1') {
72
- alert(easywpsmtp.str.log_cleared);
73
- } else {
74
- alert(easywpsmtp.str.error_occured + ' ' + data);
 
 
75
  }
76
- });
77
- }
78
- });
79
 
80
- $('#swpsmtp_export_settings_btn').click(function (e) {
81
- e.preventDefault();
82
- $('#swpsmtp_export_settings_frm').submit();
83
- });
84
 
85
- $('#swpsmtp_import_settings_btn').click(function (e) {
86
- e.preventDefault();
87
- $('#swpsmtp_import_settings_select_file').click();
88
- });
89
 
90
- $('#swpsmtp_import_settings_select_file').change(function (e) {
91
- e.preventDefault();
92
- $('#swpsmtp_import_settings_frm').submit();
93
- });
94
 
95
- $('#swpsmtp_self_destruct_btn').click(function (e) {
96
- e.preventDefault();
97
- if (confirm(easywpsmtp.str.confirm_self_destruct)) {
98
- var req = jQuery.ajax({
99
- url: ajaxurl,
100
- type: "post",
101
- data: {action: "swpsmtp_self_destruct", sd_code: easywpsmtp.sd_code}
102
- });
103
- req.done(function (data) {
104
- if (data === '1') {
105
- alert(easywpsmtp.str.self_destruct_completed);
106
- window.location.href = easywpsmtp.sd_redir_url;
107
- } else {
108
- alert(easywpsmtp.str.error_occured + ' ' + data);
 
 
 
 
 
109
  }
110
- });
111
- req.fail(function (err) {
112
- alert(easywpsmtp.str.error_occured + ' ' + err.status + ' (' + err.statusText + ')');
113
- });
114
- }
115
- });
116
 
117
- $('#test-email-form-submit').click(function () {
118
- $(this).val(easywpsmtp.str.sending);
119
- $(this).prop('disabled', true);
120
- $('#swpsmtp-spinner').addClass('is-active');
121
- $('#swpsmtp_settings_test_email_form').submit();
122
- return true;
123
- });
124
  });
1
  function parseHash(hash) {
2
+ hash = hash.substring(1, hash.length);
3
 
4
+ var hashObj = [];
5
 
6
+ hash.split('&').forEach(function (q) {
7
+ if (typeof q !== 'undefined') {
8
+ hashObj.push(q);
9
+ }
10
+ });
11
 
12
+ return hashObj;
13
  }
14
 
15
  var swpsmtp_urlHash = 'smtp';
17
  var swpsmtp_urlHashArr = parseHash(window.location.hash);
18
 
19
  if (swpsmtp_urlHashArr[0] !== '') {
20
+ swpsmtp_urlHash = swpsmtp_urlHashArr[0];
21
  }
22
 
23
  if (swpsmtp_urlHashArr[1] !== "undefined") {
24
+ swpsmtp_focusObj = swpsmtp_urlHashArr[1];
25
  }
26
 
27
  jQuery(function ($) {
28
+ var swpsmtp_activeTab = "";
29
+ $('a.nav-tab').click(function (e) {
30
+ if ($(this).attr('data-tab-name') !== swpsmtp_activeTab) {
31
+ $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').hide();
32
+ $('a.nav-tab[data-tab-name="' + swpsmtp_activeTab + '"]').removeClass('nav-tab-active');
33
+ swpsmtp_activeTab = $(this).attr('data-tab-name');
34
+ $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').show();
35
+ $(this).addClass('nav-tab-active');
36
+ $('input#swpsmtp-urlHash').val(swpsmtp_activeTab);
37
+ if (window.location.hash !== swpsmtp_activeTab) {
38
+ window.location.hash = swpsmtp_activeTab;
39
+ }
40
+ if (swpsmtp_focusObj) {
41
+ $('html, body').animate({
42
+ scrollTop: $('#' + swpsmtp_focusObj).offset().top
43
+ }, 'fast', function () {
44
+ $('#' + swpsmtp_focusObj).focus();
45
+ swpsmtp_focusObj = false;
46
+ });
47
+ }
48
+ }
49
+ });
50
+ $('a.nav-tab[data-tab-name="' + swpsmtp_urlHash + '"]').trigger('click');
51
  });
52
 
53
  jQuery(function ($) {
54
+ $('#swpsmtp-mail input').not('.ignore-change').change(function () {
55
+ $('#swpsmtp-save-settings-notice').show();
56
+ $('#test-email-form-submit').prop('disabled', true);
57
+ });
58
+ $('#swpsmtp_enable_domain_check').change(function () {
59
+ $('input[name="swpsmtp_allowed_domains"]').prop('disabled', !$(this).is(':checked'));
60
+ $('input[name="swpsmtp_block_all_emails"]').prop('disabled', !$(this).is(':checked'));
61
+ });
62
+ $('#swpsmtp_clear_log_btn').click(function (e) {
63
+ e.preventDefault();
64
+ if (confirm(easywpsmtp.str.clear_log)) {
65
+ var req = jQuery.ajax({
66
+ url: ajaxurl,
67
+ type: "post",
68
+ data: { action: "swpsmtp_clear_log", nonce: easywpsmtp.clear_log_nonce }
69
+ });
70
+ req.done(function (data) {
71
+ if (data === '1') {
72
+ alert(easywpsmtp.str.log_cleared);
73
+ } else {
74
+ alert(easywpsmtp.str.error_occured + ' ' + data);
75
+ }
76
+ });
77
  }
78
+ });
 
 
79
 
80
+ $('#swpsmtp_export_settings_btn').click(function (e) {
81
+ e.preventDefault();
82
+ $('#swpsmtp_export_settings_frm').submit();
83
+ });
84
 
85
+ $('#swpsmtp_import_settings_btn').click(function (e) {
86
+ e.preventDefault();
87
+ $('#swpsmtp_import_settings_select_file').click();
88
+ });
89
 
90
+ $('#swpsmtp_import_settings_select_file').change(function (e) {
91
+ e.preventDefault();
92
+ $('#swpsmtp_import_settings_frm').submit();
93
+ });
94
 
95
+ $('#swpsmtp_self_destruct_btn').click(function (e) {
96
+ e.preventDefault();
97
+ if (confirm(easywpsmtp.str.confirm_self_destruct)) {
98
+ var req = jQuery.ajax({
99
+ url: ajaxurl,
100
+ type: "post",
101
+ data: { action: "swpsmtp_self_destruct", sd_code: easywpsmtp.sd_code }
102
+ });
103
+ req.done(function (data) {
104
+ if (data === '1') {
105
+ alert(easywpsmtp.str.self_destruct_completed);
106
+ window.location.href = easywpsmtp.sd_redir_url;
107
+ } else {
108
+ alert(easywpsmtp.str.error_occured + ' ' + data);
109
+ }
110
+ });
111
+ req.fail(function (err) {
112
+ alert(easywpsmtp.str.error_occured + ' ' + err.status + ' (' + err.statusText + ')');
113
+ });
114
  }
115
+ });
 
 
 
 
 
116
 
117
+ $('#test-email-form-submit').click(function () {
118
+ $(this).val(easywpsmtp.str.sending);
119
+ $(this).prop('disabled', true);
120
+ $('#swpsmtp-spinner').addClass('is-active');
121
+ $('#swpsmtp_settings_test_email_form').submit();
122
+ return true;
123
+ });
124
  });
languages/easy-wp-smtp.pot CHANGED
@@ -1,221 +1,224 @@
1
- #: easy-wp-smtp-admin-menu.php:28
2
  msgid "Are you sure want to clear log?"
3
  msgstr ""
4
 
5
- #: easy-wp-smtp-admin-menu.php:29
6
  msgid "Log cleared."
7
  msgstr ""
8
 
9
- #: easy-wp-smtp-admin-menu.php:30
10
  msgid "Error occurred:"
11
  msgstr ""
12
 
13
- #: easy-wp-smtp-admin-menu.php:31
14
  msgid "Sending..."
15
  msgstr ""
16
 
17
- #: easy-wp-smtp-admin-menu.php:32
18
  msgid "Are you sure you want to delete ALL your settings and deactive plugin?"
19
  msgstr ""
20
 
21
- #: easy-wp-smtp-admin-menu.php:33
22
  msgid "All settings have been deleted and plugin is deactivated."
23
  msgstr ""
24
 
25
- #: easy-wp-smtp-admin-menu.php:42
26
  msgid "Easy WP SMTP"
27
  msgstr ""
28
 
29
- #: easy-wp-smtp-admin-menu.php:96
30
  msgid ""
31
  "PHP OpenSSL extension is not installed on the server. It's required by Easy "
32
  "WP SMTP plugin to operate properly. Please contact your server administrator "
33
  "or hosting provider and ask them to install it."
34
  msgstr ""
35
 
36
- #: easy-wp-smtp-admin-menu.php:99
37
  msgid ""
38
  "PHP OpenSSL extension is not installed on the server. It is required for "
39
  "encryption to work properly. Please contact your server administrator or "
40
  "hosting provider and ask them to install it."
41
  msgstr ""
42
 
43
- #: easy-wp-smtp-admin-menu.php:106
44
  #, php-format
45
  msgid ""
46
  "Your PHP version is %s, encryption function requires PHP version 5.3.0 or "
47
  "higher."
48
  msgstr ""
49
 
50
- #: easy-wp-smtp-admin-menu.php:111
51
  msgid "Easy WP SMTP Settings"
52
  msgstr ""
53
 
54
- #: easy-wp-smtp-admin-menu.php:126
 
55
  msgid "Nonce check failed."
56
  msgstr ""
57
 
58
- #: easy-wp-smtp-admin-menu.php:136
59
  msgid "Please enter a valid email address in the 'FROM' field."
60
  msgstr ""
61
 
62
- #: easy-wp-smtp-admin-menu.php:181
63
  msgid "Please enter a valid port in the 'SMTP Port' field."
64
  msgstr ""
65
 
66
- #: easy-wp-smtp-admin-menu.php:190
67
  msgid "Settings saved."
68
  msgstr ""
69
 
70
- #: easy-wp-smtp-admin-menu.php:192
71
  msgid "Settings are not saved."
72
  msgstr ""
73
 
74
- #: easy-wp-smtp-admin-menu.php:204
75
  msgid "Please enter a valid email address in the recipient email field."
76
  msgstr ""
77
 
78
- #: easy-wp-smtp-admin-menu.php:230
79
  msgid "SMTP Settings"
80
  msgstr ""
81
 
82
- #: easy-wp-smtp-admin-menu.php:231
83
  msgid "Additional Settings"
84
  msgstr ""
85
 
86
- #: easy-wp-smtp-admin-menu.php:232 easy-wp-smtp-admin-menu.php:435
 
87
  msgid "Test Email"
88
  msgstr ""
89
 
90
- #: easy-wp-smtp-admin-menu.php:244
91
  msgid "SMTP Configuration Settings"
92
  msgstr ""
93
 
94
- #: easy-wp-smtp-admin-menu.php:247
95
  msgid ""
96
  "You can request your hosting provider for the SMTP details of your site. Use "
97
  "the SMTP details provided by your hosting provider to configure the "
98
  "following settings."
99
  msgstr ""
100
 
101
- #: easy-wp-smtp-admin-menu.php:251
102
  msgid "From Email Address"
103
  msgstr ""
104
 
105
- #: easy-wp-smtp-admin-menu.php:254
106
  msgid "This email address will be used in the 'From' field."
107
  msgstr ""
108
 
109
- #: easy-wp-smtp-admin-menu.php:258
110
  msgid "From Name"
111
  msgstr ""
112
 
113
- #: easy-wp-smtp-admin-menu.php:261
114
  msgid "This text will be used in the 'FROM' field"
115
  msgstr ""
116
 
117
- #: easy-wp-smtp-admin-menu.php:263
118
  msgid "Force From Name Replacement"
119
  msgstr ""
120
 
121
- #: easy-wp-smtp-admin-menu.php:265
122
  msgid ""
123
  "When enabled, the plugin will set the above From Name for each email. "
124
  "Disable it if you're using contact form plugins, it will prevent the plugin "
125
  "from replacing form submitter's name when contact email is sent."
126
  msgstr ""
127
 
128
- #: easy-wp-smtp-admin-menu.php:267
129
  msgid ""
130
  "If email's From Name is empty, the plugin will set the above value "
131
  "regardless."
132
  msgstr ""
133
 
134
- #: easy-wp-smtp-admin-menu.php:272
135
  msgid "Reply-To Email Address"
136
  msgstr ""
137
 
138
- #: easy-wp-smtp-admin-menu.php:275
139
  msgid ""
140
  "Optional. This email address will be used in the 'Reply-To' field of the "
141
  "email. Leave it blank to use 'From' email as the reply-to value."
142
  msgstr ""
143
 
144
- #: easy-wp-smtp-admin-menu.php:279
145
  msgid "SMTP Host"
146
  msgstr ""
147
 
148
- #: easy-wp-smtp-admin-menu.php:282
149
  msgid "Your mail server"
150
  msgstr ""
151
 
152
- #: easy-wp-smtp-admin-menu.php:286
153
  msgid "Type of Encryption"
154
  msgstr ""
155
 
156
- #: easy-wp-smtp-admin-menu.php:288
157
  msgid "None"
158
  msgstr ""
159
 
160
- #: easy-wp-smtp-admin-menu.php:289
161
  msgid "SSL/TLS"
162
  msgstr ""
163
 
164
- #: easy-wp-smtp-admin-menu.php:290
165
  msgid "STARTTLS"
166
  msgstr ""
167
 
168
- #: easy-wp-smtp-admin-menu.php:291
169
  msgid "For most servers SSL/TLS is the recommended option"
170
  msgstr ""
171
 
172
- #: easy-wp-smtp-admin-menu.php:295
173
  msgid "SMTP Port"
174
  msgstr ""
175
 
176
- #: easy-wp-smtp-admin-menu.php:298
177
  msgid "The port to your mail server"
178
  msgstr ""
179
 
180
- #: easy-wp-smtp-admin-menu.php:302
181
  msgid "SMTP Authentication"
182
  msgstr ""
183
 
184
- #: easy-wp-smtp-admin-menu.php:304
185
  msgid "No"
186
  msgstr ""
187
 
188
- #: easy-wp-smtp-admin-menu.php:305
189
  msgid "Yes"
190
  msgstr ""
191
 
192
- #: easy-wp-smtp-admin-menu.php:306
193
  msgid "This options should always be checked 'Yes'"
194
  msgstr ""
195
 
196
- #: easy-wp-smtp-admin-menu.php:310
197
  msgid "SMTP Username"
198
  msgstr ""
199
 
200
- #: easy-wp-smtp-admin-menu.php:313
201
  msgid "The username to login to your mail server"
202
  msgstr ""
203
 
204
- #: easy-wp-smtp-admin-menu.php:317
205
  msgid "SMTP Password"
206
  msgstr ""
207
 
208
- #: easy-wp-smtp-admin-menu.php:320
209
  msgid "The password to login to your mail server"
210
  msgstr ""
211
 
212
- #: easy-wp-smtp-admin-menu.php:321 easy-wp-smtp-admin-menu.php:437
213
- #: easy-wp-smtp-admin-menu.php:487
 
214
  msgctxt "\"Note\" as in \"Note: keep this in mind\""
215
  msgid "Note:"
216
  msgstr ""
217
 
218
- #: easy-wp-smtp-admin-menu.php:321
219
  msgid ""
220
  "when you click \"Save Changes\", your actual password is stored in the "
221
  "database and then used to send emails. This field is replaced with a gag "
@@ -224,210 +227,212 @@ msgid ""
224
  "programs, for example)."
225
  msgstr ""
226
 
227
- #: easy-wp-smtp-admin-menu.php:326 easy-wp-smtp-admin-menu.php:388
 
228
  msgid "Save Changes"
229
  msgstr ""
230
 
231
- #: easy-wp-smtp-admin-menu.php:336
232
  msgid "Additional Settings (Optional)"
233
  msgstr ""
234
 
235
- #: easy-wp-smtp-admin-menu.php:340
236
  msgid "Don't Replace \"From\" Field"
237
  msgstr ""
238
 
239
- #: easy-wp-smtp-admin-menu.php:343
240
  msgid ""
241
  "Comma separated emails list. Example value: email1@domain.com, email2@domain."
242
  "com"
243
  msgstr ""
244
 
245
- #: easy-wp-smtp-admin-menu.php:344
246
  msgid ""
247
  "This option is useful when you are using several email aliases on your SMTP "
248
  "server. If you don't want your aliases to be replaced by the address "
249
  "specified in \"From\" field, enter them in this field."
250
  msgstr ""
251
 
252
- #: easy-wp-smtp-admin-menu.php:348
253
  msgid "Enable Domain Check"
254
  msgstr ""
255
 
256
- #: easy-wp-smtp-admin-menu.php:351
257
  msgid ""
258
  "This option is usually used by developers only. SMTP settings will be used "
259
  "only if the site is running on following domain(s):"
260
  msgstr ""
261
 
262
- #: easy-wp-smtp-admin-menu.php:353
263
  msgid "Coma-separated domains list. Example: domain1.com, domain2.com"
264
  msgstr ""
265
 
266
- #: easy-wp-smtp-admin-menu.php:355
267
  msgid "Block all emails"
268
  msgstr ""
269
 
270
- #: easy-wp-smtp-admin-menu.php:357
271
  msgid ""
272
  "When enabled, plugin attempts to block ALL emails from being sent out if "
273
  "domain mismtach."
274
  msgstr ""
275
 
276
- #: easy-wp-smtp-admin-menu.php:361
277
  msgid "Encrypt Password"
278
  msgstr ""
279
 
280
- #: easy-wp-smtp-admin-menu.php:365
281
  msgid ""
282
  "When enabled, your SMTP password is stored in the database using AES-256 "
283
  "encryption."
284
  msgstr ""
285
 
286
- #: easy-wp-smtp-admin-menu.php:372
287
  msgid "Allow Insecure SSL Certificates"
288
  msgstr ""
289
 
290
- #: easy-wp-smtp-admin-menu.php:375
291
  msgid ""
292
  "Allows insecure and self-signed SSL certificates on SMTP server. It's highly "
293
  "recommended to keep this option disabled."
294
  msgstr ""
295
 
296
- #: easy-wp-smtp-admin-menu.php:379
297
  msgid "Enable Debug Log"
298
  msgstr ""
299
 
300
- #: easy-wp-smtp-admin-menu.php:382
301
  msgid "Check this box to enable mail debug log"
302
  msgstr ""
303
 
304
- #: easy-wp-smtp-admin-menu.php:383
305
  msgid "Clear Log"
306
  msgstr ""
307
 
308
- #: easy-wp-smtp-admin-menu.php:383
309
  msgid "View Log"
310
  msgstr ""
311
 
312
- #: easy-wp-smtp-admin-menu.php:395
313
  msgid "Danger Zone"
314
  msgstr ""
315
 
316
- #: easy-wp-smtp-admin-menu.php:397
317
  msgid ""
318
  "Actions in this section can (and some of them will) erase or mess up your "
319
  "settings. Use it with caution."
320
  msgstr ""
321
 
322
- #: easy-wp-smtp-admin-menu.php:400
323
  msgid "Export\\Import Settings"
324
  msgstr ""
325
 
326
- #: easy-wp-smtp-admin-menu.php:402
327
  msgid "Export Settings"
328
  msgstr ""
329
 
330
- #: easy-wp-smtp-admin-menu.php:403
331
  msgid "Use this to export plugin settings to a file."
332
  msgstr ""
333
 
334
- #: easy-wp-smtp-admin-menu.php:405
335
  msgid "Import Settings"
336
  msgstr ""
337
 
338
- #: easy-wp-smtp-admin-menu.php:406
339
  msgid ""
340
  "Use this to import plugin settings from a file. Note this would replace all "
341
  "your existing settings, so use with caution."
342
  msgstr ""
343
 
344
- #: easy-wp-smtp-admin-menu.php:410
345
  msgid "Delete Settings and Deactivate Plugin"
346
  msgstr ""
347
 
348
- #: easy-wp-smtp-admin-menu.php:412
349
  msgid "Self-destruct"
350
  msgstr ""
351
 
352
- #: easy-wp-smtp-admin-menu.php:413
353
  msgid ""
354
  "This will remove ALL your settings and deactivate the plugin. Useful when "
355
  "you're uninstalling the plugin and want to completely remove all crucial "
356
  "data stored in the database."
357
  msgstr ""
358
 
359
- #: easy-wp-smtp-admin-menu.php:414
360
  msgid "Warning! This can't be undone."
361
  msgstr ""
362
 
363
- #: easy-wp-smtp-admin-menu.php:437
364
  msgid ""
365
  "You have unsaved settings. In order to send a test email, you need to go "
366
  "back to previous tab and click \"Save Changes\" button first."
367
  msgstr ""
368
 
369
- #: easy-wp-smtp-admin-menu.php:443
370
  msgid "Following error occurred when attempting to send test email:"
371
  msgstr ""
372
 
373
- #: easy-wp-smtp-admin-menu.php:446
374
  msgid ""
375
  "Test email was successfully sent. No errors occurred during the process."
376
  msgstr ""
377
 
378
- #: easy-wp-smtp-admin-menu.php:457 easy-wp-smtp-admin-menu.php:465
 
379
  msgid "Show Debug Log"
380
  msgstr ""
381
 
382
- #: easy-wp-smtp-admin-menu.php:467
383
  msgid "Hide Debug Log"
384
  msgstr ""
385
 
386
- #: easy-wp-smtp-admin-menu.php:486
387
  msgid ""
388
  "You can use this section to send an email from your server using the above "
389
  "configured SMTP details to see if the email gets delivered."
390
  msgstr ""
391
 
392
- #: easy-wp-smtp-admin-menu.php:487
393
  msgid ""
394
  "debug log for this test email will be automatically displayed right after "
395
  "you send it. Test email also ignores \"Enable Domain Check\" option."
396
  msgstr ""
397
 
398
- #: easy-wp-smtp-admin-menu.php:492
399
  msgid "To"
400
  msgstr ""
401
 
402
- #: easy-wp-smtp-admin-menu.php:495
403
  msgid "Enter the recipient's email address"
404
  msgstr ""
405
 
406
- #: easy-wp-smtp-admin-menu.php:499
407
  msgid "Subject"
408
  msgstr ""
409
 
410
- #: easy-wp-smtp-admin-menu.php:502
411
  msgid "Enter a subject for your message"
412
  msgstr ""
413
 
414
- #: easy-wp-smtp-admin-menu.php:506
415
  msgid "Message"
416
  msgstr ""
417
 
418
- #: easy-wp-smtp-admin-menu.php:509
419
  msgid "Write your email message"
420
  msgstr ""
421
 
422
- #: easy-wp-smtp-admin-menu.php:514
423
  msgid "Send Test Email"
424
  msgstr ""
425
 
426
- #: easy-wp-smtp-admin-menu.php:527
427
  msgid "Documentation"
428
  msgstr ""
429
 
430
- #: easy-wp-smtp-admin-menu.php:529
431
  #, php-format
432
  msgctxt ""
433
  "%s is replaced by <a target=\"_blank\" href=\"https://wp-ecommerce.net/easy-"
@@ -438,53 +443,53 @@ msgid ""
438
  "plugin."
439
  msgstr ""
440
 
441
- #: easy-wp-smtp-admin-menu.php:533
442
  msgid "Support"
443
  msgstr ""
444
 
445
- #: easy-wp-smtp-admin-menu.php:535
446
  #, php-format
447
  msgctxt "%s is replaced by \"Support Forum\" link"
448
  msgid "Having issues or difficulties? You can post your issue on the %s"
449
  msgstr ""
450
 
451
- #: easy-wp-smtp-admin-menu.php:535
452
  msgid "Support Forum"
453
  msgstr ""
454
 
455
- #: easy-wp-smtp-admin-menu.php:539
456
  msgid "Rate Us"
457
  msgstr ""
458
 
459
- #: easy-wp-smtp-admin-menu.php:541
460
  #, php-format
461
  msgctxt "%s is replaced by \"rating\" link"
462
  msgid "Like the plugin? Please give us a %s"
463
  msgstr ""
464
 
465
- #: easy-wp-smtp-admin-menu.php:541
466
  msgid "rating"
467
  msgstr ""
468
 
469
- #: easy-wp-smtp.php:303
470
  msgid "Error occurred during settings import"
471
  msgstr ""
472
 
473
- #: easy-wp-smtp.php:343
474
  #, php-format
475
  msgid ""
476
  "Please configure your SMTP credentials in the <a href=\"%s\">settings menu</"
477
  "a> in order to send email using Easy WP SMTP plugin."
478
  msgstr ""
479
 
480
- #: easy-wp-smtp.php:353
481
  msgid "Settings have been imported successfully."
482
  msgstr ""
483
 
484
- #: easy-wp-smtp.php:385 easy-wp-smtp.php:393
485
  msgid "Settings"
486
  msgstr ""
487
 
488
- #: easy-wp-smtp.php:554
489
  msgid "Please refresh the page and try again."
490
  msgstr ""
1
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:32
2
  msgid "Are you sure want to clear log?"
3
  msgstr ""
4
 
5
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:33
6
  msgid "Log cleared."
7
  msgstr ""
8
 
9
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:34
10
  msgid "Error occurred:"
11
  msgstr ""
12
 
13
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:35
14
  msgid "Sending..."
15
  msgstr ""
16
 
17
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:36
18
  msgid "Are you sure you want to delete ALL your settings and deactive plugin?"
19
  msgstr ""
20
 
21
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:37
22
  msgid "All settings have been deleted and plugin is deactivated."
23
  msgstr ""
24
 
25
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:47
26
  msgid "Easy WP SMTP"
27
  msgstr ""
28
 
29
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:102
30
  msgid ""
31
  "PHP OpenSSL extension is not installed on the server. It's required by Easy "
32
  "WP SMTP plugin to operate properly. Please contact your server administrator "
33
  "or hosting provider and ask them to install it."
34
  msgstr ""
35
 
36
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:105
37
  msgid ""
38
  "PHP OpenSSL extension is not installed on the server. It is required for "
39
  "encryption to work properly. Please contact your server administrator or "
40
  "hosting provider and ask them to install it."
41
  msgstr ""
42
 
43
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:112
44
  #, php-format
45
  msgid ""
46
  "Your PHP version is %s, encryption function requires PHP version 5.3.0 or "
47
  "higher."
48
  msgstr ""
49
 
50
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:117
51
  msgid "Easy WP SMTP Settings"
52
  msgstr ""
53
 
54
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:132
55
+ #: easy-wp-smtp/easy-wp-smtp.php:387
56
  msgid "Nonce check failed."
57
  msgstr ""
58
 
59
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:142
60
  msgid "Please enter a valid email address in the 'FROM' field."
61
  msgstr ""
62
 
63
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:187
64
  msgid "Please enter a valid port in the 'SMTP Port' field."
65
  msgstr ""
66
 
67
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:196
68
  msgid "Settings saved."
69
  msgstr ""
70
 
71
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:198
72
  msgid "Settings are not saved."
73
  msgstr ""
74
 
75
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:210
76
  msgid "Please enter a valid email address in the recipient email field."
77
  msgstr ""
78
 
79
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:236
80
  msgid "SMTP Settings"
81
  msgstr ""
82
 
83
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:237
84
  msgid "Additional Settings"
85
  msgstr ""
86
 
87
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:238
88
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:442
89
  msgid "Test Email"
90
  msgstr ""
91
 
92
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:250
93
  msgid "SMTP Configuration Settings"
94
  msgstr ""
95
 
96
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:253
97
  msgid ""
98
  "You can request your hosting provider for the SMTP details of your site. Use "
99
  "the SMTP details provided by your hosting provider to configure the "
100
  "following settings."
101
  msgstr ""
102
 
103
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:257
104
  msgid "From Email Address"
105
  msgstr ""
106
 
107
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:260
108
  msgid "This email address will be used in the 'From' field."
109
  msgstr ""
110
 
111
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:264
112
  msgid "From Name"
113
  msgstr ""
114
 
115
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:267
116
  msgid "This text will be used in the 'FROM' field"
117
  msgstr ""
118
 
119
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:269
120
  msgid "Force From Name Replacement"
121
  msgstr ""
122
 
123
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:271
124
  msgid ""
125
  "When enabled, the plugin will set the above From Name for each email. "
126
  "Disable it if you're using contact form plugins, it will prevent the plugin "
127
  "from replacing form submitter's name when contact email is sent."
128
  msgstr ""
129
 
130
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:273
131
  msgid ""
132
  "If email's From Name is empty, the plugin will set the above value "
133
  "regardless."
134
  msgstr ""
135
 
136
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:278
137
  msgid "Reply-To Email Address"
138
  msgstr ""
139
 
140
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:281
141
  msgid ""
142
  "Optional. This email address will be used in the 'Reply-To' field of the "
143
  "email. Leave it blank to use 'From' email as the reply-to value."
144
  msgstr ""
145
 
146
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:285
147
  msgid "SMTP Host"
148
  msgstr ""
149
 
150
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:288
151
  msgid "Your mail server"
152
  msgstr ""
153
 
154
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:292
155
  msgid "Type of Encryption"
156
  msgstr ""
157
 
158
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:294
159
  msgid "None"
160
  msgstr ""
161
 
162
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:295
163
  msgid "SSL/TLS"
164
  msgstr ""
165
 
166
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:296
167
  msgid "STARTTLS"
168
  msgstr ""
169
 
170
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:297
171
  msgid "For most servers SSL/TLS is the recommended option"
172
  msgstr ""
173
 
174
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:301
175
  msgid "SMTP Port"
176
  msgstr ""
177
 
178
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:304
179
  msgid "The port to your mail server"
180
  msgstr ""
181
 
182
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:308
183
  msgid "SMTP Authentication"
184
  msgstr ""
185
 
186
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:310
187
  msgid "No"
188
  msgstr ""
189
 
190
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:311
191
  msgid "Yes"
192
  msgstr ""
193
 
194
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:312
195
  msgid "This options should always be checked 'Yes'"
196
  msgstr ""
197
 
198
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:316
199
  msgid "SMTP Username"
200
  msgstr ""
201
 
202
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:319
203
  msgid "The username to login to your mail server"
204
  msgstr ""
205
 
206
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:323
207
  msgid "SMTP Password"
208
  msgstr ""
209
 
210
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:326
211
  msgid "The password to login to your mail server"
212
  msgstr ""
213
 
214
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:327
215
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:444
216
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:494
217
  msgctxt "\"Note\" as in \"Note: keep this in mind\""
218
  msgid "Note:"
219
  msgstr ""
220
 
221
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:327
222
  msgid ""
223
  "when you click \"Save Changes\", your actual password is stored in the "
224
  "database and then used to send emails. This field is replaced with a gag "
227
  "programs, for example)."
228
  msgstr ""
229
 
230
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:332
231
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:394
232
  msgid "Save Changes"
233
  msgstr ""
234
 
235
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:342
236
  msgid "Additional Settings (Optional)"
237
  msgstr ""
238
 
239
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:346
240
  msgid "Don't Replace \"From\" Field"
241
  msgstr ""
242
 
243
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:349
244
  msgid ""
245
  "Comma separated emails list. Example value: email1@domain.com, email2@domain."
246
  "com"
247
  msgstr ""
248
 
249
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:350
250
  msgid ""
251
  "This option is useful when you are using several email aliases on your SMTP "
252
  "server. If you don't want your aliases to be replaced by the address "
253
  "specified in \"From\" field, enter them in this field."
254
  msgstr ""
255
 
256
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:354
257
  msgid "Enable Domain Check"
258
  msgstr ""
259
 
260
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:357
261
  msgid ""
262
  "This option is usually used by developers only. SMTP settings will be used "
263
  "only if the site is running on following domain(s):"
264
  msgstr ""
265
 
266
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:359
267
  msgid "Coma-separated domains list. Example: domain1.com, domain2.com"
268
  msgstr ""
269
 
270
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:361
271
  msgid "Block all emails"
272
  msgstr ""
273
 
274
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:363
275
  msgid ""
276
  "When enabled, plugin attempts to block ALL emails from being sent out if "
277
  "domain mismtach."
278
  msgstr ""
279
 
280
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:367
281
  msgid "Encrypt Password"
282
  msgstr ""
283
 
284
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:371
285
  msgid ""
286
  "When enabled, your SMTP password is stored in the database using AES-256 "
287
  "encryption."
288
  msgstr ""
289
 
290
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:378
291
  msgid "Allow Insecure SSL Certificates"
292
  msgstr ""
293
 
294
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:381
295
  msgid ""
296
  "Allows insecure and self-signed SSL certificates on SMTP server. It's highly "
297
  "recommended to keep this option disabled."
298
  msgstr ""
299
 
300
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:385
301
  msgid "Enable Debug Log"
302
  msgstr ""
303
 
304
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:388
305
  msgid "Check this box to enable mail debug log"
306
  msgstr ""
307
 
308
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:389
309
  msgid "Clear Log"
310
  msgstr ""
311
 
312
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:389
313
  msgid "View Log"
314
  msgstr ""
315
 
316
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:401
317
  msgid "Danger Zone"
318
  msgstr ""
319
 
320
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:403
321
  msgid ""
322
  "Actions in this section can (and some of them will) erase or mess up your "
323
  "settings. Use it with caution."
324
  msgstr ""
325
 
326
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:406
327
  msgid "Export\\Import Settings"
328
  msgstr ""
329
 
330
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:408
331
  msgid "Export Settings"
332
  msgstr ""
333
 
334
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:409
335
  msgid "Use this to export plugin settings to a file."
336
  msgstr ""
337
 
338
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:411
339
  msgid "Import Settings"
340
  msgstr ""
341
 
342
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:412
343
  msgid ""
344
  "Use this to import plugin settings from a file. Note this would replace all "
345
  "your existing settings, so use with caution."
346
  msgstr ""
347
 
348
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:416
349
  msgid "Delete Settings and Deactivate Plugin"
350
  msgstr ""
351
 
352
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:418
353
  msgid "Self-destruct"
354
  msgstr ""
355
 
356
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:418
357
  msgid ""
358
  "This will remove ALL your settings and deactivate the plugin. Useful when "
359
  "you're uninstalling the plugin and want to completely remove all crucial "
360
  "data stored in the database."
361
  msgstr ""
362
 
363
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:419
364
  msgid "Warning! This can't be undone."
365
  msgstr ""
366
 
367
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:444
368
  msgid ""
369
  "You have unsaved settings. In order to send a test email, you need to go "
370
  "back to previous tab and click \"Save Changes\" button first."
371
  msgstr ""
372
 
373
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:450
374
  msgid "Following error occurred when attempting to send test email:"
375
  msgstr ""
376
 
377
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:453
378
  msgid ""
379
  "Test email was successfully sent. No errors occurred during the process."
380
  msgstr ""
381
 
382
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:464
383
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:472
384
  msgid "Show Debug Log"
385
  msgstr ""
386
 
387
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:474
388
  msgid "Hide Debug Log"
389
  msgstr ""
390
 
391
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:493
392
  msgid ""
393
  "You can use this section to send an email from your server using the above "
394
  "configured SMTP details to see if the email gets delivered."
395
  msgstr ""
396
 
397
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:494
398
  msgid ""
399
  "debug log for this test email will be automatically displayed right after "
400
  "you send it. Test email also ignores \"Enable Domain Check\" option."
401
  msgstr ""
402
 
403
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:499
404
  msgid "To"
405
  msgstr ""
406
 
407
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:502
408
  msgid "Enter the recipient's email address"
409
  msgstr ""
410
 
411
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:506
412
  msgid "Subject"
413
  msgstr ""
414
 
415
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:509
416
  msgid "Enter a subject for your message"
417
  msgstr ""
418
 
419
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:513
420
  msgid "Message"
421
  msgstr ""
422
 
423
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:516
424
  msgid "Write your email message"
425
  msgstr ""
426
 
427
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:521
428
  msgid "Send Test Email"
429
  msgstr ""
430
 
431
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:534
432
  msgid "Documentation"
433
  msgstr ""
434
 
435
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:536
436
  #, php-format
437
  msgctxt ""
438
  "%s is replaced by <a target=\"_blank\" href=\"https://wp-ecommerce.net/easy-"
443
  "plugin."
444
  msgstr ""
445
 
446
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:540
447
  msgid "Support"
448
  msgstr ""
449
 
450
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:542
451
  #, php-format
452
  msgctxt "%s is replaced by \"Support Forum\" link"
453
  msgid "Having issues or difficulties? You can post your issue on the %s"
454
  msgstr ""
455
 
456
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:542
457
  msgid "Support Forum"
458
  msgstr ""
459
 
460
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:546
461
  msgid "Rate Us"
462
  msgstr ""
463
 
464
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:548
465
  #, php-format
466
  msgctxt "%s is replaced by \"rating\" link"
467
  msgid "Like the plugin? Please give us a %s"
468
  msgstr ""
469
 
470
+ #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:548
471
  msgid "rating"
472
  msgstr ""
473
 
474
+ #: easy-wp-smtp/easy-wp-smtp.php:317
475
  msgid "Error occurred during settings import"
476
  msgstr ""
477
 
478
+ #: easy-wp-smtp/easy-wp-smtp.php:368
479
  #, php-format
480
  msgid ""
481
  "Please configure your SMTP credentials in the <a href=\"%s\">settings menu</"
482
  "a> in order to send email using Easy WP SMTP plugin."
483
  msgstr ""
484
 
485
+ #: easy-wp-smtp/easy-wp-smtp.php:378
486
  msgid "Settings have been imported successfully."
487
  msgstr ""
488
 
489
+ #: easy-wp-smtp/easy-wp-smtp.php:415 easy-wp-smtp/easy-wp-smtp.php:424
490
  msgid "Settings"
491
  msgstr ""
492
 
493
+ #: easy-wp-smtp/easy-wp-smtp.php:592
494
  msgid "Please refresh the page and try again."
495
  msgstr ""
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: wpecommerce, wp.insider, alexanderfoxc
3
  Donate link: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
4
  Tags: mail, wordpress smtp, phpmailer, smtp, wp_mail, email, gmail, outgoing mail, privacy, security, sendmail, ssl, tls, wp-phpmailer, mail smtp, wp smtp
5
  Requires at least: 4.3
6
- Tested up to: 5.3
7
  Requires PHP: 5.3
8
- Stable tag: 1.3.9.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -79,6 +79,11 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
82
  = 1.3.9.1 =
83
  * Fixed potential vulnerability in import\export settings.
84
 
@@ -183,9 +188,6 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
183
  = 1.1.7 =
184
  * Made some improvements to the encoding option.
185
 
186
- = 1.1.7 =
187
- * Made some improvements to the encoding option.
188
-
189
  = 1.1.6 =
190
  * Fixed some character encoding issues of test email functionality
191
  * Plugin will now force the from name and email address saved in the settings (just like version 1.1.1)
@@ -231,6 +233,7 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
231
 
232
  = 1.0.3 =
233
  * Added a new option to the settings which allows a user to enable/disable SMTP debug
 
234
  = 1.0.2 =
235
  * Fixed a bug where the debug output was being displayed on the front end
236
 
@@ -238,4 +241,4 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
238
  * First commit of the plugin
239
 
240
  == Upgrade Notice ==
241
- There were some major changes in version 1.0.8. So you will need to reconfigure the SMTP options after the upgrade.
3
  Donate link: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
4
  Tags: mail, wordpress smtp, phpmailer, smtp, wp_mail, email, gmail, outgoing mail, privacy, security, sendmail, ssl, tls, wp-phpmailer, mail smtp, wp smtp
5
  Requires at least: 4.3
6
+ Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 1.3.9.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.3.9.2 =
83
+ * Settings are exported in JSON format now.
84
+ * Added additional sanitization to some actions on the settings page.
85
+ * Regenerated .pot file.
86
+
87
  = 1.3.9.1 =
88
  * Fixed potential vulnerability in import\export settings.
89
 
188
  = 1.1.7 =
189
  * Made some improvements to the encoding option.
190
 
 
 
 
191
  = 1.1.6 =
192
  * Fixed some character encoding issues of test email functionality
193
  * Plugin will now force the from name and email address saved in the settings (just like version 1.1.1)
233
 
234
  = 1.0.3 =
235
  * Added a new option to the settings which allows a user to enable/disable SMTP debug
236
+
237
  = 1.0.2 =
238
  * Fixed a bug where the debug output was being displayed on the front end
239
 
241
  * First commit of the plugin
242
 
243
  == Upgrade Notice ==
244
+ Upgrade to 1.3.9.2 is highly recommended as it adds additional CSRF protection for some admin-side functions.
screenshot-2.jpg ADDED
Binary file