Skip to content

Commit

Permalink
2.0.19
Browse files Browse the repository at this point in the history
* Fixed: All reported office 365 issues.
* New: Add link to Amazon SES Extension
  • Loading branch information
smusman98 committed Jul 18, 2022
1 parent 0632b86 commit 89180a6
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 23 deletions.
8 changes: 6 additions & 2 deletions Postman/Extensions/Core/StatusSolution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
}
Expand All @@ -53,4 +57,4 @@ private function strExists( $value ) {

}

new StatusSolution();
new StatusSolution();
18 changes: 13 additions & 5 deletions Postman/Extensions/License/PostmanLicenseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


Expand Down Expand Up @@ -327,16 +328,23 @@ public function validate_license() {
}

$license_data = $this->license_data;
$expires = $license_data->expires == 'lifetime' ? '2500/12/12' : $license_data->expires;

$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;
Expand Down
10 changes: 0 additions & 10 deletions Postman/Extensions/License/PostmanLicenseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -39,14 +37,6 @@ public function includes() {

}


function add_extension_headers($headers) {
$headers[] = 'Class';
$headers[] = 'Slug';

return $headers;
}

/**
* Init
*/
Expand Down
8 changes: 8 additions & 0 deletions Postman/Postman.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Postman/PostmanViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,11 @@ private function displayTopNavigation() {
printf( '<h2>%s</h2>', sprintf( __( '%s Setup', 'post-smtp' ), __( 'Post SMTP', 'post-smtp' ) ) );

if ( ! $show && POST_SMTP_SHOW_RELEASE_MESSAGE ) {
$linkText = POST_SMTP_RELEASE_URL == '#' ? '' : '<a target="_blank" href="' . POST_SMTP_RELEASE_URL . '">Read Here</a>';
echo '
<div class="updated settings-error notice is-dismissible">
<p>
<strong>Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ':</strong> <a target="_blank" href="' . POST_SMTP_RELEASE_URL . '">Read Here</a>
<strong>Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ':</strong> ' . $linkText . '
</p>
<button style="z-index: 100;" data-version="'. $version . '" data-security="' . wp_create_nonce('postsmtp') .'" type="button" class="notice-dismiss postman-release-message">
<span class="screen-reader-text">Dismiss this notice.</span>
Expand Down Expand Up @@ -370,6 +371,9 @@ private function displayTopNavigation() {
$resetTitle = __( 'Reset Plugin', 'post-smtp' );
$importExportReset = sprintf( '%s/%s/%s', $importTitle, $exportTile, $resetTitle );
printf( $purgeLinkPattern, $this->getPageUrl( PostmanAdminController::MANAGE_OPTIONS_PAGE_SLUG ), sprintf( '%s', $importExportReset ) );

do_action( 'post_smtp_extension_reset_link' );

print '</ul>';
print '</div>';
?>
Expand All @@ -378,6 +382,7 @@ private function displayTopNavigation() {
<h4><img class="align-middle" src="<?php echo plugins_url( 'style/images/new.gif', dirname( __DIR__ ) . '/postman-smtp.php' ); ?>"><a style="color: black;" target="_blank" href="https://postmansmtp.com/extensions/">Extensions</a></h4>
<ul>
<li><a target="_blank" href="https://postmansmtp.com/extensions/office-365-for-post-smtp-extension/">Office 365 API</a></li>
<li><a target="_blank" href="https://postmansmtp.com/extensions/post-smtp-extension-for-amazon-ses/">Amazon SES</a></li>
</ul>
</div>

Expand Down
8 changes: 4 additions & 4 deletions postman-smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Plugin Name: Post SMTP
* Plugin URI: https://wordpress.org/plugins/post-smtp/
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
* Version: 2.0.18
* Version: 2.0.19
* Author: Yehuda Hassine
* Text Domain: post-smtp
* Author URI: https://postmansmtp.com
Expand Down Expand Up @@ -35,10 +35,10 @@
define( 'POST_SMTP_BASE', __FILE__ );
define( 'POST_SMTP_PATH', __DIR__ );
define( 'POST_SMTP_URL', plugins_url('', POST_SMTP_BASE ) );
define( 'POST_SMTP_VER', '2.0.18' );
define( 'POST_SMTP_VER', '2.0.19' );
define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', true );
define( 'POST_SMTP_RELEASE_MESSAGE', "Post SMTP v2.0.18 - Extensions" );
define( 'POST_SMTP_RELEASE_URL', 'https://postmansmtp.com/post-smtp-2-0-18-extensions/' );
define( 'POST_SMTP_RELEASE_MESSAGE', "All Office365 extension issues are fixed now + Amazon SES Extension download." );
define( 'POST_SMTP_RELEASE_URL', '#' );

$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) );
$required_php_version = version_compare( PHP_VERSION, '5.6.0', '<' );
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehudaha
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
Requires at least: 3.9
Tested up to: 5.6
Stable tag: 2.0.18
Stable tag: 2.0.19
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -281,6 +281,10 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a

== Changelog ==

= 2.0.19 - 2020-01-19
* Fixed: All reported office 365 issues.
* New: Add link to Amazon SES Extension

= 2.0.18 - 2020-01-17
* New: Plugin Extensions

Expand Down

0 comments on commit 89180a6

Please sign in to comment.