inpsyde / modularity

A PSR-11 implementation for WordPress Plugins, Themes or Libraries.
https://inpsyde.github.io/modularity/
GNU General Public License v2.0
46 stars 4 forks source link

`AuthorURI` vs. `Author URI` in plugin header documentation (and code?) #14

Closed tyrann0us closed 3 years ago

tyrann0us commented 3 years ago

Describe the bug At least in the documentation (https://github.com/inpsyde/modularity/blob/master/docs/Properties.md) and the release notes for v1.3.0 (https://github.com/inpsyde/modularity/releases/tag/1.3.0) AuthorURI is mentioned as one of the plugin headers. However, similar to the theme headers, it is Author URI (with whitespace), see https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields.

Expected behavior All examples should use the official plugin header Author URI instead of AuthorURI.

Additional context I haven't checked the actual code, so I don't know if this is just a typo in the documentation or if the code actually doesn't support Author URI.

Chrico commented 3 years ago

It's a bit missleading. If we look at https://developer.wordpress.org/reference/functions/get_plugin_data/ we can see, that the header input name is Author URI, but it will be mapped in get_plugin_data() to AuthorURI.

So yes, it seems the documentation is a bit missleading here. We need to re-check the table in https://github.com/inpsyde/modularity/blob/master/docs/Properties.md -

Looks like we documented the output not the input in the mapping table (also for Theme). :)

Updates

Plugins : https://github.com/inpsyde/modularity/commit/5e45d94aee95c7298384b6d3af3e85c72d2d263a Themes: https://github.com/inpsyde/modularity/commit/5aa29e3bbb133ba91029061ed1e8f2d26e8f7a49


Could you please review? @tyrann0us :)

tyrann0us commented 3 years ago

LGTM. Haven't tested this though. Closing this, thanks!