diff --git a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php index 3e17dbd4..6ff5a69e 100644 --- a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php +++ b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php @@ -98,6 +98,14 @@ function enqueuePortTestResources() { wp_enqueue_script( 'postman_port_test_script' ); $warning = __( 'Warning', 'post-smtp' ); wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_hostname_element_name', '#input_' . PostmanOptions::HOSTNAME ); + wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_email_test', array( + 'recipient' => '#' . PostmanSendTestEmailController::RECIPIENT_EMAIL_FIELD_NAME, + 'not_started' => _x( 'In Outbox', 'Email Test Status', 'post-smtp' ), + 'sending' => _x( 'Sending...', 'Email Test Status', 'post-smtp' ), + 'success' => _x( 'Success', 'Email Test Status', 'post-smtp' ), + 'failed' => _x( 'Failed', 'Email Test Status', 'post-smtp' ), + 'ajax_error' => __( 'Ajax Error', 'post-smtp' ), + ) ); PostmanConnectivityTestController::addLocalizeScriptForPortTest(); } static function addLocalizeScriptForPortTest() { @@ -135,6 +143,8 @@ public function port_test_hostname_callback() { public function outputPortTestContent() { print '
'; + wp_nonce_field('post-smtp', 'security'); + PostmanViewController::outputChildPageHeader( __( 'Connectivity Test', 'post-smtp' ) ); print '

'; diff --git a/Postman/Postman-Connectivity-Test/postman_port_test.js b/Postman/Postman-Connectivity-Test/postman_port_test.js index 1d5c3fbf..8667c060 100644 --- a/Postman/Postman-Connectivity-Test/postman_port_test.js +++ b/Postman/Postman-Connectivity-Test/postman_port_test.js @@ -73,7 +73,7 @@ function portQuizTest(socket, hostname, port) { 'action' : 'postman_port_quiz_test', 'hostname' : hostname, 'port' : port, - '_wpnonce' : jQuery('#_wpnonce').val(), + 'security' : jQuery('#security').val(), }; jQuery.post( ajaxurl, @@ -201,7 +201,7 @@ function portTest3(socket, hostname, port, open) { 'action' : 'postman_test_smtps', 'hostname' : hostname, 'port' : port, - '_wpnonce' : jQuery('#_wpnonce').val(), + 'security' : jQuery('#security').val(), }; jQuery .post( diff --git a/Postman/Postman-Email-Log/PostmanEmailLogController.php b/Postman/Postman-Email-Log/PostmanEmailLogController.php index d22b2654..2df2377d 100644 --- a/Postman/Postman-Email-Log/PostmanEmailLogController.php +++ b/Postman/Postman-Email-Log/PostmanEmailLogController.php @@ -3,7 +3,7 @@ exit; // Exit if accessed directly } -require_once dirname(__DIR__) . '/PostmanEmailLogs.php'; +require_once dirname(__DIR__) . '/PostmanLogFields.php'; require_once 'PostmanEmailLogService.php'; require_once 'PostmanEmailLogView.php'; @@ -82,7 +82,7 @@ public function resendMail() { // get the email address of the recipient from the HTTP Request $postid = $this->getRequestParameter( 'email' ); if ( ! empty( $postid ) ) { - $meta_values = PostmanEmailLogs::get_data( $postid ); + $meta_values = PostmanLogFields::get_instance()->get( $postid ); if ( isset( $_POST['mail_to'] ) && ! empty( $_POST['mail_to'] ) ) { $emails = explode( ',', $_POST['mail_to'] ); @@ -211,7 +211,7 @@ function view_log_item() { return; } - $meta_values = PostmanEmailLogs::get_data( $postid ); + $meta_values = PostmanLogFields::get_instance()->get( $postid ); // https://css-tricks.com/examples/hrs/ print '