Version Description
- 2021-04-22
- Fixed:
WP_Scripts::localize called incorrectly
message.
Download this release
Release Info
Developer | yehudah |
Plugin | Post SMTP Mailer/Email Log |
Version | 2.0.23 |
Comparing to | |
See all releases |
Code changes from version 2.0.22 to 2.0.23
- Postman/Localize.php +29 -0
- Postman/Postman-Configuration/PostmanConfigurationController.php +2 -24
- Postman/Postman-Configuration/postman_manual_config.js +5 -5
- Postman/Postman-Configuration/postman_wizard.js +38 -38
- Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php +1 -1
- Postman/Postman-Connectivity-Test/postman_port_test.js +5 -5
- Postman/Postman-Controller/PostmanAdminPointer.php +31 -26
- Postman/Postman-Diagnostic-Test/PostmanDiagnosticTestController.php +5 -2
- Postman/Postman-Email-Log/PostmanEmailLogController.php +1 -5
- Postman/Postman-Mail/postman_smtp.js +2 -2
- Postman/Postman-Send-Test-Email/postman_send_test_email.js +6 -6
- Postman/Postman.php +0 -12
- Postman/PostmanAdminController.php +1 -1
- Postman/PostmanViewController.php +1 -8
- postman-smtp.php +8 -4
- readme.txt +5 -3
- script/localize.js +3 -0
- script/postman.js +1 -1
- script/postman_resend_email_sript.js +2 -2
Postman/Localize.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$warning = __( 'Warning', 'post-smtp' );
|
3 |
+
|
4 |
+
return array(
|
5 |
+
/* translators: where %s is the name of the SMTP server */
|
6 |
+
'postman_smtp_mitm' => sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ),
|
7 |
+
/* translators: where %d is a port number */
|
8 |
+
'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' ),
|
9 |
+
'postman_input_sender_email' => '#input_' . PostmanOptions::MESSAGE_SENDER_EMAIL,
|
10 |
+
'postman_input_sender_name' => '#input_' . PostmanOptions::MESSAGE_SENDER_NAME,
|
11 |
+
'postman_port_element_name' => '#input_' . PostmanOptions::PORT,
|
12 |
+
'postman_hostname_element_name' => '#input_' . PostmanOptions::HOSTNAME,
|
13 |
+
'postman_enc_for_password_el' => '#input_enc_type_password',
|
14 |
+
'postman_input_basic_username' => '#input_' . PostmanOptions::BASIC_AUTH_USERNAME,
|
15 |
+
'postman_input_basic_password' => '#input_' . PostmanOptions::BASIC_AUTH_PASSWORD,
|
16 |
+
'postman_redirect_url_el' => '#input_oauth_redirect_url',
|
17 |
+
'postman_input_auth_type' => '#input_' . PostmanOptions::AUTHENTICATION_TYPE,
|
18 |
+
'postman_js_email_was_resent' => __( 'Email was successfully resent (but without attachments)', 'post-smtp' ),
|
19 |
+
/* Translators: Where %s is an error message */
|
20 |
+
'postman_js_email_not_resent' => __( 'Email could not be resent. Error: %s', 'post-smtp' ),
|
21 |
+
'postman_js_resend_label' => __( 'Resend', 'post-smtp' ),
|
22 |
+
'steps_current_step' => 'steps_current_step',
|
23 |
+
'steps_pagination' => 'steps_pagination',
|
24 |
+
'steps_finish' => _x( 'Finish', 'Press this button to Finish this task', 'post-smtp' ),
|
25 |
+
'steps_next' => _x( 'Next', 'Press this button to go to the next step', 'post-smtp' ),
|
26 |
+
'steps_previous' => _x( 'Previous', 'Press this button to go to the previous step', 'post-smtp' ),
|
27 |
+
'steps_loading' => 'steps_loading'
|
28 |
+
);
|
29 |
+
|
Postman/Postman-Configuration/PostmanConfigurationController.php
CHANGED
@@ -100,28 +100,6 @@ class PostmanConfigurationController {
|
|
100 |
/**
|
101 |
*/
|
102 |
private function addLocalizeScriptsToPage() {
|
103 |
-
$warning = __( 'Warning', 'post-smtp' );
|
104 |
-
/* translators: where %s is the name of the SMTP server */
|
105 |
-
wp_localize_script( 'postman_wizard_script', 'postman_smtp_mitm', sprintf( '%s: %s', $warning, __( 'connected to %1$s instead of %2$s.', 'post-smtp' ) ) );
|
106 |
-
/* translators: where %d is a port number */
|
107 |
-
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' ) );
|
108 |
-
|
109 |
-
// user input
|
110 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_sender_email', '#input_' . PostmanOptions::MESSAGE_SENDER_EMAIL );
|
111 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_sender_name', '#input_' . PostmanOptions::MESSAGE_SENDER_NAME );
|
112 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_port_element_name', '#input_' . PostmanOptions::PORT );
|
113 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_hostname_element_name', '#input_' . PostmanOptions::HOSTNAME );
|
114 |
-
|
115 |
-
// the enc input
|
116 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_enc_for_password_el', '#input_enc_type_password' );
|
117 |
-
// these are the ids for the <option>s in the encryption <select>
|
118 |
-
// the password inputs
|
119 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_basic_username', '#input_' . PostmanOptions::BASIC_AUTH_USERNAME );
|
120 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_basic_password', '#input_' . PostmanOptions::BASIC_AUTH_PASSWORD );
|
121 |
-
|
122 |
-
// the auth input
|
123 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_redirect_url_el', '#input_oauth_redirect_url' );
|
124 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_input_auth_type', '#input_' . PostmanOptions::AUTHENTICATION_TYPE );
|
125 |
|
126 |
// the transport modules scripts
|
127 |
foreach ( PostmanTransportRegistry::getInstance()->getTransports() as $transport ) {
|
@@ -187,7 +165,7 @@ class PostmanConfigurationController {
|
|
187 |
wp_enqueue_style( 'jquery_steps_style' );
|
188 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
189 |
wp_enqueue_script( 'postman_wizard_script' );
|
190 |
-
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, '$jq', 'jQuery.noConflict(true)' );
|
191 |
$shortLocale = substr( get_locale(), 0, 2 );
|
192 |
if ( $shortLocale != 'en' ) {
|
193 |
$url = plugins_url( sprintf( 'script/jquery-validate/localization/messages_%s.js', $shortLocale ), $this->rootPluginFilenameAndPath );
|
@@ -601,7 +579,7 @@ class PostmanConfigurationController {
|
|
601 |
Postman::getMailerTypeRecommend();
|
602 |
|
603 |
$in_wizard = true;
|
604 |
-
include_once POST_SMTP_PATH . '/Postman/extra/donation.php';
|
605 |
|
606 |
print '</section>';
|
607 |
print '</fieldset>';
|
100 |
/**
|
101 |
*/
|
102 |
private function addLocalizeScriptsToPage() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
// the transport modules scripts
|
105 |
foreach ( PostmanTransportRegistry::getInstance()->getTransports() as $transport ) {
|
165 |
wp_enqueue_style( 'jquery_steps_style' );
|
166 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
167 |
wp_enqueue_script( 'postman_wizard_script' );
|
168 |
+
//wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, '$jq', 'jQuery.noConflict(true)' );
|
169 |
$shortLocale = substr( get_locale(), 0, 2 );
|
170 |
if ( $shortLocale != 'en' ) {
|
171 |
$url = plugins_url( sprintf( 'script/jquery-validate/localization/messages_%s.js', $shortLocale ), $this->rootPluginFilenameAndPath );
|
579 |
Postman::getMailerTypeRecommend();
|
580 |
|
581 |
$in_wizard = true;
|
582 |
+
//include_once POST_SMTP_PATH . '/Postman/extra/donation.php';
|
583 |
|
584 |
print '</section>';
|
585 |
print '</fieldset>';
|
Postman/Postman-Configuration/postman_manual_config.js
CHANGED
@@ -44,7 +44,7 @@ jQuery(document).ready(
|
|
44 |
Hook.call( 'post_smtp_notification_change', selected );
|
45 |
|
46 |
});
|
47 |
-
|
48 |
|
49 |
// add an event on the authentication input field
|
50 |
// on user changing the auth type, determine whether to show
|
@@ -61,23 +61,23 @@ jQuery(document).ready(
|
|
61 |
|
62 |
// add an event on the hostname input field
|
63 |
// on keyup, start the countdown
|
64 |
-
jQuery(postman_hostname_element_name).keyup(function() {
|
65 |
clearTimeout(typingTimer);
|
66 |
-
if (jQuery(postman_hostname_element_name).val) {
|
67 |
typingTimer = setTimeout(doneTyping, doneTypingInterval);
|
68 |
}
|
69 |
});
|
70 |
|
71 |
// user is "finished typing," do something
|
72 |
function doneTyping() {
|
73 |
-
if (jQuery(postman_input_auth_type).val() == 'oauth2') {
|
74 |
reloadOauthSection();
|
75 |
}
|
76 |
}
|
77 |
});
|
78 |
|
79 |
function reloadOauthSection() {
|
80 |
-
var hostname = jQuery(postman_hostname_element_name).val();
|
81 |
var transport = jQuery('#input_transport_type').val();
|
82 |
var authtype = jQuery('select#input_auth_type').val();
|
83 |
var security = jQuery('#security').val();
|
44 |
Hook.call( 'post_smtp_notification_change', selected );
|
45 |
|
46 |
});
|
47 |
+
|
48 |
|
49 |
// add an event on the authentication input field
|
50 |
// on user changing the auth type, determine whether to show
|
61 |
|
62 |
// add an event on the hostname input field
|
63 |
// on keyup, start the countdown
|
64 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).keyup(function() {
|
65 |
clearTimeout(typingTimer);
|
66 |
+
if (jQuery(post_smtp_localize.postman_hostname_element_name).val) {
|
67 |
typingTimer = setTimeout(doneTyping, doneTypingInterval);
|
68 |
}
|
69 |
});
|
70 |
|
71 |
// user is "finished typing," do something
|
72 |
function doneTyping() {
|
73 |
+
if (jQuery(post_smtp_localize.postman_input_auth_type).val() == 'oauth2') {
|
74 |
reloadOauthSection();
|
75 |
}
|
76 |
}
|
77 |
});
|
78 |
|
79 |
function reloadOauthSection() {
|
80 |
+
var hostname = jQuery(post_smtp_localize.postman_hostname_element_name).val();
|
81 |
var transport = jQuery('#input_transport_type').val();
|
82 |
var authtype = jQuery('select#input_auth_type').val();
|
83 |
var security = jQuery('#security').val();
|
Postman/Postman-Configuration/postman_wizard.js
CHANGED
@@ -7,7 +7,7 @@ portTestInProgress = false;
|
|
7 |
* Functions to run on document load
|
8 |
*/
|
9 |
jQuery(document).ready(function() {
|
10 |
-
jQuery(postman_input_sender_email).focus();
|
11 |
initializeJQuerySteps();
|
12 |
// add an event on the plugin selection
|
13 |
jQuery('input[name="input_plugin"]').click(function() {
|
@@ -63,7 +63,7 @@ function checkEmail(goDaddyHostDetected, email) {
|
|
63 |
smtpDiscovery = response.data;
|
64 |
if (response.data.hostname != null
|
65 |
&& response.data.hostname) {
|
66 |
-
jQuery(postman_hostname_element_name).val(
|
67 |
response.data.hostname);
|
68 |
}
|
69 |
enableSmtpHostnameInput(goDaddyHostDetected);
|
@@ -108,12 +108,12 @@ function initializeJQuerySteps() {
|
|
108 |
autoFocus : true,
|
109 |
startIndex : parseInt(postman_setup_wizard.start_page),
|
110 |
labels : {
|
111 |
-
current : steps_current_step,
|
112 |
-
pagination : steps_pagination,
|
113 |
-
finish : steps_finish,
|
114 |
-
next : steps_next,
|
115 |
-
previous : steps_previous,
|
116 |
-
loading : steps_loading
|
117 |
},
|
118 |
onStepChanging : function(event, currentIndex, newIndex) {
|
119 |
return handleStepChange(event, currentIndex, newIndex,
|
@@ -121,7 +121,7 @@ function initializeJQuerySteps() {
|
|
121 |
|
122 |
},
|
123 |
onInit : function() {
|
124 |
-
jQuery(postman_input_sender_email).focus();
|
125 |
},
|
126 |
onStepChanged : function(event, currentIndex, priorIndex) {
|
127 |
return postHandleStepChange(event, currentIndex,
|
@@ -191,7 +191,7 @@ function handleStepChange(event, currentIndex, newIndex, form) {
|
|
191 |
if (currentIndex === 1) {
|
192 |
// page 1 : look-up the email
|
193 |
// address for the smtp server
|
194 |
-
checkGoDaddyAndCheckEmail(jQuery(postman_input_sender_email).val());
|
195 |
|
196 |
} else if (currentIndex === 2) {
|
197 |
|
@@ -203,7 +203,7 @@ function handleStepChange(event, currentIndex, newIndex, form) {
|
|
203 |
portsToCheck = 0;
|
204 |
totalAvail = 0;
|
205 |
|
206 |
-
getHostsToCheck(jQuery(postman_hostname_element_name).val());
|
207 |
|
208 |
} else if (currentIndex === 3) {
|
209 |
|
@@ -219,9 +219,9 @@ function handleStepChange(event, currentIndex, newIndex, form) {
|
|
219 |
if (!valid) {
|
220 |
return false;
|
221 |
}
|
222 |
-
var chosenPort = jQuery(postman_port_element_name).val();
|
223 |
-
var hostname = jQuery(postman_hostname_element_name).val();
|
224 |
-
var authType = jQuery(postman_input_auth_type).val()
|
225 |
|
226 |
}
|
227 |
|
@@ -234,7 +234,7 @@ function postHandleStepChange(event, currentIndex, priorIndex, myself) {
|
|
234 |
// the user is old enough and wants
|
235 |
// to the previous step.
|
236 |
if (currentIndex === 2) {
|
237 |
-
jQuery(postman_hostname_element_name).focus();
|
238 |
// this is the second place i disable the next button but Steps
|
239 |
// re-enables it after the screen slides
|
240 |
if (priorIndex === 1) {
|
@@ -253,7 +253,7 @@ function postHandleStepChange(event, currentIndex, priorIndex, myself) {
|
|
253 |
}
|
254 |
if (currentIndex === 4) {
|
255 |
if (redirectUrlWarning) {
|
256 |
-
alert(postman_wizard_bad_redirect_url);
|
257 |
}
|
258 |
if (chosenPort == 'none') {
|
259 |
if (priorIndex === 5) {
|
@@ -269,7 +269,7 @@ function postHandleStepChange(event, currentIndex, priorIndex, myself) {
|
|
269 |
|
270 |
/**
|
271 |
* Asks the server for a List of sockets to perform port checks upon.
|
272 |
-
*
|
273 |
* @param hostname
|
274 |
*/
|
275 |
function getHostsToCheck(hostname) {
|
@@ -298,7 +298,7 @@ function getHostsToCheck(hostname) {
|
|
298 |
|
299 |
/**
|
300 |
* Handles the response from the server of the list of sockets to check.
|
301 |
-
*
|
302 |
* @param hostname
|
303 |
* @param response
|
304 |
*/
|
@@ -323,7 +323,7 @@ function handleHostsToCheckResponse(response) {
|
|
323 |
|
324 |
/**
|
325 |
* Asks the server to run a connectivity test on the given port
|
326 |
-
*
|
327 |
* @param hostname
|
328 |
* @param port
|
329 |
* @param data
|
@@ -342,7 +342,7 @@ function postThePortTest(hostname, port, data) {
|
|
342 |
|
343 |
/**
|
344 |
* Handles the result of the port test
|
345 |
-
*
|
346 |
* @param hostname
|
347 |
* @param port
|
348 |
* @param data
|
@@ -368,7 +368,7 @@ function handlePortTestResponse(hostname, port, data, response) {
|
|
368 |
}
|
369 |
|
370 |
/**
|
371 |
-
*
|
372 |
* @param message
|
373 |
*/
|
374 |
function updateStatus(message) {
|
@@ -502,7 +502,7 @@ function handleConfigurationResponse(response) {
|
|
502 |
|
503 |
jQuery('select#input_notification_service').change(function() {
|
504 |
var selected = jQuery( this ).val();
|
505 |
-
|
506 |
if ( selected == 'default' ) {
|
507 |
jQuery('#slack_cred').fadeOut('fast');
|
508 |
jQuery('#pushover_cred').fadeOut('fast');
|
@@ -554,7 +554,7 @@ function getConfiguration() {
|
|
554 |
var data = {
|
555 |
'action' : 'import_configuration',
|
556 |
'plugin' : plugin,
|
557 |
-
'
|
558 |
};
|
559 |
jQuery
|
560 |
.post(
|
@@ -564,21 +564,21 @@ function getConfiguration() {
|
|
564 |
if (response.success) {
|
565 |
jQuery('select#input_transport_type').val(
|
566 |
'smtp');
|
567 |
-
jQuery(postman_input_sender_email).val(
|
568 |
response.sender_email);
|
569 |
-
jQuery(postman_input_sender_name).val(
|
570 |
response.sender_name);
|
571 |
-
jQuery(postman_hostname_element_name).val(
|
572 |
response.hostname);
|
573 |
-
jQuery(postman_port_element_name).val(
|
574 |
response.port);
|
575 |
-
jQuery(postman_input_auth_type).val(
|
576 |
response.auth_type);
|
577 |
jQuery('#input_enc_type')
|
578 |
.val(response.enc_type);
|
579 |
-
jQuery(postman_input_basic_username).val(
|
580 |
response.basic_auth_username);
|
581 |
-
jQuery(postman_input_basic_password).val(
|
582 |
response.basic_auth_password);
|
583 |
switchBetweenPasswordAndOAuth();
|
584 |
}
|
@@ -586,14 +586,14 @@ function getConfiguration() {
|
|
586 |
ajaxFailed(response);
|
587 |
});
|
588 |
} else {
|
589 |
-
jQuery(postman_input_sender_email).val('');
|
590 |
-
jQuery(postman_input_sender_name).val('');
|
591 |
-
jQuery(postman_input_basic_username).val('');
|
592 |
-
jQuery(postman_input_basic_password).val('');
|
593 |
-
jQuery(postman_hostname_element_name).val('');
|
594 |
-
jQuery(postman_port_element_name).val('');
|
595 |
-
jQuery(postman_input_auth_type).val('none');
|
596 |
-
jQuery(postman_enc_for_password_el).val('none');
|
597 |
switchBetweenPasswordAndOAuth();
|
598 |
}
|
599 |
}
|
7 |
* Functions to run on document load
|
8 |
*/
|
9 |
jQuery(document).ready(function() {
|
10 |
+
jQuery(post_smtp_localize.postman_input_sender_email).focus();
|
11 |
initializeJQuerySteps();
|
12 |
// add an event on the plugin selection
|
13 |
jQuery('input[name="input_plugin"]').click(function() {
|
63 |
smtpDiscovery = response.data;
|
64 |
if (response.data.hostname != null
|
65 |
&& response.data.hostname) {
|
66 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).val(
|
67 |
response.data.hostname);
|
68 |
}
|
69 |
enableSmtpHostnameInput(goDaddyHostDetected);
|
108 |
autoFocus : true,
|
109 |
startIndex : parseInt(postman_setup_wizard.start_page),
|
110 |
labels : {
|
111 |
+
current : post_smtp_localize.steps_current_step,
|
112 |
+
pagination : post_smtp_localize.steps_pagination,
|
113 |
+
finish : post_smtp_localize.steps_finish,
|
114 |
+
next : post_smtp_localize.steps_next,
|
115 |
+
previous : post_smtp_localize.steps_previous,
|
116 |
+
loading : post_smtp_localize.steps_loading
|
117 |
},
|
118 |
onStepChanging : function(event, currentIndex, newIndex) {
|
119 |
return handleStepChange(event, currentIndex, newIndex,
|
121 |
|
122 |
},
|
123 |
onInit : function() {
|
124 |
+
jQuery(post_smtp_localize.postman_input_sender_email).focus();
|
125 |
},
|
126 |
onStepChanged : function(event, currentIndex, priorIndex) {
|
127 |
return postHandleStepChange(event, currentIndex,
|
191 |
if (currentIndex === 1) {
|
192 |
// page 1 : look-up the email
|
193 |
// address for the smtp server
|
194 |
+
checkGoDaddyAndCheckEmail(jQuery(post_smtp_localize.postman_input_sender_email).val());
|
195 |
|
196 |
} else if (currentIndex === 2) {
|
197 |
|
203 |
portsToCheck = 0;
|
204 |
totalAvail = 0;
|
205 |
|
206 |
+
getHostsToCheck(jQuery(post_smtp_localize.postman_hostname_element_name).val());
|
207 |
|
208 |
} else if (currentIndex === 3) {
|
209 |
|
219 |
if (!valid) {
|
220 |
return false;
|
221 |
}
|
222 |
+
var chosenPort = jQuery(post_smtp_localize.postman_port_element_name).val();
|
223 |
+
var hostname = jQuery(post_smtp_localize.postman_hostname_element_name).val();
|
224 |
+
var authType = jQuery(post_smtp_localize.postman_input_auth_type).val()
|
225 |
|
226 |
}
|
227 |
|
234 |
// the user is old enough and wants
|
235 |
// to the previous step.
|
236 |
if (currentIndex === 2) {
|
237 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).focus();
|
238 |
// this is the second place i disable the next button but Steps
|
239 |
// re-enables it after the screen slides
|
240 |
if (priorIndex === 1) {
|
253 |
}
|
254 |
if (currentIndex === 4) {
|
255 |
if (redirectUrlWarning) {
|
256 |
+
alert(post_smtp_localize.postman_wizard_bad_redirect_url);
|
257 |
}
|
258 |
if (chosenPort == 'none') {
|
259 |
if (priorIndex === 5) {
|
269 |
|
270 |
/**
|
271 |
* Asks the server for a List of sockets to perform port checks upon.
|
272 |
+
*
|
273 |
* @param hostname
|
274 |
*/
|
275 |
function getHostsToCheck(hostname) {
|
298 |
|
299 |
/**
|
300 |
* Handles the response from the server of the list of sockets to check.
|
301 |
+
*
|
302 |
* @param hostname
|
303 |
* @param response
|
304 |
*/
|
323 |
|
324 |
/**
|
325 |
* Asks the server to run a connectivity test on the given port
|
326 |
+
*
|
327 |
* @param hostname
|
328 |
* @param port
|
329 |
* @param data
|
342 |
|
343 |
/**
|
344 |
* Handles the result of the port test
|
345 |
+
*
|
346 |
* @param hostname
|
347 |
* @param port
|
348 |
* @param data
|
368 |
}
|
369 |
|
370 |
/**
|
371 |
+
*
|
372 |
* @param message
|
373 |
*/
|
374 |
function updateStatus(message) {
|
502 |
|
503 |
jQuery('select#input_notification_service').change(function() {
|
504 |
var selected = jQuery( this ).val();
|
505 |
+
|
506 |
if ( selected == 'default' ) {
|
507 |
jQuery('#slack_cred').fadeOut('fast');
|
508 |
jQuery('#pushover_cred').fadeOut('fast');
|
554 |
var data = {
|
555 |
'action' : 'import_configuration',
|
556 |
'plugin' : plugin,
|
557 |
+
'security' : jQuery('#security').val(),
|
558 |
};
|
559 |
jQuery
|
560 |
.post(
|
564 |
if (response.success) {
|
565 |
jQuery('select#input_transport_type').val(
|
566 |
'smtp');
|
567 |
+
jQuery(post_smtp_localize.postman_input_sender_email).val(
|
568 |
response.sender_email);
|
569 |
+
jQuery(post_smtp_localize.postman_input_sender_name).val(
|
570 |
response.sender_name);
|
571 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).val(
|
572 |
response.hostname);
|
573 |
+
jQuery(post_smtp_localize.postman_port_element_name).val(
|
574 |
response.port);
|
575 |
+
jQuery(post_smtp_localize.postman_input_auth_type).val(
|
576 |
response.auth_type);
|
577 |
jQuery('#input_enc_type')
|
578 |
.val(response.enc_type);
|
579 |
+
jQuery(post_smtp_localize.postman_input_basic_username).val(
|
580 |
response.basic_auth_username);
|
581 |
+
jQuery(post_smtp_localize.postman_input_basic_password).val(
|
582 |
response.basic_auth_password);
|
583 |
switchBetweenPasswordAndOAuth();
|
584 |
}
|
586 |
ajaxFailed(response);
|
587 |
});
|
588 |
} else {
|
589 |
+
jQuery(post_smtp_localize.postman_input_sender_email).val('');
|
590 |
+
jQuery(post_smtp_localize.postman_input_sender_name).val('');
|
591 |
+
jQuery(post_smtp_localize.postman_input_basic_username).val('');
|
592 |
+
jQuery(post_smtp_localize.postman_input_basic_password).val('');
|
593 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).val('');
|
594 |
+
jQuery(post_smtp_localize.postman_port_element_name).val('');
|
595 |
+
jQuery(post_smtp_localize.postman_input_auth_type).val('none');
|
596 |
+
jQuery(post_smtp_localize.postman_enc_for_password_el).val('none');
|
597 |
switchBetweenPasswordAndOAuth();
|
598 |
}
|
599 |
}
|
Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
CHANGED
@@ -97,7 +97,7 @@ class PostmanConnectivityTestController {
|
|
97 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
98 |
wp_enqueue_script( 'postman_port_test_script' );
|
99 |
$warning = __( 'Warning', 'post-smtp' );
|
100 |
-
|
101 |
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_email_test', array(
|
102 |
'recipient' => '#' . PostmanSendTestEmailController::RECIPIENT_EMAIL_FIELD_NAME,
|
103 |
'not_started' => _x( 'In Outbox', 'Email Test Status', 'post-smtp' ),
|
97 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
98 |
wp_enqueue_script( 'postman_port_test_script' );
|
99 |
$warning = __( 'Warning', 'post-smtp' );
|
100 |
+
|
101 |
wp_localize_script( PostmanViewController::POSTMAN_SCRIPT, 'postman_email_test', array(
|
102 |
'recipient' => '#' . PostmanSendTestEmailController::RECIPIENT_EMAIL_FIELD_NAME,
|
103 |
'not_started' => _x( 'In Outbox', 'Email Test Status', 'post-smtp' ),
|
Postman/Postman-Connectivity-Test/postman_port_test.js
CHANGED
@@ -2,7 +2,7 @@ postman_begin_test_button_id = 'input#begin-port-test';
|
|
2 |
|
3 |
jQuery(document).ready(function() {
|
4 |
var elHostname = jQuery(postman_begin_test_button_id);
|
5 |
-
jQuery(postman_hostname_element_name).focus();
|
6 |
elHostname.click(function() {
|
7 |
valid = jQuery('#port_test_form_id').valid();
|
8 |
if (!valid) {
|
@@ -20,7 +20,7 @@ jQuery(document).ready(function() {
|
|
20 |
$elTestingTable.show();
|
21 |
show('.portquiz');
|
22 |
|
23 |
-
var hostname = jQuery(postman_hostname_element_name).val();
|
24 |
var data = {
|
25 |
'action' : 'postman_get_hosts_to_test',
|
26 |
'hostname' : hostname,
|
@@ -45,7 +45,7 @@ jQuery(document).ready(function() {
|
|
45 |
|
46 |
/**
|
47 |
* Handles the response from the server of the list of sockets to check.
|
48 |
-
*
|
49 |
* @param hostname
|
50 |
* @param response
|
51 |
*/
|
@@ -262,7 +262,7 @@ function enableButtonCheck() {
|
|
262 |
if (totalPortsTested >= portsToBeTested) {
|
263 |
enable(postman_begin_test_button_id);
|
264 |
hideLoaderIcon();
|
265 |
-
jQuery(postman_hostname_element_name).focus();
|
266 |
}
|
267 |
}
|
268 |
function inspectResponse(id, response, port) {
|
@@ -333,4 +333,4 @@ function addConclusion(message, success, isSecure) {
|
|
333 |
message = '❌ ' + secureIcon + message;
|
334 |
}
|
335 |
jQuery('ol.conclusion').append('<li>' + message + '</li>');
|
336 |
-
}
|
2 |
|
3 |
jQuery(document).ready(function() {
|
4 |
var elHostname = jQuery(postman_begin_test_button_id);
|
5 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).focus();
|
6 |
elHostname.click(function() {
|
7 |
valid = jQuery('#port_test_form_id').valid();
|
8 |
if (!valid) {
|
20 |
$elTestingTable.show();
|
21 |
show('.portquiz');
|
22 |
|
23 |
+
var hostname = jQuery(post_smtp_localize.postman_hostname_element_name).val();
|
24 |
var data = {
|
25 |
'action' : 'postman_get_hosts_to_test',
|
26 |
'hostname' : hostname,
|
45 |
|
46 |
/**
|
47 |
* Handles the response from the server of the list of sockets to check.
|
48 |
+
*
|
49 |
* @param hostname
|
50 |
* @param response
|
51 |
*/
|
262 |
if (totalPortsTested >= portsToBeTested) {
|
263 |
enable(postman_begin_test_button_id);
|
264 |
hideLoaderIcon();
|
265 |
+
jQuery(post_smtp_localize.postman_hostname_element_name).focus();
|
266 |
}
|
267 |
}
|
268 |
function inspectResponse(id, response, port) {
|
333 |
message = '❌ ' + secureIcon + message;
|
334 |
}
|
335 |
jQuery('ol.conclusion').append('<li>' + message + '</li>');
|
336 |
+
}
|
Postman/Postman-Controller/PostmanAdminPointer.php
CHANGED
@@ -4,90 +4,95 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
}
|
5 |
|
6 |
if (! class_exists ( 'PostmanAdminPointer' )) {
|
7 |
-
|
8 |
/**
|
9 |
* From http://code.tutsplus.com/articles/integrating-with-wordpress-ui-admin-pointers--wp-26853
|
10 |
*
|
11 |
* @author jasonhendriks
|
12 |
-
*
|
13 |
*/
|
14 |
class PostmanAdminPointer {
|
15 |
private $logger;
|
16 |
private $rootPluginFilenameAndPath;
|
17 |
-
|
18 |
/**
|
19 |
*
|
20 |
-
* @param mixed $rootPluginFilenameAndPath
|
21 |
*/
|
22 |
function __construct($rootPluginFilenameAndPath) {
|
23 |
$this->logger = new PostmanLogger ( get_class ( $this ) );
|
24 |
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
25 |
-
|
26 |
// Don't run on WP < 3.3
|
27 |
if (get_bloginfo ( 'version' ) < '3.3' || true)
|
28 |
return;
|
29 |
-
|
30 |
add_action ( 'admin_enqueue_scripts', array (
|
31 |
$this,
|
32 |
-
'wptuts_pointer_load'
|
33 |
), 1000 );
|
34 |
add_filter ( 'postman_admin_pointers-settings_page_postman', array (
|
35 |
$this,
|
36 |
-
'wptuts_register_pointer_testing'
|
37 |
) );
|
38 |
}
|
39 |
-
|
40 |
/**
|
41 |
*
|
42 |
-
* @param mixed $hook_suffix
|
43 |
*/
|
44 |
function wptuts_pointer_load($hook_suffix) {
|
45 |
// only do this for administrators
|
46 |
if (PostmanUtils::isAdmin ()) {
|
47 |
$this->logger->trace ( 'wptuts' );
|
48 |
-
|
49 |
$screen = get_current_screen ();
|
50 |
$screen_id = $screen->id;
|
51 |
-
|
52 |
// Get pointers for this screen
|
53 |
$pointers = apply_filters ( 'postman_admin_pointers-' . $screen_id, array () );
|
54 |
-
|
55 |
if (! $pointers || ! is_array ( $pointers ))
|
56 |
return;
|
57 |
-
|
58 |
// Get dismissed pointers
|
59 |
$dismissed = explode ( ',', ( string ) get_user_meta ( get_current_user_id (), 'dismissed_wp_pointers', true ) );
|
60 |
$this->logger->trace ( $dismissed );
|
61 |
$valid_pointers = array ();
|
62 |
-
|
63 |
// Check pointers and remove dismissed ones.
|
64 |
foreach ( $pointers as $pointer_id => $pointer ) {
|
65 |
-
|
66 |
// Sanity check
|
67 |
if (in_array ( $pointer_id, $dismissed ) || empty ( $pointer ) || empty ( $pointer_id ) || empty ( $pointer ['target'] ) || empty ( $pointer ['options'] ))
|
68 |
continue;
|
69 |
-
|
70 |
$pointer ['pointer_id'] = $pointer_id;
|
71 |
-
|
72 |
// Add the pointer to $valid_pointers array
|
73 |
$valid_pointers ['pointers'] [] = $pointer;
|
74 |
}
|
75 |
-
|
76 |
// No valid pointers? Stop here.
|
77 |
if (empty ( $valid_pointers )) {
|
78 |
return;
|
79 |
}
|
80 |
-
|
81 |
// Add pointers style to queue.
|
82 |
wp_enqueue_style ( 'wp-pointer' );
|
83 |
-
|
84 |
// Add pointers script to queue. Add custom script.
|
|
|
|
|
|
|
|
|
85 |
wp_enqueue_script ( 'postman_admin_pointer', plugins_url ( 'script/postman-admin-pointer.js', $this->rootPluginFilenameAndPath ), array (
|
86 |
-
'wp-pointer'
|
87 |
) );
|
88 |
-
|
89 |
// Add pointer options to script.
|
90 |
wp_localize_script ( 'postman_admin_pointer', 'postman_admin_pointer', $valid_pointers );
|
|
|
91 |
$this->logger->trace ( 'out wptuts' );
|
92 |
}
|
93 |
}
|
@@ -100,9 +105,9 @@ if (! class_exists ( 'PostmanAdminPointer' )) {
|
|
100 |
'content' => '',
|
101 |
'position' => array (
|
102 |
'edge' => 'top',
|
103 |
-
'align' => 'left'
|
104 |
-
)
|
105 |
-
)
|
106 |
);
|
107 |
return $p;
|
108 |
}
|
4 |
}
|
5 |
|
6 |
if (! class_exists ( 'PostmanAdminPointer' )) {
|
7 |
+
|
8 |
/**
|
9 |
* From http://code.tutsplus.com/articles/integrating-with-wordpress-ui-admin-pointers--wp-26853
|
10 |
*
|
11 |
* @author jasonhendriks
|
12 |
+
*
|
13 |
*/
|
14 |
class PostmanAdminPointer {
|
15 |
private $logger;
|
16 |
private $rootPluginFilenameAndPath;
|
17 |
+
|
18 |
/**
|
19 |
*
|
20 |
+
* @param mixed $rootPluginFilenameAndPath
|
21 |
*/
|
22 |
function __construct($rootPluginFilenameAndPath) {
|
23 |
$this->logger = new PostmanLogger ( get_class ( $this ) );
|
24 |
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
25 |
+
|
26 |
// Don't run on WP < 3.3
|
27 |
if (get_bloginfo ( 'version' ) < '3.3' || true)
|
28 |
return;
|
29 |
+
|
30 |
add_action ( 'admin_enqueue_scripts', array (
|
31 |
$this,
|
32 |
+
'wptuts_pointer_load'
|
33 |
), 1000 );
|
34 |
add_filter ( 'postman_admin_pointers-settings_page_postman', array (
|
35 |
$this,
|
36 |
+
'wptuts_register_pointer_testing'
|
37 |
) );
|
38 |
}
|
39 |
+
|
40 |
/**
|
41 |
*
|
42 |
+
* @param mixed $hook_suffix
|
43 |
*/
|
44 |
function wptuts_pointer_load($hook_suffix) {
|
45 |
// only do this for administrators
|
46 |
if (PostmanUtils::isAdmin ()) {
|
47 |
$this->logger->trace ( 'wptuts' );
|
48 |
+
|
49 |
$screen = get_current_screen ();
|
50 |
$screen_id = $screen->id;
|
51 |
+
|
52 |
// Get pointers for this screen
|
53 |
$pointers = apply_filters ( 'postman_admin_pointers-' . $screen_id, array () );
|
54 |
+
|
55 |
if (! $pointers || ! is_array ( $pointers ))
|
56 |
return;
|
57 |
+
|
58 |
// Get dismissed pointers
|
59 |
$dismissed = explode ( ',', ( string ) get_user_meta ( get_current_user_id (), 'dismissed_wp_pointers', true ) );
|
60 |
$this->logger->trace ( $dismissed );
|
61 |
$valid_pointers = array ();
|
62 |
+
|
63 |
// Check pointers and remove dismissed ones.
|
64 |
foreach ( $pointers as $pointer_id => $pointer ) {
|
65 |
+
|
66 |
// Sanity check
|
67 |
if (in_array ( $pointer_id, $dismissed ) || empty ( $pointer ) || empty ( $pointer_id ) || empty ( $pointer ['target'] ) || empty ( $pointer ['options'] ))
|
68 |
continue;
|
69 |
+
|
70 |
$pointer ['pointer_id'] = $pointer_id;
|
71 |
+
|
72 |
// Add the pointer to $valid_pointers array
|
73 |
$valid_pointers ['pointers'] [] = $pointer;
|
74 |
}
|
75 |
+
|
76 |
// No valid pointers? Stop here.
|
77 |
if (empty ( $valid_pointers )) {
|
78 |
return;
|
79 |
}
|
80 |
+
|
81 |
// Add pointers style to queue.
|
82 |
wp_enqueue_style ( 'wp-pointer' );
|
83 |
+
|
84 |
// Add pointers script to queue. Add custom script.
|
85 |
+
/**
|
86 |
+
* @todo Check if this work
|
87 |
+
*/
|
88 |
+
/*
|
89 |
wp_enqueue_script ( 'postman_admin_pointer', plugins_url ( 'script/postman-admin-pointer.js', $this->rootPluginFilenameAndPath ), array (
|
90 |
+
'wp-pointer'
|
91 |
) );
|
92 |
+
|
93 |
// Add pointer options to script.
|
94 |
wp_localize_script ( 'postman_admin_pointer', 'postman_admin_pointer', $valid_pointers );
|
95 |
+
*/
|
96 |
$this->logger->trace ( 'out wptuts' );
|
97 |
}
|
98 |
}
|
105 |
'content' => '',
|
106 |
'position' => array (
|
107 |
'edge' => 'top',
|
108 |
+
'align' => 'left'
|
109 |
+
)
|
110 |
+
)
|
111 |
);
|
112 |
return $p;
|
113 |
}
|
Postman/Postman-Diagnostic-Test/PostmanDiagnosticTestController.php
CHANGED
@@ -204,13 +204,16 @@ class PostmanGetDiagnosticsViaAjax {
|
|
204 |
foreach ( $functions as $function ) {
|
205 |
$thing = $function ['function'];
|
206 |
if ( is_array( $thing ) ) {
|
207 |
-
|
208 |
-
|
|
|
|
|
209 |
} else {
|
210 |
array_push( $functionArray, $thing );
|
211 |
}
|
212 |
}
|
213 |
}
|
|
|
214 |
return implode( ', ', $functionArray );
|
215 |
}
|
216 |
|
204 |
foreach ( $functions as $function ) {
|
205 |
$thing = $function ['function'];
|
206 |
if ( is_array( $thing ) ) {
|
207 |
+
$name = get_class($thing [0]) . '->' . $thing [1];
|
208 |
+
array_push($functionArray, $name);
|
209 |
+
} elseif ( is_object( $thing ) ) {
|
210 |
+
array_push( $functionArray, 'Anonymous Function' );
|
211 |
} else {
|
212 |
array_push( $functionArray, $thing );
|
213 |
}
|
214 |
}
|
215 |
}
|
216 |
+
|
217 |
return implode( ', ', $functionArray );
|
218 |
}
|
219 |
|
Postman/Postman-Email-Log/PostmanEmailLogController.php
CHANGED
@@ -391,10 +391,6 @@ class PostmanEmailLogController {
|
|
391 |
wp_enqueue_style( 'postman_email_log' );
|
392 |
wp_enqueue_script( 'postman_resend_email_script' );
|
393 |
wp_enqueue_script( 'sprintf' );
|
394 |
-
wp_localize_script( 'postman_resend_email_script', 'postman_js_email_was_resent', __( 'Email was successfully resent (but without attachments)', 'post-smtp' ) );
|
395 |
-
/* Translators: Where %s is an error message */
|
396 |
-
wp_localize_script( 'postman_resend_email_script', 'postman_js_email_not_resent', __( 'Email could not be resent. Error: %s', 'post-smtp' ) );
|
397 |
-
wp_localize_script( 'postman_resend_email_script', 'postman_js_resend_label', __( 'Resend', 'post-smtp' ) );
|
398 |
}
|
399 |
|
400 |
/**
|
@@ -425,7 +421,7 @@ class PostmanEmailLogController {
|
|
425 |
/* Translators where (%s) is the name of the plugin */
|
426 |
echo sprintf( __( '%s Email Log', 'post-smtp' ), __( 'Post SMTP', 'post-smtp' ) )?></h2>
|
427 |
|
428 |
-
<?php include_once POST_SMTP_PATH . '/Postman/extra/donation.php'; ?>
|
429 |
|
430 |
<div
|
431 |
style="background: #ECECEC; border: 1px solid #CCC; padding: 0 10px; margin-top: 5px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
|
391 |
wp_enqueue_style( 'postman_email_log' );
|
392 |
wp_enqueue_script( 'postman_resend_email_script' );
|
393 |
wp_enqueue_script( 'sprintf' );
|
|
|
|
|
|
|
|
|
394 |
}
|
395 |
|
396 |
/**
|
421 |
/* Translators where (%s) is the name of the plugin */
|
422 |
echo sprintf( __( '%s Email Log', 'post-smtp' ), __( 'Post SMTP', 'post-smtp' ) )?></h2>
|
423 |
|
424 |
+
<?php //include_once POST_SMTP_PATH . '/Postman/extra/donation.php'; ?>
|
425 |
|
426 |
<div
|
427 |
style="background: #ECECEC; border: 1px solid #CCC; padding: 0 10px; margin-top: 5px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
|
Postman/Postman-Mail/postman_smtp.js
CHANGED
@@ -42,7 +42,7 @@ function postmanSmtpInit() {
|
|
42 |
show('p#wizard_oauth2_help');
|
43 |
jQuery('p#wizard_oauth2_help').html(
|
44 |
response.configuration.help_text);
|
45 |
-
jQuery(postman_redirect_url_el).val(
|
46 |
response.configuration.redirect_url);
|
47 |
jQuery('#input_oauth_callback_domain').val(
|
48 |
response.configuration.callback_domain);
|
@@ -86,4 +86,4 @@ function postmanSmtpInit() {
|
|
86 |
// modded by this transport
|
87 |
var transportName = jQuery('select#input_transport_type').val();
|
88 |
transport.handleTransportChange(transportName);
|
89 |
-
}
|
42 |
show('p#wizard_oauth2_help');
|
43 |
jQuery('p#wizard_oauth2_help').html(
|
44 |
response.configuration.help_text);
|
45 |
+
jQuery(post_smtp_localize.postman_redirect_url_el).val(
|
46 |
response.configuration.redirect_url);
|
47 |
jQuery('#input_oauth_callback_domain').val(
|
48 |
response.configuration.callback_domain);
|
86 |
// modded by this transport
|
87 |
var transportName = jQuery('select#input_transport_type').val();
|
88 |
transport.handleTransportChange(transportName);
|
89 |
+
}
|
Postman/Postman-Send-Test-Email/postman_send_test_email.js
CHANGED
@@ -14,12 +14,12 @@ jQuery(document).ready(
|
|
14 |
stepsOrientation : "vertical",
|
15 |
autoFocus : true,
|
16 |
labels : {
|
17 |
-
current : steps_current_step,
|
18 |
-
pagination : steps_pagination,
|
19 |
-
finish : steps_finish,
|
20 |
-
next : steps_next,
|
21 |
-
previous : steps_previous,
|
22 |
-
loading : steps_loading
|
23 |
},
|
24 |
onStepChanging : function(event, currentIndex,
|
25 |
newIndex) {
|
14 |
stepsOrientation : "vertical",
|
15 |
autoFocus : true,
|
16 |
labels : {
|
17 |
+
current : post_smtp_localize.steps_current_step,
|
18 |
+
pagination : post_smtp_localize.steps_pagination,
|
19 |
+
finish : post_smtp_localize.steps_finish,
|
20 |
+
next : post_smtp_localize.steps_next,
|
21 |
+
previous : post_smtp_localize.steps_previous,
|
22 |
+
loading : post_smtp_localize.steps_loading
|
23 |
},
|
24 |
onStepChanging : function(event, currentIndex,
|
25 |
newIndex) {
|
Postman/Postman.php
CHANGED
@@ -147,18 +147,6 @@ class Postman {
|
|
147 |
|
148 |
add_filter( 'extra_plugin_headers', [ $this, 'add_extension_headers' ] );
|
149 |
|
150 |
-
/**
|
151 |
-
* @todo: WPML say they fix the issue in version 3.9
|
152 |
-
* https://wordpress.org/support/topic/error-in-pluggable-php173/#post-10021301
|
153 |
-
*/
|
154 |
-
if ( get_option( 'icl_sitepress_version' ) && version_compare( get_option( 'icl_sitepress_version' ), '3.9', '<' ) ) {
|
155 |
-
|
156 |
-
$active_plugins = (array)get_option('active_plugins', array());
|
157 |
-
if (in_array('sitepress-multilingual-cms/sitepress.php', $active_plugins) && !get_option('postman_wpml_fixed')) {
|
158 |
-
add_action('admin_notices', array($this, 'post_smtp_wpml_admin_notice'));
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
// hook on the wp_loaded event
|
163 |
add_action( 'wp_loaded', array(
|
164 |
$this,
|
147 |
|
148 |
add_filter( 'extra_plugin_headers', [ $this, 'add_extension_headers' ] );
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
// hook on the wp_loaded event
|
151 |
add_action( 'wp_loaded', array(
|
152 |
$this,
|
Postman/PostmanAdminController.php
CHANGED
@@ -301,7 +301,7 @@ if ( ! class_exists( 'PostmanAdminController' ) ) {
|
|
301 |
// only administrators should be able to trigger this
|
302 |
if ( PostmanUtils::isAdmin() ) {
|
303 |
$mylinks = array(
|
304 |
-
sprintf( '<a href="%s" target="_blank" class="postman_settings">%s</a>', 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehudahas@gmail.com&item_name=Donation+for+PostSMTP', __( 'Donate', 'post-smtp' ) ),
|
305 |
sprintf( '<a href="%s" class="postman_settings">%s</a>', PostmanUtils::getSettingsPageUrl(), __( 'Settings', 'post-smtp' ) ),
|
306 |
sprintf( '<a href="%s" class="postman_settings">%s</a>', 'https://postmansmtp.com', __( 'Visit us', 'post-smtp' ) ),
|
307 |
);
|
301 |
// only administrators should be able to trigger this
|
302 |
if ( PostmanUtils::isAdmin() ) {
|
303 |
$mylinks = array(
|
304 |
+
//sprintf( '<a href="%s" target="_blank" class="postman_settings">%s</a>', 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehudahas@gmail.com&item_name=Donation+for+PostSMTP', __( 'Donate', 'post-smtp' ) ),
|
305 |
sprintf( '<a href="%s" class="postman_settings">%s</a>', PostmanUtils::getSettingsPageUrl(), __( 'Settings', 'post-smtp' ) ),
|
306 |
sprintf( '<a href="%s" class="postman_settings">%s</a>', 'https://postmansmtp.com', __( 'Visit us', 'post-smtp' ) ),
|
307 |
);
|
Postman/PostmanViewController.php
CHANGED
@@ -169,13 +169,6 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
|
|
169 |
'bad_response' => __( 'An unexpected error occurred', 'post-smtp' ),
|
170 |
'corrupt_response' => __( 'Unexpected PHP messages corrupted the Ajax response', 'post-smtp' ),
|
171 |
) );
|
172 |
-
|
173 |
-
wp_localize_script( 'jquery_steps_script', 'steps_current_step', 'steps_current_step' );
|
174 |
-
wp_localize_script( 'jquery_steps_script', 'steps_pagination', 'steps_pagination' );
|
175 |
-
wp_localize_script( 'jquery_steps_script', 'steps_finish', _x( 'Finish', 'Press this button to Finish this task', 'post-smtp' ) );
|
176 |
-
wp_localize_script( 'jquery_steps_script', 'steps_next', _x( 'Next', 'Press this button to go to the next step', 'post-smtp' ) );
|
177 |
-
wp_localize_script( 'jquery_steps_script', 'steps_previous', _x( 'Previous', 'Press this button to go to the previous step', 'post-smtp' ) );
|
178 |
-
wp_localize_script( 'jquery_steps_script', 'steps_loading', 'steps_loading' );
|
179 |
}
|
180 |
|
181 |
/**
|
@@ -332,7 +325,7 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
|
|
332 |
</div>';
|
333 |
}
|
334 |
|
335 |
-
include_once POST_SMTP_PATH . '/Postman/extra/donation.php';
|
336 |
|
337 |
echo '<div class="twitter-wrap">';
|
338 |
print '<div id="postman-main-menu" class="welcome-panel">';
|
169 |
'bad_response' => __( 'An unexpected error occurred', 'post-smtp' ),
|
170 |
'corrupt_response' => __( 'Unexpected PHP messages corrupted the Ajax response', 'post-smtp' ),
|
171 |
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
|
174 |
/**
|
325 |
</div>';
|
326 |
}
|
327 |
|
328 |
+
//include_once POST_SMTP_PATH . '/Postman/extra/donation.php';
|
329 |
|
330 |
echo '<div class="twitter-wrap">';
|
331 |
print '<div id="postman-main-menu" class="welcome-panel">';
|
postman-smtp.php
CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
* Plugin Name: Post SMTP
|
7 |
* Plugin URI: https://wordpress.org/plugins/post-smtp/
|
8 |
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
|
9 |
-
* Version: 2.0.
|
10 |
* Author: Yehuda Hassine
|
11 |
* Text Domain: post-smtp
|
12 |
* Author URI: https://postmansmtp.com
|
@@ -35,10 +35,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
35 |
define( 'POST_SMTP_BASE', __FILE__ );
|
36 |
define( 'POST_SMTP_PATH', __DIR__ );
|
37 |
define( 'POST_SMTP_URL', plugins_url('', POST_SMTP_BASE ) );
|
38 |
-
define( 'POST_SMTP_VER', '2.0.
|
39 |
define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', true );
|
40 |
-
define( 'POST_SMTP_RELEASE_MESSAGE', "
|
41 |
-
define( 'POST_SMTP_RELEASE_URL', '
|
42 |
|
43 |
$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) );
|
44 |
$required_php_version = version_compare( PHP_VERSION, '5.6.0', '<' );
|
@@ -111,6 +111,10 @@ function post_dismiss_not_configured() {
|
|
111 |
add_action( 'admin_footer', 'post_dismiss_not_configured' );
|
112 |
|
113 |
function post_smtp_general_scripts() {
|
|
|
|
|
|
|
|
|
114 |
wp_enqueue_script( 'post-smtp-hooks', POST_SMTP_URL . '/script/post-smtp-hooks.js', [], false );
|
115 |
}
|
116 |
add_action( 'admin_enqueue_scripts', 'post_smtp_general_scripts', 8 );
|
6 |
* Plugin Name: Post SMTP
|
7 |
* Plugin URI: https://wordpress.org/plugins/post-smtp/
|
8 |
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
|
9 |
+
* Version: 2.0.23
|
10 |
* Author: Yehuda Hassine
|
11 |
* Text Domain: post-smtp
|
12 |
* Author URI: https://postmansmtp.com
|
35 |
define( 'POST_SMTP_BASE', __FILE__ );
|
36 |
define( 'POST_SMTP_PATH', __DIR__ );
|
37 |
define( 'POST_SMTP_URL', plugins_url('', POST_SMTP_BASE ) );
|
38 |
+
define( 'POST_SMTP_VER', '2.0.23' );
|
39 |
define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', true );
|
40 |
+
define( 'POST_SMTP_RELEASE_MESSAGE', "`WP_Scripts::localize called incorrectly` - Fixed" );
|
41 |
+
define( 'POST_SMTP_RELEASE_URL', '#' );
|
42 |
|
43 |
$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) );
|
44 |
$required_php_version = version_compare( PHP_VERSION, '5.6.0', '<' );
|
111 |
add_action( 'admin_footer', 'post_dismiss_not_configured' );
|
112 |
|
113 |
function post_smtp_general_scripts() {
|
114 |
+
$localize = include( POST_SMTP_PATH . '/Postman/Localize.php' );
|
115 |
+
wp_register_script( 'post-smtp-localize', POST_SMTP_URL . '/script/localize.js', [], false );
|
116 |
+
wp_localize_script( 'post-smtp-localize', 'post_smtp_localize', $localize );
|
117 |
+
wp_enqueue_script( 'post-smtp-localize' );
|
118 |
wp_enqueue_script( 'post-smtp-hooks', POST_SMTP_URL . '/script/post-smtp-hooks.js', [], false );
|
119 |
}
|
120 |
add_action( 'admin_enqueue_scripts', 'post_smtp_general_scripts', 8 );
|
readme.txt
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
=== Post SMTP Mailer/Email Log ===
|
2 |
Contributors: yehudah
|
3 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehudahas@gmail.com&item_name=Donation+for+PostSMTP
|
4 |
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -281,6 +280,9 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
|
|
281 |
|
282 |
== Changelog ==
|
283 |
|
|
|
|
|
|
|
284 |
= 2.0.22 - 2021-02-14
|
285 |
* Update: Chrome extension URL change
|
286 |
* Fixed: Double save when extension save to option
|
1 |
=== Post SMTP Mailer/Email Log ===
|
2 |
Contributors: yehudah
|
|
|
3 |
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
|
4 |
Requires at least: 3.9
|
5 |
+
Tested up to: 5.7.1
|
6 |
+
Stable tag: 2.0.23
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
280 |
|
281 |
== Changelog ==
|
282 |
|
283 |
+
= 2.0.23 - 2021-04-22
|
284 |
+
* Fixed: `WP_Scripts::localize called incorrectly` message.
|
285 |
+
|
286 |
= 2.0.22 - 2021-02-14
|
287 |
* Update: Chrome extension URL change
|
288 |
* Fixed: Double save when extension save to option
|
script/localize.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
(function ($) {
|
2 |
+
console.log('Post SMTP localize loaded.');
|
3 |
+
})(jQuery)
|
script/postman.js
CHANGED
@@ -110,7 +110,7 @@ function handleConfigurationResponse(response) {
|
|
110 |
if (response.display_auth == 'oauth2') {
|
111 |
show('p#wizard_oauth2_help');
|
112 |
jQuery('p#wizard_oauth2_help').html(response.help_text);
|
113 |
-
jQuery(postman_redirect_url_el).val(response.redirect_url);
|
114 |
jQuery('#input_oauth_callback_domain').val(response.callback_domain);
|
115 |
jQuery('#client_id').html(response.client_id_label);
|
116 |
jQuery('#client_secret').html(response.client_secret_label);
|
110 |
if (response.display_auth == 'oauth2') {
|
111 |
show('p#wizard_oauth2_help');
|
112 |
jQuery('p#wizard_oauth2_help').html(response.help_text);
|
113 |
+
jQuery(post_smtp_localize.postman_redirect_url_el).val(response.redirect_url);
|
114 |
jQuery('#input_oauth_callback_domain').val(response.callback_domain);
|
115 |
jQuery('#client_id').html(response.client_id_label);
|
116 |
jQuery('#client_secret').html(response.client_secret_label);
|
script/postman_resend_email_sript.js
CHANGED
@@ -30,9 +30,9 @@ jQuery(document).ready(function($) {
|
|
30 |
jQuery.post(ajaxurl, data, function(response) {
|
31 |
if (response.success) {
|
32 |
alert(response.data.message);
|
33 |
-
// jQuery('span#resend-' + emailId).text(postman_js_resend_label);
|
34 |
} else {
|
35 |
-
alert(sprintf(postman_js_email_not_resent, response.data.message));
|
36 |
}
|
37 |
}).fail(function(response) {
|
38 |
ajaxFailed(response);
|
30 |
jQuery.post(ajaxurl, data, function(response) {
|
31 |
if (response.success) {
|
32 |
alert(response.data.message);
|
33 |
+
// jQuery('span#resend-' + emailId).text(post_smtp_localize.postman_js_resend_label);
|
34 |
} else {
|
35 |
+
alert(sprintf(post_smtp_localize.postman_js_email_not_resent, response.data.message));
|
36 |
}
|
37 |
}).fail(function(response) {
|
38 |
ajaxFailed(response);
|