ms_not_installed

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

WordPress Version: 6.2

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that your host&#8217;s database server is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: Table name. */
            __('<strong>Database tables are missing.</strong> This means that your host&#8217;s database server is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: Site URL, 2: Table name, 3: Database name. */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= sprintf(
        /* translators: %s: Documentation URL. */
        __('Read the <a href="%s" target="_blank">Debugging a WordPress Network</a> article. Some of the suggestions there may help you figure out what went wrong.'),
        __('https://wordpress.org/documentation/article/debugging-a-wordpress-network/')
    );
    $msg .= ' ' . __('If you are still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' === $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 6.1

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that your host&#8217;s database server is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: Table name. */
            __('<strong>Database tables are missing.</strong> This means that your host&#8217;s database server is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: Site URL, 2: Table name, 3: Database name. */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= sprintf(
        /* translators: %s: Documentation URL. */
        __('Read the <a href="%s" target="_blank">Debugging a WordPress Network</a> article. Some of the suggestions there may help you figure out what went wrong.'),
        __('https://wordpress.org/support/article/debugging-a-wordpress-network/')
    );
    $msg .= ' ' . __('If you are still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' === $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 5.5

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: Table name. */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: Site URL, 2: Table name, 3: Database name. */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= sprintf(
        /* translators: %s: Documentation URL. */
        __('Read the <a href="%s" target="_blank">Debugging a WordPress Network</a> article. Some of the suggestions there may help you figure out what went wrong.'),
        __('https://wordpress.org/support/article/debugging-a-wordpress-network/')
    );
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' === $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 5.3

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: Table name. */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: Site URL, 2: Table name, 3: Database name. */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= sprintf(
        /* translators: %s: Documentation URL. */
        __('Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.'),
        __('https://wordpress.org/support/article/debugging-a-wordpress-network/')
    );
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 5.1

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: table name */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: site url, 2: table name, 3: database name */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    /* translators: %s: Codex URL */
    $msg .= sprintf(__('Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.'), __('https://codex.wordpress.org/Debugging_a_WordPress_Network'));
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 4.4

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 * @since 4.4.0 The `$domain` and `$path` parameters were added.
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param string $domain The requested domain for the error to reference.
 * @param string $path   The requested path for the error to reference.
 */
function ms_not_installed($domain, $path)
{
    global $wpdb;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: table name */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: site url, 2: table name, 3: database name */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    /* translators: %s: Codex URL */
    $msg .= sprintf(__('Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.'), __('https://codex.wordpress.org/Debugging_a_WordPress_Network'));
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 4.3

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 *
 * @global wpdb   $wpdb
 * @global string $domain
 * @global string $path
 */
function ms_not_installed()
{
    global $wpdb, $domain, $path;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: table name */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: site url, 2: table name, 3: database name */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= __('Read the <a target="_blank" href="https://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.');
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 4.2

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 */
function ms_not_installed()
{
    global $wpdb, $domain, $path;
    if (!is_admin()) {
        dead_db();
    }
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(
            /* translators: %s: table name */
            __('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'),
            '<code>' . $wpdb->site . '</code>'
        ) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(
            /* translators: 1: site url, 2: table name, 3: database name */
            __('<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?'),
            '<code>' . rtrim($domain . $path, '/') . '</code>',
            '<code>' . $wpdb->blogs . '</code>',
            '<code>' . DB_NAME . '</code>'
        ) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= __('Read the <a target="_blank" href="https://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.');
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title, array('response' => 500));
}

WordPress Version: 4.0

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 */
function ms_not_installed()
{
    global $wpdb, $domain, $path;
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    if (!is_admin()) {
        die($msg);
    }
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    $query = $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($wpdb->site));
    if (!$wpdb->get_var($query)) {
        $msg .= '<p>' . sprintf(__('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.'), $wpdb->site) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(__('<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?'), rtrim($domain . $path, '/'), $wpdb->blogs, DB_NAME) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= __('Read the <a target="_blank" href="http://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.');
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title);
}

WordPress Version: 3.7

/**
 * Displays a failure message.
 *
 * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well.
 *
 * @access private
 * @since 3.0.0
 */
function ms_not_installed()
{
    global $wpdb, $domain, $path;
    wp_load_translations_early();
    $title = __('Error establishing a database connection');
    $msg = '<h1>' . $title . '</h1>';
    if (!is_admin()) {
        die($msg);
    }
    $msg .= '<p>' . __('If your site does not display, please contact the owner of this network.') . '';
    $msg .= ' ' . __('If you are the owner of this network please check that MySQL is running properly and all tables are error free.') . '</p>';
    if (!$wpdb->get_var("SHOW TABLES LIKE '{$wpdb->site}'")) {
        $msg .= '<p>' . sprintf(__('<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.'), $wpdb->site) . '</p>';
    } else {
        $msg .= '<p>' . sprintf(__('<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?'), rtrim($domain . $path, '/'), $wpdb->blogs, DB_NAME) . '</p>';
    }
    $msg .= '<p><strong>' . __('What do I do now?') . '</strong> ';
    $msg .= __('Read the <a target="_blank" href="http://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.');
    $msg .= ' ' . __('If you&#8217;re still stuck with this message, then check that your database contains the following tables:') . '</p><ul>';
    foreach ($wpdb->tables('global') as $t => $table) {
        if ('sitecategories' == $t) {
            continue;
        }
        $msg .= '<li>' . $table . '</li>';
    }
    $msg .= '</ul>';
    wp_die($msg, $title);
}