[wp-trac] [WordPress Trac] #43797: Consent Logging

WordPress Trac noreply at wordpress.org
Sun Apr 22 07:19:58 UTC 2018


#43797: Consent Logging
----------------------------------------+------------------------------
 Reporter:  xkon                        |       Owner:  xkon
     Type:  enhancement                 |      Status:  assigned
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  General                     |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  gdpr 2nd-opinion has-patch  |     Focuses:
----------------------------------------+------------------------------
Changes (by xkon):

 * keywords:  gdpr => gdpr 2nd-opinion has-patch


Comment:

 After back & forth discussions about this, the opinions are somewhat in
 the middle of if this should be in core or not.

 I'm in favor of trying to provide as much as possible built-in so we know
 that the Admins have a single page to view for their proof of consents,
 even if `core` itself doesn't actually need it on it's own.

 In [attachment:43797.diff] I've made a first pass of moving the plugin
 into core the same way as the other privacy tools are handled at the
 moment.

  - This creates a new `consent_log` CPT that can be used pretty much to
 log anything ( not only consents to be honest ).
  - It adds 2 new post statuses `consent_accepted` - `consent_declined`
  - It adds a Consent Log page under Tools with the option to remove all
 consents for a certain User by the admin.

 There are 4 functions requires 3 things:

 **User ID**: you can place here whatever, either email, id, or any other
 identifier that fits your needs.

 **Consent ID**: This should be unique as a prevention of plugins
 overriding each other and taping into / reading different consents to
 avoid making extra ones. This would be considered misuse. The unique
 consent ID will be provided on any given form as a random maybe and it
 will be the plugins/themes/authors responsibility to keep track of so it
 can re-check it.

 **Consent Status**: either `consent_accepted`, or `consent_declined`

 {{{#!php
 <?php
 $the_consent = new Consent_Log();

 $consent = $the_consent->has_consent( 'test at test.oo', 'unique_form_id_1'
 );

 $consent = $the_consent->create_consent( 'test at test.oo',
 'unique_form_id_1', 'consent_accepted' );

 $consent = $the_consent->update_consent( 'test at test.oo',
 'unique_form_id_1', 'consent_declined' );

 $consent = $the_consent->remove_consent( 'test at test.oo',
 'unique_form_id_1' );
 }}}

 I'm sure there are more stuff to add / fix / alter but I think this is a
 decent start for this kind of Tool.

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


More information about the wp-trac mailing list