3 Answers
3

@david: Both @Adam Backtrom and @Viper007Bond give some good advice so I thought I'd take their advice and see if I couldn't implement something, see below.

What follows iS a plugin called WP Active Plugins Data that parses the header metadata for all active plugins anytime any plugin is activated and it stores all the metadata for each plugin into an array option in wp_options. I designed it for both regular WordPress plugins and multisite site-wide plugins. You can download it here from gist but I've also copied the code here for your review:

Want to see how it works? Here's a test file you can drop in the root of your WordPress site (http://example.com/test.php.) Make sure you have both this plugin and Akismet activated before you test it.

You can parse your plugin's meta data (that stuff at the top of the file), but it's better for performance if you just set your own PHP variable with a matching version number. When you update the plugin, just update both version numbers.

It's slightly more work for you in the short term, but a lot better in the long term.

There is in the admin screens: get_plugin_data(). In templates, I think you will need the plugin to hold that data in PHP, e.g., set a constant or global or something, and keep that value synchronized with the plugin header version number.

wp-settings.php calls wp_get_active_and_valid_plugins(), which pulls data from the active_plugins site option. This option only contains the path to the plugin file, and wp-settings.php only runs include_once on the file, so it's never parsed for the plugin metadata.