Easy WP SMTP - Version 1.3.9.3

Version Description

  • Removed the warning: Undefined index log_file_name
  • Added "substitute mode" option for the "Reply-To" field. Thanks to @idave2012
Download this release

Release Info

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

Code changes from version 1.3.9.2 to 1.3.9.3

Files changed (3) hide show
  1. class-easywpsmtp-admin.php +11 -5
  2. easy-wp-smtp.php +30 -6
  3. readme.txt +6 -2
class-easywpsmtp-admin.php CHANGED
@@ -97,6 +97,7 @@ function swpsmtp_settings() {
97
  /* Update settings */
98
  $swpsmtp_options['from_name_field'] = isset( $_POST['swpsmtp_from_name'] ) ? sanitize_text_field( wp_unslash( $_POST['swpsmtp_from_name'] ) ) : '';
99
  $swpsmtp_options['force_from_name_replace'] = isset( $_POST['swpsmtp_force_from_name_replace'] ) ? 1 : false;
 
100
 
101
  if ( isset( $_POST['swpsmtp_from_email'] ) ) {
102
  if ( is_email( $_POST['swpsmtp_from_email'] ) ) {
@@ -241,6 +242,11 @@ function swpsmtp_settings() {
241
  <td>
242
  <input id="swpsmtp_reply_to_email" type="email" name="swpsmtp_reply_to_email" value="<?php echo isset( $swpsmtp_options['reply_to_email'] ) ? esc_attr( $swpsmtp_options['reply_to_email'] ) : ''; ?>" /><br />
243
  <p class="description"><?php esc_html_e( "Optional. This email address will be used in the 'Reply-To' field of the email. Leave it blank to use 'From' email as the reply-to value.", 'easy-wp-smtp' ); ?></p>
 
 
 
 
 
244
  </td>
245
  </tr>
246
  <tr class="ad_opt swpsmtp_smtp_options">
@@ -253,19 +259,19 @@ function swpsmtp_settings() {
253
  <tr class="ad_opt swpsmtp_smtp_options">
254
  <th><?php esc_html_e( 'Type of Encryption', 'easy-wp-smtp' ); ?></th>
255
  <td>
256
- <label for="swpsmtp_smtp_type_encryption_1"><input type="radio" id="swpsmtp_smtp_type_encryption_1" name="swpsmtp_smtp_type_encryption" value='none'
257
  <?php
258
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'none' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
259
  echo 'checked="checked"';}
260
  ?>
261
  /> <?php esc_html_e( 'None', 'easy-wp-smtp' ); ?></label>
262
- <label for="swpsmtp_smtp_type_encryption_2"><input type="radio" id="swpsmtp_smtp_type_encryption_2" name="swpsmtp_smtp_type_encryption" value='ssl'
263
  <?php
264
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'ssl' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
265
  echo 'checked="checked"';}
266
  ?>
267
  /> <?php esc_html_e( 'SSL/TLS', 'easy-wp-smtp' ); ?></label>
268
- <label for="swpsmtp_smtp_type_encryption_3"><input type="radio" id="swpsmtp_smtp_type_encryption_3" name="swpsmtp_smtp_type_encryption" value='tls'
269
  <?php
270
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'tls' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
271
  echo 'checked="checked"';}
@@ -284,13 +290,13 @@ function swpsmtp_settings() {
284
  <tr class="ad_opt swpsmtp_smtp_options">
285
  <th><?php esc_html_e( 'SMTP Authentication', 'easy-wp-smtp' ); ?></th>
286
  <td>
287
- <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_1" name="swpsmtp_smtp_autentication" value='no'
288
  <?php
289
  if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'no' === $swpsmtp_options['smtp_settings']['autentication'] ) {
290
  echo 'checked="checked"';}
291
  ?>
292
  /> <?php esc_html_e( 'No', 'easy-wp-smtp' ); ?></label>
293
- <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_2" name="swpsmtp_smtp_autentication" value='yes'
294
  <?php
295
  if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'yes' === $swpsmtp_options['smtp_settings']['autentication'] ) {
296
  echo 'checked="checked"';}
97
  /* Update settings */
98
  $swpsmtp_options['from_name_field'] = isset( $_POST['swpsmtp_from_name'] ) ? sanitize_text_field( wp_unslash( $_POST['swpsmtp_from_name'] ) ) : '';
99
  $swpsmtp_options['force_from_name_replace'] = isset( $_POST['swpsmtp_force_from_name_replace'] ) ? 1 : false;
100
+ $swpsmtp_options['sub_mode'] = isset( $_POST['swpsmtp_sub_mode'] ) ? 1 : false;
101
 
102
  if ( isset( $_POST['swpsmtp_from_email'] ) ) {
103
  if ( is_email( $_POST['swpsmtp_from_email'] ) ) {
242
  <td>
243
  <input id="swpsmtp_reply_to_email" type="email" name="swpsmtp_reply_to_email" value="<?php echo isset( $swpsmtp_options['reply_to_email'] ) ? esc_attr( $swpsmtp_options['reply_to_email'] ) : ''; ?>" /><br />
244
  <p class="description"><?php esc_html_e( "Optional. This email address will be used in the 'Reply-To' field of the email. Leave it blank to use 'From' email as the reply-to value.", 'easy-wp-smtp' ); ?></p>
245
+ <p>
246
+ <label><input type="checkbox" id="swpsmtp_sub_mode" name="swpsmtp_sub_mode" value="1" <?php echo ( isset( $swpsmtp_options['sub_mode'] ) && ( $swpsmtp_options['sub_mode'] ) ) ? ' checked' : ''; ?> /> <?php esc_html_e( 'Substitute Mode', 'easy-wp-smtp' ); ?></label>
247
+ </p>
248
+ <p class="description"><?php esc_html_e( 'When enabled, the plugin will substitute occurances of the above From Email with the Reply-To Email address. The Reply-To Email will still be used if no other Reply-To Email is present. This option can prevent conflicts with other plugins that specify reply-to email addresses but still replaces the From Email with the Reply-To Email.', 'easy-wp-smtp' ); ?></p>
249
+ <p>
250
  </td>
251
  </tr>
252
  <tr class="ad_opt swpsmtp_smtp_options">
259
  <tr class="ad_opt swpsmtp_smtp_options">
260
  <th><?php esc_html_e( 'Type of Encryption', 'easy-wp-smtp' ); ?></th>
261
  <td>
262
+ <label for="swpsmtp_smtp_type_encryption_1"><input type="radio" id="swpsmtp_smtp_type_encryption_1" name="swpsmtp_smtp_type_encryption" value='none'
263
  <?php
264
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'none' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
265
  echo 'checked="checked"';}
266
  ?>
267
  /> <?php esc_html_e( 'None', 'easy-wp-smtp' ); ?></label>
268
+ <label for="swpsmtp_smtp_type_encryption_2"><input type="radio" id="swpsmtp_smtp_type_encryption_2" name="swpsmtp_smtp_type_encryption" value='ssl'
269
  <?php
270
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'ssl' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
271
  echo 'checked="checked"';}
272
  ?>
273
  /> <?php esc_html_e( 'SSL/TLS', 'easy-wp-smtp' ); ?></label>
274
+ <label for="swpsmtp_smtp_type_encryption_3"><input type="radio" id="swpsmtp_smtp_type_encryption_3" name="swpsmtp_smtp_type_encryption" value='tls'
275
  <?php
276
  if ( isset( $swpsmtp_options['smtp_settings']['type_encryption'] ) && 'tls' === $swpsmtp_options['smtp_settings']['type_encryption'] ) {
277
  echo 'checked="checked"';}
290
  <tr class="ad_opt swpsmtp_smtp_options">
291
  <th><?php esc_html_e( 'SMTP Authentication', 'easy-wp-smtp' ); ?></th>
292
  <td>
293
+ <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_1" name="swpsmtp_smtp_autentication" value='no'
294
  <?php
295
  if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'no' === $swpsmtp_options['smtp_settings']['autentication'] ) {
296
  echo 'checked="checked"';}
