Is it save to require plugin.php early to be able to use get_plugin_data() earlier?

At first glance it works and I cannot see any implications but maybe
you are aware of some?

You say that you are not getting errors, which I would have expected but it looks as though WordPress uses require_once() so you are probably safe:

39  /** WordPress Plugin Administration API */
40  require_once(ABSPATH . 'wp-admin/includes/plugin.php');

This kind of hack tends to indicate that you are doing something wrong though.

Leave a Comment