How to Use
Download > Install > Activate. That’s it!
Example
Instantly view details about your PHP install without exposing a separate ‘live’ page with phpinfo() details and associated risks.
Source
This code can be pasted into the functions.php file of your child theme or, download and install the plugin for simple code activation.
function add_phpinfo_menu() {
add_menu_page(
'PHP Info',
'PHP Info',
'manage_options',
'phpinfo-page',
'display_phpinfo'
);
}
add_action('admin_menu', 'add_phpinfo_menu');
function display_phpinfo() {
if (!current_user_can('manage_options')) {
wp_die(__('You do not have sufficient permissions to access this page.'));
}
echo '<div class="wrap">';
ob_start();
phpinfo();
$phpinfo_content = ob_get_clean();
echo $phpinfo_content;
echo '</div>';
}