Easy WP SMTP - Version 1.2.7

Version Description

  • Added extra debug info (when test email function is used). This debug info will show more details if anything fails. This will be helpful to debug SMTP connection failure on your server.
Download this release

Release Info

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

Code changes from version 1.2.4 to 1.2.7

easy-wp-smtp-admin-menu.php CHANGED
@@ -41,7 +41,7 @@ function swpsmtp_settings() {
41
  $swpsmtp_options['smtp_settings']['type_encryption'] = ( isset($_POST['swpsmtp_smtp_type_encryption']) ) ? sanitize_text_field($_POST['swpsmtp_smtp_type_encryption']) : 'none';
42
  $swpsmtp_options['smtp_settings']['autentication'] = ( isset($_POST['swpsmtp_smtp_autentication']) ) ? sanitize_text_field($_POST['swpsmtp_smtp_autentication']) : 'yes';
43
  $swpsmtp_options['smtp_settings']['username'] = sanitize_text_field($_POST['swpsmtp_smtp_username']);
44
- $smtp_password = trim($_POST['swpsmtp_smtp_password']);
45
  $swpsmtp_options['smtp_settings']['password'] = base64_encode($smtp_password);
46
 
47
  /* Check value from "SMTP port" option */
@@ -64,16 +64,18 @@ function swpsmtp_settings() {
64
  }
65
 
66
  /* Send test letter */
 
67
  if (isset($_POST['swpsmtp_test_submit']) && check_admin_referer(plugin_basename(__FILE__), 'swpsmtp_nonce_name')) {
68
  if (isset($_POST['swpsmtp_to'])) {
69
- if (is_email($_POST['swpsmtp_to'])) {
70
- $swpsmtp_to = $_POST['swpsmtp_to'];
 
71
  } else {
72
  $error .= __("Please enter a valid email address in the recipient email field.", 'easy-wp-smtp');
73
  }
74
  }
75
- $swpsmtp_subject = isset($_POST['swpsmtp_subject']) ? $_POST['swpsmtp_subject'] : '';
76
- $swpsmtp_message = isset($_POST['swpsmtp_message']) ? $_POST['swpsmtp_message'] : '';
77
 
78
  //Save the test mail details so it doesn't need to be filled in everytime.
79
  $smtp_test_mail['swpsmtp_to'] = $swpsmtp_to;
@@ -130,7 +132,7 @@ function swpsmtp_settings() {
130
  </td>
131
  </tr>
132
  <tr class="ad_opt swpsmtp_smtp_options">
133
- <th><?php _e('Type of Encription', 'easy-wp-smtp'); ?></th>
134
  <td>
135
  <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 ('none' == $swpsmtp_options['smtp_settings']['type_encryption']) echo 'checked="checked"'; ?> /> <?php _e('None', 'easy-wp-smtp'); ?></label>
136
  <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 ('ssl' == $swpsmtp_options['smtp_settings']['type_encryption']) echo 'checked="checked"'; ?> /> <?php _e('SSL', 'easy-wp-smtp'); ?></label>
@@ -192,21 +194,21 @@ function swpsmtp_settings() {
192
  <tr valign="top">
193
  <th scope="row"><?php _e("To", 'easy-wp-smtp'); ?>:</th>
194
  <td>
195
- <input type="text" name="swpsmtp_to" value="<?php echo $smtp_test_mail['swpsmtp_to']; ?>" /><br />
196
  <p class="description"><?php _e("Enter the recipient's email address", 'easy-wp-smtp'); ?></p>
197
  </td>
198
  </tr>
199
  <tr valign="top">
200
  <th scope="row"><?php _e("Subject", 'easy-wp-smtp'); ?>:</th>
201
  <td>
202
- <input type="text" name="swpsmtp_subject" value="<?php echo $smtp_test_mail['swpsmtp_subject']; ?>" /><br />
203
  <p class="description"><?php _e("Enter a subject for your message", 'easy-wp-smtp'); ?></p>
204
  </td>
205
  </tr>
206
  <tr valign="top">
207
  <th scope="row"><?php _e("Message", 'easy-wp-smtp'); ?>:</th>
208
  <td>
209
- <textarea name="swpsmtp_message" id="swpsmtp_message" rows="5"><?php echo $smtp_test_mail['swpsmtp_message']; ?></textarea><br />
210
  <p class="description"><?php _e("Write your email message", 'easy-wp-smtp'); ?></p>
211
  </td>
212
  </tr>
41
  $swpsmtp_options['smtp_settings']['type_encryption'] = ( isset($_POST['swpsmtp_smtp_type_encryption']) ) ? sanitize_text_field($_POST['swpsmtp_smtp_type_encryption']) : 'none';
42
  $swpsmtp_options['smtp_settings']['autentication'] = ( isset($_POST['swpsmtp_smtp_autentication']) ) ? sanitize_text_field($_POST['swpsmtp_smtp_autentication']) : 'yes';
43
  $swpsmtp_options['smtp_settings']['username'] = sanitize_text_field($_POST['swpsmtp_smtp_username']);
44
+ $smtp_password = stripslashes($_POST['swpsmtp_smtp_password']);
45
  $swpsmtp_options['smtp_settings']['password'] = base64_encode($smtp_password);
46
 
47
  /* Check value from "SMTP port" option */
64
  }
65
 
66
  /* Send test letter */
67
+ $swpsmtp_to = '';
68
  if (isset($_POST['swpsmtp_test_submit']) && check_admin_referer(plugin_basename(__FILE__), 'swpsmtp_nonce_name')) {
69
  if (isset($_POST['swpsmtp_to'])) {
70
+ $to_email = sanitize_text_field($_POST['swpsmtp_to']);
71
+ if (is_email($to_email)) {
72
+ $swpsmtp_to = $to_email;
73
  } else {
74
  $error .= __("Please enter a valid email address in the recipient email field.", 'easy-wp-smtp');
75
  }
76
  }
77
+ $swpsmtp_subject = isset($_POST['swpsmtp_subject']) ? sanitize_text_field($_POST['swpsmtp_subject']) : '';
78
+ $swpsmtp_message = isset($_POST['swpsmtp_message']) ? sanitize_text_field($_POST['swpsmtp_message']) : '';
79
 
80
  //Save the test mail details so it doesn't need to be filled in everytime.
81
  $smtp_test_mail['swpsmtp_to'] = $swpsmtp_to;
132
  </td>
133
  </tr>
134
  <tr class="ad_opt swpsmtp_smtp_options">
135
+ <th><?php _e('Type of Encryption', 'easy-wp-smtp'); ?></th>
136
  <td>
137
  <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 ('none' == $swpsmtp_options['smtp_settings']['type_encryption']) echo 'checked="checked"'; ?> /> <?php _e('None', 'easy-wp-smtp'); ?></label>
138
  <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 ('ssl' == $swpsmtp_options['smtp_settings']['type_encryption']) echo 'checked="checked"'; ?> /> <?php _e('SSL', 'easy-wp-smtp'); ?></label>
194
  <tr valign="top">
195
  <th scope="row"><?php _e("To", 'easy-wp-smtp'); ?>:</th>
196
  <td>
197
+ <input type="text" name="swpsmtp_to" value="<?php echo esc_html($smtp_test_mail['swpsmtp_to']); ?>" /><br />
198
  <p class="description"><?php _e("Enter the recipient's email address", 'easy-wp-smtp'); ?></p>
199
  </td>
200
  </tr>
201
  <tr valign="top">
202
  <th scope="row"><?php _e("Subject", 'easy-wp-smtp'); ?>:</th>
203
  <td>
204
+ <input type="text" name="swpsmtp_subject" value="<?php echo esc_html($smtp_test_mail['swpsmtp_subject']); ?>" /><br />
205
  <p class="description"><?php _e("Enter a subject for your message", 'easy-wp-smtp'); ?></p>
206
  </td>
207
  </tr>
208
  <tr valign="top">
209
  <th scope="row"><?php _e("Message", 'easy-wp-smtp'); ?>:</th>
210
  <td>
211
+ <textarea name="swpsmtp_message" id="swpsmtp_message" rows="5"><?php echo esc_textarea($smtp_test_mail['swpsmtp_message']); ?></textarea><br />
212
  <p class="description"><?php _e("Write your email message", 'easy-wp-smtp'); ?></p>
213
  </td>
214
  </tr>
easy-wp-smtp.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy WP SMTP
4
- Version: 1.2.4
5
  Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
6
  Author: wpecommerce
7
  Author URI: https://wp-ecommerce.net/
@@ -169,7 +169,10 @@ if (!function_exists('swpsmtp_test_mail')) {
169
  $mail->Subject = $subject;
170
  $mail->MsgHTML($message);
171
  $mail->AddAddress($to_email);
172
- $mail->SMTPDebug = 0;
 
 
 
173
 
174
  /* Send mail and return result */
175
  if (!$mail->Send())
@@ -178,6 +181,10 @@ if (!function_exists('swpsmtp_test_mail')) {
178
  $mail->ClearAddresses();
179
  $mail->ClearAllRecipients();
180
 
 
 
 
 
181
  if (!empty($errors)) {
182
  return $errors;
183
  } else {
@@ -252,9 +259,10 @@ if (!function_exists('swpsmtp_credentials_configured')) {
252
  if (!function_exists('swpsmtp_send_uninstall')) {
253
 
254
  function swpsmtp_send_uninstall() {
255
- /* delete plugin options */
256
- delete_site_option('swpsmtp_options');
257
- delete_option('swpsmtp_options');
 
258
  }
259
 
260
  }
1
  <?php
2
  /*
3
  Plugin Name: Easy WP SMTP
4
+ Version: 1.2.7
5
  Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
6
  Author: wpecommerce
7
  Author URI: https://wp-ecommerce.net/
169
  $mail->Subject = $subject;
170
  $mail->MsgHTML($message);
171
  $mail->AddAddress($to_email);
172
+ global $debugMSG;
173
+ $debugMSG='';
174
+ $mail->Debugoutput=function($str, $level) {global $debugMSG; $debugMSG.=$str;};
175
+ $mail->SMTPDebug = 1;
176
 
177
  /* Send mail and return result */
178
  if (!$mail->Send())
181
  $mail->ClearAddresses();
182
  $mail->ClearAllRecipients();
183
 
184
+ echo '<div class="swpsmtp-yellow-box"><h3>Debug Info</h3>';
185
+ echo '<textarea rows="20" style="width: 100%;">'.$debugMSG.'</textarea>';
186
+ echo '</div>';
187
+
188
  if (!empty($errors)) {
189
  return $errors;
190
  } else {
259
  if (!function_exists('swpsmtp_send_uninstall')) {
260
 
261
  function swpsmtp_send_uninstall() {
262
+ /* Don't delete plugin options. It is better to retain the options so if someone accidentally deactivates, the configuration is not lost. */
263
+
264
+ //delete_site_option('swpsmtp_options');
265
+ //delete_option('swpsmtp_options');
266
  }
267
 
268
  }
languages/easy-wp-smtp.mo DELETED
Binary file
languages/easy-wp-smtp.pot CHANGED
@@ -80,7 +80,7 @@ msgid "Your mail server"
80
  msgstr ""
81
 
82
  #: easy-wp-smtp.php:267
83
- msgid "Type of Encription"
84
  msgstr ""
85
 
86
  #: easy-wp-smtp.php:269
80
  msgstr ""
81
 
82
  #: easy-wp-smtp.php:267
83
+ msgid "Type of Encryption"
84
  msgstr ""
85
 
86
  #: easy-wp-smtp.php:269
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Easy WP SMTP ===
2
- Contributors: wpecommerce
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.7
7
- Stable tag: 1.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,16 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
 
 
 
 
78
  = 1.2.4 =
79
  * Improved the admin interface.
80
  * The test email details now gets saved after you use it. So you don't need to type it every single time you want to send a test email.
1
  === Easy WP SMTP ===
2
+ Contributors: wpecommerce, wp.insider
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.8
7
+ Stable tag: 1.2.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.2.7 =
79
+ * Added extra debug info (when test email function is used). This debug info will show more details if anything fails. This will be helpful to debug SMTP connection failure on your server.
80
+
81
+ = 1.2.6 =
82
+ * Some special characters in the password field were getting removed when the text sanitization was done. This has been improved.
83
+ * The settings configuration will not be deleted if you deactivated the plugin. This will prevent configuration loss if you accidentally deactivate the plugin.
84
+
85
+ = 1.2.5 =
86
+ * Fixed possible XSS vulnerability with the email subject and email body input fields.
87
+
88
  = 1.2.4 =
89
  * Improved the admin interface.
90
  * The test email details now gets saved after you use it. So you don't need to type it every single time you want to send a test email.