Thanks to visit codestin.com
Credit goes to github.com

Skip to content

webtions/my-plugin-information

Repository files navigation

My Plugin Information

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

Usage

Use the [mpi] shortcode to output plugin information from WordPress.org.

Basic example

[mpi slug='my-plugin-slug' field='version']

With nested subfield

Use the optional subfield parameter to access nested fields:

[mpi slug='my-plugin-slug' field='sections' subfield='changelog']

Available Shortcode Fields

Use the [mpi] shortcode to retrieve data from the WordPress.org Plugin API.

Basic Fields

These can be used directly via the field attribute:

  • name
  • slug
  • version
  • author
  • author_profile
  • requires
  • tested
  • requires_php
  • rating
  • num_ratings
  • support_url
  • support_threads
  • support_threads_resolved
  • active_installs
  • last_updated
  • added
  • homepage
  • download_link
  • donate_link
  • preview_link

Nested Fields (with subfield)

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']

sections supports:

  • description
  • installation
  • faq
  • changelog
  • reviews

ratings supports:

  • 5, 4, 3, 2, 1 — count of each star rating

ℹ️ Other complex fields like contributors, tags, and versions are not supported via shortcode. To access them, use the mpi_get_plugin_info() function in your PHP code.


Security

If you discover a security vulnerability in this plugin, please report it privately to [email protected] so it can be addressed responsibly.

License

This plugin is licensed under the GPL-3.0 License.

Credits

Thanks to the following contributors for helping improve this plugin:


Development

Show setup instructions

Setup

To contribute to the plugin and ensure your code follows coding standards:

  1. Clone the repository:

    git clone https://github.com/webtions/my-plugin-information.git
  2. Navigate to the plugin directory:

    cd my-plugin-information
  3. Install PHP dependencies:

    composer install

Development Commands

Check for coding standard issues:

composer standards:check

Automatically fix fixable code style issues:

composer standards:fix

Run static analysis:

composer analyze

This plugin follows the official WordPress Coding Standards.

Changelog

View changelog

1.0.0 - (27 July 2025)

  • Added mpi_transient_expiration filter to control cache duration
  • Added subfield shortcode attribute (thanks to @vyskoczilova)
  • Added support for nested fields like sections and ratings
  • Added support for retrieving average star rating using the ratings.average subfield, 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

0.3.0 - (24 June 2015)

  • 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

0.2.0 - (30 April 2014)

0.1.1 - (15 November 2013)

  • Structural changes to improve logic

0.1.0 - (30 September 2013)

  • Initial release

About

Communicate with WordPress.org Plugins API to retrive your Plugin Information

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages