Here is a simple WordPress plugin that will create a [activeplugin]
shortcode:
<?php
/**
* Plugin Name: Display Active Plugins
* Plugin URI: https://wpxss.com
* Description: Display all Active WordPress plugins in a [activeplugins] shortcode
* Author: Stefan Pejcic
* Version: 1.0
* Author URI: https://wpxss.com
*/
add_shortcode( 'activeplugins', function(){
$active_plugins = get_option( 'active_plugins' );
$plugins = "";
if( count( $active_plugins ) > 0 ){
$plugins = "<ul>";
foreach ( $active_plugins as $plugin ) {
$plugins .= "<li>" . $plugin . "</li>";
}
$plugins .= "</ul>";
}
return $plugins;
});
Add it as plugin and activate, then add shortcode [activeplugins]
anywhere on your website and it will display all active plugins:


Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