[wp-trac] [WordPress Trac] #43438: Add filters and Ajax support for personal data export

WordPress Trac noreply at wordpress.org
Fri Aug 24 00:15:17 UTC 2018


#43438: Add filters and Ajax support for personal data export
---------------------------------------------+-----------------------
 Reporter:  azaozz                           |       Owner:  desrosj
     Type:  enhancement                      |      Status:  assigned
 Priority:  low                              |   Milestone:  4.9.9
Component:  Privacy                          |     Version:  4.9.6
 Severity:  normal                           |  Resolution:
 Keywords:  has-unit-tests has-patch commit  |     Focuses:
---------------------------------------------+-----------------------

Comment (by birgire):

 great @desrosj

 Some minor adjustments in [attachment:"43438.16.diff"]:

 In both test classes:

 - Fix a typo in the property inline documentation by replacing
 {{{$key_to_unset}}} to  {{{$new_callback_value}}}.
 - Fix a typo: Replace "An value to change the ..." to "A value to change
 the ..."
 - Change for better readability from {{{'security' => 'not-a-valid-
 nonce'}}} to {{{'security' => 'invalid-nonce'}}} in
 {{{test_failure_with_invalid_nonce()}}}.
 - Adds an inline comment in {{{test_error_when_incorrect_request_type():
 // Incorrect request type, expects
 'remove_personal_data'/'export_personal_data'.}}}
 - Adds to the inline comment in {{{test_error_when_request_id_invalid():
 // Invalid request I, less than 1.}}}

 Adds inline comments in the following
 {{{Tests_Ajax_PrivacyErasePersonalData}}} methods:
  - {{{test_error_when_missing_request_id(): // Missing request ID.}}}
  - {{{test_error_when_incorrect_request_type(): // Incorrect request type,
 expects 'remove_personal_data'.}}}
  - {{{test_error_when_invalid_email: // Invalid requester's email
 address.}}}
  - {{{test_error_when_missing_eraser_index: // Missing eraser index.}}}
  - {{{test_error_when_missing_page_index: // Missing page index.}}}

 ---

 PS: I wonder if we could simplify and dry it more with a helper method
 like {{{_set_exporter_callback( $callback ) }}} ?

 Example:

 {{{
 $this->_set_exporter_callback( 'callback_return_wp_error' );
 $this->_make_ajax_call();

 }}}

 instead of:

 {{{
 $this->new_callback_value = array( $this, 'callback_return_wp_error' );
 add_filter( 'wp_privacy_personal_data_exporters', array( $this,
 'filter_exporter_callback_index_value' ), 20 );
 $this->_make_ajax_call();

 }}}

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


More information about the wp-trac mailing list