Optimize install check by checking alloptions cache before doing a separate query. Props joostdevalk. fixes #8947
git-svn-id: https://develop.svn.wordpress.org/trunk@10958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
84207a7e84
commit
fdc0e0b555
@ -1679,7 +1679,12 @@ function is_blog_installed() {
|
||||
return true;
|
||||
|
||||
$suppress = $wpdb->suppress_errors();
|
||||
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
|
||||
$alloptions = wp_load_alloptions();
|
||||
// If siteurl is not set to autoload, but other options are loaded, check if it's there
|
||||
if ( !isset($alloptions['siteurl']) && count($alloptions) > 1 )
|
||||
$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 ) ? true : false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user