is_blog_installed

The timeline below displays how wordpress function is_blog_installed has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an unwise state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE === $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE === $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. This is not good.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.6

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an unwise state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. This is not good.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.3

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (is_array($described_table) && count($described_table) === 0) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .10

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.5

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.4

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.3

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (is_array($described_table) && count($described_table) === 0) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .10

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.4

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically.
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 3.6

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 3.5

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (is_array($described_table) && count($described_table) === 0) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 3.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .10

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.3

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: Database repair URL. */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 2.9

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 2.8

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (is_array($described_table) && count($described_table) === 0) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 2.3

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .20

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 2.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .10

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 1.8

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 1.7

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (is_array($described_table) && count($described_table) === 0) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 1.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .10

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        $described_table = $wpdb->get_results("DESCRIBE {$table};");
        if (!$described_table && empty($wpdb->last_error) || is_array($described_table) && 0 === count($described_table)) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.1

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 0.3

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 * 
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .20

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 0.2

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 * 
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: .18

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 5.0

/**
 * Determines whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 * 
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.9

/**
 * Test whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch installation is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean installation.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.7

/**
 * Test whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch install is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(
            /* translators: %s: database repair URL */
            __('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'),
            'maint/repair.php?referrer=is_blog_installed'
        );
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.5

/**
 * Test whether WordPress is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the site is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch install is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(__('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'), 'maint/repair.php?referrer=is_blog_installed');
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.4

/**
 * Test whether blog is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the blog is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!wp_installing()) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch install is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(__('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'), 'maint/repair.php?referrer=is_blog_installed');
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.1

/**
 * Test whether blog is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @return bool Whether the blog is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!defined('WP_INSTALLING')) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch install is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(__('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'), 'maint/repair.php?referrer=is_blog_installed');
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 4.0

/**
 * Test whether blog is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves
 * the cache values, then this will work. If you use the default WordPress
 * cache, and the database goes away, then you might have problems.
 *
 * Checks for the 'siteurl' option for whether WordPress is installed.
 *
 * @since 2.1.0
 *
 * @global wpdb $wpdb WordPress database access abstraction object.
 *
 * @return bool Whether the blog is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    /*
     * Check cache first. If options table goes away and we have true
     * cached, oh well.
     */
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!defined('WP_INSTALLING')) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    /*
     * Loop over the WP tables. If none exist, then scratch install is allowed.
     * If one or more exist, suggest table repair since we got here because the
     * options table could not be accessed.
     */
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(__('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'), 'maint/repair.php?referrer=is_blog_installed');
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}

WordPress Version: 3.7

/**
 * Test whether blog is already installed.
 *
 * The cache will be checked first. If you have a cache plugin, which saves the
 * cache values, then this will work. If you use the default WordPress cache,
 * and the database goes away, then you might have problems.
 *
 * Checks for the option siteurl for whether WordPress is installed.
 *
 * @since 2.1.0
 * @uses $wpdb
 *
 * @return bool Whether blog is already installed.
 */
function is_blog_installed()
{
    global $wpdb;
    // Check cache first. If options table goes away and we have true cached, oh well.
    if (wp_cache_get('is_blog_installed')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    if (!defined('WP_INSTALLING')) {
        $alloptions = wp_load_alloptions();
    }
    // If siteurl is not set to autoload, check it specifically
    if (!isset($alloptions['siteurl'])) {
        $installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
    } else {
        $installed = $alloptions['siteurl'];
    }
    $wpdb->suppress_errors($suppress);
    $installed = !empty($installed);
    wp_cache_set('is_blog_installed', $installed);
    if ($installed) {
        return true;
    }
    // If visiting repair.php, return true and let it take over.
    if (defined('WP_REPAIRING')) {
        return true;
    }
    $suppress = $wpdb->suppress_errors();
    // Loop over the WP tables. If none exist, then scratch install is allowed.
    // If one or more exist, suggest table repair since we got here because the options
    // table could not be accessed.
    $wp_tables = $wpdb->tables();
    foreach ($wp_tables as $table) {
        // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
        if (defined('CUSTOM_USER_TABLE') && CUSTOM_USER_TABLE == $table) {
            continue;
        }
        if (defined('CUSTOM_USER_META_TABLE') && CUSTOM_USER_META_TABLE == $table) {
            continue;
        }
        if (!$wpdb->get_results("DESCRIBE {$table};")) {
            continue;
        }
        // One or more tables exist. We are insane.
        wp_load_translations_early();
        // Die with a DB error.
        $wpdb->error = sprintf(__('One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.'), 'maint/repair.php?referrer=is_blog_installed');
        dead_db();
    }
    $wpdb->suppress_errors($suppress);
    wp_cache_set('is_blog_installed', false);
    return false;
}