Parsed: 108629

  public static function get_database_size() {
    global $wpdb;
    $size = 0;
    $rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A );

    if ( $wpdb->num_rows > 0 ) {
      foreach ( $rows as $row ) {
        $size += $row['Data_length'] + $row['Index_length'];
      }
    }

    return (int) $size;
  }