Skip to content

Commit

Permalink
Use is_single_file_plugin() in Abstract_File_Check
Browse files Browse the repository at this point in the history
  • Loading branch information
mukeshpanchal27 committed Nov 8, 2023
1 parent 7eea104 commit bba8ba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/Checker/Checks/Abstract_File_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ private static function get_files( Check_Context $plugin ) {

// If the location is a plugin folder, get all its files.
// Otherwise, it is a single-file plugin.
if ( $plugin->path() === $location ) {
if ( $plugin->is_single_file_plugin() ) {
self::$file_list_cache[ $location ][] = $location;
} else {
$iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $location ) );
foreach ( $iterator as $file ) {
if ( ! $file->isFile() ) {
Expand All @@ -229,8 +231,6 @@ private static function get_files( Check_Context $plugin ) {
self::$file_list_cache[ $location ][] = $file_path;
}
}
} else {
self::$file_list_cache[ $location ][] = $location;
}

return self::$file_list_cache[ $location ];
Expand Down

0 comments on commit bba8ba5

Please sign in to comment.