WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 6 months ago

#4514 closed enhancement (fixed)

Add support for 'Requires at least' and 'Requires PHP' headers in the main plugin file

Reported by: SergeyBiryukov Owned by: dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description (last modified by SergeyBiryukov)

Background: #2952 added support for Requires PHP plugin header.

At the time, it made sense to have it defined in the same place as Requires at least, which only exists in readme.txt.

Per discussion with @Otto42 in #WP46938, a decision was made for WP core to read both Requires at least and Requires PHP headers from the plugin's main PHP file as well, and give precedence to those instead of the ones from the readme.txt file.

For consistency, Plugin Directory should do the same.

Change History (6)

#1 @SergeyBiryukov
2 years ago

  • Description modified (diff)

#2 @dd32
2 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 9050:

Plugin Directory: Preference the Requires PHP and Requires at least headers defined in the Plugins .php header over the readme.txt values.

This also moves the missing fields in the readme.txt to being notes rather than warnings in the readme validator.

This matches the behaviour in WordPress 5.3, see #WP46938.
Fixes #4514.

#3 @dingo_d
2 years ago

Since we kinda want to have the same functionality in themes, how does this affect the themes development?

Should we make a new rule about this in the theme review handbook and themes development handbook to include this in the readme/functions.php file of the theme?

#4 @swissspidy
6 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

As per suggestion by @ocean90 I am reopening this because GlotPress needs to be updated for this as well:

https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-code-import.php#L87

This ticket was mentioned in Slack in #meta-i18n by ocean90. View the logs.


6 months ago

#6 @ocean90
6 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 10971:

Plugin Directory: Update text domain check for plugins using the Requires at least header in the plugin's main PHP file.

Fixes #4514.

Note: See TracTickets for help on using tickets.