diff --git a/admin/class-scans-stats.php b/admin/class-scans-stats.php index f8fcea954..5aa0ee62e 100644 --- a/admin/class-scans-stats.php +++ b/admin/class-scans-stats.php @@ -184,9 +184,9 @@ function ( $item ) { $rule_query = new Issues_Query( [ 'rule_slugs' => [ $rule_slug ], + 'post_types' => Settings::get_scannable_post_types(), ], - 1, - Issues_Query::FLAG_INCLUDE_ALL_POST_TYPES + 1 ); if ( $rule_query->count() ) { @@ -195,8 +195,9 @@ function ( $item ) { } $data['rules_passed'] = $this->rule_count - $data['rules_failed']; - $data['passed_percentage'] = 100; - if ( $data['posts_scanned'] > 0 && $tests_count > 0 ) { + $data['passed_percentage'] = 'N/A'; + $scannable_post_types = Settings::get_scannable_post_types(); + if ( ! empty( $scannable_post_types ) && $data['posts_scanned'] > 0 && $tests_count > 0 ) { $data['passed_percentage'] = round( ( $data['rules_passed'] / $this->rule_count ) * 100, 2 ); }