Merge pull request #1714 from mailpoet/php56-warning-improvement

Improve PHP 5.6 warning [MAILPOET-1690]
This commit is contained in:
M. Shull
2019-01-09 07:48:05 -05:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class PHPVersionWarnings {
}
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);
$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'));
@@ -29,7 +29,7 @@ class PHPVersionWarnings {
$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() {

View File

@@ -33,12 +33,12 @@ class PHPVersionWarningsTest extends \MailPoetTest {
function testItPrintsWarningFor56() {
$mock = Mock::double('MailPoet\WP\Notice', [
'displayError' => function($message, $classes, $data_notice_name) {
'displayWarning' => function($message, $classes, $data_notice_name) {
return $message;
}
]);
$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('https://www.mailpoet.com/let-us-handle-your-php-upgrade/');
}