From 38153c0f3e739f3d89a1a7734fd7d199bf457fab Mon Sep 17 00:00:00 2001
From: yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>
Date: Wed, 15 May 2019 12:14:32 +0000
Subject: = 2.0 - 2019-05-15 * New: Mailer Type - Added an option to send
 without overwrite the 'wp_mail' function, better compability to WordPress
 delivery. hopefully will be the default in the future. * Updated: Sendgrid
 API was upgraded and rewritten to the new version. * Fixed: Message-Id header
 was missing on SMTP * Fixed: Email logger optimization - better query for
 large amount of records. * Fixed: The localization was fixed to match
 translate.wordpress.org translation system ( Thanks to Niels de Blaauw from
 Level-Level ). * Fixed: Code and optimization ( Thanks to Niels de Blaauw
 from Level-Level ).

---
 Postman/Postman-Controller/PostmanAdminPointer.php |  4 +-
 .../PostmanDashboardWidgetController.php           | 24 ++++----
 .../PostmanManageConfigurationAjaxHandler.php      |  2 +-
 .../PostmanWelcomeController.php                   | 70 +++++++++++-----------
 4 files changed, 50 insertions(+), 50 deletions(-)

(limited to 'Postman/Postman-Controller')

diff --git a/Postman/Postman-Controller/PostmanAdminPointer.php b/Postman/Postman-Controller/PostmanAdminPointer.php
index 16bd6a2..15fb52d 100644
--- a/Postman/Postman-Controller/PostmanAdminPointer.php
+++ b/Postman/Postman-Controller/PostmanAdminPointer.php
@@ -13,7 +13,7 @@ if (! class_exists ( 'PostmanAdminPointer' )) {
 		
 		/**
 		 *
-		 * @param unknown $rootPluginFilenameAndPath        	
+		 * @param mixed $rootPluginFilenameAndPath        	
 		 */
 		function __construct($rootPluginFilenameAndPath) {
 			$this->logger = new PostmanLogger ( get_class ( $this ) );
@@ -35,7 +35,7 @@ if (! class_exists ( 'PostmanAdminPointer' )) {
 		
 		/**
 		 *
-		 * @param unknown $hook_suffix        	
+		 * @param mixed $hook_suffix        	
 		 */
 		function wptuts_pointer_load($hook_suffix) {
 			// only do this for administrators
diff --git a/Postman/Postman-Controller/PostmanDashboardWidgetController.php b/Postman/Postman-Controller/PostmanDashboardWidgetController.php
index 7393ee3..6233315 100644
--- a/Postman/Postman-Controller/PostmanDashboardWidgetController.php
+++ b/Postman/Postman-Controller/PostmanDashboardWidgetController.php
@@ -54,7 +54,7 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 		public function addDashboardWidget() {
 			// only display to the widget to administrator
 			if (PostmanUtils::isAdmin ()) {
-				wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', Postman::TEXT_DOMAIN ), array (
+				wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', 'post-smtp' ), array (
 						$this,
 						'printDashboardWidget' 
 				) ); // Display function.
@@ -67,7 +67,7 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 		public function addNetworkDashboardWidget() {
 			// only display to the widget to administrator
 			if (PostmanUtils::isAdmin ()) {
-				wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', Postman::TEXT_DOMAIN ), array (
+				wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', 'post-smtp' ), array (
 						$this,
 						'printNetworkDashboardWidget' 
 				) ); // Display function.
@@ -78,8 +78,8 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 		 * Create the function to output the contents of our Dashboard Widget.
 		 */
 		public function printDashboardWidget() {
-			$goToSettings = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getSettingsPageUrl (), __ ( 'Settings', Postman::TEXT_DOMAIN ) );
-			$goToEmailLog = sprintf ( '%s', _x ( 'Email Log', 'The log of Emails that have been delivered', Postman::TEXT_DOMAIN ) );
+			$goToSettings = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getSettingsPageUrl (), __ ( 'Settings', 'post-smtp' ) );
+			$goToEmailLog = sprintf ( '%s', _x ( 'Email Log', 'The log of Emails that have been delivered', 'post-smtp' ) );
 			if ($this->options->isMailLoggingEnabled ()) {
 				$goToEmailLog = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getEmailLogPageUrl (), $goToEmailLog );
 			}
@@ -92,16 +92,16 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 		 */
 		public function print_postman_status() {
 			if (! PostmanPreRequisitesCheck::isReady ()) {
-				printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Error: Postman is missing a required PHP library.', Postman::TEXT_DOMAIN ) );
+				printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Error: Postman is missing a required PHP library.', 'post-smtp' ) );
 			} else if ($this->wpMailBinder->isUnboundDueToException ()) {
-				printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman: wp_mail has been declared by another plugin or theme, so you won\'t be able to use Postman until the conflict is resolved.', Postman::TEXT_DOMAIN ) );
+				printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman: wp_mail has been declared by another plugin or theme, so you won\'t be able to use Postman until the conflict is resolved.', 'post-smtp' ) );
 			} else {
 				if ($this->options->getRunMode () != PostmanOptions::RUN_MODE_PRODUCTION) {
-					printf ( '<p><span style="background-color:yellow">%s</span></p>', __ ( 'Postman is in <em>non-Production</em> mode and is dumping all emails.', Postman::TEXT_DOMAIN ) );
+					printf ( '<p><span style="background-color:yellow">%s</span></p>', __ ( 'Postman is in <em>non-Production</em> mode and is dumping all emails.', 'post-smtp' ) );
 				} else if (PostmanTransportRegistry::getInstance ()->getSelectedTransport ()->isConfiguredAndReady ()) {
-					printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s </p>', sprintf ( _n ( '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> email.', '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> emails.', PostmanState::getInstance ()->getSuccessfulDeliveries (), Postman::TEXT_DOMAIN ), PostmanState::getInstance ()->getSuccessfulDeliveries () ) );
+					printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s </p>', sprintf ( _n ( '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> email.', '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> emails.', PostmanState::getInstance ()->getSuccessfulDeliveries (), 'post-smtp' ), PostmanState::getInstance ()->getSuccessfulDeliveries () ) );
 				} else {
-					printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman is <em>not</em> configured and is mimicking out-of-the-box WordPress email delivery.', Postman::TEXT_DOMAIN ) );
+					printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman is <em>not</em> configured and is mimicking out-of-the-box WordPress email delivery.', 'post-smtp' ) );
 				}
 				$currentTransport = PostmanTransportRegistry::getInstance ()->getActiveTransport ();
 				$deliveryDetails = $currentTransport->getDeliveryDetails ( $this->options );
@@ -113,14 +113,14 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 		 * Create the function to output the contents of our Dashboard Widget.
 		 */
 		public function printNetworkDashboardWidget() {
-			printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s</p>', __ ( 'Postman is operating in per-site mode.', Postman::TEXT_DOMAIN ) );
+			printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s</p>', __ ( 'Postman is operating in per-site mode.', 'post-smtp' ) );
 		}
 		
 		/**
 		 * From http://www.hughlashbrooke.com/2014/02/wordpress-add-items-glance-widget/
 		 * http://coffeecupweb.com/how-to-add-custom-post-types-to-at-a-glance-dashboard-widget-in-wordpress/
 		 *
-		 * @param unknown $items        	
+		 * @param mixed $items        	
 		 * @return string
 		 */
 		function customizeAtAGlanceDashboardWidget($items = array()) {
@@ -143,7 +143,7 @@ if (! class_exists ( "PostmanDashboardWidgetController" )) {
 						$privated = intval ( $num_posts->private );
 						$post_type = get_post_type_object ( $type );
 						
-						$text = _n ( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $privated, Postman::TEXT_DOMAIN );
+						$text = _n ( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $privated, 'post-smtp' );
 						$text = sprintf ( $text, number_format_i18n ( $privated ) );
 						
 						$items [] = sprintf ( '<a class="%1$s-count" href="%3$s">%2$s</a>', $type, $text, PostmanUtils::getEmailLogPageUrl () ) . "\n";
diff --git a/Postman/Postman-Controller/PostmanManageConfigurationAjaxHandler.php b/Postman/Postman-Controller/PostmanManageConfigurationAjaxHandler.php
index 2c05b3a..1260dad 100644
--- a/Postman/Postman-Controller/PostmanManageConfigurationAjaxHandler.php
+++ b/Postman/Postman-Controller/PostmanManageConfigurationAjaxHandler.php
@@ -27,7 +27,7 @@ class PostmanWizardSocket {
 	
 	/**
 	 *
-	 * @param unknown $queryHostData        	
+	 * @param mixed $queryHostData        	
 	 */
 	function __construct($queryHostData) {
 		$this->hostname = $queryHostData ['hostname'];
diff --git a/Postman/Postman-Controller/PostmanWelcomeController.php b/Postman/Postman-Controller/PostmanWelcomeController.php
index b43e969..869848a 100644
--- a/Postman/Postman-Controller/PostmanWelcomeController.php
+++ b/Postman/Postman-Controller/PostmanWelcomeController.php
@@ -19,8 +19,8 @@ class PostmanWelcomeController {
 
 			// About
 			add_dashboard_page(
-				__( 'Welcome',  Postman::TEXT_DOMAIN ),
-				__( 'Welcome',  Postman::TEXT_DOMAIN ),
+				__( 'Welcome',  'post-smtp' ),
+				__( 'Welcome',  'post-smtp' ),
 				'manage_options',
 				'post-about',
 				array( $this, 'about_screen' )
@@ -28,8 +28,8 @@ class PostmanWelcomeController {
 
 			// Credits
 			add_dashboard_page(
-				__( 'Credits',  Postman::TEXT_DOMAIN ),
-				__( 'Credits',  Postman::TEXT_DOMAIN ),
+				__( 'Credits',  'post-smtp' ),
+				__( 'Credits',  'post-smtp' ),
 				'manage_options',
 				'post-credits',
 				array( $this, 'credits_screen' )
@@ -72,36 +72,36 @@ class PostmanWelcomeController {
 			}
 		</style>
 		<div class="wrap about-wrap">
-			<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', Postman::TEXT_DOMAIN ), $this->version ); ?></h1>
-			<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! Post SMTP %s is bundled up and ready to take your SMTP needs to the next level!', Postman::TEXT_DOMAIN ), $this->version ); ?><br>
+			<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', 'post-smtp' ), $this->version ); ?></h1>
+			<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! Post SMTP %s is bundled up and ready to take your SMTP needs to the next level!', 'post-smtp' ), $this->version ); ?><br>
 				<?php printf( '<strong>%s</strong>','Post SMTP support every SMTP service: Gmail/G-suite, SendGrid, Mandrill, Office365, and more...' ); ?>
 			</div>
-			<div class="post-badge"><?php printf( esc_html__( 'Version %s', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
+			<div class="post-badge"><?php printf( esc_html__( 'Version %s', 'post-smtp' ), $this->version ); ?></div>
 
 			<h2 class="nav-tab-wrapper">
 				<a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>">
-					<?php esc_html_e( 'What&#8217;s New', Postman::TEXT_DOMAIN ); ?>
+					<?php esc_html_e( 'What&#8217;s New', 'post-smtp' ); ?>
 				</a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>">
-					<?php esc_html_e( 'Credits', Postman::TEXT_DOMAIN ); ?>
+					<?php esc_html_e( 'Credits', 'post-smtp' ); ?>
 				</a>
 			</h2>
 
 			<div class="changelog">
-				<h3><?php esc_html_e( 'Email Log', Postman::TEXT_DOMAIN ); ?></h3>
+				<h3><?php esc_html_e( 'Email Log', 'post-smtp' ); ?></h3>
 
 				<div class="feature-section col two-col">
 					<div class="last-feature">
-						<h4><?php esc_html_e( 'Email log filter', Postman::TEXT_DOMAIN ); ?></h4>
+						<h4><?php esc_html_e( 'Email log filter', 'post-smtp' ); ?></h4>
 						<p>
-							<?php esc_html_e( 'You can easily filter by dates and search in your log.', Postman::TEXT_DOMAIN ); ?>
+							<?php esc_html_e( 'You can easily filter by dates and search in your log.', 'post-smtp' ); ?>
 							<img src="<?php echo $this->pluginUrl; ?>/images/filter-preview.gif">	
 						</p>
 					</div>
 
 					<div>
-						<h4><?php esc_html_e( 'Multiple emails resend', Postman::TEXT_DOMAIN ); ?></h4>
+						<h4><?php esc_html_e( 'Multiple emails resend', 'post-smtp' ); ?></h4>
 						<p>
-							<?php esc_html_e( 'Resend any email to the original recipient or any other emails you choose.', Postman::TEXT_DOMAIN ); ?>
+							<?php esc_html_e( 'Resend any email to the original recipient or any other emails you choose.', 'post-smtp' ); ?>
 							<img src="<?php echo $this->pluginUrl; ?>/images/resend-preview.gif">	
 						</p>
 					</div>
@@ -109,7 +109,7 @@ class PostmanWelcomeController {
 			</div>
 
 			<div class="changelog">
-				<h3><?php esc_html_e( 'The best delivery experience', Postman::TEXT_DOMAIN ); ?></h3>
+				<h3><?php esc_html_e( 'The best delivery experience', 'post-smtp' ); ?></h3>
 
 				<div class="feature-section col one-col">
 					<div class="last-feature">
@@ -120,30 +120,30 @@ class PostmanWelcomeController {
 						Supports forced recipients (cc, bcc, to) and custom email headers,
 						SASL Support: Plain/Login/CRAM-MD5/XOAUTH2 authentication,
 						Security Support: SMTPS and STARTTLS (SSL/TLS),
-						Copy configuration to other instances of Post.', Postman::TEXT_DOMAIN ); ?></p>
+						Copy configuration to other instances of Post.', 'post-smtp' ); ?></p>
 					</div>
 				</div>
 
 				<div class="feature-section col three-col">
 					<div>
-						<h4><?php esc_html_e( 'Email log HTML preview', Postman::TEXT_DOMAIN ); ?></h4>
-						<p><?php esc_html_e( 'You can now see sent emails as HTML.', Postman::TEXT_DOMAIN ); ?></p>
+						<h4><?php esc_html_e( 'Email log HTML preview', 'post-smtp' ); ?></h4>
+						<p><?php esc_html_e( 'You can now see sent emails as HTML.', 'post-smtp' ); ?></p>
 					</div>
 
 					<div>
-						<h4><?php esc_html_e( 'Continues email delivery', Postman::TEXT_DOMAIN ); ?></h4>
-						<p><?php esc_html_e( 'if email fail to sent you will get notified using the local mail system.', Postman::TEXT_DOMAIN ); ?></p>
+						<h4><?php esc_html_e( 'Continues email delivery', 'post-smtp' ); ?></h4>
+						<p><?php esc_html_e( 'if email fail to sent you will get notified using the local mail system.', 'post-smtp' ); ?></p>
 					</div>
 
 					<div class="last-feature">
-						<h4><?php esc_html_e( 'The best debugging tools.', Postman::TEXT_DOMAIN ); ?></h4>
-						<p><?php esc_html_e( 'Full Transcripts, Connectivity Test, Diagnostic Test.', Postman::TEXT_DOMAIN ); ?></p>
+						<h4><?php esc_html_e( 'The best debugging tools.', 'post-smtp' ); ?></h4>
+						<p><?php esc_html_e( 'Full Transcripts, Connectivity Test, Diagnostic Test.', 'post-smtp' ); ?></p>
 					</div>
 				</div>
 			</div>
 
 			<div class="return-to-dashboard">
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></a>
+				<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', 'post-smtp' ); ?></a>
 			</div>
 
 		</div>
@@ -170,36 +170,36 @@ class PostmanWelcomeController {
 			}			
 		</style>
 		<div class="wrap about-wrap">
-			<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', Postman::TEXT_DOMAIN ), $this->version ); ?></h1>
-			<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
-			<div class="post-badge"><?php printf( esc_html__( 'Version %s', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
+			<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', 'post-smtp' ), $this->version ); ?></h1>
+			<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', 'post-smtp' ), $this->version ); ?></div>
+			<div class="post-badge"><?php printf( esc_html__( 'Version %s', 'post-smtp' ), $this->version ); ?></div>
 
 			<h2 class="nav-tab-wrapper">
 				<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
-					<?php esc_html_e( 'What&#8217;s New', Postman::TEXT_DOMAIN ); ?>
+					<?php esc_html_e( 'What&#8217;s New', 'post-smtp' ); ?>
 				</a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
-					<?php esc_html_e( 'Credits', Postman::TEXT_DOMAIN ); ?>
+					<?php esc_html_e( 'Credits', 'post-smtp' ); ?>
 				</a>
 			</h2>
 
-			<p class="about-description"><?php esc_html_e( 'Post SMTP started by Jason Hendriks, Jason left the project and Yehuda Hassine (me) continue his work.', Postman::TEXT_DOMAIN ); ?></p>
+			<p class="about-description"><?php esc_html_e( 'Post SMTP started by Jason Hendriks, Jason left the project and Yehuda Hassine (me) continue his work.', 'post-smtp' ); ?></p>
 
-			<h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', Postman::TEXT_DOMAIN ); ?></h4>
+			<h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'post-smtp' ); ?></h4>
 			<ul class="wp-people-group " id="wp-people-group-project-leaders">
 				<li class="wp-person" id="wp-person-jasonhendriks">
 					<a href="https://profiles.wordpress.org/jasonhendriks"><img src="https://secure.gravatar.com/avatar/8692c7b6084517a592f6cad107f7bcb0?s=60&d=mm&r=g" class="gravatar" alt="Jason Hendriks " /></a>
 					<a class="web" href="http://profiles.wordpress.org/matt">Jason Hendriks</a>
-					<span class="title"><?php esc_html_e( 'Founding Developer (abandoned)', Postman::TEXT_DOMAIN ); ?></span>
+					<span class="title"><?php esc_html_e( 'Founding Developer (abandoned)', 'post-smtp' ); ?></span>
 				</li>
 				<li class="wp-person" id="wp-person-yehudah">
 					<a href="http://profiles.wordpress.org/yehudah"><img src="https://secure.gravatar.com/avatar/c561638d04ea8fef351f974dbb9ece39?s=60&d=mm&r=g" class="gravatar" alt="Yehuda Hassine" /></a>
 					<a class="web" href="http://profiles.wordpress.org/yehudah">Yehuda Hassine</a>
-					<span class="title"><?php esc_html_e( 'Lead Developer', Postman::TEXT_DOMAIN ); ?></span>
+					<span class="title"><?php esc_html_e( 'Lead Developer', 'post-smtp' ); ?></span>
 				</li>
 			</ul>
 
-			<h4 class="wp-people-group"><?php esc_html_e( 'Top Community Members', Postman::TEXT_DOMAIN ); ?></h4>
-			<h5><?php esc_html_e( 'Here I will list top users that help Post SMTP grow (bugs, features, etc...)', Postman::TEXT_DOMAIN ); ?>
+			<h4 class="wp-people-group"><?php esc_html_e( 'Top Community Members', 'post-smtp' ); ?></h4>
+			<h5><?php esc_html_e( 'Here I will list top users that help Post SMTP grow (bugs, features, etc...)', 'post-smtp' ); ?>
 			<p class="wp-credits-list">
 				<a href="http://profiles.wordpress.org/diegocanal">diegocanal</a>,
 				<a href="http://profiles.wordpress.org/jyourstone">Johan Yourstone</a>,
@@ -209,7 +209,7 @@ class PostmanWelcomeController {
 			</p>
 
 			<div class="return-to-dashboard">
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></a>
+				<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', 'post-smtp' ); ?></a>
 			</div>
 
 		</div>
-- 
cgit v1.2.3