summaryrefslogtreecommitdiff
path: root/Postman/Postman-Connectivity-Test
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-05-15 12:14:32 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-05-15 12:14:32 +0000
commit38153c0f3e739f3d89a1a7734fd7d199bf457fab (patch)
tree28e19f4e091d5182a2c63bc98377e5381b0043ac /Postman/Postman-Connectivity-Test
parent942aa536210fe204a2d097eb8878c1d690e0547b (diff)
downloadPost-SMTP-38153c0f3e739f3d89a1a7734fd7d199bf457fab.zip
= 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 ).
Diffstat (limited to 'Postman/Postman-Connectivity-Test')
-rw-r--r--Postman/Postman-Connectivity-Test/Postman-PortTest.php4
-rw-r--r--Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php58
2 files changed, 31 insertions, 31 deletions
diff --git a/Postman/Postman-Connectivity-Test/Postman-PortTest.php b/Postman/Postman-Connectivity-Test/Postman-PortTest.php
index 6591db0..91d18f1 100644
--- a/Postman/Postman-Connectivity-Test/Postman-PortTest.php
+++ b/Postman/Postman-Connectivity-Test/Postman-PortTest.php
@@ -50,8 +50,8 @@ class PostmanPortTest {
/**
* Wrap the regDomain/getRegisteredDomain function
*
- * @param unknown $domain
- * @return unknown|Ambigous <NULL, string, unknown, mixed>
+ * @param mixed $domain
+ * @return mixed
*/
private function getRegisteredDomain($hostname) {
$registeredDomain = getRegisteredDomain ( $hostname );
diff --git a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
index 7ee3c44..b423c05 100644
--- a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
+++ b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
@@ -13,7 +13,7 @@ class PostmanConnectivityTestController {
/**
* Constructor
*
- * @param unknown $rootPluginFilenameAndPath
+ * @param mixed $rootPluginFilenameAndPath
*/
public function __construct( $rootPluginFilenameAndPath ) {
assert( ! empty( $rootPluginFilenameAndPath ) );
@@ -77,7 +77,7 @@ class PostmanConnectivityTestController {
* Register the Email Test screen
*/
public function addPortTestSubmenu() {
- $page = add_submenu_page( null, sprintf( __( '%s Setup', Postman::TEXT_DOMAIN ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ) ), __( 'Postman SMTP', Postman::TEXT_DOMAIN ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConnectivityTestController::PORT_TEST_SLUG, array(
+ $page = add_submenu_page( null, sprintf( __( '%s Setup', 'post-smtp' ), __( 'Postman SMTP', 'post-smtp' ) ), __( 'Postman SMTP', 'post-smtp' ), Postman::MANAGE_POSTMAN_CAPABILITY_NAME, PostmanConnectivityTestController::PORT_TEST_SLUG, array(
$this,
'outputPortTestContent',
) );
@@ -93,26 +93,26 @@ class PostmanConnectivityTestController {
function enqueuePortTestResources() {
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
wp_enqueue_script( 'postman_port_test_script' );
- $warning = __( 'Warning', Postman::TEXT_DOMAIN );
+ $warning = __( 'Warning', 'post-smtp' );
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_hostname_element_name', '#input_' . PostmanOptions::HOSTNAME );
PostmanConnectivityTestController::addLocalizeScriptForPortTest();
}
static function addLocalizeScriptForPortTest() {
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_port_test', array(
- 'in_progress' => _x( 'Checking..', 'The "please wait" message', Postman::TEXT_DOMAIN ),
- 'open' => _x( 'Open', 'The port is open', Postman::TEXT_DOMAIN ),
- 'closed' => _x( 'Closed', 'The port is closed', Postman::TEXT_DOMAIN ),
- 'yes' => __( 'Yes', Postman::TEXT_DOMAIN ),
- 'no' => __( 'No', Postman::TEXT_DOMAIN ),
+ 'in_progress' => _x( 'Checking..', 'The "please wait" message', 'post-smtp' ),
+ 'open' => _x( 'Open', 'The port is open', 'post-smtp' ),
+ 'closed' => _x( 'Closed', 'The port is closed', 'post-smtp' ),
+ 'yes' => __( 'Yes', 'post-smtp' ),
+ 'no' => __( 'No', 'post-smtp' ),
/* translators: where %d is a port number */
- 'blocked' => __( 'No outbound route between this site and the Internet on Port %d.', Postman::TEXT_DOMAIN ),
+ 'blocked' => __( 'No outbound route between this site and the Internet on Port %d.', 'post-smtp' ),
/* translators: where %d is a port number and %s is a hostname */
- 'try_dif_smtp' => __( 'Port %d is open, but not to %s.', Postman::TEXT_DOMAIN ),
+ 'try_dif_smtp' => __( 'Port %d is open, but not to %s.', 'post-smtp' ),
/* translators: where %d is the port number and %s is the hostname */
- 'success' => __( 'Port %d can be used for SMTP to %s.', Postman::TEXT_DOMAIN ),
- 'mitm' => sprintf( '%s: %s', __( 'Warning', Postman::TEXT_DOMAIN ), __( 'connected to %1$s instead of %2$s.', Postman::TEXT_DOMAIN ) ),
+ 'success' => __( 'Port %d can be used for SMTP to %s.', 'post-smtp' ),
+ 'mitm' => sprintf( '%s: %s', __( 'Warning', 'post-smtp' ), __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ),
/* translators: where %d is a port number and %s is the URL for the Postman Gmail Extension */
- 'https_success' => __( 'Port %d can be used with the %s.', Postman::TEXT_DOMAIN ),
+ 'https_success' => __( 'Port %d can be used with the %s.', 'post-smtp' ),
) );
}
@@ -132,46 +132,46 @@ class PostmanConnectivityTestController {
public function outputPortTestContent() {
print '<div class="wrap">';
- PostmanViewController::outputChildPageHeader( __( 'Connectivity Test', Postman::TEXT_DOMAIN ) );
+ PostmanViewController::outputChildPageHeader( __( 'Connectivity Test', 'post-smtp' ) );
print '<p>';
- print __( 'This test determines which well-known ports are available for Postman to use.', Postman::TEXT_DOMAIN );
+ print __( 'This test determines which well-known ports are available for Postman to use.', 'post-smtp' );
print '<form id="port_test_form_id" method="post">';
- printf( '<label for="hostname">%s</label>', __( 'Outgoing Mail Server Hostname', Postman::TEXT_DOMAIN ) );
+ printf( '<label for="hostname">%s</label>', __( 'Outgoing Mail Server Hostname', 'post-smtp' ) );
$this->port_test_hostname_callback();
- submit_button( _x( 'Begin Test', 'Button Label', Postman::TEXT_DOMAIN ), 'primary', 'begin-port-test', true );
+ submit_button( _x( 'Begin Test', 'Button Label', 'post-smtp' ), 'primary', 'begin-port-test', true );
print '</form>';
print '<table id="connectivity_test_table">';
- print sprintf( '<tr><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th colspan="5">%s</th></tr>', __( 'Transport', Postman::TEXT_DOMAIN ), _x( 'Socket', 'A socket is the network term for host and port together', Postman::TEXT_DOMAIN ), __( 'Status', Postman::TEXT_DOMAIN ) . '<sup>*</sup>', __( 'Service Available', Postman::TEXT_DOMAIN ), __( 'Server ID', Postman::TEXT_DOMAIN ), __( 'Authentication', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<tr><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th rowspan="2">%s</th><th colspan="5">%s</th></tr>', __( 'Transport', 'post-smtp' ), _x( 'Socket', 'A socket is the network term for host and port together', 'post-smtp' ), __( 'Status', 'post-smtp' ) . '<sup>*</sup>', __( 'Service Available', 'post-smtp' ), __( 'Server ID', 'post-smtp' ), __( 'Authentication', 'post-smtp' ) );
print sprintf( '<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>', 'None', 'Login', 'Plain', 'CRAM-MD5', 'OAuth 2.0' );
$sockets = PostmanTransportRegistry::getInstance()->getSocketsForSetupWizardToProbe();
foreach ( $sockets as $socket ) {
if ( $socket ['smtp'] ) {
print sprintf( '<tr id="%s"><th class="name">%s</th><td class="socket">%s:%s</td><td class="firewall resettable">-</td><td class="service resettable">-</td><td class="reported_id resettable">-</td><td class="auth_none resettable">-</td><td class="auth_login resettable">-</td><td class="auth_plain resettable">-</td><td class="auth_crammd5 resettable">-</td><td class="auth_xoauth2 resettable">-</td></tr>', $socket ['id'], $socket ['transport_name'], $socket ['host'], $socket ['port'] );
} else {
- print sprintf( '<tr id="%s"><th class="name">%s</th><td class="socket">%s:%s</td><td class="firewall resettable">-</td><td class="service resettable">-</td><td class="reported_id resettable">-</td><td colspan="5">%s</td></tr>', $socket ['id'], $socket ['transport_name'], $socket ['host'], $socket ['port'], __( 'n/a', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<tr id="%s"><th class="name">%s</th><td class="socket">%s:%s</td><td class="firewall resettable">-</td><td class="service resettable">-</td><td class="reported_id resettable">-</td><td colspan="5">%s</td></tr>', $socket ['id'], $socket ['transport_name'], $socket ['host'], $socket ['port'], __( 'n/a', 'post-smtp' ) );
}
}
print '</table>';
/* Translators: Where %s is the name of the service providing Internet connectivity test */
- printf( '<p class="portquiz" style="display:none; font-size:0.8em">* %s</p>', sprintf( __( 'According to %s', Postman::TEXT_DOMAIN ), '<a target="_blank" href="https://downor.me/portquiz.net">portquiz.net</a>' ) );
+ printf( '<p class="portquiz" style="display:none; font-size:0.8em">* %s</p>', sprintf( __( 'According to %s', 'post-smtp' ), '<a target="_blank" href="https://downor.me/portquiz.net">portquiz.net</a>' ) );
printf( '<p class="ajax-loader" style="display:none"><img src="%s"/></p>', plugins_url( 'post-smtp/style/ajax-loader.gif' ) );
print '<section id="conclusion" style="display:none">';
- print sprintf( '<h3>%s:</h3>', __( 'Summary', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<h3>%s:</h3>', __( 'Summary', 'post-smtp' ) );
print '<ol class="conclusion">';
print '</ol>';
print '</section>';
print '<section id="blocked-port-help" style="display:none">';
- print sprintf( '<p><b>%s</b></p>', __( 'A test with <span style="color:red">"No"</span> Service Available indicates one or more of these issues:', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<p><b>%s</b></p>', __( 'A test with <span style="color:red">"No"</span> Service Available indicates one or more of these issues:', 'post-smtp' ) );
print '<ol>';
- printf( '<li>%s</li>', __( 'Your web host has placed a firewall between this site and the Internet', Postman::TEXT_DOMAIN ) );
- printf( '<li>%s</li>', __( 'The SMTP hostname is wrong or the mail server does not provide service on this port', Postman::TEXT_DOMAIN ) );
+ printf( '<li>%s</li>', __( 'Your web host has placed a firewall between this site and the Internet', 'post-smtp' ) );
+ printf( '<li>%s</li>', __( 'The SMTP hostname is wrong or the mail server does not provide service on this port', 'post-smtp' ) );
/* translators: where (1) is the URL and (2) is the system */
- $systemBlockMessage = __( 'Your <a href="%1$s">%2$s configuration</a> is preventing outbound connections', Postman::TEXT_DOMAIN );
+ $systemBlockMessage = __( 'Your <a href="%1$s">%2$s configuration</a> is preventing outbound connections', 'post-smtp' );
printf( '<li>%s</li>', sprintf( $systemBlockMessage, 'http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen', 'PHP' ) );
printf( '<li>%s</li>', sprintf( $systemBlockMessage, 'http://wp-mix.com/disable-external-url-requests/', 'WordPress' ) );
print '</ol></p>';
- print sprintf( '<p><b>%s</b></p>', __( 'If the issues above can not be resolved, your last option is to configure Postman to use an email account managed by your web host with an SMTP server managed by your web host.', Postman::TEXT_DOMAIN ) );
+ print sprintf( '<p><b>%s</b></p>', __( 'If the issues above can not be resolved, your last option is to configure Postman to use an email account managed by your web host with an SMTP server managed by your web host.', 'post-smtp' ) );
print '</section>';
print '</div>';
}
@@ -271,9 +271,9 @@ class PostmanPortTestAjaxController {
/**
*
- * @param unknown $hostname
- * @param unknown $port
- * @param unknown $success
+ * @param mixed $hostname
+ * @param mixed $port
+ * @param mixed $success
*/
private function buildResponse( $hostname, $port, PostmanPortTest $portTest, $success, $transport = '' ) {
$this->logger->debug( sprintf( 'testing port result for %s:%s success=%s', $hostname, $port, $success ) );