WP_Automatic_Updater::send_plugin_theme_email( string $type, array $successful_updates, array $failed_updates )
- Since
- 5.5.0
- Source
wp-admin/includes/class-wp-automatic-updater.php:1224
Compatibility
- WordPress
- since 5.5.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.
Parameters
$typestring- The type of email to send. Can be one of 'success', 'fail', 'mixed'.
$successful_updatesarray- A list of updates that succeeded.
$failed_updatesarray- A list of updates that failed.
Performance profile
How much work a call to WP_Automatic_Updater::send_plugin_theme_email() 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
- Expensive
- Scaling
- Scales with input
- Instructions
- 125–210
- Plugin surface
- 1 hook
- Called by
- 1
Sends mail via wp_mail().
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 560.
Third-party callbacks on 'auto_plugin_theme_update_email' run inside this call, and their cost is not bounded by anything here.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- optionoption read or write
get_option()called directly - hookthird-party callbacks
apply_filters()called directly - mailsends mail
wp_mail()called directly - cacheobject cache
wp_cache_get()one call below WP_Automatic_Updater::send_plugin_theme_email() - serializeserialisation
maybe_unserialize()one call below WP_Automatic_Updater::send_plugin_theme_email()
Further down the call graph this can also reach query 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 · 60 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_Automatic_Updater::send_plugin_theme_email() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!empty($successful_updates) && $type !== "fail" && !$type | 125–131 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 127–133 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 129–135 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && !$type | 131–137 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 138–144 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 139–145 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 140–146 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 141–147 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 142–148 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && !$type | 143–149 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 144–150 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && !$type | 145–151 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
48 further outcomes, up to 210 instructions
!empty($successful_updates) && $type !== "fail" && $type | 148–155 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 150–157 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 152–159 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 152–158 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 153–159 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 154–161 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 154–160 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && !$type | 155–161 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 156–162 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && !$type | 157–163 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 158–164 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && !$type | 159–165 | get_option(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 162–169 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 164–166 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 164–171 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 166–168 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 166–173 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 166–172 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 168–170 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 168–175 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 168–174 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 170–172 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 170–176 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 172–178 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 174–176 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 176–178 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 176–183 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 178–180 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 178–180 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 178–185 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 180–182 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 180–182 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type | 180–187 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 182–184 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type | 182–189 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 184–186 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 188–190 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 190–192 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 192–194 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 192–194 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 194–196 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 194–196 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 196–198 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) | 198–200 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 202–204 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 204–206 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 206–208 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
!empty($successful_updates) && $type !== "fail" && $type && $failed_updates | 208–210 | get_option(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), admin_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 560 | 125–210 | 44 | |
| 8.5 | 560 | 125–210 | 44 | |
| 8.4 | 560 | 125–210 | 44 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 563 | 128–213 | 44 | |
| 8.2 | 563 | 128–213 | 44 | 1 more instruction than PHP 8.1 |
| 8.1 | 562 | 128–213 | 44 | |
| 7.4 | 562 | 128–213 | 44 |
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.
Hooks and filters fired · 1
One hook fires while WP_Automatic_Updater::send_plugin_theme_email() runs, in this order:
- apply_filters( auto_plugin_theme_update_email )filterline 1522 (+298 into the body)
Filters the email sent following an automatic background update for plugins and themes.
Uses · 10
- get_option()Retrieves an option value based on an option name.
- __()Retrieves the translation of $text.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- esc_url()Checks and cleans a URL.
- admin_url()Retrieves the URL to the admin area for the current site.
- wp_specialchars_decode()Converts a number of HTML entities into their special characters.
- get_site_option()Retrieve an option value for the current network based on name of option.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- wp_mail()Sends an email, similar to PHP's mail function.
- update_option()Updates the value of an option that was already added.
Used by · 1
- WP_Automatic_Updater::after_plugin_theme_update()Checks whether an email should be sent after attempting plugin or theme updates.
Source code
protected function send_plugin_theme_email( $type, $successful_updates, $failed_updates ) { // No updates were attempted. if ( empty( $successful_updates ) && empty( $failed_updates ) ) { return; } $unique_failures = false; $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() ); /* * When only failures have occurred, an email should only be sent if there are unique failures. * A failure is considered unique if an email has not been sent for an update attempt failure * to a plugin or theme with the same new_version. */ if ( 'fail' === $type ) { foreach ( $failed_updates as $update_type => $failures ) { foreach ( $failures as $failed_update ) { if ( ! isset( $past_failure_emails[ $failed_update->item->{$update_type} ] ) ) { $unique_failures = true; continue; } // Check that the failure represents a new failure based on the new_version. if ( version_compare( $past_failure_emails[ $failed_update->item->{$update_type} ], $failed_update->item->new_version, '<' ) ) { $unique_failures = true; } } } if ( ! $unique_failures ) { return; } } $body = array(); $successful_plugins = ( ! empty( $successful_updates['plugin'] ) ); $successful_themes = ( ! empty( $successful_updates['theme'] ) ); $failed_plugins = ( ! empty( $failed_updates['plugin'] ) ); $failed_themes = ( ! empty( $failed_updates['theme'] ) ); switch ( $type ) { case 'success': if ( $successful_plugins && $successful_themes ) { /* translators: %s: Site title. */ $subject = __( '[%s] Some plugins and themes have automatically updated' ); $body[] = sprintf( /* translators: %s: Home URL. */ __( 'Howdy! Some plugins and themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ), home_url() ); } elseif ( $successful_plugins ) { /* translators: %s: Site title. */ $subject = __( '[%s] Some plugins were automatically updated' ); $body[] = sprintf( /* translators: %s: Home URL. */ __( 'Howdy! Some plugins have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ), home_url() ); } else { /* translators: %s: Site title. */ $subject = __( '[%s] Some themes were automatically updated' ); $body[] = sprintf( /* translators: %s: Home URL. */ __( 'Howdy! Some themes have automatically updated to their latest versions on your site at %s. No further action is needed on your part.' ), home_url() ); } break; case 'fail': case 'mixed': if ( $failed_plugins && $failed_themes ) { /* translators: %s: Site title. */ $subject = __( '[%s] Some plugins and themes have failed to update' ); $body[] = sprintf( /* translators: %s: Home URL. */ __( 'Howdy! Plugins and themes failed to update on your site at %s.' ), home_url() ); } elseif ( $failed_plugins ) {Changelog
Introduced in 5.5.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.7.7 tag, from
src/wp-admin/includes/class-wp-automatic-updater.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.