diff options
Diffstat (limited to 'Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php')
-rw-r--r-- | Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php | 58 |
1 files changed, 29 insertions, 29 deletions
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 ) ); |