Skip to content

Match the WP core behaviour in parsing plugin file header fields#15

Merged
namithj merged 1 commit into
fairpm:mainfrom
kasparsd:fix-plugin-header-parser
May 23, 2026
Merged

Match the WP core behaviour in parsing plugin file header fields#15
namithj merged 1 commit into
fairpm:mainfrom
kasparsd:fix-plugin-header-parser

Conversation

@kasparsd
Copy link
Copy Markdown
Contributor

@kasparsd kasparsd commented May 22, 2026

Fixes #14.

Now the DID install returns:

{"success":true,"data":{"slug":"handbook-callout-blocks-c9ecf6","pluginName":"Handbook Callout Blocks","plugin":"handbook-callout-blocks-c9ecf6\/handbook.php","activateUrl":"http:\/\/localhost:8888\/wp-admin\/plugins.php?_wpnonce=e1a1a9f354&action=activate&plugin=handbook-callout-blocks-c9ecf6\/handbook.php","message":"The plugin has no required plugins."}}

Signed-off-by: Kaspars Dambis <hi@kaspars.net>
continue;
}
foreach ($all_fields as $field) {
$pattern = '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote($field, '/') . ':(.*)$/mi';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@namithj namithj merged commit ae41493 into fairpm:main May 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PluginHeaderParser::parse_content scans only the first PHP comment for header fields

2 participants