Coding Standards: Wrap some long lines in wp-admin/js/site-health.js per the JS coding standards for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48301 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-04 19:54:39 +00:00
parent fe2ceeada4
commit 719cf5650a

View File

@ -84,11 +84,20 @@ jQuery( document ).ready( function( $ ) {
count = SiteHealth.site_status.issues[ issue.status ];
if ( 'critical' === issue.status ) {
heading = sprintf( _n( '%s critical issue', '%s critical issues', count ), '<span class="issue-count">' + count + '</span>' );
heading = sprintf(
_n( '%s critical issue', '%s critical issues', count ),
'<span class="issue-count">' + count + '</span>'
);
} else if ( 'recommended' === issue.status ) {
heading = sprintf( _n( '%s recommended improvement', '%s recommended improvements', count ), '<span class="issue-count">' + count + '</span>' );
heading = sprintf(
_n( '%s recommended improvement', '%s recommended improvements', count ),
'<span class="issue-count">' + count + '</span>'
);
} else if ( 'good' === issue.status ) {
heading = sprintf( _n( '%s item with no issues detected', '%s items with no issues detected', count ), '<span class="issue-count">' + count + '</span>' );
heading = sprintf(
_n( '%s item with no issues detected', '%s items with no issues detected', count ),
'<span class="issue-count">' + count + '</span>'
);
}
if ( heading ) {
@ -109,8 +118,11 @@ jQuery( document ).ready( function( $ ) {
var $wrapper = $progress.closest( '.site-health-progress-wrapper' );
var $progressLabel = $( '.site-health-progress-label', $wrapper );
var $circle = $( '.site-health-progress svg #bar' );
var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) + parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var failedTests = ( parseInt( SiteHealth.site_status.issues.recommended, 0 ) * 0.5 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) +
parseInt( SiteHealth.site_status.issues.recommended, 0 ) +
( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var failedTests = ( parseInt( SiteHealth.site_status.issues.recommended, 0 ) * 0.5 ) +
( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var val = 100 - Math.ceil( ( failedTests / totalTests ) * 100 );
if ( 0 === totalTests ) {