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() {
- Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ': Read Here + Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ': ' . $linkText . '