File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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 * ) E R R O R S ? / g;
135137 var warningRegex = / ( \d * ) W A R N I N G S ? / 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+ }
You can’t perform that action at this time.
0 commit comments