List Installed Plugin on WP Dashboard

If you’re looking to List Installed Plugin on WP Dashboard, you’ve reached the ultimate destination for WordPress optimization. Managing a complex site can be overwhelming, especially when it comes to keeping track of the plugins that power your features. For any serious site owner, the ability to List Installed Plugin on WP Dashboard at a glance is more than just a convenience—it’s a critical part of maintaining a secure and high-performance environment. In this guide, we’ll show you how to build a custom dashboard widget that provides a real-time overview of your active plugins and their versions.

Why Monitor Plugin Versions on Your Dashboard?

Plugin management is the backbone of WordPress security. Outdated plugins are one of the most common entry points for vulnerabilities. While the standard ‘Plugins’ page is useful, it requires several clicks to reach and can be cluttered with dozens of entries. By choosing to List Installed Plugin on WP Dashboard via a dedicated dashboard widget, you ensure that vital version information is the first thing you see when you log in. This proactive approach to maintenance is a key part of building Safe AI Workflows and robust web environments. Staying informed is the best defense against potential threats.

The Custom Widget Advantage

While there are many plugins that can add metadata to your dashboard, building your own lightweight solution is often better for performance. A custom script allows you to List Installed Plugin on WP Dashboard without the overhead of a heavy third-party plugin that might track your data or add unnecessary features. This philosophy of ‘minimal but powerful’ is something we often discuss in our Beginner’s Guide to AI Blog Writing, where focus and efficiency are paramount. Custom code ensures you only run exactly what you need.

How the Script Works

The PHP snippet we’ve provided uses two main WordPress functions: get_plugins() and wp_remote_get(). The first function retrieves a list of all installed plugins on your local filesystem. The second function is used to query the official WordPress.org API to find the latest version available in the repository. By comparing these two values, the widget can tell you exactly which plugins are up-to-date and which ones need your attention immediately. This is the most reliable way to List Installed Plugin on WP Dashboard and verify their status against the official repo.

Step-by-Step Implementation

To successfully List Installed Plugin on WP Dashboard, follow these steps to deploy the code safely on your own server:

  • Create a Plugin File: Create a new file named dashboard_plugin_version_widget.php in your local environment.
  • Paste the Code: Copy the full PHP snippet provided below into that file. Ensure no leading or trailing whitespace is outside the PHP tags.
  • Zip and Upload: Zip the file and upload it via ‘Plugins > Add New’ on your WordPress dashboard.
  • Activate: Once activated, navigate to your Dashboard home, and you will see the ‘Active Plugins Versions’ widget.

The Full PHP Snippet

Save the following as dashboard_plugin_version_widget.php. This script is fully compatible with the latest WordPress standards as detailed in the Official WordPress Plugin Handbook.

<?php
/*
	Plugin Name: Plugin Version on dashboard
    Plugin URI: https://tskamath.com/plugins
	Description: List on dashboard all the Installed Plugin and their Version both local and in Repo
	Version: 1.0.1
    Author: Srikanth Kamath
    Author URI: https://tskamath.com
*/

if ( ! defined( 'ABSPATH' ) ) {
	die( 'Forbidden' );
}

if(is_admin()) { 

    function getPluginVersionFromRepository($slug) {
        $url = "https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slugs][]={$slug}";
        $response = wp_remote_get($url); 
        $plugins = json_decode($response['body']);

        foreach($plugins as $key => $plugin) {
        	if(isset($plugin->version)) {
	            return $plugin->version;
	        }
        }
        return "N/A";
    }

    function activePluginsVersions() {
        $allPlugins = get_plugins(); 
        $activePlugins = get_option('active_plugins'); 

        echo '<table width="100%">';
        echo '<thead><tr><th align="left">Plugin</th><th align="left">Local</th><th align="left">Repo</th></tr></thead><tbody>';

        foreach($allPlugins as $key => $value) {
            if(in_array($key, $activePlugins)) { 
                $slug = explode('/',$key)[0]; 
                $repoVersion = getPluginVersionFromRepository($slug);
                echo "<tr><td>{$value['Name']}</td><td>{$value['Version']}</td><td>{$repoVersion}</td></tr>";
            }
        }
        echo '</tbody></table>';
    }     

    function fpwAddDashboardWidget() {
        wp_add_dashboard_widget('active_plugins_versions', 'Active Plugins Versions', 'activePluginsVersions');  
    }
    add_action('wp_dashboard_setup', 'fpwAddDashboardWidget');
}

Conclusion

By implementing this custom widget, you’ve taken a significant step toward better site management. The ability to List Installed Plugin on WP Dashboard instantly every time you log in means you are much less likely to miss a critical security update. Start using this tool today to keep your WordPress environment lean, fast, and secure. Automation is the future of web management, and it starts with simple, effective tools like this one.

Leave a Reply

Your email address will not be published. Required fields are marked *