Revert "api validation localhost error message : display only if localhost"

This reverts commit 4992b65f14.
This commit is contained in:
qfrery
2018-06-23 15:07:37 +02:00
parent 4992b65f14
commit ad0e04a9c2
2 changed files with 1392 additions and 1377 deletions

View File

@ -66,13 +66,8 @@ class Services extends APIEndpoint {
break;
default:
$code = !empty($result['code']) ? $result['code'] : Bridge::CHECK_ERROR_UNKNOWN;
$errorMessage = __('Error validating MailPoet Sending Service key, please try again later (%s).', 'mailpoet');
// If site runs on localhost
if( 1 === preg_match("/^(http|https)\:\/\/(localhost|127\.0\.0\.1)/", site_url()) ) {
$errorMessage .= ' ' . __("Note that it doesn't work on localhost.", 'mailpoet');
}
$error = sprintf(
$errorMessage,
__("Error validating MailPoet Sending Service key, please try again later (%s). Note that it doesn't work on localhost.", 'mailpoet'),
$this->getErrorDescriptionByCode($code)
);
break;

2762
package-lock.json generated

File diff suppressed because it is too large Load Diff