Skip to content

Commit

Permalink
update plugins/post-smtp
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleBlanchette committed Oct 8, 2024
1 parent 855b784 commit 2028dc6
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function get_body( $interval ) {
$from = strtotime( $from->format( 'Y-m-d H:i:s' ) );
}

$logs = $this->get_total_logs( $from, $to, 4 );
$logs = $this->get_total_logs( $from, $to );

include_once POST_SMTP_PATH . '/Postman/Postman-Email-Health-Report/PostmanReportTemplate.php';
$get_body = new PostmanReportTemplate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,11 @@ private function get_email_body( $message ) {
// add the From Header
$sender = $message->getFromAddress();
{
$senderEmail = $options->getMessageSenderEmail();
$senderName = $sender->getName();
assert( ! empty( $senderEmail ) );

$senderEmail = !empty( $sender->getEmail() ) ? $sender->getEmail() : $options->getMessageSenderEmail();
$senderName = !empty( $sender->getName() ) ? $sender->getName() : $options->getMessageSenderName();

$senderText = ! empty( $senderName ) ? $senderName : $senderEmail;
$this->mailgunMessage ['from'] = "{$senderText} <{$senderEmail}>";
$this->mailgunMessage ['from'] = "{$senderName} <{$senderEmail}>";
// now log it
$sender->log( $this->logger, 'From' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function outputTestEmailContent() {
'<p>%s <b>%s</b> %s</p>',
esc_html__( 'This is the conversation between Postman and the mail server. It can be useful for diagnosing problems.', 'post-smtp' ) ,
esc_html__( 'DO NOT', 'post-smtp' ),
esc_html__( 'post it on-line, it may contain your account password.', 'post-smtp' )
esc_html__( 'post it online, it may contain your account password.', 'post-smtp' )
);
print '<section>';
printf( '<p><label for="postman_test_message_transcript">%s</label></p>', esc_html__( 'Session Transcript', 'post-smtp' ) );
Expand Down
8 changes: 7 additions & 1 deletion wp-content/plugins/post-smtp/Postman/PostmanUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ static function roundBytes( $size ) {
'TiB',
'PiB',
);
return @round( $size / pow( 1024, ($i = floor( log( $size, 1024 ) )) ), 2 ) . ' ' . $unit [ $i ];

$log = log( $size, 1024 );
$unit_key = floor( $log );
$pow = pow( 1024, $unit_key );
$pow = floor( $pow );

return @round( $size / $pow, 2 ) . ' ' . $unit[$unit_key];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public function outputDefaultContent() {
print '</br><hr width="70%"></br>';
/* translators: where %s is the URL to the WordPress.org review and ratings page */
printf(
'<p>%s <a href="%s">%s</a>%s</p>',
'<p>%s <a href="%s">%s</a> %s</p>',
esc_html__( 'Please consider', 'post-smtp' ),
esc_url( 'https://wordpress.org/support/plugin/post-smtp/reviews/?filter=5' ),
esc_html__( 'leaving a review', 'post-smtp' ),
Expand All @@ -563,7 +563,7 @@ public function outputDefaultContent() {
esc_html__( 'New for v1.9.8!', 'post-smtp' ),
esc_html__( ' Fallback - setup a second delivery method when the first one is failing', 'post-smtp' ),
esc_url( 'https://postmansmtp.com/post-smtp-1-9-7-the-smtp-fallback/' ),
esc_html__( 'Check the detailes here', 'post-smtp')
esc_html__( 'Check the details here', 'post-smtp')
);

?>
Expand Down
85 changes: 59 additions & 26 deletions wp-content/plugins/post-smtp/Postman/Wizard/NewWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,7 @@ class Post_SMTP_New_Wizard {
)
);

private $socket_sequence = array(
'gmail_api',
'sendinblue_api',
'sendgrid_api',
'mailgun_api',
'elasticemail_api',
'mandrill_api',
'postmark_api',
'sparkpost_api',
'mailjet_api',
'sendpulse_api',
'office365_api',
'aws_ses_api',
'zohomail_api',
'smtp',
'default'
);
private $socket_sequence = array();

/**
* Constructor for the class
Expand All @@ -74,6 +58,30 @@ class Post_SMTP_New_Wizard {
*/
public function __construct() {

$this->socket_sequence = array(
'gmail_api',
'sendinblue_api',
'sendgrid_api',
'mailgun_api',
'elasticemail_api',
'mandrill_api',
'postmark_api',
'sparkpost_api',
'mailjet_api',
'sendpulse_api'
);

if( !is_plugin_active( 'post-smtp-pro/post-smtp-pro.php' ) ) {

$this->socket_sequence[] = 'office365_api';
$this->socket_sequence[] = 'aws_ses_api';
$this->socket_sequence[] = 'zohomail_api';

}

$this->socket_sequence[] = 'smtp';
$this->socket_sequence[] = 'default';

add_filter( 'post_smtp_legacy_wizard', '__return_false' );
add_action( 'post_smtp_new_wizard', array( $this, 'load_wizard' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
Expand Down Expand Up @@ -115,15 +123,30 @@ public function load_wizard() {
<span class="dashicons dashicons-no-alt ps-pro-close-popup"></span>
<div class="ps-pro-popup-content">
<img src="" class="ps-pro-for-img" />
<h1><span class="ps-pro-for"></span> is a Pro feature</h1>
<h1><span class="ps-pro-for"></span> is Pro Feature</h1>
<p>
We're sorry, the <span class="ps-pro-for"></span> mailer is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome fetures.
We're sorry, the <span class="ps-pro-for"></span> mailer is not available on your plan.
<br />
Please upgrade to the PRO plan to unlock all these awesome features.
</p>
<div>
<a href="https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard&utm_campaign=plugin" target="_blank" class="button button-primary ps-yellow-btn ps-pro-product-url" style="color: #ffffff!important">UPGRADE TO PRO</a>
<a href="https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard&utm_campaign=plugin" target="_blank" class="button button-primary ps-yellow-btn ps-pro-product-url" style="color: #ffffff!important; font-weight: 400; align-content: center;">Upgrade to PRO <span class="dashicons dashicons-arrow-right-alt2"></span></a>
</div>
<div class="ps-pro-promo-area">
<p>
<b>Bonus:</b> Upgrade now and get <span class="ps-pro-discount">25% off</span> on Post SMTP lifetime plans!
</p>
<div class="ps-pro-coupon">
<b>
Use Coupon: <span class="ps-pro-coupon-code">GETSMTPPRO</span> <span class="dashicons dashicons-admin-page ps-click-to-copy"></span>
</b>
</div>
<div id="ps-pro-code-copy-notification" style="display: none;position:absolute;color: #b3d5b6;border-radius:3px;right: 0;left: 0; bottom: -12px; margin: auto;width: 95px;font-size: 11px;background: #e1fde4;border: 1px solid #b3d5b6;line-height: 22px;">
Code Copied<span class="dashicons dashicons-yes"></span>
</div>
</div>
<div>
<a href="" class="ps-pro-close-popup" style="color: #c2c2c2; font-size: 10px;">Already purchased?</a>
<a href="" class="ps-pro-close-popup" style="color: #6A788B; font-size: 10px; font-size: 12px;">Already purchased?</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -211,8 +234,18 @@ public function load_wizard() {

$url = isset( $urls[$transport->getSlug()] ) ? $urls[$transport->getSlug()] : $transport->getLogoURL();
$this->sockets[$transport->getSlug()] = $transport->getName();
$checked = $transport->getSlug() == $this->options->getTransportType() ? 'checked' : '';
$checked = ( isset( $_GET['socket'] ) && !empty( sanitize_text_field( $_GET['socket'] ) ) && $transport->getSlug() == sanitize_text_field( $_GET['socket'] ) ) ? 'checked' : '';

if( isset( $_GET['socket'] ) && !empty( sanitize_text_field( $_GET['socket'] ) ) && $transport->getSlug() == sanitize_text_field( $_GET['socket'] ) ) {

$checked = 'checked';

}
elseif( $transport->getSlug() == $this->options->getTransportType() && !is_plugin_active( 'post-smtp-pro/post-smtp-pro.php' ) ) {

$checked = 'checked';

}

$slug = $transport->getSlug();
$transport_name = $transport->getName();

Expand All @@ -227,7 +260,7 @@ public function load_wizard() {
$slug = $transport_slug;
$transport_name = 'Microsoft 365';
$is_pro = 'ps-pro-extension';
$product_url = 'https://postmansmtp.com/extensions/office-365-extension-for-post-smtp/?utm_source=plugin&utm_medium=wizard&utm_campaign=plugin';
$product_url = 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard_microsoft&utm_campaign=plugin';

}
if( $transport_slug == 'zohomail_api' ) {
Expand All @@ -236,7 +269,7 @@ public function load_wizard() {
$slug = $transport_slug;
$transport_name = 'Zoho';
$is_pro = 'ps-pro-extension';
$product_url = 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard&utm_campaign=plugin';
$product_url = 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard_zoho&utm_campaign=plugin';

}
if( !class_exists( 'Post_Smtp_Amazon_Ses' ) && $transport_slug == 'aws_ses_api' ) {
Expand All @@ -245,7 +278,7 @@ public function load_wizard() {
$slug = $transport_slug;
$transport_name = 'Amazon SES';
$is_pro = 'ps-pro-extension';
$product_url = 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard&utm_campaign=plugin';
$product_url = 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wizard_amazonses&utm_campaign=plugin';

}

Expand Down
91 changes: 74 additions & 17 deletions wp-content/plugins/post-smtp/Postman/Wizard/assets/css/wizard.css
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@

.button-primary.ps-yellow-btn {
border: #ff9900;
background: #ff9900;
border-radius: 0px;
line-height: 40px;
background: #fa8900;
border-radius: 50px;
line-height: 35px;
width: 170px;
color: #000!important;
color: #000 !important;
}

.button-primary.ps-yellow-btn.focus,
Expand All @@ -391,10 +391,10 @@
border-color: #000000;
}

.button-primary.ps-blue-btn .dashicons,
.button-primary.ps-blue-btn .dashicons,
.button-primary.ps-yellow-btn .dashicons {
vertical-align: middle;
font-size: 16px;
font-size: 15px;
}

.button-primary {
Expand Down Expand Up @@ -571,42 +571,99 @@

.ps-pro-popup-outer {
position: absolute;
width: 500px;
height: 360px;
border-top: 3px solid #375caf;
width: 550px;
height: 400px;
background: #fff;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 7px;
}

span.ps-pro-close-popup {
position: absolute;
right: 27px;
right: 18px;
top: 0;
color: #fff;
background: #bababa;
color: #222222;
border: 1px solid #e2e4ea;
border-radius: 50px;
cursor: pointer;
}

.ps-pro-popup-body {
position: relative;
cursor: pointer;
line-height: 30px;
}

.ps-pro-popup-content {
width: 60%;
width: 92%;
text-align: center;
font-weight: bolder;
margin: 30px auto;
margin: 15px auto;
}

.ps-pro-popup-content h1 {
color: #214A72;
font-weight: 400;
}

.ps-pro-popup-content p {
font-size: 11px;
color: #000;
color: #6A788B;
margin: 25px 0;
font-weight: 400;
width: 75%;
margin: 25px auto;
}

.ps-pro-promo-area {
background: #f0f6ff;
border-radius: 6px;
margin: 20px 0 5px 0;
padding: 16px 0px;
position: relative;
}

.ps-pro-promo-area p {
color: #214a72;
font-size: 12px;
margin: 0 auto;
}

.ps-pro-promo-area b {
font-weight: bolder;
}

.ps-pro-coupon {
background: #5e7cbf;
display: inline-block;
padding: 0px 14px;
border-radius: 7px;
margin-top: 10px;
}

.ps-pro-coupon b {
color: #fff;
}

.ps-pro-discount {
background: #121FCF;
background: linear-gradient(298.51deg, #8ED2F5 -7.43%, #46519E 78.45%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bolder;
}
#ps-pro-code-copy-notification .dashicons {
vertical-align: middle;
}

.ps-click-to-copy {
vertical-align: sub;
}

.ps-click-to-copy {
cursor: pointer;
}

.ps-wizard-connectivity-information {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions wp-content/plugins/post-smtp/Postman/Wizard/assets/js/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ jQuery( document ).ready(function() {
var placeholder = jQuery( this ).find( 'h4' ).text();
var imgSrc = jQuery( this ).find( 'img' ).attr( 'src' );
var productURL = jQuery( this ).data( 'url' );
imgSrc = imgSrc.replace( '.png', '-popup.png' );

jQuery( '.ps-pro-for-img' ).attr( 'src', imgSrc );
jQuery( '.ps-pro-product-url' ).attr( 'href', productURL );
Expand All @@ -520,4 +521,26 @@ jQuery( document ).ready(function() {

} );

jQuery( '.ps-click-to-copy' ).click( function() {

// Get the coupon code text
var couponCode = jQuery( '.ps-pro-coupon-code' ).text();

// Create a temporary textarea element to copy the text
var $temp = jQuery( '<textarea>' );
jQuery( 'body' ).append( $temp );
$temp.val( couponCode ).select();
document.execCommand( 'copy' );
$temp.remove();

// Show the notification
jQuery( '#ps-pro-code-copy-notification' ).fadeIn();

// Hide the notification after 1 second
setTimeout(function() {
jQuery( '#ps-pro-code-copy-notification' ).fadeOut();
}, 2000);

});

} );
Loading

0 comments on commit 2028dc6

Please sign in to comment.