Skip to content

Commit

Permalink
2.0.27
Browse files Browse the repository at this point in the history
Add notice about Google Less Secure App.
  • Loading branch information
smusman98 committed Jul 18, 2022
1 parent dc2dffe commit 21cce0b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
18 changes: 11 additions & 7 deletions Postman/Postman-Mail/PostmanModuleTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ public function populateConfigurationFromRecommendation($winningRecommendation)
}

/**
*
* @since 2.0.27 OAuth 2.0 will be selected by default as Google is disabling less secure Apps.
* @version 1.1
*/
public function createOverrideMenu(PostmanWizardSocket $socket, $winningRecommendation, $userSocketOverride, $userAuthOverride) {
$overrideItem = parent::createOverrideMenu ( $socket, $winningRecommendation, $userSocketOverride, $userAuthOverride );
Expand Down Expand Up @@ -709,21 +712,22 @@ public function createOverrideMenu(PostmanWizardSocket $socket, $winningRecommen
$noAuthMode = true;
}
}

if ($selected) {
if ($socket->auth_crammd5 || $socket->auth_login || $socket->authPlain) {
array_push ( $overrideAuthItems, array (
'selected' => $passwordMode,
'name' => __ ( 'Password (requires username and password)', 'post-smtp' ),
'value' => 'password'
) );
}
if ($socket->auth_xoauth || $winningRecommendation ['auth'] == 'oauth2') {
array_push ( $overrideAuthItems, array (
'selected' => $oauth2Mode,
'name' => __ ( 'OAuth 2.0 (requires Client ID and Client Secret)', 'post-smtp' ),
'value' => 'oauth2'
) );
}
if ($socket->auth_crammd5 || $socket->auth_login || $socket->authPlain) {
array_push ( $overrideAuthItems, array (
'selected' => $passwordMode,
'name' => __ ( 'Password (requires username and password) <span class=\'ps-less-secure\'>Not recommended </span>(Starting May 30, 2022, ​​Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.) <a href=\'https://postmansmtp.com/gmail-is-disabling-less-secure-apps\' target="_blank">Learn More</a>', 'post-smtp' ),
'value' => 'password'
) );
}
if ($socket->auth_none) {
array_push ( $overrideAuthItems, array (
'selected' => $noAuthMode,
Expand Down
28 changes: 26 additions & 2 deletions Postman/PostmanViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function __construct( $rootPluginFilenameAndPath, PostmanOptions $options, Postm
$this->oauthScribe = $oauthScribe;
$this->adminController = $adminController;
$this->logger = new PostmanLogger( get_class( $this ) );
$hostname = PostmanOptions::getInstance()->getHostname();
$auth_type = PostmanOptions::getInstance()->getAuthenticationType();

PostmanUtils::registerAdminMenu( $this, 'generateDefaultContent' );
PostmanUtils::registerAdminMenu( $this, 'addPurgeDataSubmenu' );

Expand All @@ -42,6 +45,10 @@ function __construct( $rootPluginFilenameAndPath, PostmanOptions $options, Postm
add_action( 'wp_ajax_delete_lock_file', array( $this, 'delete_lock_file' ) );
add_action( 'wp_ajax_dismiss_version_notify', array( $this, 'dismiss_version_notify' ) );
add_action( 'wp_ajax_dismiss_donation_notify', array( $this, 'dismiss_donation_notify' ) );

if( $hostname == 'smtp.gmail.com' && $auth_type == 'plain' ) {
add_action( 'admin_notices', array( $this, 'google_less_secure_notice' ) );
}

//add_action( 'admin_init', array( $this, 'do_activation_redirect' ) );

Expand Down Expand Up @@ -395,6 +402,23 @@ private function displayTopNavigation() {
</div>
<?php
}
}
}

public function google_less_secure_notice() {

?>
<div class="notice notice-error is-dismissible">
<?php
printf(
'<p>%1$s <br />%2$s <a href="%3$s" target="_blank">%4$s</a></p>',
esc_html__( '"To help keep your account secure, starting May 30, 2022, ​​Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password."', 'post-smtp' ),
esc_html__( 'You can switch to Auth 2.0 option to continue without any downtime.', 'post-smtp' ),
esc_url( 'https://postmansmtp.com/gmail-is-disabling-less-secure-apps' ),
esc_html__( 'Click here for more info', 'post-smtp' )
);
?>
</div>
<?php

}
}
}
4 changes: 2 additions & 2 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.26
* Version: 2.0.27
* Author: Post SMTP
* Text Domain: post-smtp
* Author URI: https://postmansmtp.com
Expand Down Expand Up @@ -35,7 +35,7 @@
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.26' );
define( 'POST_SMTP_VER', '2.0.27' );
define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', true );
define( 'POST_SMTP_RELEASE_MESSAGE', "THE FUTURE OF Post SMTP - PLEASE READ!" );
define( 'POST_SMTP_RELEASE_URL', 'https://postmansmtp.com/the-future-of-post-smtp/' );
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Plugin URI: https://wpexperts.io/
Contributors: wpexpertsio
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.9.3
Stable tag: 2.0.26
Tested up to: 6.0
Stable tag: 2.0.27
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 2.0.27 - 2022-05-19 =
Add notice about Google Less Secure App.

= 2.0.26 - 2022-04-22 =
* **Bug Fixes**
* Email header was broken in some cases.
Expand Down
8 changes: 8 additions & 0 deletions style/postman.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ p#back_to_main_menu {
background: #fff;
}

.ps-less-secure {
color: red;
}

#user_auth_override td {
padding-bottom: 15px;
}


@keyframes pulse {
0% {
Expand Down

0 comments on commit 21cce0b

Please sign in to comment.