From 1648e71a9f9949ccc53051c69ec4393d1d645ca7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 20 Aug 2022 00:30:54 +0000 Subject: [PATCH] Coding Standards: Simplify the logic in `wp_not_installed()`. The function to check whether WordPress is not installed has evolved over time, ending up with duplicate conditionals. This commit combines two conditionals into a single one and includes an early return. Follow-up to [672], [676], [725], [1184], [1401], [1980], [2171], [2467], [2468], [2486], [2703], [3011], [3670], [12688], [12732], [12762], [13253], [29599], [30581], [34828]. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53915 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 5a251af21e..3b0b89af8b 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -768,23 +768,23 @@ function wp_start_object_cache() { * @access private */ function wp_not_installed() { - if ( is_multisite() ) { - if ( ! is_blog_installed() && ! wp_installing() ) { - nocache_headers(); - - wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); - } - } elseif ( ! is_blog_installed() && ! wp_installing() ) { - nocache_headers(); - - require ABSPATH . WPINC . '/kses.php'; - require ABSPATH . WPINC . '/pluggable.php'; - - $link = wp_guess_url() . '/wp-admin/install.php'; - - wp_redirect( $link ); - die(); + if ( is_blog_installed() || wp_installing() ) { + return; } + + nocache_headers(); + + if ( is_multisite() ) { + wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); + } + + require ABSPATH . WPINC . '/kses.php'; + require ABSPATH . WPINC . '/pluggable.php'; + + $link = wp_guess_url() . '/wp-admin/install.php'; + + wp_redirect( $link ); + die(); } /**