Easy WP SMTP - Version 1.3.9.1

Version Description

  • Fixed potential vulnerability in import\export settings.
Download this release

Release Info

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

Code changes from version 1.3.6 to 1.3.9.1

css/style.css CHANGED
@@ -20,4 +20,62 @@ textarea#swpsmtp_message{
20
  border-radius: 3px 3px 3px 3px;
21
  border-style: solid;
22
  border-width: 1px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
20
  border-radius: 3px 3px 3px 3px;
21
  border-style: solid;
22
  border-width: 1px;
23
+ }
24
+ div.swpsmtp-tab-container, #swpsmtp-save-settings-notice {
25
+ display: none;
26
+ }
27
+ #swpsmtp-spinner {
28
+ float: none;
29
+ vertical-align: top;
30
+ }
31
+ div.swpsmtp-tab-container {
32
+ padding-top: 10px;
33
+ }
34
+ .swpsmtp-stars-container {
35
+ text-align: center;
36
+ margin-top: 10px;
37
+ }
38
+ .swpsmtp-stars-container span {
39
+ vertical-align: text-top;
40
+ color: #ffb900;
41
+ }
42
+ .swpsmtp-stars-container a {
43
+ text-decoration: none;
44
+ }
45
+ .swpsmtp-settings-grid {
46
+ display:inline-block;
47
+ }
48
+ .swpsmtp-settings-main-cont {
49
+ width: 80%;
50
+ }
51
+ .swpsmtp-settings-sidebar-cont {
52
+ width: 19%;
53
+ float: right;
54
+ padding-top: 10px;
55
+ }
56
+
57
+ div.swpsmtp-msg-cont {
58
+ clear: both;
59
+ margin-bottom: 10px;
60
+ padding: 5px 10px;
61
+ border-radius: 2px;
62
+ background-color: #ffffe0;
63
+ }
64
+ div.swpsmtp-msg-cont.msg-error {
65
+ border-left: 5px solid red;
66
+ }
67
+ div.swpsmtp-msg-cont.msg-success {
68
+ border-left: 5px solid green;
69
+ }
70
+
71
+ #swpsmtp-debug-log-cont {
72
+ display: none;
73
+ }
74
+
75
+ @media (max-width: 782px) {
76
+ .swpsmtp-settings-grid {
77
+ display: block;
78
+ float: none;
79
+ width: 100%;
80
+ }
81
  }
easy-wp-smtp-admin-menu.php CHANGED
@@ -1,14 +1,51 @@
1
  <?php
2
 
3
- /**
4
- * Add menu and submenu.
5
- * @return void
6
- */
7
- function swpsmtp_admin_default_setup() {
8
- //add_submenu_page( 'options-general.php', __( 'Easy WP SMTP', 'easy-wp-smtp' ), __( 'Easy WP SMTP', 'easy-wp-smtp' ), $capabilities, 'swpsmtp_settings', 'swpsmtp_settings' );
9
- add_options_page( __( 'Easy WP SMTP', 'easy-wp-smtp' ), __( 'Easy WP SMTP', 'easy-wp-smtp' ), 'manage_options', 'swpsmtp_settings', 'swpsmtp_settings' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
 
 
 
12
  /**
13
  * Sanitizes textarea. Tries to use wp sanitize_textarea_field() function. If that's not available, uses its own methods
14
  * @return string
@@ -50,12 +87,26 @@ function swpsmtp_sanitize_textarea( $str ) {
50
  * @return void
51
  */
52
  function swpsmtp_settings() {
 
 
 
53
  //check if OpenSSL PHP extension is loaded and display warning if it's not
54
  if ( ! extension_loaded( 'openssl' ) ) {
55
- $class = 'notice notice-warning';
56
- $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' );
57
  printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
 
 
 
58
  }
 
 
 
 
 
 
 
 
59
  echo '<div class="wrap" id="swpsmtp-mail">';
60
  echo '<h2>' . __( "Easy WP SMTP Settings", 'easy-wp-smtp' ) . '</h2>';
61
  echo '<div id="poststuff"><div id="post-body">';
@@ -104,13 +155,13 @@ function swpsmtp_settings() {
104
 
105
  $smtp_password = $_POST[ 'swpsmtp_smtp_password' ];
106
  if ( $smtp_password !== $gag_password ) {
107
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = swpsmtp_encrypt_password( $smtp_password );
108
  }
109
 
110
  if ( $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] && ! get_option( 'swpsmtp_pass_encrypted', false ) ) {
111
  update_option( 'swpsmtp_options', $swpsmtp_options );
112
- $pass = swpsmtp_get_password();
113
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = swpsmtp_encrypt_password( $pass );
114
  update_option( 'swpsmtp_options', $swpsmtp_options );
115
  }
116
 
@@ -163,75 +214,11 @@ function swpsmtp_settings() {
163
  update_option( 'smtp_test_mail', $smtp_test_mail );
164
 
165
  if ( ! empty( $swpsmtp_to ) ) {
166
- $test_res = swpsmtp_test_mail( $swpsmtp_to, $swpsmtp_subject, $swpsmtp_message );
167
  }
168
  }
169
-
170
- //check if server meets encryption requirements
171
- $enc_req_met = true;
172
- $enc_req_err = '';
173
- if ( ! extension_loaded( 'openssl' ) ) {
174
- $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 />';
175
- $enc_req_met = false;
176
- }
177
- if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) {
178
- $enc_req_err = ! empty( $enc_req_err ) ? $enc_req_err .= '<br />' : '';
179
- $enc_req_err .= sprintf( __( 'Your PHP version is %s, encryption function requires PHP version 5.3.0 or higher.', 'easy-wp-smtp' ), PHP_VERSION );
180
- $enc_req_met = false;
181
- }
182
  ?>
183
- <style>
184
- div.swpsmtp-tab-container, #swpsmtp-save-settings-notice {
185
- display: none;
186
- }
187
- .swpsmtp-stars-container {
188
- text-align: center;
189
- margin-top: 10px;
190
- }
191
- .swpsmtp-stars-container span {
192
- vertical-align: text-top;
193
- color: #ffb900;
194
- }
195
- .swpsmtp-stars-container a {
196
- text-decoration: none;
197
- }
198
- .swpsmtp-settings-grid {
199
- display:inline-block;
200
- }
201
- .swpsmtp-settings-main-cont {
202
- width: 80%;
203
- }
204
- .swpsmtp-settings-sidebar-cont {
205
- width: 19%;
206
- float: right;
207
- }
208
-
209
- div.swpsmtp-msg-cont {
210
- clear: both;
211
- margin-bottom: 10px;
212
- padding: 5px 10px;
213
- border-radius: 2px;
214
- background-color: #ffffe0;
215
- }
216
- div.swpsmtp-msg-cont.msg-error {
217
- border-left: 5px solid red;
218
- }
219
- div.swpsmtp-msg-cont.msg-success {
220
- border-left: 5px solid green;
221
- }
222
-
223
- #swpsmtp-debug-log-cont {
224
- display: none;
225
- }
226
-
227
- @media (max-width: 782px) {
228
- .swpsmtp-settings-grid {
229
- display: block;
230
- float: none;
231
- width: 100%;
232
- }
233
- }
234
- </style>
235
  <div class="updated fade" <?php if ( empty( $message ) ) echo "style=\"display:none\""; ?>>
