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:1235
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
- 141–207
- 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 585.
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 - querycontent query
get_user_by()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 transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 88 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 | 141–147 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 143–149 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 143–149 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 145–151 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 145–151 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 147–153 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 147–153 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 149–155 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 154–160 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 155–161 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 156–162 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 156–162 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
76 further outcomes, up to 207 instructions
!empty($successful_updates) && $type !== "fail" && !$type | 157–163 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 157–163 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 158–164 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 158–164 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 159–165 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 159–165 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 160–166 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 160–166 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 161–167 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 161–167 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 162–168 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 163–169 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 167–171 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 168–174 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 169–173 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 169–173 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 169–175 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 170–176 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 170–176 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 171–175 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 171–175 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 171–177 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 171–177 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 172–178 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 172–178 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 173–177 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 173–177 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 173–179 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 173–179 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 174–180 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 174–180 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 175–179 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 175–181 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 175–181 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 176–182 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && !$type | 177–183 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 180 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 181–185 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 182 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 && empty($failed_updates) && $successful_updates | 182 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 182–188 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 183–187 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 183–187 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 184 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 184 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 184–190 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 184–190 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 185–189 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 185–189 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 186 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 186 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 186–192 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 186–192 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 187–191 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 187–191 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 188 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), __(), __(), get_option(), get_option(), wp_specialchars_decode(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), update_option(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 188–194 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 188–194 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 189–193 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 190–196 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 194 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 195–199 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 196 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 196 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), home_url(), sprintf(), __(), __(), __(), __(), admin_url(), sprintf(), __(), __(), __(), get_option(), home_url(), parse_url(), get_site_option(), sprintf(), compact(), apply_filters(), wp_specialchars_decode(), wp_mail(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 197–201 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 197–201 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 198 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 198 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 199–203 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 199–203 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 200 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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) && $successful_updates | 200 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 201–205 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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 | 201–205 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type && empty($failed_updates) && $successful_updates | 202 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
!empty($successful_updates) && $type !== "fail" && $type | 203–207 | get_option(), get_site_option(), get_user_by(), get_locale(), switch_to_locale(), __(), __(), 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(), restore_previous_locale() |
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 | 585 | 141–207 | 46 | |
| 8.5 | 585 | 141–207 | 46 | |
| 8.4 | 585 | 141–207 | 46 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 588 | 144–210 | 46 | |
| 8.2 | 588 | 144–210 | 46 | 1 more instruction than PHP 8.1 |
| 8.1 | 587 | 144–210 | 46 | |
| 7.4 | 587 | 144–210 | 46 |
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 1541 (+306 into the body)
Filters the email sent following an automatic background update for plugins and themes.
Uses · 15
- get_option()Retrieves an option value based on an option name.
- get_user_by()Retrieves user info by a given field.
- get_site_option()Retrieve an option value for the current network based on name of option.
- switch_to_user_locale()Switches the translations according to the given user's locale.
- switch_to_locale()Switches the translations according to the given locale.
- get_locale()Retrieves the current locale.
- __()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.
- apply_filters()Calls the callback functions that have been added to a filter hook.
Show all 15
- wp_mail()Sends an email, similar to PHP's mail function.
- update_option()Updates the value of an option that was already added.
- restore_previous_locale()Restores the translations according to the previous locale.
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; } } $admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) ); if ( $admin_user ) { $switched_locale = switch_to_user_locale( $admin_user->ID ); } else { $switched_locale = switch_to_locale( get_locale() ); } $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 ) {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 7.0.4 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.