To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer
action hook. Put this code into your plugin:
if(!is_admin) {
function fpwScripts($atts) {
global $wp_scripts;
$out = '<h2>Registered Scripts</h2>';
foreach($wp_scripts->registered as $key => $value) {
$out .= "<h3>{$value->handle}</h3>";
$out .= "source = {$value->src}<br>";
$out .= "dependencies = array(<br>";
foreach($value->deps as $dep) {
$out .= ' ' . "{$dep},<br>";
}
$out .= ")";
}
return $out;
}
add_shortcode('scripts', 'fpwScripts');
} else {
function fpwAdminScripts() {
global $wp_scripts;
$out = '<div style="margin-left:200px">';
$out .= '<h2>Admin Registered Scripts</h2>';
foreach($wp_scripts->registered as $key => $value) {
$out .= "<h3>{$value->handle}</h3>";
$out .= "source = {$value->src}<br>";
$out .= "dependencies = array(<br>";
foreach($value->deps as $dep) {
$out .= ' ' . "{$dep},<br>";
}
$out .= ")";
}
$out .= '<p> </p><p> </p></div>';
echo $out;
}
add_action('admin_footer', 'fpwAdminScripts');
}
Note: if you decide to display admin registered scripts on your plugin's page, instead of using admin_footer hook, just use fpwAdminScripts()
function, there.