236
  <p><strong><?php echo $message; ?></strong></p>
237
  </div>
@@ -245,9 +232,6 @@ function swpsmtp_settings() {
245
  <a href="#testemail" data-tab-name="testemail" class="nav-tab"><?php _e( 'Test Email', 'easy-wp-smtp' ); ?></a>
246
  </div>
247
 
248
- <div class="swpsmtp-yellow-box">
249
- <?php _ex( sprintf( "Please visit the %s plugin's documentation page to learn how to use this plugin.", '<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>' ), '%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' ); ?>
250
- </div>
251
  <div class="swpsmtp-settings-container">
252
  <div class="swpsmtp-settings-grid swpsmtp-settings-main-cont">
253
 
@@ -302,9 +286,9 @@ function swpsmtp_settings() {
302
  <th><?php _e( 'Type of Encryption', 'easy-wp-smtp' ); ?></th>
303
  <td>
304
  <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>
305
- <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', 'easy-wp-smtp' ); ?></label>
306
- <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( 'TLS', 'easy-wp-smtp' ); ?></label><br />
307
- <p class="description"><?php _e( "For most servers SSL is the recommended option", 'easy-wp-smtp' ); ?></p>
308
  </td>
309
  </tr>
310
  <tr class="ad_opt swpsmtp_smtp_options">
@@ -332,9 +316,9 @@ function swpsmtp_settings() {
332
  <tr class="ad_opt swpsmtp_smtp_options">
333
  <th><?php _e( 'SMTP Password', 'easy-wp-smtp' ); ?></th>
334
  <td>
335
- <input id='swpsmtp_smtp_password' type='password' name='swpsmtp_smtp_password' value='<?php echo (swpsmtp_get_password() !== '' ? $gag_password : ''); ?>' autocomplete='new-password' /><br />
336
  <p class="description"><?php _e( "The password to login to your mail server", 'easy-wp-smtp' ); ?></p>
337
- <p class="description"><b><?php _e( 'Note', '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>
338
  </td>
339
  </tr>
340
  </table>
@@ -365,7 +349,7 @@ function swpsmtp_settings() {
365
  <td>
366
  <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' : ''; ?>/>
367
  <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>
368
- <input id="swpsmtp_allowed_domains" type="text" name="swpsmtp_allowed_domains" value="<?php echo base64_decode_maybe( $swpsmtp_options[ 'allowed_domains' ] ); ?>"<?php echo (isset( $swpsmtp_options[ 'enable_domain_check' ] ) && ($swpsmtp_options[ 'enable_domain_check' ])) ? '' : ' disabled'; ?>/>
369
  <p class="description"><?php _e( "Coma-separated domains list. Example: domain1.com, domain2.com", 'easy-wp-smtp' ); ?></p>
370
  <p>
371
  <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>
@@ -406,23 +390,60 @@ function swpsmtp_settings() {
406
 
407
  </div><!-- end of inside -->
408
  </div><!-- end of postbox -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  </div>
410
  </form>
411
 
 
 
 
 
 
 
 
 
 
412
  <div class="swpsmtp-tab-container" data-tab-name="testemail">
413
  <div class="postbox">
414
  <h3 class="hndle"><label for="title"><?php _e( 'Test Email', 'easy-wp-smtp' ); ?></label></h3>
415
  <div class="inside">
416
- <div id="swpsmtp-save-settings-notice" class="swpsmtp-msg-cont msg-error"><b><?php _e( 'Notice:', '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>
417
 
418
  <?php
419
  if ( isset( $test_res ) && is_array( $test_res ) ) {
420
  if ( isset( $test_res[ 'error' ] ) ) {
421
  $errmsg_class = ' msg-error';
422
- $errmsg_text = '<b>' . __( 'Following error occured when attempting to send test email:', 'easy-wp-smtp' ) . '</b><br />' . $test_res[ 'error' ];
423
  } else {
424
  $errmsg_class = ' msg-success';
425
- $errmsg_text = '<b>' . __( 'Test email was successfully sent. No errors occured during the process.', 'easy-wp-smtp' ) . '</b>';
426
  }
427
  ?>
428
 
@@ -493,6 +514,7 @@ function swpsmtp_settings() {
493
  <input type="submit" id="test-email-form-submit" class="button-primary" value="<?php _e( 'Send Test Email', 'easy-wp-smtp' ) ?>" />
494
  <input type="hidden" name="swpsmtp_test_submit" value="submit" />
495
  <?php wp_nonce_field( plugin_basename( __FILE__ ), 'swpsmtp_test_nonce_name' ); ?>
 
496
  </p>
497
  </form>
498
  </div><!-- end of inside -->
@@ -501,6 +523,12 @@ function swpsmtp_settings() {
501
  </div>
502
  </div>
503
  <div class="swpsmtp-settings-grid swpsmtp-settings-sidebar-cont">
 
 
 
 
 
 
504
  <div class="postbox" style="min-width: inherit;">
505
  <h3 class="hndle"><label for="title"><?php _e( "Support", 'easy-wp-smtp' ); ?></label></h3>
506
  <div class="inside">
@@ -512,131 +540,15 @@ function swpsmtp_settings() {
512
  <div class="inside">
513
  <?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' ) ) ); ?>
514
  <div class="swpsmtp-stars-container">
515
- <a href="https://wordpress.org/support/plugin/easy-wp-smtp/reviews/#new-post" 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>
516
  </a>
517
  </div>
518
  </div>
519
  </div>
520
  </div>
521
  </div>
522
- <div class="swpsmtp-yellow-box">
523
- <?php _ex( sprintf( "Please visit the %s plugin's documentation page to learn how to use this plugin.", '<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>' ), '%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' ); ?>
524
- </div>
525
-
526
- <script>
527
- function parseHash(hash) {
528
- hash = hash.substring(1, hash.length);
529
-
530
- var hashObj = [];
531
-
532
- hash.split('&').forEach(function (q) {
533
- if (typeof q !== 'undefined') {
534
- hashObj.push(q);
535
- }
536
- });
537
-
538
- return hashObj;
539
- }
540
-
541
- var swpsmtp_urlHash = 'smtp';
542
- var swpsmtp_focusObj = false;
543
- var swpsmtp_urlHashArr = parseHash(window.location.hash);
544
-
545
- if (swpsmtp_urlHashArr[0] !== '') {
546
- swpsmtp_urlHash = swpsmtp_urlHashArr[0];
547
- }
548
-
549
- if (swpsmtp_urlHashArr[1] !== "undefined") {
550
- swpsmtp_focusObj = swpsmtp_urlHashArr[1];
551
- }
552
-
553
- jQuery(function ($) {
554
- var swpsmtp_activeTab = "";
555
- $('a.nav-tab').click(function (e) {
556
- if ($(this).attr('data-tab-name') !== swpsmtp_activeTab) {
557
- $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').hide();
558
- $('a.nav-tab[data-tab-name="' + swpsmtp_activeTab + '"]').removeClass('nav-tab-active');
559
- swpsmtp_activeTab = $(this).attr('data-tab-name');
560
- $('div.swpsmtp-tab-container[data-tab-name="' + swpsmtp_activeTab + '"]').show();
561
- $(this).addClass('nav-tab-active');
562
- $('input#swpsmtp-urlHash').val(swpsmtp_activeTab);
563
- if (window.location.hash !== swpsmtp_activeTab) {
564
- window.location.hash = swpsmtp_activeTab;
565
- }
566
- if (swpsmtp_focusObj) {
567
- $('html, body').animate({
568
- scrollTop: $('#' + swpsmtp_focusObj).offset().top
569
- }, 'fast', function () {
570
- $('#' + swpsmtp_focusObj).focus();
571
- swpsmtp_focusObj = false;
572
- });
573
- }
574
- }
575
- });
576
- $('a.nav-tab[data-tab-name="' + swpsmtp_urlHash + '"]').trigger('click');
577
- });
578
-
579
- jQuery(function ($) {
580
- $('#swpsmtp-mail input').not('.ignore-change').change(function () {
581
- $('#swpsmtp-save-settings-notice').show();
582
- ;
583
- });
584
- $('#swpsmtp_enable_domain_check').change(function () {
585
- $('input[name="swpsmtp_allowed_domains"]').prop('disabled', !$(this).is(':checked'));
586
- $('input[name="swpsmtp_block_all_emails"]').prop('disabled', !$(this).is(':checked'));
587
- });
588
- $('#swpsmtp_clear_log_btn').click(function (e) {
589
- e.preventDefault();
590
- if (confirm("<?php _e( 'Are you sure want to clear log?', 'easy-wp-smtp' ); ?>")) {
591
- var req = jQuery.ajax({
592
- url: ajaxurl,
593
- type: "post",
594
- data: {action: "swpsmtp_clear_log"}
595
- });
596
- req.done(function (data) {
597
- if (data === '1') {
598
- alert("<?php _e( 'Log cleared.', 'easy-wp-smtp' ); ?>");
599
- } else {
600
- alert("Error occured: " + data);
601
- }
602
- });
603
- }
604
- });
605
- });
606
-
607
- </script>
608
 
609
  <?php
610
  echo '</div></div>'; //<!-- end of #poststuff and #post-body -->
611
  echo '</div>'; //<!-- end of .wrap #swpsmtp-mail .swpsmtp-mail -->
612
  }
613
-
614
- /**
615
- * Plugin functions for init
616
- * @return void
617
- */
618
- function swpsmtp_admin_init() {
619
- /* Internationalization, first(!) */
620
- load_plugin_textdomain( 'easy-wp-smtp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
621
-
622
- add_action( 'wp_ajax_swpsmtp_clear_log', 'swpsmtp_clear_log' );
623
- //view log file
624
- if ( isset( $_GET[ 'swpsmtp_action' ] ) ) {
625
- if ( $_GET[ 'swpsmtp_action' ] === 'view_log' ) {
626
- $swpsmtp_options = get_option( 'swpsmtp_options' );
627
- $log_file_name = $swpsmtp_options[ 'smtp_settings' ][ 'log_file_name' ];
628
- if ( ! file_exists( plugin_dir_path( __FILE__ ) . $log_file_name ) ) {
629
- if ( swpsmtp_write_to_log( "Easy WP SMTP debug log file\r\n\r\n" ) === false ) {
630
- wp_die( 'Can\'t write to log file. Check if plugin directory (' . plugin_dir_path( __FILE__ ) . ') is writeable.' );
631
- };
632
- }
633
- $logfile = fopen( plugin_dir_path( __FILE__ ) . $log_file_name, 'rb' );
634
- if ( ! $logfile ) {
635
- wp_die( 'Can\'t open log file.' );
636
- }
637
- header( 'Content-Type: text/plain' );
638
- fpassthru( $logfile );
639
- die;
640
- }
641
- }
642
- }
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
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">';
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
 
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>
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
 
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">
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>
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>
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
 
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 -->
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">
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 CHANGED
@@ -27,6 +27,16 @@ class SWPSMTPUtils {
27
  return self::$instance;
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
30
  function encrypt_password( $pass ) {
31
  if ( $pass === '' ) {
32
  return '';
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 '';
easy-wp-smtp.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy WP SMTP
4
- Version: 1.3.6
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/
@@ -12,127 +12,71 @@
12
 
13
  //Prefix/Slug - swpsmtp
14
 
15
- include_once('easy-wp-smtp-admin-menu.php');
16
 
17
- /**
18
- * Add action links on plugin page in to Plugin Name block
19
- * @param $links array() action links
20
- * @param $file string relative path to pugin "easy-wp-smtp/easy-wp-smtp.php"
21
- * @return $links array() action links
22
- */
23
- if ( ! function_exists( 'swpsmtp_plugin_action_links' ) ) {
24
-
25
- function swpsmtp_plugin_action_links( $links, $file ) {
26
- /* Static so we don't call plugin_basename on every plugin row. */
27
- static $this_plugin;
28
- if ( ! $this_plugin ) {
29
- $this_plugin = plugin_basename( __FILE__ );
30
- }
31
- if ( $file == $this_plugin ) {
32
- $settings_link = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
33
- array_unshift( $links, $settings_link );
34
- }
35
- return $links;
36
- }
37
-
38
- }
39
 
40
- /**
41
- * Add action links on plugin page in to Plugin Description block
42
- * @param $links array() action links
43
- * @param $file string relative path to pugin "easy-wp-smtp/easy-wp-smtp.php"
44
- * @return $links array() action links
45
- */
46
- if ( ! function_exists( 'swpsmtp_register_plugin_links' ) ) {
47
 
48
- function swpsmtp_register_plugin_links( $links, $file ) {
49
- $base = plugin_basename( __FILE__ );
50
- if ( $file == $base ) {
51
- $links[] = '<a href="options-general.php?page=swpsmtp_settings">' . __( 'Settings', 'easy-wp-smtp' ) . '</a>';
 
 
 
 
 
 
 
 
52
  }
53
- return $links;
54
- }
55
-
56
- }
57
-
58
- //plugins_loaded action hook handler
59
- if ( ! function_exists( 'swpsmtp_plugins_loaded_handler' ) ) {
60
-
61
- function swpsmtp_plugins_loaded_handler() {
62
- load_plugin_textdomain( 'easy-wp-smtp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
63
  }
64
 
65
- }
66
-
67
-
68
- /**
69
- * Function to add plugin scripts
70
- * @return void
71
- */
72
- if ( ! function_exists( 'swpsmtp_admin_head' ) ) {
73
-
74
- function swpsmtp_admin_head() {
75
- wp_enqueue_style( 'swpsmtp_stylesheet', plugins_url( 'css/style.css', __FILE__ ) );
76
- }
77
-
78
- }
79
 
80
- function swpsmtp_clear_log() {
81
- if ( swpsmtp_write_to_log( "Easy WP SMTP debug log file\r\n\r\n", true ) !== false ) {
82
- echo '1';
83
- } else {
84
- echo 'Can\'t clear log - log file is not writeable.';
85
- }
86
- wp_die();
87
- }
88
 
89
- function swpsmtp_write_to_log( $str, $overwrite = false ) {
90
- $swpsmtp_options = get_option( 'swpsmtp_options' );
91
- if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'log_file_name' ] ) ) {
92
- $log_file_name = $swpsmtp_options[ 'smtp_settings' ][ 'log_file_name' ];
93
- } else {
94
- // let's generate log file name
95
- $log_file_name = uniqid() . '_debug_log.txt';
96
- $swpsmtp_options[ 'smtp_settings' ][ 'log_file_name' ] = $log_file_name;
97
- update_option( 'swpsmtp_options', $swpsmtp_options );
98
- file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, "Easy WP SMTP debug log file\r\n\r\n" );
99
  }
100
- return(file_put_contents( plugin_dir_path( __FILE__ ) . $log_file_name, $str, ( ! $overwrite ? FILE_APPEND : 0 ) ));
101
- }
102
 
103
- function base64_decode_maybe( $str ) {
104
- if ( ! function_exists( 'mb_detect_encoding' ) ) {
105
- return base64_decode( $str );
106
- }
107
- if ( mb_detect_encoding( $str ) === mb_detect_encoding( base64_decode( base64_encode( base64_decode( $str ) ) ) ) ) {
108
- $str = base64_decode( $str );
 
 
 
 
 
109
  }
110
- return $str;
111
- }
112
 
113
- /**
114
- * Function to add smtp options in the phpmailer_init
115
- * @return void
116
- */
117
- if ( ! function_exists( 'swpsmtp_init_smtp' ) ) {
118
-
119
- function swpsmtp_init_smtp( &$phpmailer ) {
120
  //check if SMTP credentials have been configured.
121
- if ( ! swpsmtp_credentials_configured() ) {
122
  return;
123
  }
124
- $swpsmtp_options = get_option( 'swpsmtp_options' );
125
  //check if Domain Check enabled
126
- $domain = swpsmtp_is_domain_blocked();
127
  if ( $domain !== false ) {
128
  //domain check failed
129
  //let's check if we have block all emails option enabled
130
- if ( isset( $swpsmtp_options[ 'block_all_emails' ] ) && $swpsmtp_options[ 'block_all_emails' ] === 1 ) {
131
  // it's enabled. Let's use gag mailer class that would prevent emails from being sent out.
132
  $phpmailer = new swpsmtp_gag_mailer();
133
  } else {
134
  // it's disabled. Let's write some info to the log
135
- swpsmtp_write_to_log(
136
  "\r\n------------------------------------------------------------------------------------------------------\r\n" .
137
  "Domain check failed: website domain (" . $domain . ") is not in allowed domains list.\r\n" .
138
  "SMTP settings won't be used.\r\n" .
@@ -140,28 +84,29 @@ if ( ! function_exists( 'swpsmtp_init_smtp' ) ) {
140
  }
141
  return;
142
  }
 
143
  /* Set the mailer type as per config above, this overrides the already called isMail method */
144
  $phpmailer->IsSMTP();
145
- if ( isset( $swpsmtp_options[ 'force_from_name_replace' ] ) && $swpsmtp_options[ 'force_from_name_replace' ] === 1 ) {
146
- $from_name = $swpsmtp_options[ 'from_name_field' ];
147
  } else {
148
- $from_name = ! empty( $phpmailer->FromName ) ? $phpmailer->FromName : $swpsmtp_options[ 'from_name_field' ];
149
  }
150
- $from_email = $swpsmtp_options[ 'from_email_field' ];
151
  //set ReplyTo option if needed
152
  //this should be set before SetFrom, otherwise might be ignored
153
- if ( ! empty( $swpsmtp_options[ 'reply_to_email' ] ) ) {
154
- $phpmailer->AddReplyTo( $swpsmtp_options[ 'reply_to_email' ], $from_name );
155
  }
156
  // let's see if we have email ignore list populated
157
- if ( isset( $swpsmtp_options[ 'email_ignore_list' ] ) && ! empty( $swpsmtp_options[ 'email_ignore_list' ] ) ) {
158
- $emails_arr = explode( ',', $swpsmtp_options[ 'email_ignore_list' ] );
159
  if ( is_array( $emails_arr ) && ! empty( $emails_arr ) ) {
160
  //we have coma-separated list
161
  } else {
162
  //it's single email
163
  unset( $emails_arr );
164
- $emails_arr = array( $swpsmtp_options[ 'email_ignore_list' ] );
165
  }
166
  $from = $phpmailer->From;
167
  $match_found = false;
@@ -183,24 +128,24 @@ if ( ! function_exists( 'swpsmtp_init_smtp' ) ) {
183
  //This should set Return-Path header for servers that are not properly handling it, but needs testing first
184
  //$phpmailer->Sender = $phpmailer->From;
185
  /* Set the SMTPSecure value */
186
- if ( $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] !== 'none' ) {
187
- $phpmailer->SMTPSecure = $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ];
188
  }
189
 
190
  /* Set the other options */
191
- $phpmailer->Host = $swpsmtp_options[ 'smtp_settings' ][ 'host' ];
192
- $phpmailer->Port = $swpsmtp_options[ 'smtp_settings' ][ 'port' ];
193
 
194
  /* If we're using smtp auth, set the username & password */
195
- if ( 'yes' == $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) {
196
  $phpmailer->SMTPAuth = true;
197
- $phpmailer->Username = $swpsmtp_options[ 'smtp_settings' ][ 'username' ];
198
- $phpmailer->Password = swpsmtp_get_password();
199
  }
200
  //PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate.
201
  $phpmailer->SMTPAutoTLS = false;
202
 
203
- if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] ) && $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] !== false ) {
204
  // Insecure SSL option enabled
205
  $phpmailer->SMTPOptions = array(
206
  'ssl' => array(
@@ -210,30 +155,22 @@ if ( ! function_exists( 'swpsmtp_init_smtp' ) ) {
210
  ) );
211
  }
212
 
213
- if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'enable_debug' ] ) && $swpsmtp_options[ 'smtp_settings' ][ 'enable_debug' ] ) {
214
  $phpmailer->Debugoutput = function($str, $level) {
215
- swpsmtp_write_to_log( $str );
216
  };
217
  $phpmailer->SMTPDebug = 1;
218
  }
 
 
219
  }
220
 
221
- }
222
-
223
- /**
224
- * Function to test mail sending
225
- * @return text or errors
226
- */
227
- if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
228
-
229
- function swpsmtp_test_mail( $to_email, $subject, $message ) {
230
  $ret = array();
231
- if ( ! swpsmtp_credentials_configured() ) {
232
  return false;
233
  }
234
 
235
- $swpsmtp_options = get_option( 'swpsmtp_options' );
236
-
237
  require_once( ABSPATH . WPINC . '/class-phpmailer.php' );
238
  $mail = new PHPMailer( true );
239
 
@@ -242,8 +179,8 @@ if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
242
  $charset = get_bloginfo( 'charset' );
243
  $mail->CharSet = $charset;
244
 
245
- $from_name = $swpsmtp_options[ 'from_name_field' ];
246
- $from_email = $swpsmtp_options[ 'from_email_field' ];
247
 
248
  $mail->IsSMTP();
249
 
@@ -252,21 +189,21 @@ if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
252
  $mail->IsHTML( false );
253
 
254
  /* If using smtp auth, set the username & password */
255
- if ( 'yes' == $swpsmtp_options[ 'smtp_settings' ][ 'autentication' ] ) {
256
  $mail->SMTPAuth = true;
257
- $mail->Username = $swpsmtp_options[ 'smtp_settings' ][ 'username' ];
258
- $mail->Password = swpsmtp_get_password();
259
  }
260
 
261
  /* Set the SMTPSecure value, if set to none, leave this blank */
262
- if ( $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ] !== 'none' ) {
263
- $mail->SMTPSecure = $swpsmtp_options[ 'smtp_settings' ][ 'type_encryption' ];
264
  }
265
 
266
  /* PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate. */
267
  $mail->SMTPAutoTLS = false;
268
 
269
- if ( isset( $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] ) && $swpsmtp_options[ 'smtp_settings' ][ 'insecure_ssl' ] !== false ) {
270
  // Insecure SSL option enabled
271
  $mail->SMTPOptions = array(
272
  'ssl' => array(
@@ -277,10 +214,10 @@ if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
277
  }
278
 
279
  /* Set the other options */
280
- $mail->Host = $swpsmtp_options[ 'smtp_settings' ][ 'host' ];
281
- $mail->Port = $swpsmtp_options[ 'smtp_settings' ][ 'port' ];
282
- if ( ! empty( $swpsmtp_options[ 'reply_to_email' ] ) ) {
283
- $mail->AddReplyTo( $swpsmtp_options[ 'reply_to_email' ], $from_name );
284
  }
285
  $mail->SetFrom( $from_email, $from_name );
286
  //This should set Return-Path header for servers that are not properly handling it, but needs testing first
@@ -295,6 +232,8 @@ if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
295
  $debugMSG .= $str;
296
  };
297
  $mail->SMTPDebug = 1;
 
 
298
 
299
  /* Send mail and return result */
300
  $mail->Send();
@@ -309,51 +248,216 @@ if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
309
  return $ret;
310
  }
311
 
312
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
 
314
- function swpsmtp_encrypt_password( $pass ) {
315
- if ( $pass === '' ) {
316
- return '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
 
319
- $swpsmtp_options = get_option( 'swpsmtp_options' );
 
 
 
 
 
 
 
 
320
 
321
- if ( empty( $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] ) || ! extension_loaded( 'openssl' ) ) {
322
- // no openssl extension loaded - we can't encrypt the password
323
- $password = base64_encode( $pass );
324
- update_option( 'swpsmtp_pass_encrypted', false );
325
- } else {
326
- // let's encrypt password
327
- require_once('easy-wp-smtp-utils.php');
328
- $cryptor = SWPSMTPUtils::get_instance();
329
- $password = $cryptor->encrypt_password( $pass );
330
- update_option( 'swpsmtp_pass_encrypted', true );
331
  }
332
- return $password;
333
- }
334
 
335
- if ( ! function_exists( 'swpsmtp_get_password' ) ) {
 
 
 
 
 
 
 
336
 
337
- function swpsmtp_get_password() {
338
- $swpsmtp_options = get_option( 'swpsmtp_options' );
 
 
 
 
 
 
 
 
 
 
 
 
339
 
340
- $temp_password = isset( $swpsmtp_options[ 'smtp_settings' ][ 'password' ] ) ? $swpsmtp_options[ 'smtp_settings' ][ 'password' ] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  if ( $temp_password == '' ) {
342
  return '';
343
  }
344
 
345
- if ( get_option( 'swpsmtp_pass_encrypted' ) ) {
346
- //this is encrypted password
347
- require_once('easy-wp-smtp-utils.php');
348
- $cryptor = SWPSMTPUtils::get_instance();
349
- $decrypted = $cryptor->decrypt_password( $temp_password );
350
- //check if encryption option is disabled
351
- if ( empty( $swpsmtp_options[ 'smtp_settings' ][ 'encrypt_pass' ] ) ) {
352
- //it is. let's save decrypted password
353
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = swpsmtp_encrypt_password( addslashes( $decrypted ) );
354
- update_option( 'swpsmtp_options', $swpsmtp_options );
 
 
 
355
  }
356
- return $decrypted;
 
 
357
  }
358
 
359
  $password = "";
@@ -375,146 +479,114 @@ if ( ! function_exists( 'swpsmtp_get_password' ) ) {
375
  return stripslashes( $password );
376
  }
377
 
378
- }
379
-
380
- if ( ! function_exists( 'swpsmtp_admin_notice' ) ) {
 
381
 
382
- function swpsmtp_admin_notice() {
383
- if ( ! swpsmtp_credentials_configured() ) {
384
- $settings_url = admin_url() . 'options-general.php?page=swpsmtp_settings';
385
- ?>
386
- <div class="error">
387
- <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>
388
- </div>
389
- <?php
 
390
  }
 
391
  }
392
 
393
- }
394
-
395
- if ( ! function_exists( 'swpsmtp_credentials_configured' ) ) {
396
-
397
- function swpsmtp_credentials_configured() {
398
- $swpsmtp_options = get_option( 'swpsmtp_options' );
399
- $credentials_configured = true;
400
- if ( ! isset( $swpsmtp_options[ 'from_email_field' ] ) || empty( $swpsmtp_options[ 'from_email_field' ] ) ) {
401
  $credentials_configured = false;
402
  }
403
- if ( ! isset( $swpsmtp_options[ 'from_name_field' ] ) || empty( $swpsmtp_options[ 'from_name_field' ] ) ) {
404
  $credentials_configured = false;
405
  }
406
  return $credentials_configured;
407
  }
408
 
409
- }
410
-
411
- /**
412
- * Performed at uninstall.
413
- * @return void
414
- */
415
- if ( ! function_exists( 'swpsmtp_send_uninstall' ) ) {
416
-
417
- function swpsmtp_send_uninstall() {
418
- /* Don't delete plugin options. It is better to retain the options so if someone accidentally deactivates, the configuration is not lost. */
419
-
420
- //delete_site_option('swpsmtp_options');
421
- //delete_option('swpsmtp_options');
422
- }
423
-
424
- }
425
-
426
- function swpsmtp_activate() {
427
- $swpsmtp_options_default = array(
428
- 'from_email_field' => '',
429
- 'from_name_field' => '',
430
- 'force_from_name_replace' => 0,
431
- 'smtp_settings' => array(
432
- 'host' => 'smtp.example.com',
433
- 'type_encryption' => 'none',
434
- 'port' => 25,
435
- 'autentication' => 'yes',
436
- 'username' => '',
437
- 'password' => ''
438
- )
439
- );
440
-
441
- /* install the default plugin options if needed */
442
- $swpsmtp_options = get_option( 'swpsmtp_options' );
443
- if ( ! $swpsmtp_options ) {
444
- $swpsmtp_options = $swpsmtp_options_default;
445
- }
446
- $swpsmtp_options = array_merge( $swpsmtp_options_default, $swpsmtp_options );
447
- update_option( 'swpsmtp_options', $swpsmtp_options, 'yes' );
448
- //add current domain to allowed domains list
449
- if ( ! isset( $swpsmtp_options[ 'allowed_domains' ] ) ) {
450
- $domain = parse_url( get_site_url(), PHP_URL_HOST );
451
- if ( $domain ) {
452
- $swpsmtp_options[ 'allowed_domains' ] = base64_encode( $domain );
453
- update_option( 'swpsmtp_options', $swpsmtp_options );
454
- }
455
- } else { // let's check if existing value should be base64 encoded
456
- if ( ! empty( $swpsmtp_options[ 'allowed_domains' ] ) ) {
457
- if ( base64_decode_maybe( $swpsmtp_options[ 'allowed_domains' ] ) === $swpsmtp_options[ 'allowed_domains' ] ) {
458
- $swpsmtp_options[ 'allowed_domains' ] = base64_encode( $swpsmtp_options[ 'allowed_domains' ] );
459
- update_option( 'swpsmtp_options', $swpsmtp_options );
460
  }
461
  }
462
- }
463
- // Encrypt password if needed
464
- if ( ! get_option( 'swpsmtp_pass_encrypted' ) ) {
465
- if ( extension_loaded( 'openssl' ) ) {
466
- if ( $swpsmtp_options[ 'smtp_settings' ][ 'password' ] !== '' ) {
467
- $swpsmtp_options[ 'smtp_settings' ][ 'password' ] = swpsmtp_encrypt_password( swpsmtp_get_password() );
468
- update_option( 'swpsmtp_options', $swpsmtp_options );
469
  }
470
  }
471
  }
472
- }
473
 
474
- function swpsmtp_is_domain_blocked() {
475
- $swpsmtp_options = get_option( 'swpsmtp_options' );
476
- //check if Domain Check enabled
477
- if ( isset( $swpsmtp_options[ 'enable_domain_check' ] ) && $swpsmtp_options[ 'enable_domain_check' ] ) {
478
- //check if allowed domains list is not blank
479
- if ( isset( $swpsmtp_options[ 'allowed_domains' ] ) && ! empty( $swpsmtp_options[ 'allowed_domains' ] ) ) {
480
- $swpsmtp_options[ 'allowed_domains' ] = base64_decode_maybe( $swpsmtp_options[ 'allowed_domains' ] );
481
- //let's see if we have one domain or coma-separated domains
482
- $domains_arr = explode( ',', $swpsmtp_options[ 'allowed_domains' ] );
483
- if ( is_array( $domains_arr ) && ! empty( $domains_arr ) ) {
484
- //we have coma-separated list
485
- } else {
486
- //it's single domain
487
- unset( $domains_arr );
488
- $domains_arr = array( $swpsmtp_options[ 'allowed_domains' ] );
489
- }
490
- $site_domain = parse_url( get_site_url(), PHP_URL_HOST );
491
- $match_found = false;
492
- foreach ( $domains_arr as $domain ) {
493
- if ( strtolower( trim( $domain ) ) === strtolower( trim( $site_domain ) ) ) {
494
- $match_found = true;
495
- break;
496
- }
497
- }
498
- if ( ! $match_found ) {
499
- return $site_domain;
500
- }
501
  }
 
 
 
 
 
 
 
 
 
 
502
  }
503
- return false;
504
  }
505
 
506
- function swpsmtp_wp_mail( $args ) {
507
- $swpsmtp_options = get_option( 'swpsmtp_options' );
508
- $domain = swpsmtp_is_domain_blocked();
509
- if ( $domain !== false && (isset( $swpsmtp_options[ 'block_all_emails' ] ) && $swpsmtp_options[ 'block_all_emails' ] === 1) ) {
510
- swpsmtp_write_to_log(
511
- "\r\n------------------------------------------------------------------------------------------------------\r\n" .
512
- "Domain check failed: website domain (" . $domain . ") is not in allowed domains list.\r\n" .
513
- "Following email not sent (block all emails option is enabled):\r\n" .
514
- "To: " . $args[ 'to' ] . "; Subject: " . $args[ 'subject' ] . "\r\n" .
515
- "------------------------------------------------------------------------------------------------------\r\n\r\n" );
516
- }
517
- return $args;
518
  }
519
 
520
  class swpsmtp_gag_mailer extends stdClass {
@@ -524,22 +596,3 @@ class swpsmtp_gag_mailer extends stdClass {
524
  }
525
 
526
  }
527
-
528
- /**
529
- * Add all hooks
530
- */
531
- add_filter( 'plugin_action_links', 'swpsmtp_plugin_action_links', 10, 2 );
532
- add_action( 'plugins_loaded', 'swpsmtp_plugins_loaded_handler' );
533
- add_filter( 'plugin_row_meta', 'swpsmtp_register_plugin_links', 10, 2 );
534
- add_filter( 'wp_mail', 'swpsmtp_wp_mail', 2147483647 );
535
-
536
- add_action( 'phpmailer_init', 'swpsmtp_init_smtp', 999 );
537
-
538
- add_action( 'admin_menu', 'swpsmtp_admin_default_setup' );
539
-
540
- add_action( 'admin_init', 'swpsmtp_admin_init' );
541
- add_action( 'admin_enqueue_scripts', 'swpsmtp_admin_head' );
542
- add_action( 'admin_notices', 'swpsmtp_admin_notice' );
543
-
544
- register_activation_hook( __FILE__, 'swpsmtp_activate' );
545
- register_uninstall_hook( plugin_basename( __FILE__ ), 'swpsmtp_send_uninstall' );
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/
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" .
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;
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(
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
 
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
 
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(
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
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();
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 = "";
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 {
596
  }
597
 
598
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/script.js CHANGED
@@ -1,8 +1,124 @@
1
- (function ($) {
2
- $(document).ready(function () {
3
- /*
4
- *add notice about changing in the settings page
5
- */
6
-
7
- });
8
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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';
16
+ 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
+ });
languages/easy-wp-smtp.pot CHANGED
@@ -1,173 +1,221 @@
1
- msgid ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
- "Project-Id-Version: Easy WP SMTP\n"
4
- "POT-Creation-Date: 2018-01-18 18:02+1000\n"
5
- "PO-Revision-Date: 2018-01-18 18:02+1000\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.7\n"
12
- "X-Poedit-KeywordsList: _e;__\n"
13
- "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SearchPath-0: .\n"
15
-
16
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:9
17
  msgid "Easy WP SMTP"
18
  msgstr ""
19
 
20
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  msgid "Easy WP SMTP Settings"
22
  msgstr ""
23
 
24
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:69
25
  msgid "Nonce check failed."
26
  msgstr ""
27
 
28
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:77
29
  msgid "Please enter a valid email address in the 'FROM' field."
30
  msgstr ""
31
 
32
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:110
33
  msgid "Please enter a valid port in the 'SMTP Port' field."
34
  msgstr ""
35
 
36
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:119
37
  msgid "Settings saved."
38
  msgstr ""
39
 
40
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:121
41
  msgid "Settings are not saved."
42
  msgstr ""
43
 
44
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:133
45
  msgid "Please enter a valid email address in the recipient email field."
46
  msgstr ""
47
 
48
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:200
49
  msgid "SMTP Settings"
50
  msgstr ""
51
 
52
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:201
53
  msgid "Additional Settings"
54
  msgstr ""
55
 
56
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:202
57
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:355
58
  msgid "Test Email"
59
  msgstr ""
60
 
61
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:217
62
  msgid "SMTP Configuration Settings"
63
  msgstr ""
64
 
65
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:220
66
  msgid ""
67
  "You can request your hosting provider for the SMTP details of your site. Use "
68
  "the SMTP details provided by your hosting provider to configure the "
69
  "following settings."
70
  msgstr ""
71
 
72
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:224
73
  msgid "From Email Address"
74
  msgstr ""
75
 
76
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:227
77
  msgid "This email address will be used in the 'From' field."
78
  msgstr ""
79
 
80
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:231
81
  msgid "From Name"
82
  msgstr ""
83
 
84
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:234
85
  msgid "This text will be used in the 'FROM' field"
86
  msgstr ""
87
 
88
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  msgid "Reply-To Email Address"
90
  msgstr ""
91
 
92
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:241
93
  msgid ""
94
  "Optional. This email address will be used in the 'Reply-To' field of the "
95
  "email. Leave it blank to use 'From' email as the reply-to value."
96
  msgstr ""
97
 
98
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:245
99
  msgid "SMTP Host"
100
  msgstr ""
101
 
102
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:248
103
  msgid "Your mail server"
104
  msgstr ""
105
 
106
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:252
107
  msgid "Type of Encryption"
108
  msgstr ""
109
 
110
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:254
111
  msgid "None"
112
  msgstr ""
113
 
114
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:255
115
- msgid "SSL"
116
  msgstr ""
117
 
118
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:256
119
- msgid "TLS"
120
  msgstr ""
121
 
122
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:257
123
- msgid "For most servers SSL is the recommended option"
124
  msgstr ""
125
 
126
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:261
127
  msgid "SMTP Port"
128
  msgstr ""
129
 
130
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:264
131
  msgid "The port to your mail server"
132
  msgstr ""
133
 
134
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:268
135
  msgid "SMTP Authentication"
136
  msgstr ""
137
 
138
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:270
139
  msgid "No"
140
  msgstr ""
141
 
142
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:271
143
  msgid "Yes"
144
  msgstr ""
145
 
146
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:272
147
  msgid "This options should always be checked 'Yes'"
148
  msgstr ""
149
 
150
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:276
151
  msgid "SMTP Username"
152
  msgstr ""
153
 
154
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:279
155
  msgid "The username to login to your mail server"
156
  msgstr ""
157
 
158
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:283
159
  msgid "SMTP Password"
160
  msgstr ""
161
 
162
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:286
163
  msgid "The password to login to your mail server"
164
  msgstr ""
165
 
166
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:287
167
- msgid "Note"
 
 
168
  msgstr ""
169
 
170
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:287
171
  msgid ""
172
  "when you click \"Save Changes\", your actual password is stored in the "
173
  "database and then used to send emails. This field is replaced with a gag "
@@ -176,163 +224,267 @@ msgid ""
176
  "programs, for example)."
177
  msgstr ""
178
 
179
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:292
180
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:343
181
  msgid "Save Changes"
182
  msgstr ""
183
 
184
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:302
185
  msgid "Additional Settings (Optional)"
186
  msgstr ""
187
 
188
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:306
189
  msgid "Don't Replace \"From\" Field"
190
  msgstr ""
191
 
192
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:309
193
  msgid ""
194
  "Comma separated emails list. Example value: email1@domain.com, email2@domain."
195
  "com"
196
  msgstr ""
197
 
198
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:310
199
  msgid ""
200
  "This option is useful when you are using several email aliases on your SMTP "
201
  "server. If you don't want your aliases to be replaced by the address "
202
  "specified in \"From\" field, enter them in this field."
203
  msgstr ""
204
 
205
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:314
206
  msgid "Enable Domain Check"
207
  msgstr ""
208
 
209
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:317
210
  msgid ""
211
  "This option is usually used by developers only. SMTP settings will be used "
212
  "only if the site is running on following domain(s):"
213
  msgstr ""
214
 
215
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:319
216
  msgid "Coma-separated domains list. Example: domain1.com, domain2.com"
217
  msgstr ""
218
 
219
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:321
220
  msgid "Block all emails"
221
  msgstr ""
222
 
223
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:323
224
  msgid ""
225
  "When enabled, plugin attempts to block ALL emails from being sent out if "
226
  "domain mismtach."
227
  msgstr ""
228
 
229
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:327
 
 
 
 
 
 
 
 
 
 
230
  msgid "Allow Insecure SSL Certificates"
231
  msgstr ""
232
 
233
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:330
234
  msgid ""
235
  "Allows insecure and self-signed SSL certificates on SMTP server. It's highly "
236
  "recommended to keep this option disabled."
237
  msgstr ""
238
 
239
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:334
240
  msgid "Enable Debug Log"
241
  msgstr ""
242
 
243
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:337
244
  msgid "Check this box to enable mail debug log"
245
  msgstr ""
246
 
247
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:338
 
 
 
 
248
  msgid "View Log"
249
  msgstr ""
250
 
251
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:338
252
- msgid "Clear Log"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  msgstr ""
254
 
255
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:357
256
- msgid "Notice:"
257
  msgstr ""
258
 
259
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:357
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  msgid ""
261
  "You have unsaved settings. In order to send a test email, you need to go "
262
  "back to previous tab and click \"Save Changes\" button first."
263
  msgstr ""
264
 
265
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  msgid ""
267
  "You can use this section to send an email from your server using the above "
268
  "configured SMTP details to see if the email gets delivered."
269
  msgstr ""
270
 
271
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:359
272
  msgid ""
273
  "debug log for this test email will be automatically displayed right after "
274
  "you send it. Test email also ignores \"Enable Domain Check\" option."
275
  msgstr ""
276
 
277
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:364
278
  msgid "To"
279
  msgstr ""
280
 
281
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:367
282
  msgid "Enter the recipient's email address"
283
  msgstr ""
284
 
285
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:371
286
  msgid "Subject"
287
  msgstr ""
288
 
289
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:374
290
  msgid "Enter a subject for your message"
291
  msgstr ""
292
 
293
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:378
294
  msgid "Message"
295
  msgstr ""
296
 
297
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:381
298
  msgid "Write your email message"
299
  msgstr ""
300
 
301
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:386
302
  msgid "Send Test Email"
303
  msgstr ""
304
 
305
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  msgid "Support"
307
  msgstr ""
308
 
309
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:400
310
- msgid "Support Forum"
 
 
311
  msgstr ""
312
 
313
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:404
314
- msgid "Rate Us"
315
  msgstr ""
316
 
317
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:406
318
- msgid "rating"
319
  msgstr ""
320
 
321
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:484
322
- msgid "Are you sure want to clear log?"
 
 
323
  msgstr ""
324
 
325
- #: easy-wp-smtp/easy-wp-smtp-admin-menu.php:492
326
- msgid "Log cleared."
327
  msgstr ""
328
 
329
- #: easy-wp-smtp/easy-wp-smtp.php:32 easy-wp-smtp/easy-wp-smtp.php:51
330
- msgid "Settings"
331
  msgstr ""
332
 
333
- #: easy-wp-smtp/easy-wp-smtp.php:349
334
  #, php-format
335
  msgid ""
336
  "Please configure your SMTP credentials in the <a href=\"%s\">settings menu</"
337
  "a> in order to send email using Easy WP SMTP plugin."
338
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
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
  "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-"
434
+ "wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-"
435
+ "server-2197\">Easy WP SMTP</a>"
436
+ msgid ""
437
+ "Please visit the %s plugin's documentation page to learn how to use this "
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 ""
readme.txt CHANGED
@@ -3,8 +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: 4.9
7
- Stable tag: 1.3.6
 
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -22,6 +23,7 @@ Easy WP SMTP allows you to configure and send all outgoing emails via a SMTP ser
22
  * Securely deliver emails to your recipients.
23
  * Option to enable debug logging to see if the emails are getting sent out successfully or not.
24
  * Ability to specify a Reply-to email address.
 
25
 
26
  = Easy WP SMTP Plugin Usage =
27
 
@@ -77,6 +79,25 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  = 1.3.6 =
81
  * SMTP Username and SMTP Host fields are no longer multiplying slashes (thanks to jstepak for reporting).
82
  * Added option to encrypt password using AES-256 encryption. This requires PHP 5.3+ and OpenSSL PHP extension to be enabled on the server.
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
 
23
  * Securely deliver emails to your recipients.
24
  * Option to enable debug logging to see if the emails are getting sent out successfully or not.
25
  * Ability to specify a Reply-to email address.
26
+ * Option to Export and Import the SMTP settings.
27
 
28
  = Easy WP SMTP Plugin Usage =
29
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.3.9.1 =
83
+ * Fixed potential vulnerability in import\export settings.
84
+
85
+ = 1.3.9 =
86
+ * Added Export\Import settings functionality.
87
+ * Added option to delete all settings and deactivate plugin.
88
+
89
+ = 1.3.8.1 =
90
+ * Fixed incompatibility with WP versions older than 4.7.0 (thanks to stevendigital for reporting).
91
+
92
+ = 1.3.8 =
93
+ * Set reasonable timeout for SMTP server connection attempt. This prevents admin area from being locked up for too long if your SMTP server refuses connections.
94
+ * Added spinner to indicate that test email is being sent.
95
+ * "Send Test Email" button is now disabled if there are unsaved settings changes.
96
+ * Minor settings page adjustments.
97
+
98
+ = 1.3.7 =
99
+ * Renamed SSL and TLS to what they actually are.
100
+
101
  = 1.3.6 =
102
  * SMTP Username and SMTP Host fields are no longer multiplying slashes (thanks to jstepak for reporting).
103
  * Added option to encrypt password using AES-256 encryption. This requires PHP 5.3+ and OpenSSL PHP extension to be enabled on the server.