[wp-trac] [WordPress Trac] #43438: Export registered user's private data on request

WordPress Trac noreply at wordpress.org
Tue Mar 6 16:45:18 UTC 2018


#43438: Export registered user's private data on request
------------------------------+------------------
 Reporter:  azaozz            |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  5.0
Component:  General           |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  gdpr needs-patch  |     Focuses:
------------------------------+------------------

Comment (by allendav):

 A few us of at Automattic chatted about a personal data exporter design
 that could support WooCommerce and its extensions needs (and be applicable
 to core itself or any plugin)

 In a nutshell, we eventually thought it would be best to try having
 plugins (and extensions) register a callback function(s) for the export of
 personal data, e.g. have a plugin do something like this):

 {{{
 add_filter( "wp_privacy_register_export_data_callback", array( $this,
 'register_export_data_callback' ) );

 function register_export_data_callback( $export_callbacks ) {
     $export_callbacks[] = array(
         'slug' => 'stripe',
         'plugin_friendly_name' => __( 'Stripe Payments for WooCommerce' ),
         'callback' => array( $this, 'export_data' )
     );
     return $export_callbacks;
 }
 }}}

 The plugin’s actual data-exporting callback would then look something like
 this, accepting the search parameter (e.g. the email address to export
 for) and a page parameter (more about that below).

 {{{
 function export_data( $email_address, $page ) {
     // do something here to get the next page of data for the email
 address given
     return array(
         'data' => array(
             // data goes here
         ),
     'done' => true // or return false if we want to be called again for
 another page of data
     );
 }
 }}}

 For now, we are thinking the data should be super simple, an array of
 name/value pairs, to keep the barrier to entry low – we could always add
 more things to the pairs later, e.g:

 {{{
 [
     {
         name: “billing address order #1000”,
         value:  “1444 Seattle Hill Rd”
     },
     {
         name: “billing address order #998”,
         value:  “17725 108th St SE”
     },
 ]
 }}}

 Then, ajax on a core provided wp-admin page (or the REST API) could be
 used to fetch a list of all the registered callbacks (and their plugins),
 e.g. ala:

 {{{
 $registered_callbacks_array = apply_filter(
 “wp_privacy_register_plugin_export_data_callback”, array() );
 }}}

 and work with each plugin in the $registered_callbacks_array in turn
 calling its callback(s) to fetch how ever many pages of data that plugin
 decides to return for the email address of interest.

 The web CLIENT would assemble the responses in memory (not the server) and
 then the user could do whatever they want with the data.

 Thoughts?

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


More information about the wp-trac mailing list