From 835ae5bd30ba87e2838493f576798baa466d8c98 Mon Sep 17 00:00:00 2001 From: smusman98 Date: Mon, 18 Jul 2022 14:46:52 +0500 Subject: [PATCH] 2.0.23 * Fixed: WP_Scripts::localize called incorrectly message. --- Postman/Localize.php | 29 +++++++ .../PostmanConfigurationController.php | 26 +------ .../postman_manual_config.js | 10 +-- .../Postman-Configuration/postman_wizard.js | 76 +++++++++---------- .../PostmanConnectivityTestController.php | 2 +- .../postman_port_test.js | 10 +-- .../PostmanAdminPointer.php | 57 +++++++------- .../PostmanDiagnosticTestController.php | 7 +- .../PostmanEmailLogController.php | 6 +- Postman/Postman-Mail/postman_smtp.js | 4 +- .../postman_send_test_email.js | 12 +-- Postman/Postman.php | 12 --- Postman/PostmanAdminController.php | 2 +- Postman/PostmanViewController.php | 9 +-- postman-smtp.php | 12 ++- readme.txt | 8 +- script/localize.js | 3 + script/postman.js | 2 +- script/postman_resend_email_sript.js | 4 +- 19 files changed, 146 insertions(+), 145 deletions(-) create mode 100644 Postman/Localize.php create mode 100644 script/localize.js diff --git a/Postman/Localize.php b/Postman/Localize.php new file mode 100644 index 00000000..f37b0827 --- /dev/null +++ b/Postman/Localize.php @@ -0,0 +1,29 @@ + sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ), + /* translators: where %d is a port number */ + 'postman_wizard_bad_redirect_url' => __( 'You are about to configure OAuth 2.0 with an IP address instead of a domain name. This is not permitted. Either assign a real domain name to your site or add a fake one in your local host file.', 'post-smtp' ), + 'postman_input_sender_email' => '#input_' . PostmanOptions::MESSAGE_SENDER_EMAIL, + 'postman_input_sender_name' => '#input_' . PostmanOptions::MESSAGE_SENDER_NAME, + 'postman_port_element_name' => '#input_' . PostmanOptions::PORT, + 'postman_hostname_element_name' => '#input_' . PostmanOptions::HOSTNAME, + 'postman_enc_for_password_el' => '#input_enc_type_password', + 'postman_input_basic_username' => '#input_' . PostmanOptions::BASIC_AUTH_USERNAME, + 'postman_input_basic_password' => '#input_' . PostmanOptions::BASIC_AUTH_PASSWORD, + 'postman_redirect_url_el' => '#input_oauth_redirect_url', + 'postman_input_auth_type' => '#input_' . PostmanOptions::AUTHENTICATION_TYPE, + 'postman_js_email_was_resent' => __( 'Email was successfully resent (but without attachments)', 'post-smtp' ), + /* Translators: Where %s is an error message */ + 'postman_js_email_not_resent' => __( 'Email could not be resent. Error: %s', 'post-smtp' ), + 'postman_js_resend_label' => __( 'Resend', 'post-smtp' ), + 'steps_current_step' => 'steps_current_step', + 'steps_pagination' => 'steps_pagination', + 'steps_finish' => _x( 'Finish', 'Press this button to Finish this task', 'post-smtp' ), + 'steps_next' => _x( 'Next', 'Press this button to go to the next step', 'post-smtp' ), + 'steps_previous' => _x( 'Previous', 'Press this button to go to the previous step', 'post-smtp' ), + 'steps_loading' => 'steps_loading' +); + diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php index 2d9ff48f..f7c0cc4d 100644 --- a/Postman/Postman-Configuration/PostmanConfigurationController.php +++ b/Postman/Postman-Configuration/PostmanConfigurationController.php @@ -100,28 +100,6 @@ private function registerStylesAndScripts() { /** */ private function addLocalizeScriptsToPage() { - $warning = __( 'Warning', 'post-smtp' ); - /* translators: where %s is the name of the SMTP server */ - wp_localize_script( 'postman_wizard_script', 'postman_smtp_mitm', sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ) ); - /* translators: where %d is a port number */ - wp_localize_script( 'postman_wizard_script', 'postman_wizard_bad_redirect_url', __( 'You are about to configure OAuth 2.0 with an IP address instead of a domain name. This is not permitted. Either assign a real domain name to your site or add a fake one in your local host file.', 'post-smtp' ) ); - - // user input - wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_sender_email', '#input_' . PostmanOptions::MESSAGE_SENDER_EMAIL ); - wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_sender_name', '#input_' . PostmanOptions::MESSAGE_SENDER_NAME ); - wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_port_element_name', '#input_' . PostmanOptions::PORT ); - wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_hostname_element_name', '#input_' . PostmanOptions::HOSTNAME ); - - // the enc input - wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_enc_for_password_el', '#input_enc_type_password' ); - // these are the ids for the