Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugins/post-smtp/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();
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 );
}

/**
Expand Down 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 @@ -328,23 +329,39 @@ 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;
}

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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' ];

Expand All @@ -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 Expand Up @@ -97,4 +87,4 @@ public function remove_extension($slug) {
public function get_extensions() {
return $this->extensions;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@ function postman_render_email_page() {
<input id="from_date" class="email-log-date" value="<?php echo esc_attr($from_date); ?>" type="text" name="from_date" placeholder="<?php _e( 'From Date', 'post-smtp' ); ?>">
</div>
<div class="form-control">
<label for="to_date"><?php _e( 'To Date', 'post-smtp' ); ?></label>
<label for="to_date"><?php _e( 'To Date', 'post-smtp' ); ?></label>
<input id="to_date" class="email-log-date" value="<?php echo esc_attr($to_date); ?>" type="text" name="to_date" placeholder="<?php _e( 'To Date', 'post-smtp' ); ?>">
</div>
<div class="form-control">
<label for="search"><?php _e( 'Search', 'post-smtp' ); ?></label>
<label for="search"><?php _e( 'Search', 'post-smtp' ); ?></label>
<input id="search" type="text" name="search" value="<?php echo esc_attr($search); ?>" placeholder="<?php _e( 'Search', 'post-smtp' ); ?>">
</div>
<div class="form-control">
Expand All @@ -451,7 +451,7 @@ function postman_render_email_page() {
echo '<option value="' . $value . '"' . $selected . '>' . $value . '</option>';
}
?>
</select>
</select>
</div>

<div class="form-control" style="padding: 0 5px 0 5px;">
Expand All @@ -467,19 +467,22 @@ function postman_render_email_page() {
</div>

</div>
<div class="error">Please notice: when you select a date for example 11/20/2017, behind the scene the query select <b>11/20/2017 00:00:00</b>.<br>So if you searching for an email arrived that day at any hour you need to select 11/20/2017 as the <b>From Date</b> and 11/21/2017 as the <b>To Date</b>.</div>
<div class="error" style="padding: 20px; font-size: 16px;">
<strong>For more advanced, better performance and UI Email logger check our new extension:</strong><br><br>
<a style="font-weight: bold;" target="_blank" href="https://postmansmtp.com/extensions/better-email-logger-post-smtp-extension/">Better Email Logger</a>
</div>
</form>

<!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->
<form id="movies-filter" method="get">
<!-- For plugins, we also need to ensure that the form posts back to our current page -->
<input type="hidden" name="page"
value="<?php echo filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING ); ?>" />

<!-- Now we can render the completed list table -->
<?php $testListTable->display()?>
</form>

<?php add_thickbox(); ?>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 14 additions & 6 deletions plugins/post-smtp/Postman/Postman.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -97,7 +97,7 @@ public function __construct( $rootPluginFilenameAndPath, $version ) {
}

// register the email transports

// store an instance of the WpMailBinder
$this->wpMailBinder = PostmanWpMailBinder::getInstance();

Expand Down 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 All @@ -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();

Expand Down Expand Up @@ -415,7 +423,7 @@ public function display_configuration_required_warning() {
}
$message .= (sprintf( ' %s | %s', $goToEmailLog, $goToSettings ));
$message .= '<input type="hidden" name="security" class="security" value="' . wp_create_nonce('postsmtp') . '">';

$hide = get_option('postman_release_version' );

if ( $msg['error'] == true && ! $hide ) {
Expand Down
31 changes: 24 additions & 7 deletions plugins/post-smtp/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 All @@ -336,13 +337,13 @@ private function displayTopNavigation() {
echo '<div class="twitter-wrap">';
print '<div id="postman-main-menu" class="welcome-panel">';
print '<div class="welcome-panel-content">';
print '<div class="welcome-panel-column-container">';
print '<div class="welcome-panel-column">';
print '<div class="welcome-panel-column-container" style="display: flex; flex-wrap: wrap; justify-content: space-around; align-items: flex-start;">';
print '<div class="ps-welcome-panel-column">';
printf( '<h4>%s</h4>', __( 'Configuration', 'post-smtp' ) );
printf( '<a class="button button-primary button-hero" href="%s">%s</a>', $this->getPageUrl( PostmanConfigurationController::CONFIGURATION_WIZARD_SLUG ), __( 'Start the Wizard', 'post-smtp' ) );
printf( '<p class="">%s <a href="%s" class="configure_manually">%s</a></p>', __( 'or', 'post-smtp' ), $this->getPageUrl( PostmanConfigurationController::CONFIGURATION_SLUG ), __( 'Show All Settings', 'post-smtp' ) );
print '</div>';
print '<div class="welcome-panel-column">';
print '<div class="ps-welcome-panel-column">';
printf( '<h4>%s</h4>', _x( 'Actions', 'Main Menu', 'post-smtp' ) );
print '<ul>';

Expand Down Expand Up @@ -370,17 +371,33 @@ 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>';
print '<div class="welcome-panel-column welcome-panel-last">';
?>

<div class="ps-welcome-panel-column">
<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 style="font-weight: bold;" target="_blank" href="https://postmansmtp.com/extensions/better-email-logger-post-smtp-extension/">Better Email Logger</a></li>
<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>

<?php
print '<div class="ps-welcome-panel-column welcome-panel-last">';
printf( '<h4>%s</h4>', _x( 'Troubleshooting', 'Main Menu', 'post-smtp' ) );
print '<ul>';
printf( '<li><a target="blank" class="align-middle" href="https://postmansmtp.com/help-configure-post-smtp/" class="welcome-icon postman_guides">%s</a></li>', __( 'Need help setup everything? (paid)', 'post-smtp' ) );
printf( '<li><a href="%s" class="welcome-icon run-port-test">%s</a></li>', $this->getPageUrl( PostmanConnectivityTestController::PORT_TEST_SLUG ), __( 'Connectivity Test', 'post-smtp' ) );
printf( '<li><a href="%s" class="welcome-icon run-port-test">%s</a></li>', $this->getPageUrl( PostmanDiagnosticTestController::DIAGNOSTICS_SLUG ), __( 'Diagnostic Test', 'post-smtp' ) );
printf( '<li><a href="%s" data-security="%s" class="welcome-icon release-lock-file">%s</a></li>', '#', wp_create_nonce( "postman" ), __( 'Release Lock File Error', 'post-smtp' ) );
printf( '<li><a href="https://wordpress.org/support/plugin/post-smtp/" class="welcome-icon postman_support">%s</a></li>', __( 'Online Support', 'post-smtp' ) );
printf( '<li><a target="blank" class="align-middle" href="https://postmansmtp.com/category/guides/" class="welcome-icon postman_guides">%s</a></li>', __( 'Guides', 'post-smtp' ) );
printf( '<li><img class="align-middle" src="' . plugins_url( 'style/images/new.gif', dirname( __DIR__ ) . '/postman-smtp.php' ) . '"><a target="blank" class="align-middle" href="https://www.facebook.com/groups/post.smtp" class="welcome-icon postman_guides">%s</a></li>', __( 'Facebook Group', 'post-smtp' ) );
printf( '<li><a target="blank" class="align-middle" href="https://www.facebook.com/groups/post.smtp" class="welcome-icon postman_guides">%s</a></li>', __( 'Facebook Group', 'post-smtp' ) );
printf( '<li><a target="blank" class="align-middle" href="https://postmansmtp.com/category/guides/" class="welcome-icon postman_guides">%s</a></li>', __( 'Guides', 'post-smtp' ) );
print '</ul></div></div></div></div>';
?>
</div>
Expand Down
8 changes: 4 additions & 4 deletions plugins/post-smtp/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.16
* Version: 2.0.20
* 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.16' );
define( 'POST_SMTP_VER', '2.0.20' );
define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', true );
define( 'POST_SMTP_RELEASE_MESSAGE', "I have released a new Google Analytics AIO plugin, if you liked it please leave a review." );
define( 'POST_SMTP_RELEASE_URL', 'https://wordpress.org/plugins/metrics-query/' );
define( 'POST_SMTP_RELEASE_MESSAGE', "I released a new Email Logger extension - A MUST DOWNLOAD." );
define( 'POST_SMTP_RELEASE_URL', 'https://postmansmtp.com/extensions/better-email-logger-post-smtp-extension/' );

$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
Loading