wppaste
WordPress

wp_privacy_send_personal_data_export_email( int $request_id ): true|WP_Error

Since
4.9.6
Source
wp-admin/includes/privacy-tools.php:594
Send an email to the user with a link to the personal data export file

Compatibility

WordPress
since 4.9.6
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

$request_idint
The request ID for this personal data export.

Return value

true|WP_Error
True on success or WP_Error on failure.

Performance profile

How much work a call to wp_privacy_send_personal_data_export_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
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
14–149

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

Plugin surface
5 hooks

Third-party callbacks on 'wp_privacy_export_expiration', 'wp_privacy_personal_data_email_to', 'wp_privacy_personal_data_email_subject' 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

  • hookthird-party callbacksapply_filters()called directly
  • optionoption read or writeget_option()called directly
  • mailsends mailwp_mail()called directly
  • querycontent queryget_post()one call below wp_privacy_send_personal_data_export_email()
  • cacheobject cachewp_cache_get()one call below wp_privacy_send_personal_data_export_email()
  • serializeserialisationmaybe_unserialize()one call below wp_privacy_send_personal_data_export_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 · 9 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_privacy_send_personal_data_export_email() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
always14–17wp_get_user_request(), __()
empty($request)139wp_get_user_request(), get_locale(), switch_to_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail()
!empty($request)140wp_get_user_request(), switch_to_user_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail()
empty($request)141wp_get_user_request(), get_locale(), switch_to_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), restore_previous_locale()
!empty($request)142wp_get_user_request(), switch_to_user_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), restore_previous_locale()
empty($request)146wp_get_user_request(), get_locale(), switch_to_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), __(), request()
!empty($request)147wp_get_user_request(), switch_to_user_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), __(), request()
empty($request)148wp_get_user_request(), get_locale(), switch_to_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), restore_previous_locale(), __(), request()
!empty($request)149wp_get_user_request(), switch_to_user_locale(), apply_filters(), get_option(), time(), date_i18n(), wp_privacy_exports_url(), get_post_meta(), get_option(), wp_specialchars_decode(), home_url(), apply_filters(), __(), sprintf(), apply_filters(), __(), apply_filters(), sanitize_url(), sanitize_url(), apply_filters(), wp_mail(), restore_previous_locale(), __(), request()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev16414–1495
8.516414–1495
8.416414–149515 fewer instructions than PHP 8.3
8.317914–1645
8.217914–1645
8.117914–1645
7.417914–1645

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 · 5

5 hooks fire while wp_privacy_send_personal_data_export_email() runs, in this order:

  1. apply_filters( wp_privacy_export_expiration )filterline 610 (+16 into the body)

    Filters the lifetime, in seconds, of a personal data export file.

  2. apply_filters( wp_privacy_personal_data_email_to )filterline 629 (+35 into the body)

    Filters the recipient of the personal data export email notification.

  3. apply_filters( wp_privacy_personal_data_email_subject )filterline 665 (+71 into the body)

    Filters the subject of the email sent when an export request is completed.

  4. apply_filters( wp_privacy_personal_data_email_content )filterline 711 (+117 into the body)

    Filters the text of the email sent with a personal data export file.

  5. apply_filters( wp_privacy_personal_data_email_headers )filterline 744 (+150 into the body)

    Filters the headers of the email sent with a personal data export file.

Uses · 16

Show all 16

Used by · 1

Changelog

Introduced in 4.9.6. 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.1.0 tag, from src/wp-admin/includes/privacy-tools.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.