diff --git a/plugins/post-smtp/Postman/Extensions/Core/StatusSolution.php b/plugins/post-smtp/Postman/Extensions/Core/StatusSolution.php index 67ac768d..b48abfa9 100644 --- a/plugins/post-smtp/Postman/Extensions/Core/StatusSolution.php +++ b/plugins/post-smtp/Postman/Extensions/Core/StatusSolution.php @@ -35,7 +35,11 @@ public function find_solution( $solution, $status, $log, $message ) { $possible_solution[] = 'Two factor authentication is enabled, replace your password with app password.'; $possible_solution[] = $this->make_clickable( 'https://support.google.com/mail/?p=InvalidSecondFactor' ); } elseif ( $this->strExists( 'Username and Password not accepted' ) || $this->strExists( 'Authentication unsuccessful' ) ) { - $possible_solution[] = 'Check you credentials, wrong email or password.'; + $possible_solution[] = 'Check you credentials, wrong email or password.'; + } elseif ( $this->strExists( 'ErrorSendAsDenied' ) ) { + $possible_solution[] = 'Give the configured account "Send As" permissions on the "From" mailbox (admin.office365.com).'; + } elseif ( $this->strExists( 'ErrorParticipantDoesntHaveAnEmailAddress' ) ) { + $possible_solution[] = "Probably office 365 doesn't like shared mailbox in Reply-To field"; } else { $possible_solution[] = 'Not found, check status column for more info.'; } @@ -53,4 +57,4 @@ private function strExists( $value ) { } -new StatusSolution(); \ No newline at end of file +new StatusSolution(); diff --git a/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseHandler.php b/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseHandler.php index e1449510..f8f32a21 100644 --- a/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseHandler.php +++ b/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseHandler.php @@ -18,7 +18,7 @@ class PostmanLicenseHandler { private $item_shortname; private $version; private $author; - private $api_url = 'http://localhost/psp/'; + private $api_url = 'https://postmansmtp.com'; function __construct( $_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null, $_item_id = null ) { @@ -92,7 +92,7 @@ public function hooks() { // Display notices to admins add_action( 'admin_notices', array( $this, 'notices' ) ); - add_action( 'in_plugin_update_message-' . plugin_basename( $this->file ), array( $this, 'plugin_row_license_missing' ), 10, 2 ); + //add_action( 'in_plugin_update_message-' . plugin_basename( $this->file ), array( $this, 'plugin_row_license_missing' ), 10, 2 ); } /** @@ -248,9 +248,10 @@ public function activate_license() { update_option( $this->item_shortname . '_license_active', $this->license_data ); update_option( $this->item_shortname . '_license_key', $license ); - $slug = plugin_basename($this->file); - PostmanLicenseManager::get_instance()->add_extension($slug); - + if ( $this->license_data->success && $this->license_data->license == 'valid' ) { + $slug = plugin_basename($this->file); + PostmanLicenseManager::get_instance()->add_extension($slug); + } } @@ -328,15 +329,31 @@ public function validate_license() { $license_data = $this->license_data; + if ( $license_data && isset( $license_data->expires ) ) { + if ( $license_data->expires == 'lifetime' ) { + $expires = '2500/12/12'; + } else { + $expires = $license_data->expires; + } + } else { + return; + } + $datetime1 = new DateTime(); - $datetime2 = new DateTime( $license_data->expires ); + + if ( is_numeric( $expires ) ) { + $datetime2 = new DateTime(); + $datetime2->setTimestamp( $expires ); + } else { + $datetime2 = new DateTime( $expires ); + } foreach ( self::DAYS_TO_ALERT as $day_to_alert ) { $interval = $datetime1->diff($datetime2); if( $interval->days == $day_to_alert ){ add_action( 'admin_notices', function () use ( $day_to_alert, $license_data ) { - echo $this->item_name . ' is about to expire in ' . $day_to_alert . ' days: ' . $license_data->expires; + //echo $this->item_name . ' is about to expire in ' . $day_to_alert . ' days: ' . $license_data->expires; }); return; @@ -344,7 +361,7 @@ public function validate_license() { if ( $interval->days == 0 ) { add_action( 'admin_notices', function () use ( $license_data ) { - echo $this->item_name . ' license expire today at: ' . $license_data->expires; + //echo $this->item_name . ' license expire today at: ' . $license_data->expires; }); return; @@ -353,7 +370,7 @@ public function validate_license() { if ( $license_data->activations_left == 0 ) { add_action( 'admin_notices', function () use ( $license_data ) { - echo $this->item_name . ' has no activations'; + //echo $this->item_name . ' has no activations'; }); return; diff --git a/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseManager.php b/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseManager.php index a25f0923..17cfecf7 100644 --- a/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseManager.php +++ b/plugins/post-smtp/Postman/Extensions/License/PostmanLicenseManager.php @@ -3,7 +3,7 @@ class PostmanLicenseManager { - const ENDPOINT = 'https://postmansmtpcom-staging.dxpsites.net'; + const ENDPOINT = 'https://postmansmtp.com'; const CORE_EXTENSIONS = [ 'gmail_api', 'sendgrid_api', 'mandrill_api', 'mailgun_api' ]; @@ -28,8 +28,6 @@ private function __construct() { $this->includes(); $this->rand_cache_interval = rand( 1, 24 ); - - add_filter( 'extra_plugin_headers', [ $this, 'add_extension_headers' ] ); } public function includes() { @@ -39,14 +37,6 @@ public function includes() { } - - function add_extension_headers($headers) { - $headers[] = 'Class'; - $headers[] = 'Slug'; - - return $headers; - } - /** * Init */ @@ -97,4 +87,4 @@ public function remove_extension($slug) { public function get_extensions() { return $this->extensions; } -} \ No newline at end of file +} diff --git a/plugins/post-smtp/Postman/Postman-Email-Log/PostmanEmailLogController.php b/plugins/post-smtp/Postman/Postman-Email-Log/PostmanEmailLogController.php index e94eb434..87ab8453 100644 --- a/plugins/post-smtp/Postman/Postman-Email-Log/PostmanEmailLogController.php +++ b/plugins/post-smtp/Postman/Postman-Email-Log/PostmanEmailLogController.php @@ -435,11 +435,11 @@ function postman_render_email_page() {
- +
- +
@@ -451,7 +451,7 @@ function postman_render_email_page() { echo ''; } ?> - +
@@ -467,19 +467,22 @@ function postman_render_email_page() {
-
Please notice: when you select a date for example 11/20/2017, behind the scene the query select 11/20/2017 00:00:00.
So if you searching for an email arrived that day at any hour you need to select 11/20/2017 as the From Date and 11/21/2017 as the To Date.
+
+ For more advanced, better performance and UI Email logger check our new extension:

+ Better Email Logger +
- +
- + display()?>
- + diff --git a/plugins/post-smtp/Postman/Postman-Mail/Zend-1.12.10/Mail/Transport/Abstract.php b/plugins/post-smtp/Postman/Postman-Mail/Zend-1.12.10/Mail/Transport/Abstract.php index 791d4229..8ac8698d 100644 --- a/plugins/post-smtp/Postman/Postman-Mail/Zend-1.12.10/Mail/Transport/Abstract.php +++ b/plugins/post-smtp/Postman/Postman-Mail/Zend-1.12.10/Mail/Transport/Abstract.php @@ -277,11 +277,7 @@ protected function _buildBody() } if (!$body) { - /** - * @see Postman_Zend_Mail_Transport_Exception - */ - require_once 'Exception.php'; - throw new Postman_Zend_Mail_Transport_Exception('No body specified'); + $body = ''; } // Get headers diff --git a/plugins/post-smtp/Postman/Postman.php b/plugins/post-smtp/Postman/Postman.php index f47fc3b4..01d7ac3d 100644 --- a/plugins/post-smtp/Postman/Postman.php +++ b/plugins/post-smtp/Postman/Postman.php @@ -23,9 +23,9 @@ class Postman { const MANAGE_POSTMAN_CAPABILITY_LOGS = 'manage_postman_logs'; /** - * Use the text domain directly instead of this constant, as it + * Use the text domain directly instead of this constant, as it * causes issues with https://translate.wordpress.org. - * + * * @deprecated * @see https://github.com/yehudah/Post-SMTP/issues/1#issuecomment-421940923 */ @@ -97,7 +97,7 @@ public function __construct( $rootPluginFilenameAndPath, $version ) { } // register the email transports - + // store an instance of the WpMailBinder $this->wpMailBinder = PostmanWpMailBinder::getInstance(); @@ -146,6 +146,8 @@ public function __construct( $rootPluginFilenameAndPath, $version ) { 'on_plugins_loaded', ) ); + add_filter( 'extra_plugin_headers', [ $this, 'add_extension_headers' ] ); + /** * @todo: WPML say they fix the issue in version 3.9 * https://wordpress.org/support/topic/error-in-pluggable-php173/#post-10021301 @@ -178,6 +180,12 @@ public function __construct( $rootPluginFilenameAndPath, $version ) { } + function add_extension_headers($headers) { + $headers[] = 'Class'; + $headers[] = 'Slug'; + + return $headers; + } /** * Functions to execute on the plugins_loaded event @@ -187,11 +195,11 @@ public function __construct( $rootPluginFilenameAndPath, $version ) { */ public function on_plugins_loaded() { - PostmanLicenseManager::get_instance()->init(); - // register the email transports $this->registerTransports( $this->rootPluginFilenameAndPath ); + PostmanLicenseManager::get_instance()->init(); + // load the text domain $this->loadTextDomain(); @@ -415,7 +423,7 @@ public function display_configuration_required_warning() { } $message .= (sprintf( ' %s | %s', $goToEmailLog, $goToSettings )); $message .= ''; - + $hide = get_option('postman_release_version' ); if ( $msg['error'] == true && ! $hide ) { diff --git a/plugins/post-smtp/Postman/PostmanViewController.php b/plugins/post-smtp/Postman/PostmanViewController.php index 02bef5e4..29384ed1 100644 --- a/plugins/post-smtp/Postman/PostmanViewController.php +++ b/plugins/post-smtp/Postman/PostmanViewController.php @@ -320,10 +320,11 @@ private function displayTopNavigation() { printf( '

%s

', sprintf( __( '%s Setup', 'post-smtp' ), __( 'Post SMTP', 'post-smtp' ) ) ); if ( ! $show && POST_SMTP_SHOW_RELEASE_MESSAGE ) { + $linkText = POST_SMTP_RELEASE_URL == '#' ? '' : 'Read Here'; echo '

- Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ': Read Here + Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ': ' . $linkText . '