Require plugin.php if no get_plugin_data

it is not included automatically by wp
This commit is contained in:
Alex P 2022-02-23 17:28:52 +02:00
parent 19d2c2528e
commit 577e5c54d2

View file

@ -56,6 +56,10 @@ class FilePathPluginFactory implements FilePathPluginFactoryInterface {
);
}
if ( ! function_exists( 'get_plugin_data' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$plugin_data = get_plugin_data( $filePath );
if ( empty( $plugin_data ) ) {
throw new UnexpectedValueException(