block-scaffolding-wp icon indicating copy to clipboard operation
block-scaffolding-wp copied to clipboard

Use correct function to get plugin meta

Open pierlon opened this issue 5 years ago • 4 comments

Using get_file_data requires a default set of default headers to also be passed. The correct function to use here would be get_plugin_data, which has those headers already set.

I would assume the projects that use this template also need to have this patched.

pierlon avatar Feb 06 '20 23:02 pierlon

This was changed in #16 because of #12. Is get_file_data() not working at all now?

kasparsd avatar Feb 06 '20 23:02 kasparsd

Oh I wasn't aware of that issue. get_file_data() is missing the required $default_headers argument, and so fails. get_plugin_data() internally calls get_file_data with default headers, which we could copy over to fix this.

pierlon avatar Feb 06 '20 23:02 pierlon

@kasparsd get_file_data is throwing a PHP fatal if WP_DEBUG is not set because of the missing $default_headers argument. As @pierlon mentioned we might need to copy over the default headers to fix both this and the PHP fatal issue.

ravichdev avatar Feb 28 '20 17:02 ravichdev

This plugin should technically be deprecated. The wp-foo-bar plugin supports everything this does and more.

derekherman avatar Mar 03 '20 00:03 derekherman