A developer-focused WordPress plugin that lets you fetch and display information about any plugin hosted on WordPress.org.
It provides a shortcode and helper functions to retrieve common fields such as version, changelog, active_installs, and many others available via the Plugin API.
Data is pulled from the WordPress.org Plugin API, cached locally using transients, and automatically refreshed every hour to reduce API calls and ensure fast performance.
Reference article: Communicating with the WordPress.org Plugin API
Use the [mpi] shortcode to output plugin information from WordPress.org.
[mpi slug='my-plugin-slug' field='version']
Use the optional subfield parameter to access nested fields:
[mpi slug='my-plugin-slug' field='sections' subfield='changelog']
Use the [mpi] shortcode to retrieve data from the WordPress.org Plugin API.
These can be used directly via the field attribute:
nameslugversionauthorauthor_profilerequirestestedrequires_phpratingnum_ratingssupport_urlsupport_threadssupport_threads_resolvedactive_installslast_updatedaddedhomepagedownload_linkdonate_linkpreview_link
Some fields return structured data (arrays). You can access sub-parts of these fields using the subfield attribute.
[mpi slug='my-plugin-information' field='sections' subfield='changelog']
[mpi slug='my-plugin-information' field='ratings' subfield='5']
descriptioninstallationfaqchangelogreviews
5,4,3,2,1— count of each star rating
ℹ️ Other complex fields like
contributors,tags, andversionsare not supported via shortcode. To access them, use thempi_get_plugin_info()function in your PHP code.
If you discover a security vulnerability in this plugin, please report it privately to [email protected] so it can be addressed responsibly.
This plugin is licensed under the GPL-3.0 License.
Thanks to the following contributors for helping improve this plugin:
- @dvankooten – code cleanup and improvements
- @vyskoczilova – added support for
subfieldattribute
Show setup instructions
To contribute to the plugin and ensure your code follows coding standards:
-
Clone the repository:
git clone https://github.com/webtions/my-plugin-information.git
-
Navigate to the plugin directory:
cd my-plugin-information -
Install PHP dependencies:
composer install
Check for coding standard issues:
composer standards:checkAutomatically fix fixable code style issues:
composer standards:fixRun static analysis:
composer analyzeThis plugin follows the official WordPress Coding Standards.
View changelog
- Added
mpi_transient_expirationfilter to control cache duration - Added
subfieldshortcode attribute (thanks to @vyskoczilova) - Added support for nested fields like
sectionsandratings - Added support for retrieving average star rating using the
ratings.averagesubfield, e.g.[mpi slug="plugin-slug" field="ratings" subfield="average"] - Changed transient naming format to
mpi-{slug} - Renamed class file and class name to match plugin slug
- Improved shortcode fallback handling
- Fixed issues reported by PHPCS and PHPStan
- Added inline comments throughout the plugin Updated readme with usage and dev instructions
- Simplified shortcode logic by removing hardcoded if checks for specific fields like rating, version, etc. (thanks to @dvankooten)
- Now all fields are fetched dynamically from the API response
- Added 3 new fields (thanks to Piet from SenlinOnline.com)
- Structural changes to improve logic
- Initial release