wp_not_installed()
- Since
- 3.0.0
- Source
wp-includes/load.php:942
Description
Dies with an error message when Multisite is enabled.
Compatibility
- WordPress
- since 3.0.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Performance profile
How much work a call to wp_not_installed() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Light
- Scaling
- Constant
- Instructions
- 4–37
- Plugin surface
- None
- Called by
- 0
Only touches the object cache, via wp_cache_get().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 38.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- cacheobject cache
wp_cache_get()one call below wp_not_installed() - hookthird-party callbacks
apply_filters()one call below wp_not_installed()
Further down the call graph this can also reach query, option, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 4 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_not_installed() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
is_blog_installed() | 4 | is_blog_installed() |
!is_blog_installed() && wp_installing() | 7 | is_blog_installed(), wp_installing() |
!is_blog_installed() && !wp_installing() && !is_multisite() | 31 | is_blog_installed(), wp_installing(), nocache_headers(), is_multisite(), wp_guess_url(), wp_redirect(), exit() |
!is_blog_installed() && !wp_installing() && is_multisite() | 37 | is_blog_installed(), wp_installing(), nocache_headers(), is_multisite(), __(), wp_die(), wp_guess_url(), wp_redirect(), exit() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 38 | 4–37 | 3 | |
| 8.5 | 38 | 4–37 | 3 | |
| 8.4 | 38 | 4–37 | 3 | 2 more instructions than PHP 8.3 |
| 8.3 | 36 | 4–35 | 3 | |
| 8.2 | 36 | 4–35 | 3 | |
| 8.1 | 36 | 4–35 | 3 | |
| 7.4 | 36 | 4–35 | 3 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 8
- is_blog_installed()Determines whether WordPress is already installed.
- wp_installing()Checks or sets whether WordPress is in "installation" mode.
- nocache_headers()Sets the HTTP headers to prevent caching for the different browsers.
- is_multisite()Determines whether Multisite is enabled.
- wp_die()Kills WordPress execution and displays HTML page with an error message.
- __()Retrieves the translation of $text.
- wp_guess_url()Guesses the URL for the site.
- wp_redirect()Redirects to another page.
Source code
function wp_not_installed() { 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();}Changelog
Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-includes/load.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.