[wp-trac] [WordPress Trac] #44314: `user_confirmed_action_email_content` filter run on two different strings

WordPress Trac noreply at wordpress.org
Mon Aug 5 12:45:31 UTC 2019


#44314: `user_confirmed_action_email_content` filter run on two different strings
--------------------------------------+-----------------------------
 Reporter:  desrosj                   |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  reviewing
 Priority:  normal                    |   Milestone:  5.3
Component:  Privacy                   |     Version:  4.9.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:15 desrosj]:
 > The only problem with not deprecating one or both calls to this filter
 is that the developer is never informed that they are (at no fault of
 their own) using it incorrectly. Passing additional information to the
 filter corrects the mistake somewhat silently. A deprecated call will
 inform developers of the bug and give a clear path to proceed.

 I might be missing something, but:
 * If a plugin expects the `user_confirmed_action_email_content` filter to
 only fire in `_wp_privacy_send_request_confirmation_notification()` and
 not in `_wp_privacy_send_erasure_fulfillment_notification()`, seems like
 they are "doing it right" and don't need to change anything?
 * If that's the case, how would they proceed to fix the deprecated notice?

 Looking at the function and hook names, they are somewhat inconsistent:

 * `_wp_privacy_send_request_confirmation_notification()`
  * `user_request_confirmed_email_to`
  * `user_request_confirmed_email_subject`
  * `user_confirmed_action_email_content`

 * `_wp_privacy_send_erasure_fulfillment_notification()`
  * `user_erasure_fulfillment_email_to`
  * `user_erasure_complete_email_subject`
  * `user_confirmed_action_email_content` (2)

 * `wp_send_user_request()`
  * `user_request_action_email_content`
  * `user_request_action_email_subject`

 Could we bring more consistency here?

 * `_wp_privacy_send_request_confirmation_notification()`
  * `user_request_confirmed_email_to`
  * `user_request_confirmed_email_subject`
  * ~~`user_confirmed_action_email_content`~~
  * `user_request_confirmed_email_content` (new)

 * `_wp_privacy_send_erasure_fulfillment_notification()`
  * `user_erasure_fulfillment_email_to`
  * ~~`user_erasure_complete_email_subject`~~
  * `user_erasure_fulfillment_email_subject` (new)
  * ~~`user_confirmed_action_email_content` (2)~~
  * `user_erasure_fulfillment_email_content` (new)

 Proposal:
 * Deprecate both instances of `user_confirmed_action_email_content`.
 * Introduce `user_request_confirmed_email_content` and
 `user_erasure_fulfillment_email_content`.
 * Deprecate `user_erasure_complete_email_subject` in favor of
 `user_erasure_fulfillment_email_subject` for consistent naming.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44314#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list