297
  ?>
298
  /> <?php esc_html_e( 'No', 'easy-wp-smtp' ); ?></label>
299
+ <label for="swpsmtp_smtp_autentication"><input type="radio" id="swpsmtp_smtp_autentication_2" name="swpsmtp_smtp_autentication" value='yes'
300
  <?php
301
  if ( isset( $swpsmtp_options['smtp_settings']['autentication'] ) && 'yes' === $swpsmtp_options['smtp_settings']['autentication'] ) {
302
  echo 'checked="checked"';}
easy-wp-smtp.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy WP SMTP
4
- Version: 1.3.9.2
5
  Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
6
  Author: wpecommerce, alexanderfoxc
7
  Author URI: https://wp-ecommerce.net/
@@ -97,7 +97,24 @@ class EasyWPSMTP {
97
  //set ReplyTo option if needed
98
  //this should be set before SetFrom, otherwise might be ignored
99
  if ( ! empty( $this->opts['reply_to_email'] ) ) {
100
- $phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
  // let's see if we have email ignore list populated
103
  if ( isset( $this->opts['email_ignore_list'] ) && ! empty( $this->opts['email_ignore_list'] ) ) {
@@ -253,7 +270,13 @@ class EasyWPSMTP {
253
  //view log file
254
  if ( isset( $_GET['swpsmtp_action'] ) ) {
255
  if ( 'view_log' === $_GET['swpsmtp_action'] ) {
256
- $log_file_name = $this->opts['smtp_settings']['log_file_name'];
 
 
 
 
 
 
257
  if ( ! file_exists( plugin_dir_path( __FILE__ ) . $log_file_name ) ) {
258
  if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n" ) === false ) {
259
  wp_die( esc_html( sprintf( 'Can\'t write to log file. Check if plugin directory (%s) is writeable.', plugin_dir_path( __FILE__ ) ) ) );
@@ -350,9 +373,9 @@ class EasyWPSMTP {
350
  ?>
351
  <div class="error">
352
  <p>
353
- <?php
354
- printf( __( 'Please configure your SMTP credentials in the <a href="%s">settings menu</a> in order to send email using Easy WP SMTP plugin.', 'easy-wp-smtp' ), esc_url( $settings_url ) );
355
- ?>
356
  </p>
357
  </div>
358
  <?php
@@ -518,6 +541,7 @@ class EasyWPSMTP {
518
  'from_email_field' => '',
519
  'from_name_field' => '',
520
  'force_from_name_replace' => 0,
 
521
  'smtp_settings' => array(
522
  'host' => 'smtp.example.com',
523
  'type_encryption' => 'none',
1
  <?php
2
  /*
3
  Plugin Name: Easy WP SMTP
4
+ Version: 1.3.9.3
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/
97
  //set ReplyTo option if needed
98
  //this should be set before SetFrom, otherwise might be ignored
99
  if ( ! empty( $this->opts['reply_to_email'] ) ) {
100
+ if ( isset( $this->opts['sub_mode'] ) && 1 === $this->opts['sub_mode'] ) {
101
+ if ( count( $phpmailer->getReplyToAddresses() ) >= 1 ) {
102
+ // Substitute from_email_field with reply_to_email
103
+ if ( array_key_exists( $this->opts['from_email_field'], $phpmailer->getReplyToAddresses() ) ) {
104
+ $reply_to_emails = $phpmailer->getReplyToAddresses();
105
+ unset( $reply_to_emails[ $this->opts['from_email_field'] ] );
106
+ $phpmailer->clearReplyTos();
107
+ foreach ( $reply_to_emails as $reply_to_email => $reply_to_name ) {
108
+ $phpmailer->AddReplyTo( $reply_to_email, $reply_to_name );
109
+ }
110
+ $phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
111
+ }
112
+ } else { // Reply-to array is empty so add reply_to_email
113
+ $phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
114
+ }
115
+ } else { // Default behaviour
116
+ $phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
117
+ }
118
  }
119
  // let's see if we have email ignore list populated
120
  if ( isset( $this->opts['email_ignore_list'] ) && ! empty( $this->opts['email_ignore_list'] ) ) {
270
  //view log file
271
  if ( isset( $_GET['swpsmtp_action'] ) ) {
272
  if ( 'view_log' === $_GET['swpsmtp_action'] ) {
273
+ $log_file_name = isset( $this->opts['smtp_settings']['log_file_name'] ) ? $this->opts['smtp_settings']['log_file_name'] : '';
274
+
275
+ if ( empty( $log_file_name ) ) {
276
+ //Nothing in the log file yet so nothing to show.
277
+ wp_die( 'Nothing in the log file yet.' );
278
+ }
279
+
280
  if ( ! file_exists( plugin_dir_path( __FILE__ ) . $log_file_name ) ) {
281
  if ( $this->log( "Easy WP SMTP debug log file\r\n\r\n" ) === false ) {
282
  wp_die( esc_html( sprintf( 'Can\'t write to log file. Check if plugin directory (%s) is writeable.', plugin_dir_path( __FILE__ ) ) ) );
373
  ?>
374
  <div class="error">
375
  <p>
376
+ <?php
377
+ 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 ) );
378
+ ?>
379
  </p>
380
  </div>
381
  <?php
541
  'from_email_field' => '',
542
  'from_name_field' => '',
543
  'force_from_name_replace' => 0,
544
+ 'sub_mode' => 0,
545
  'smtp_settings' => array(
546
  'host' => 'smtp.example.com',
547
  'type_encryption' => 'none',
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-
4
  Tags: mail, wordpress smtp, phpmailer, smtp, wp_mail, email, gmail, outgoing mail, privacy, security, sendmail, ssl, tls, wp-phpmailer, mail smtp, wp smtp
5
  Requires at least: 4.3
6
  Tested up to: 5.4
7
- Requires PHP: 5.3
8
- Stable tag: 1.3.9.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -79,6 +79,10 @@ Inspired by [WP Mail SMTP](http://wordpress.org/plugins/wp-mail-smtp/) plugin
79
 
80
  == Changelog ==
81
 
 
 
 
 
82
  = 1.3.9.2 =
83
  * Settings are exported in JSON format now.
84
  * Added additional sanitization to some actions on the settings page.
4
  Tags: mail, wordpress smtp, phpmailer, smtp, wp_mail, email, gmail, outgoing mail, privacy, security, sendmail, ssl, tls, wp-phpmailer, mail smtp, wp smtp
5
  Requires at least: 4.3
6
  Tested up to: 5.4
7
+ Requires PHP: 5.6
8
+ Stable tag: 1.3.9.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.3.9.3 =
83
+ * Removed the warning: Undefined index log_file_name
84
+ * Added "substitute mode" option for the "Reply-To" field. Thanks to @idave2012
85
+
86
  = 1.3.9.2 =
87
  * Settings are exported in JSON format now.
88
  * Added additional sanitization to some actions on the settings page.