Skip to content

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

@afragen

Description

@afragen

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

  • WordPress: 6.4-alpha-56628
  • PHP: 8.2.10
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: 8.2.10)
  • Browser: Safari 16.6
  • OS: macOS
  • Theme: Frost 1.0.5
  • MU Plugins:
    • tribe-view.php
    • trick-auto-update.php
    • wp-mail-exit.php
  • Plugins:
    • Add Custom Header Images 2.3.3
    • Auto-Flush Object Cache 0.7.0
    • Core Rollback 1.3.5
    • Embed PDF Viewer 2.3.1
    • Git Remote Updater 3.1.1
    • Git Updater - Bitbucket 2.0.3
    • Git Updater - Gist 2.0.3
    • Git Updater - GitLab 2.0.3
    • Git Updater 12.3.0.2
    • Handbook Callout Blocks 1.0.0-beta5
    • Hello Dolly 1.7.2
    • Local Development 2.8.3
    • Login Logout Primary Menu Item 0.5.0
    • oEmbed Gists and Files 1.0.1
    • Plugin Check 0.2.0
    • Plugin Dependencies 2.0.2.6
    • Query Monitor 3.13.1
    • RAU Edge Case - Defining Class in main plugin file. 0.1.0
    • RAU Edge Case - Defining Constants in main plugin file. 0.1.0
    • Rollback Auto-Update Test Fatal Plugin 0.2.0
    • Rollback Update Failure 6.3.0
    • Site Testing 0.4
    • Skip Updates 1.2.0
    • Test Plugin2 0.4.8
    • Test Plugin Dependencies 1 0.1
    • Test Reports 0.3.1
    • This Plugin Should Not Be Used 0.1
    • Updates API Inspector 0.1.1
    • WordPress Beta Tester 3.5.4
    • WP Crontrol 1.15.3
    • WP Debugging 2.11.22

Steps to Reproduce

  1. 🐞 Bug occurs.

Expected Results

  1. ✅ What should happen.

Actual Results

  1. ❌ What actually happened.

Additional Notes

  • Any additional details worth mentioning.

Supplemental Artifacts

Add as Attachment

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

[Type] BugAn existing feature is broken

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions