Plugin Directory

Changeset 1278277


Ignore:
Timestamp:
11/03/2015 04:54:51 AM (10 years ago)
Author:
wpecommerce
Message:

.committing version 1.2.1

Location:
easy-wp-smtp/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • easy-wp-smtp/trunk/easy-wp-smtp.php

    r1242043 r1278277  
    22/*
    33Plugin Name: Easy WP SMTP
    4 Version: 1.2.0
     4Version: 1.2.1
    55Plugin URI: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
    66Author: wpecommerce
     
    121121 */
    122122if ( ! function_exists ( 'swpsmtp_init_smtp' ) ) {
    123     function swpsmtp_init_smtp( $phpmailer ) {             
     123    function swpsmtp_init_smtp( $phpmailer ) {
     124                //check if SMTP credentials have been configured.
     125                if(!swpsmtp_credentials_configured()){
     126                    return;
     127                }
    124128        $swpsmtp_options = get_option( 'swpsmtp_options' );
    125129        /* Set the mailer type as per config above, this overrides the already called isMail method */
     
    145149            $phpmailer->Password = swpsmtp_get_password();
    146150        }
     151                //PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate.
     152                $phpmailer->SMTPAutoTLS = false;
    147153    }
    148154}
     
    339345if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
    340346    function swpsmtp_test_mail( $to_email, $subject, $message ) {
     347                if(!swpsmtp_credentials_configured()){
     348                    return;
     349                }
    341350        $errors = '';
    342351
     
    365374            $mail->SMTPSecure = $swpsmtp_options['smtp_settings']['type_encryption'];
    366375        }
     376               
     377                /* PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate. */
     378                $mail->SMTPAutoTLS = false;
    367379       
    368380        /* Set the other options */
     
    430442}
    431443
     444if ( ! function_exists( 'swpsmtp_admin_notice' ) ) {
     445    function swpsmtp_admin_notice() {       
     446        if(!swpsmtp_credentials_configured()){
     447            ?>
     448            <div class="error">
     449                <p><?php _e( 'Please configure your SMTP credentials in the settings in order to send email using Easy WP SMTP plugin.', 'easy-wp-smtp' ); ?></p>
     450            </div>
     451            <?php
     452        }
     453    }
     454}
     455
     456if ( ! function_exists( 'swpsmtp_credentials_configured' ) ) {
     457    function swpsmtp_credentials_configured() {
     458        $swpsmtp_options = get_option( 'swpsmtp_options' );
     459        $credentials_configured = true;
     460        if(!isset($swpsmtp_options['from_email_field']) || empty($swpsmtp_options['from_email_field'])){
     461            $credentials_configured = false;
     462        }
     463        if(!isset($swpsmtp_options['from_name_field']) || empty($swpsmtp_options['from_name_field'])){
     464            $credentials_configured = false;;
     465        }
     466        return $credentials_configured;
     467    }
     468}
     469
    432470
    433471/**
     
    444482add_action( 'admin_init', 'swpsmtp_admin_init' );
    445483add_action( 'admin_enqueue_scripts', 'swpsmtp_admin_head' );
     484add_action( 'admin_notices', 'swpsmtp_admin_notice' );
    446485
    447486register_uninstall_hook( plugin_basename( __FILE__ ), 'swpsmtp_send_uninstall' );
  • easy-wp-smtp/trunk/readme.txt

    r1242043 r1278277  
    33Donate link: https://wp-ecommerce.net/easy-wordpress-smtp-send-emails-from-your-wordpress-site-using-a-smtp-server-2197
    44Tags: 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: 3.0
     5Requires at least: 4.3
    66Tested up to: 4.3
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575
    7676== Changelog ==
     77
     78= 1.2.1 =
     79
     80* Set SMTPAutoTLS to false by default as it might cause issues if the server is advertising TLS with an invalid certificate.
     81* Display an error message near the top of admin pages if SMTP credentials are not configured.
    7782
    7883= 1.2.0 =
Note: See TracChangeset for help on using the changeset viewer.