From 5c9d27cd171445cba0fa9d578a5556e8a4067d15 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Sun, 14 Apr 2019 13:48:59 +0000 Subject: [PATCH] Coding standards: Site health: Avoid to use `var` in the middle of JavaScript function blocks. Amends [45178]. See #46683. git-svn-id: https://develop.svn.wordpress.org/trunk@45197 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/site-health.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/js/_enqueues/admin/site-health.js b/src/js/_enqueues/admin/site-health.js index 1adce04c25..eb38b8d352 100644 --- a/src/js/_enqueues/admin/site-health.js +++ b/src/js/_enqueues/admin/site-health.js @@ -56,11 +56,12 @@ jQuery( document ).ready( function( $ ) { function AppendIssue( issue ) { var template = wp.template( 'health-check-issue' ), issueWrapper = $( '#health-check-issues-' + issue.status ), - heading; + heading, + count; SiteHealth.site_status.issues[ issue.status ]++; - var count = SiteHealth.site_status.issues[ issue.status ]; + count = SiteHealth.site_status.issues[ issue.status ]; if ( 'critical' === issue.status ) { heading = sprintf( _n( '%s Critical issue', '%s Critical issues', count ), '' + count + '' ); @@ -145,9 +146,11 @@ jQuery( document ).ready( function( $ ) { } ); - // translators: %s: The percentage score for the tests. - var text = __( 'All site health tests have finished running. Your site scored %s, and the results are now available on the page.' ); - wp.a11y.speak( sprintf( text, val + '%' ) ); + wp.a11y.speak( sprintf( + // translators: %s: The percentage score for the tests. + __( 'All site health tests have finished running. Your site scored %s, and the results are now available on the page.' ), + val + '%' + ) ); } }