Merge pull request #1714 from mailpoet/php56-warning-improvement
Improve PHP 5.6 warning [MAILPOET-1690]
This commit is contained in:
@@ -21,7 +21,7 @@ class PHPVersionWarnings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function display($php_version) {
|
function display($php_version) {
|
||||||
$error_string = __('Your website is running on PHP %s. This is an old version that is slower and less safe. Read our [link]simple PHP upgrade guide[/link] or let MailPoet\'s support team upgrade it for you for free.', 'mailpoet');
|
$error_string = __('Your website is running on PHP %s which will not be supported by WordPress starting in April 2019. Read our [link]simple PHP upgrade guide[/link] or let MailPoet\'s support team upgrade it for you for free.', 'mailpoet');
|
||||||
$error_string = sprintf($error_string, $php_version);
|
$error_string = sprintf($error_string, $php_version);
|
||||||
$get_in_touch_string = _x('[link]Get in touch.[/link]', 'A link with an offer to upgrade PHP version for free', 'mailpoet');
|
$get_in_touch_string = _x('[link]Get in touch.[/link]', 'A link with an offer to upgrade PHP version for free', 'mailpoet');
|
||||||
$error = Helpers::replaceLinkTags($error_string, 'https://kb.mailpoet.com/article/251-upgrading-the-websites-php-version', array('target' => '_blank'));
|
$error = Helpers::replaceLinkTags($error_string, 'https://kb.mailpoet.com/article/251-upgrading-the-websites-php-version', array('target' => '_blank'));
|
||||||
@@ -29,7 +29,7 @@ class PHPVersionWarnings {
|
|||||||
|
|
||||||
$extra_classes = 'mailpoet-dismissible-notice is-dismissible';
|
$extra_classes = 'mailpoet-dismissible-notice is-dismissible';
|
||||||
|
|
||||||
return \MailPoet\WP\Notice::displayError($error, $extra_classes, self::OPTION_NAME);
|
return \MailPoet\WP\Notice::displayWarning($error, $extra_classes, self::OPTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disable() {
|
function disable() {
|
||||||
|
@@ -33,12 +33,12 @@ class PHPVersionWarningsTest extends \MailPoetTest {
|
|||||||
|
|
||||||
function testItPrintsWarningFor56() {
|
function testItPrintsWarningFor56() {
|
||||||
$mock = Mock::double('MailPoet\WP\Notice', [
|
$mock = Mock::double('MailPoet\WP\Notice', [
|
||||||
'displayError' => function($message, $classes, $data_notice_name) {
|
'displayWarning' => function($message, $classes, $data_notice_name) {
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
$warning = $this->phpVersionWarning->init('5.6.3', true);
|
$warning = $this->phpVersionWarning->init('5.6.3', true);
|
||||||
$mock->verifyInvoked('displayError');
|
$mock->verifyInvoked('displayWarning');
|
||||||
expect($warning)->contains('Your website is running on PHP 5.6.3');
|
expect($warning)->contains('Your website is running on PHP 5.6.3');
|
||||||
expect($warning)->contains('https://www.mailpoet.com/let-us-handle-your-php-upgrade/');
|
expect($warning)->contains('https://www.mailpoet.com/let-us-handle-your-php-upgrade/');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user