This question came up in one of the WordPress-related Facebook groups I belong to.
The poster wanted to allow selected registered WordPress users to see a list of active plugins without giving them the capability of managing (adding, editing, activating, deactivating, deleting) any plugins. He was thinking about creating a new custom WordPress role and then customizing capabilities. That would work. However, adding a script with the following code snippets to a file in the mu-plugins folder is a lot easier.
I’m indebted to Boopathi Rajan, on whose website I found these code snippets.
Here’s what the listing looks like:

Summary of steps:
- Create a PHP file called something like show-my-plugins.php
- Add the two snippets (see below) to the file.
- Upload the file to the /wp-content/mu-plugins/ folder.
Code to set up the dashboard widget:
/* Initializes a new dashboard widget */
function nwb_dash_widget_plugins_init() {
if( current_user_can('manage_options') ) {
wp_add_dashboard_widget(
'nwb_dash_plugins', // Widget slug
'* Installed/Active Plugins (nwb)', // Widget title
'nwb_dash_widget_plugins_content', // Callback to function that has the content
);
}
}
Notes:
- Line 3: Change manage_options — which is a capability only Administrators and Super Adminstrators have — to a capability appropriate for your target audience. For example, use read to allow Contributors to see the listing. Details on WordPress roles and capabilites here.
- Line 7: This calls the function that generates the content.
Notice that the code on line 7 is what calls the function that generates the content.
Code to generate the content of the dashboard widget:
/* Generates the content of the new dashboard widget */
function nwb_dash_widget_plugins_content() {
$plugins = get_plugins();
?>
<div class="wrap">
<table class="nwb-list-plugins">
<thead>
<tr>
<th>Plugin Name</th>
</tr>
</thead>
<tbody>
<?php
$sno=1;
if($plugins) {
$counter = 0;
foreach($plugins as $key=>$plugin) {
if($plugin['TextDomain']!='export-plugin-details') {
$version_latest='-';
$args = array(
'slug' => $plugin['TextDomain'],
'fields' => array(
'version' => true,
)
);
if ( function_exists('plugins_api') ) {
$call_api = plugins_api( 'plugin_information', $args );
/** Check for Errors & Display the results */
if ( is_wp_error( $call_api ) ) {
$api_error = $call_api->get_error_message();
} else {
if ( ! empty( $call_api->version ) ) {
$version_latest = $call_api->version;
}
}
}
if(is_plugin_active($key)) {
$counter ++;
$counter_cos = str_pad($counter, 3, '0', STR_PAD_LEFT);
echo "<tr>";
echo "<td><code>" . $counter_cos . '</code>' . $plugin['Name']."</td>";
echo "</tr>";
}
}
}
}
else {
echo "<tr><td colspan='4'>No Plugins found..</td></tr>";
}
?>
</tbody>
</table>
</div>
<?php
}
add_action('wp_dashboard_setup', 'nwb_dash_widget_plugins_init');
Notes:
- Line 26: I had to add this because, in one installation, I was encountering a fatal error telling me the plugin didn’t exist. I never dug too deep to figure that out, and now the listing works wherever I’ve added it.
- Line 56: This add_action call starts everything in motion, associated with the
wp_dashboard_setuphook.
Like what you see? Share with others and join my mailing list. No long-term commitment, unsubscribe any time.

Leave a Reply