mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Site Health: Don't show issue groups unless there are items in them.
The Site Health Status screen groups issues into the categories `good`, `recommended`, and `critical` when displaying them to the end user. Initially, this screen would show `0 critical issues` while the checks were being performed, and then hide the group if no issues were discovered after all checks had completed, this not being an ideal user experience, as it is a better experience to show areas that have content, instead of hiding them after the fact. This change makes the groups hidden by default, and also changes the logic to see if a group should be displayed when an item is added to the list (as opposed to the previous approach which only did this check once every single test had completed). Props DavidAnderson, palmiak. Fixes #47222. git-svn-id: https://develop.svn.wordpress.org/trunk@53950 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d7bb5d7227
commit
52d8c0ea3d
@ -168,6 +168,13 @@ jQuery( function( $ ) {
|
||||
$( '.site-health-issue-count-title', issueWrapper ).html( heading );
|
||||
}
|
||||
|
||||
if ( 0 < parseInt( SiteHealth.site_status.issues.critical, 0 ) ) {
|
||||
$( '#health-check-issues-critical' ).removeClass( 'hidden' );
|
||||
}
|
||||
if ( 0 < parseInt( SiteHealth.site_status.issues.recommended, 0 ) ) {
|
||||
$( '#health-check-issues-recommended' ).removeClass( 'hidden' );
|
||||
}
|
||||
|
||||
$( '.issues', '#health-check-issues-' + issue.status ).append( template( issue ) );
|
||||
}
|
||||
|
||||
@ -210,14 +217,6 @@ jQuery( function( $ ) {
|
||||
|
||||
$circle.css( { strokeDashoffset: pct } );
|
||||
|
||||
if ( 1 > parseInt( SiteHealth.site_status.issues.critical, 0 ) ) {
|
||||
$( '#health-check-issues-critical' ).addClass( 'hidden' );
|
||||
}
|
||||
|
||||
if ( 1 > parseInt( SiteHealth.site_status.issues.recommended, 0 ) ) {
|
||||
$( '#health-check-issues-recommended' ).addClass( 'hidden' );
|
||||
}
|
||||
|
||||
if ( 80 <= val && 0 === parseInt( SiteHealth.site_status.issues.critical, 0 ) ) {
|
||||
$wrapper.addClass( 'green' ).removeClass( 'orange' );
|
||||
|
||||
|
||||
@ -233,9 +233,9 @@ if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
|
||||
<?php _e( 'Site Health Status' ); ?>
|
||||
</h2>
|
||||
|
||||
<p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>
|
||||
<p><?php _e( 'The site health check shows information about your WordPress configuration and items that may need your attention.' ); ?></p>
|
||||
|
||||
<div class="site-health-issues-wrapper" id="health-check-issues-critical">
|
||||
<div class="site-health-issues-wrapper hidden" id="health-check-issues-critical">
|
||||
<h3 class="site-health-issue-count-title">
|
||||
<?php
|
||||
/* translators: %s: Number of critical issues found. */
|
||||
@ -243,10 +243,12 @@ if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<p><?php _e( 'Critical issues are items that may have a high impact on your sites performance or security, and resolving these issues should be prioritized.' ); ?></p>
|
||||
|
||||
<div id="health-check-site-status-critical" class="health-check-accordion issues"></div>
|
||||
</div>
|
||||
|
||||
<div class="site-health-issues-wrapper" id="health-check-issues-recommended">
|
||||
<div class="site-health-issues-wrapper hidden" id="health-check-issues-recommended">
|
||||
<h3 class="site-health-issue-count-title">
|
||||
<?php
|
||||
/* translators: %s: Number of recommended improvements. */
|
||||
@ -254,6 +256,8 @@ if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<p><?php _e( 'Recommended items are considered beneficial to your site, although not as important to prioritize as a critical issue, they may include improvements to things such as; Performance, user experience, and more.' ); ?></p>
|
||||
|
||||
<div id="health-check-site-status-recommended" class="health-check-accordion issues"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user