wppaste
WordPress

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
Sends an email upon the completion or failure of a plugin or theme background update.

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

Sends mail via wp_mail().

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
141–207

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 585.

Plugin surface
1 hook

Third-party callbacks on 'auto_plugin_theme_update_email' run inside this call, and their cost is not bounded by anything here.

Called by
1

1 place in core call this, so the cost is paid more often than your own code shows.

What it touches

  • optionoption read or writeget_option()called directly
  • querycontent queryget_user_by()called directly
  • hookthird-party callbacksapply_filters()called directly
  • mailsends mailwp_mail()called directly
  • cacheobject cachewp_cache_get()one call below WP_Automatic_Updater::send_plugin_theme_email()
  • serializeserialisationmaybe_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.

WhenInstructionsCalls it makes
!empty($successful_updates) && $type !== "fail" && !$type141–147get_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" && !$type143–149get_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" && !$type143–149get_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" && !$type145–151get_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" && !$type145–151get_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" && !$type147–153get_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" && !$type147–153get_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" && !$type149–155get_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" && $type154–160get_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" && !$type155–161get_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" && $type156–162get_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" && $type156–162get_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" && !$type157–163get_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" && !$type157–163get_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" && $type158–164get_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" && $type158–164get_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" && !$type159–165get_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" && !$type159–165get_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" && $type160–166get_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" && $type160–166get_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" && !$type161–167get_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" && !$type161–167get_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" && $type162–168get_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" && !$type163–169get_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" && $type167–171get_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" && $type168–174get_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" && $type169–173get_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" && $type169–173get_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" && !$type169–175get_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" && $type170–176get_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" && $type170–176get_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" && $type171–175get_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" && $type171–175get_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" && !$type171–177get_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" && !$type171–177get_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" && $type172–178get_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" && $type172–178get_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" && $type173–177get_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" && $type173–177get_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" && !$type173–179get_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" && !$type173–179get_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" && $type174–180get_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" && $type174–180get_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" && $type175–179get_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" && !$type175–181get_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" && !$type175–181get_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" && $type176–182get_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" && !$type177–183get_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_updates180get_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" && $type181–185get_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_updates182get_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_updates182get_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" && $type182–188get_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" && $type183–187get_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" && $type183–187get_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_updates184get_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_updates184get_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" && $type184–190get_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" && $type184–190get_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" && $type185–189get_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" && $type185–189get_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_updates186get_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_updates186get_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" && $type186–192get_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" && $type186–192get_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" && $type187–191get_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" && $type187–191get_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_updates188get_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" && $type188–194get_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" && $type188–194get_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" && $type189–193get_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" && $type190–196get_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_updates194get_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" && $type195–199get_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_updates196get_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_updates196get_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" && $type197–201get_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" && $type197–201get_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_updates198get_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_updates198get_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" && $type199–203get_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" && $type199–203get_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_updates200get_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_updates200get_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" && $type201–205get_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" && $type201–205get_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_updates202get_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" && $type203–207get_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

PHPCompiledExecutedBranchesNotes
8.6-dev585141–20746
8.5585141–20746
8.4585141–207463 fewer instructions than PHP 8.3
8.3588144–21046
8.2588144–210461 more instruction than PHP 8.1
8.1587144–21046
7.4587144–21046

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:

  1. 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

Show all 15

Used by · 1

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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.