WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 4 weeks ago

#48520 assigned defect (bug)

Remove parsing of readme.txt files from `validate_plugin_requirements()`

Reported by: afragen Owned by: afragen
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: dev-feedback has-patch
Focuses: administration Cc:

Description

Per discussion in #48515 we are removing the parsing of a plugin readme.txt file.

Everything should belong in the main plugin file headers.

Attachments (1)

48520.diff (1.7 KB) - added by afragen 17 months ago.

Download all attachments as: .zip

Change History (15)

@afragen
17 months ago

#1 @SergeyBiryukov
17 months ago

  • Milestone changed from Awaiting Review to 5.4

Some prerequisites, per comment:25:ticket:48515:

  • Resolve #meta4621, so that all three headers (Requires at least, Tested up to, Requires PHP) could be defined in the same place.
  • Publish posts on make/plugins and make/themes with an announcement for plugin and theme authors to move these headers to the main plugin file or the style.css file, and remove them from readme.txt.

#2 @desrosj
14 months ago

  • Milestone 5.4 deleted

Because the prerequisites are still unresolved, I am going to move this to Future Release. @SergeyBiryukov @afragen feel free to re-milestone this when those are addressed!

#3 @desrosj
14 months ago

  • Milestone set to Future Release

#4 @afragen
10 months ago

Is it really necessary to have Tested up to defined in the main plugin/theme file? For the purposes of this patch the only utilized headers, Requires at least and Requires PHP are already resolved to be required in the main plugin file. https://developer.wordpress.org/plugins/plugin-basics/header-requirements/

While I understand the desire for consistency, the Tested up to header only has relevance to the plugin directory and the plugin directory doesn't parse the main plugin file.

#5 @afragen
8 weeks ago

  • Keywords needs-refresh added; has-patch removed

#6 @SergeyBiryukov
7 weeks ago

It seems like a similar change should also be made to validate_theme_requirements() for consistency, which currently reads the Requires at least and Requires PHP headers from the theme's style.css file, and if they are not present there, also checks readme.txt as a fallback.

Since readme.txt is only used as a fallback in both cases, I'm not sure I see a strong benefit in removing it, but if it helps reduce the confusion of putting these headers into the correct place as outlined in #48515, then it might be a good idea.

That said, as of this time, the Requires at least and Requires PHP headers are included as suggested examples both in Header Requirements and Plugin Readmes articles. If we proceed with only recommending a single place for them, I guess they should be removed from the latter.

This ticket was mentioned in PR #1026 on WordPress/wordpress-develop by afragen.


7 weeks ago

  • Keywords has-patch added; needs-refresh removed

Remove check in readme.txt file for Requires at least and Requires PHP headers in plugins and themes for validation. While these headers may be in the readme.txt files, they should be in the main plugin file and the theme's style.css file.

Trac ticket:https://core.trac.wordpress.org/ticket/48520

#9 @afragen
7 weeks ago

  • Milestone changed from Future Release to 5.8

#10 @afragen
7 weeks ago

Requires at least and Requires PHPalso required in Theme Header Requirements to be included in style.css.

This ticket was mentioned in Slack in #core by afragen. View the logs.


6 weeks ago

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


6 weeks ago

#13 @afragen
6 weeks ago

  • Owner set to afragen
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-auto-updates by afragen. View the logs.


4 weeks ago

Note: See TracTickets for help on using tickets.