Make WordPress Core

Changeset 48301


Ignore:
Timestamp:
07/04/2020 07:54:39 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/site-health.js

    r48297 r48301  
    8585
    8686        if ( 'critical' === issue.status ) {
    87             heading = sprintf( _n( '%s critical issue', '%s critical issues', count ), '<span class="issue-count">' + count + '</span>' );
     87            heading = sprintf(
     88                _n( '%s critical issue', '%s critical issues', count ),
     89                '<span class="issue-count">' + count + '</span>'
     90            );
    8891        } else if ( 'recommended' === issue.status ) {
    89             heading = sprintf( _n( '%s recommended improvement', '%s recommended improvements', count ), '<span class="issue-count">' + count + '</span>' );
     92            heading = sprintf(
     93                _n( '%s recommended improvement', '%s recommended improvements', count ),
     94                '<span class="issue-count">' + count + '</span>'
     95            );
    9096        } else if ( 'good' === issue.status ) {
    91             heading = sprintf( _n( '%s item with no issues detected', '%s items with no issues detected', count ), '<span class="issue-count">' + count + '</span>' );
     97            heading = sprintf(
     98                _n( '%s item with no issues detected', '%s items with no issues detected', count ),
     99                '<span class="issue-count">' + count + '</span>'
     100            );
    92101        }
    93102
     
    110119        var $progressLabel = $( '.site-health-progress-label', $wrapper );
    111120        var $circle = $( '.site-health-progress svg #bar' );
    112         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 );
    113         var failedTests = ( parseInt( SiteHealth.site_status.issues.recommended, 0 ) * 0.5 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
     121        var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) +
     122                parseInt( SiteHealth.site_status.issues.recommended, 0 ) +
     123                ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
     124        var failedTests = ( parseInt( SiteHealth.site_status.issues.recommended, 0 ) * 0.5 ) +
     125                ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
    114126        var val = 100 - Math.ceil( ( failedTests / totalTests ) * 100 );
    115127
Note: See TracChangeset for help on using the changeset viewer.