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
237 stars 46 forks source link

Plugin picks README.md over readme.txt when both are present #258

Closed afragen closed 1 year ago

afragen commented 1 year ago

Describe the bug

When the plugin has both a README.md and a readme.txt in the root directory the README.md is used preferentially as it is the first item in the array from plugin-check.php lines 86-91

    if ( ! $args['readme'] ) {
        $readme_files = preg_grep( '!(^|/)readme.(txt|md)$!i', $top_level_files );
        if ( $readme_files ) {
            $args['readme'] = new Readme_Parser( array_shift( $readme_files ) );
        }
    }

Personally, I have a README.md for GitHub and a readme.txt for the plugin repo.

It would make the most sense to use the readme.txt if it exists and fallback to README.md.

Steps to Reproduce

Use the WordPress Beta Tester plugin as an example.

BTW the Environment info comes from the Test Reports plugin, which is still awaiting review. 😉

Screenshots, screen recording, code snippet

No response

Environment information

Bug Report

Description

Describe the bug.

Environment

Steps to Reproduce

  1. 🐞 Bug occurs.

Expected Results

  1. ✅ What should happen.

Actual Results

  1. ❌ What actually happened.

Additional Notes

Supplemental Artifacts

Add as Attachment

WordPress information

No response

Code of Conduct

bordoni commented 1 year ago

Resolved @afragen. Will ship a fix with 0.2.1