# Server and Site Info Widget

> Adds a dashboard widget with the PHP, database and WordPress versions, memory limit, upload limit and active theme at a glance.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard, widget, server
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/server-info-dashboard-widget/

## Code

```php
add_action( 'wp_dashboard_setup', function () {
    if ( ! current_user_can( 'manage_options' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_server_info', 'Server Info', function () {
        global $wpdb;

        $theme = wp_get_theme();
        $rows  = array(
            'WordPress'          => get_bloginfo( 'version' ),
            'PHP'                => PHP_VERSION,
            'Database'           => $wpdb->db_server_info(),
            'Web server'         => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : 'Unknown',
            'PHP memory limit'   => ini_get( 'memory_limit' ),
            'WP memory limit'    => WP_MEMORY_LIMIT,
            'Max upload size'    => size_format( wp_max_upload_size() ),
            'Max execution time' => ini_get( 'max_execution_time' ) . 's',
            'Environment'        => wp_get_environment_type(),
            'Active theme'       => $theme->get( 'Name' ) . ' ' . $theme->get( 'Version' ),
            'Object cache'       => wp_using_ext_object_cache() ? 'Persistent' : 'None',
        );

        echo '<table class="widefat striped"><tbody>';
        foreach ( $rows as $label => $value ) {
            printf( '<tr><th scope="row" style="width:45%%">%s</th><td><code>%s</code></td></tr>', esc_html( $label ), esc_html( (string) $value ) );
        }
        echo '</tbody></table>';
    } );
} );
```

## Notes

Only administrators see the widget.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Server and Site Info Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
