Show PHP Version, Memory and Queries in the Admin Footer
Replaces the WordPress version in the bottom right of admin screens with the PHP version, peak memory use and database query count of the current page.
Opens WPIDE on
Code
add_filter( 'update_footer', function ( $text ) {
if ( ! current_user_can( 'manage_options' ) ) {
return $text;
}
return sprintf(
'PHP %1$s | Memory %2$s of %3$s | %4$d queries | %5$ss',
esc_html( PHP_VERSION ),
esc_html( size_format( memory_get_peak_usage( true ) ) ),
esc_html( ini_get( 'memory_limit' ) ),
(int) get_num_queries(),
esc_html( number_format_i18n( timer_float(), 2 ) )
);
}, 99 );
Notes
Visible to administrators only.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.