WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
195 stars 39 forks source link

Windows: Plugin check reports that readme.txt file is missing. Edit Link fails for other files. #434

Closed bobbingwide closed 2 months ago

bobbingwide commented 3 months ago

When running plugin check in a Windows environment the plugin check doesn't find the readme.txt file.

It's probably a forward slash / backslash problem in trait Find_Readme()

In my example:

$plugin_relative_path is C:\apache\htdocs\wordpress/wp-content/plugins/field-block-for-acf-pro/ but the $files array has a backslash after the plugin name.

[160] => (string) "C:\apache\htdocs\wordpress/wp-content/plugins/field-block-for-acf-pro\README.md"
 [161] => (string) "C:\apache\htdocs\wordpress/wp-content/plugins/field-block-for-acf-pro\readme.txt"

See also https://github.com/WordPress/plugin-check/issues/271

Scenario

The Warning no_plugin_readme with message "The plugin readme.txt does not exist".

The Edit Link works for this file.

Environment

Windows: 11 WordPress: 6.4.3 PHP: 8.3 plugin-check version: 1.0.1

Additional observations

The Edit Link doesn't work for the other messages. The path is incorrect.

https://s.b/wordpress/wp-admin/plugin-editor.php?plugin=field-block-for-acf-pro%2Ffield-block-for-acf-pro.php&file=field-block-for-acf-pro%2FC%3A%5Capache%5Chtdocs%5Cwordpress%2Fwp-content%2Fplugins%2Ffield-block-for-acf-pro%5Cphpunit.xml.dist

https://s.b/wordpress/wp-admin/plugin-editor.php?plugin=field-block-for-acf-pro%2Ffield-block-for-acf-pro.php&file=field-block-for-acf-pro%2FC%3A%5Capache%5Chtdocs%5Cwordpress%2Fwp-content%2Fplugins%2Ffield-block-for-acf-pro%5C.git

image