WP_Debug_Data::get_database_size(): int

In this article

Fetches the total size of all the database tables for the active database user.

Return

int The size of the database, in bytes.

Source


// Populate the database debug fields.
if ( is_object( $wpdb->dbh ) ) {
	// mysqli or PDO.
	$extension = get_class( $wpdb->dbh );
} else {
	// Unknown sql extension.
	$extension = null;
}

$server = $wpdb->get_var( 'SELECT VERSION()' );

$client_version = $wpdb->dbh->client_info;

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.