Read Plugin Version Of Any WordPress Plugin


Using the get_file_data() function. More efficient than using get_plugin_data() function.

$plugin_data = get_file_data( WP_PLUGIN_DIR . '/plugin-folder-name-in-wp-content-plugins-folder/plugin-main-file.php', array( 'Version' => 'Version' ) );

$plugin_data[‘Version’] will have the version.

To read version from within the same plugin:

$plugin_data = get_file_data( __FILE__, array( 'Version' => 'Version' ) );


Pro tip: Use version_compare() PHP function to compare versions.


Leave a Reply

Random Post Selection ::

Recent Posts

Unlock Unlimited Downloads