diff --git a/includes/Checker/Checks/Abstract_File_Check.php b/includes/Checker/Checks/Abstract_File_Check.php index b216e2d2..157afdc9 100644 --- a/includes/Checker/Checks/Abstract_File_Check.php +++ b/includes/Checker/Checks/Abstract_File_Check.php @@ -193,7 +193,7 @@ private static function file_get_contents( $file ) { * @return array List of absolute file paths. */ private static function get_files( Check_Context $plugin ) { - $location = $plugin->location(); + $location = wp_normalize_path( $plugin->location() ); if ( isset( self::$file_list_cache[ $location ] ) ) { return self::$file_list_cache[ $location ]; @@ -228,7 +228,7 @@ private static function get_files( Check_Context $plugin ) { } if ( $include_file ) { - self::$file_list_cache[ $location ][] = $file_path; + self::$file_list_cache[ $location ][] = wp_normalize_path( $file_path ); } } } diff --git a/includes/Checker/Default_Check_Collection.php b/includes/Checker/Default_Check_Collection.php index 14f72c89..e135b61d 100644 --- a/includes/Checker/Default_Check_Collection.php +++ b/includes/Checker/Default_Check_Collection.php @@ -136,7 +136,7 @@ public function exclude( array $check_slugs ): Check_Collection { } return $this->filter( - static function ( Check $check, $slug ) use( $check_slugs ) { + static function ( Check $check, $slug ) use ( $check_slugs ) { return ! in_array( $slug, $check_slugs, true ); } ); diff --git a/includes/Plugin_Context.php b/includes/Plugin_Context.php index 7a0527fa..d149a1f9 100644 --- a/includes/Plugin_Context.php +++ b/includes/Plugin_Context.php @@ -42,7 +42,7 @@ class Plugin_Context { * @param string $main_file The absolute path to the plugin main file. */ public function __construct( $main_file ) { - $this->main_file = $main_file; + $this->main_file = wp_normalize_path( $main_file ); } /** diff --git a/readme.txt b/readme.txt index a7cb1ad9..6737da9b 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,10 @@ In any case, passing the checks in this tool likely helps to achieve a smooth pl == Changelog == += 1.0.2 = + +* Fix - Correct detection of readme files in Windows by normalizing file paths. + = 1.0.1 = * Fix - Add missing `test-content` folder needed for runtime checks.