Security: Replace update nag to indicate end of support.

Replace update nag in WordPress 3.9 to indicate users need to update to a newer version of WordPress in order to continue receiving security updates.

Props peterwilsoncc, audrasjb.
Fixes #56786 for the 3.9 branch.


Built from https://develop.svn.wordpress.org/branches/3.9@54899


git-svn-id: http://core.svn.wordpress.org/branches/3.9@54451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2022-11-29 22:02:17 +00:00
parent 13ffb86585
commit f52be5bdd5
5 changed files with 57 additions and 5 deletions

View File

@ -937,6 +937,26 @@ th.action-links {
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
}
.update-nag-core-insecure {
color: #fff;
background-color: #ac1b1b;
border-right-color: #cd5a5a;
font-weight: bold;
}
.update-nag-core-insecure > p:first-child {
margin-top: 0;
}
.update-nag-core-insecure > p:last-child {
margin-bottom: 0;
}
.update-nag-core-insecure a {
color: #fff;
text-decoration: underline;
}
.update-message {
color: #000;
}

View File

@ -937,6 +937,26 @@ th.action-links {
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
}
.update-nag-core-insecure {
color: #fff;
background-color: #ac1b1b;
border-left-color: #cd5a5a;
font-weight: bold;
}
.update-nag-core-insecure > p:first-child {
margin-top: 0;
}
.update-nag-core-insecure > p:last-child {
margin-bottom: 0;
}
.update-nag-core-insecure a {
color: #fff;
text-decoration: underline;
}
.update-message {
color: #000;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -211,10 +211,22 @@ function update_nag() {
if ( current_user_can('update_core') ) {
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
$msg_line2 = sprintf(
/* translators: 1: WordPress version number, 2: Link to update WordPress */
__( 'Important! Your version of WordPress (%1$s) is no longer supported, you will not receive any security updates for your website. To keep your site secure, please <a href="%2$s">update to the latest version of WordPress</a>.' ),
get_bloginfo( 'version', 'display' ),
network_admin_url( 'update-core.php' )
);
} else {
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
$msg_line2 = sprintf(
/* translators: 1: WordPress version number, 2: Link to update WordPress */
__( 'Important! Your version of WordPress (%1$s) is no longer supported, you will not receive any security updates for your website. To keep your site secure, please <a href="%2$s">update to the latest version of WordPress</a>.' ),
get_bloginfo( 'version', 'display' ),
__( 'https://wordpress.org/download/' )
);
}
echo "<div class='update-nag'>$msg</div>";
echo "<div class='update-nag update-nag-core-insecure'><p>$msg</p><p>$msg_line2</p></div>";
}
add_action( 'admin_notices', 'update_nag', 3 );
add_action( 'network_admin_notices', 'update_nag', 3 );