[wp-trac] [WordPress Trac] #50864: Handling readme.txt file in validate_theme_requirements function

WordPress Trac noreply at wordpress.org
Thu Aug 6 14:03:05 UTC 2020


#50864: Handling readme.txt file in validate_theme_requirements function
-----------------------------+------------------------------
 Reporter:  tmatsuur         |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Themes           |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by SergeyBiryukov):

 Thanks for the ticket!

 > This readme.txt file name is README.txt for some themes.
 >
 > For example, Twenty Seventeen from WordPress 5.2 (Currently changed to
 readme.txt).

 Yes, it was changed to `readme.txt` for Twenty Seventeen in [46719] for
 consistency.
 >
 > Is the file name of readme.txt already unified as "readme.txt"?
 >
 > If it is not unified yet, I think it is better to read "README.txt".

 As far as I know, `readme.txt` is the official name, but it appears to be
 treated by the plugin and theme directories as case-insensitive, see
 [https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/plugins/plugin-directory/cli/class-import.php?marks=563#L553
 Import::find_readme_file()] for plugins and
 [https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/plugins/theme-directory/class-wporg-themes-
 upload.php?marks=404#L397 WPORG_Themes_Upload::get_readme_data()] for
 themes.

 So I guess checking both names would make sense. It's worth noting though
 that `readme.txt` is only used as a fallback here, the primary location
 for the `Requires at least` and `Requires PHP` headers is the theme's
 `style.css` file, or the plugin's main PHP file. So maybe complicating the
 fallback check is not worth it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50864#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list