Skip to content

Commit 3218680

Browse files
committed
Keep track of failed plugin/theme count and display the results.
1 parent f392e7c commit 3218680

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/js/run.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ function displayReport( response ) {
131131
resetDisplay();
132132
var $ = jQuery;
133133
var compatible = 1;
134+
// Keep track of the number of failed plugins/themes.
135+
var failedCount = 0;
134136
var errorsRegex = /(\d*) ERRORS?/g;
135137
var warningRegex = /(\d*) WARNINGS?/g;
136138
var updateVersionRegex = /e: (.*?);/g;
@@ -170,6 +172,7 @@ function displayReport( response ) {
170172
if ( parseInt( errors ) > 0 ) {
171173
compatible = 0;
172174
passed = 0;
175+
failedCount++;
173176
}
174177
// Trim whitespace and newlines from report.
175178
log = log.replace( /^\s+|\s+$/g, '' );
@@ -191,10 +194,14 @@ function displayReport( response ) {
191194
var html = template( context );
192195
$('#standardMode').append( html );
193196
}
197+
194198
// Display global compatibility status.
195199
if ( compatible ) {
196200
$( '#standardMode' ).prepend( '<h3>Your WordPress install is PHP ' + test_version + ' compatible.</h3>' );
197201
} else {
202+
// Display scan stats.
203+
$( '#standardMode' ).prepend( '<p>' + failedCount + ' out of ' + plugins.length + ' plugins/themes are not compatible.</p>' );
204+
198205
$( '#standardMode' ).prepend( '<h3>Your WordPress install is not PHP ' + test_version + ' compatible.</h3>' );
199206
}
200-
}
207+
}

0 commit comments

Comments
 (0)