Feature Plugin Proposal: WP Consent API

As part of the core-privacy team’s roadmap the team has started development on a Consent API as a feature plugin.

We welcome all thoughts on this proposal, which you are welcome to leave as comments on this post, or share with us directly in the #core-privacy channel on Making WordPress Slack. We host weekly office hours on Wednesdays at 19:00 UTC, see the meetings page for times in your timezone.

Introduction

A standard way for WordPress core, plugins, and themes to obtain consent from users should be established to provide a consistent and stable experience for administrators, developers, and users of all kinds.

Currently it is possible for a consent management plugin to block third party services like Facebook, Google Maps, Twitter, if a user does not give consent. But if a WordPress plugin places a PHP cookie, a consent management plugin cannot prevent this.                                         

There are also WordPress plugins that integrate tracking code on the client side in javascript files that, when blocked by a consent management plugin, break the site. Or, if such a plugin’s javascript is minified, causing the URL to be unrecognizable, it won’t get detected by an automatic blocking script.

Lastly, the blocking approach requires a list of all types of URL’s that place cookies or use other means of tracking. A generic API which plugins adhere to can greatly help a webmaster in getting a site compliant.

Does usage of this API prevent third party services from tracking user data?

Primarily this API is aimed at helping to achieve a compliant use of cookies or other means of tracking by WordPress websites. If a plugin or custom code triggers for example Facebook, usage of this API will be of help to ensure consent. If a user manually embeds a facebook iframe, a cookie blocker is needed that initially disables the iframe and or scripts.

Third-party scripts have to be blocked by a blocking functionality in a consent management plugin. To do this in core would be too intrusive, and is also not applicable to all users: only users with visitors from opt in regions such as the European Union require such a feature. Such a feature also has a risk of breaking things. Additionally, blocking these and showing a nice placeholder, requires even more sophisticated code, all of which should not be part of WordPress core, for the same reasons.

That said, the consent API can be used to decide if an iframe or script should be blocked.

How does it work?

There are two indicators that together tell if consent is given for a certain consent category, e.g. “marketing”:

  1. The region based consent_type, which can be optin, opt out, or other possible consent_types;
  2. The visitor’s choice: not set, allow or deny.

The consent_type is a function that wraps a filter, wp_get_consent_type. If there’s no consent management plugin to set it, it will return false. This will cause all consent categories to return true, allowing cookies and other types of tracking for all categories.

If optin is set using this filter, a category will only return true if the value of the visitor’s choice is allow.

If the region based consent_type is opt out, it will return true if the visitor’s choice is not set or is allow.

Clientside, a consent management plugin can dynamically manipulate the consent type, and set the applicable categories.

A plugin can use a hook to listen for changes, or check the value of a given category.

Categories, and most other stuff can be extended with a filter.

Existing integrations

  • Cookiebot
  • Complianz
  • Example plugin. This plugin basically consists of a shortcode, with a div that shows a tracking or not tracking message. No actual data tracking 🙂

Demo site

Plugins used to set this up:

Technical Scope

The feature plugin should at least handle the following functionality:

  • PHP functions to set the consent level and consent type.
  • PHP functions to retrieve the consent level and consent type.
  • Javascript functions to set the consent level.
  • Javascript hook that fires when a consent level is set.
  • Javascript functions to retrieve the consent level.

Introducing the Feature Plugin

What’s next?

Once the plugin is confirmed as a feature plugin, the next steps would be:

  • To increase the number of users of the feature plugin.
  • To add other interested privacy team members and core developers as contributors of the plugin.
  • To have additional Third-Party consent management plugins to adopt the API.
  • To iterate on the feature plugin development.
  • To audit some specific aspects of the feature plugin:
    • security
    • coding-standards and documentation
  • To create a Trac ticket to handle a potential future merge proposal – if the feature plugin deserves it.

Post written by @rogierlankhorst / @paapst and reviewed by @garrett-eclipse / @carike

#consent-api, #core-privacy, #feature-plugins, #privacy, #privacy-roadmap

Core-Privacy office hours agenda for 04 Marc

With WordPress 5.4 entering the RC (Release Candidate) stage it’s time for the #core-privacy team to plan next steps. Along with planning privacy updates for 5.5, we’ll be discussing next steps for the Consent API (feature plugin), GDPR Data Request Form (feature plugin) and Compliance Tab during our office hours.

Come and join us for our office hours at our usual time this Wednesday, 04 March, at 1900 UTC on our Slack channel. All are welcome.

Our tentative agenda includes:

See you there.

#core-privacy, #privacy

Privacy Updates in 5.4

WordPress 5.4 brings several improvements to the privacy tools to improve the user experience and expand upon the data provided in personal data exports.

Personal Data Export now includes Session Tokens, Community Events Location and Custom User Meta.

In WordPress 5.4 the Personal Data exports were expanded upon to ensure the Personally Identifiable Information (PII) present in Session Tokens (#45889) and the Community Events Location (#43921) user data were made available to the exporting user. This data is made available in the export as custom group sections.

Session Tokens grouping
Community Events Location grouping

Along with the new groupings which will automatically be included in the export if the relevant data is available, developers can now expand upon the User profile data grouping through the use of the new wp_privacy_additional_user_data filter.

// Privacy Filter for adding additional user meta to personal data exports.
function my_custom_additional_user_profile_data( $additional_profile_data, $user, $reserved_names ) {
	return array(
		array(
			'name'  => __( 'Data one', 'a-plugin' ),
			'value' => 'one',
		),
		array(
			'name'  => __( 'Data two', 'a-plugin' ),
			'value' => 'two',
		),
		array(
			'name'  => __( 'Data three', 'a-plugin' ),
			'value' => 'three',
		),
		array(
			'name'  => __( 'Data four', 'a-plugin' ),
			'value' => 'four',
		),
	);
}
add_filter( 'wp_privacy_additional_user_profile_data', 'my_custom_additional_user_profile_data', 10, 3 );

Note: The $reserved_names array is supplied to the filter to assist developers in avoiding using these names in their array of additional data. This is due to any additional data matching these names will be suppressed from the export to avoid a conflict with the existing user profile data to be exported.

See #47509

Personal Data Exports now include a JSON file and a Table of Contents

Along with including additional data in the Personal Data Exports the export zip will now contain a JSON file (#49029) of the data for better portability. This JSON file will contain all of the data present in the HTML file with the exception of the table of contents.

The HTML export file has been updated to include a Table of Contents (#46894) for easier navigation of large data exports.

Visual Improvements to the Privacy Tools tables

In WordPress 5.4 the Privacy Tools tables have been updated to give progress indicators (#44264) for both the export and erasure processes. As well as switched the ‘Next Steps’ buttons to links (#49323) for a cleaner interface.

New filters for the headers of all Privacy-related emails

In WordPress 5.4 developers are now able to filter the email headers on privacy related emails. For example, this will enable developers to change the “From” email address. These headers and an example are listed below;

  • wp_privacy_personal_data_email_headers
  • user_request_action_email_headers
  • user_request_confirmed_email_headers
  • user_erasure_complete_email_headers
// Privacy filter for setting the From name/email on privacy emails.
function my_privacy_mail_headers( $headers, $subject, $content, $request_id, $email_data ) {
	$headers = array(
		'From: My Name <myname@example.com>',
	);
	return $headers;
}
add_filter( 'wp_privacy_personal_data_email_headers', 'my_privacy_mail_headers', 10, 5 );
add_filter( 'user_request_action_email_headers', 'my_privacy_mail_headers', 10, 5 );
add_filter( 'user_request_confirmed_email_headers', 'my_privacy_mail_headers', 10, 5 );
add_filter( 'user_erasure_complete_email_headers', 'my_privacy_mail_headers', 10, 5 );

See #44501

Renamed Function for Clarity

In WordPress 5.4 the wp_get_user_request_data function was renamed to wp_get_user_request for function clarity. This is due to the function returning the actual WP_User_Request object and not the data parameter which is part of the request object. The old function signature will now produce a _doing_it_wrong warning message.

See #46302

#5-4, #core-privacy, #dev-notes, #privacy

Core-Privacy office hours agenda for 18 December 2019

The #core-privacy team has been having some great discussions surrounding the Consent API and Compliance Tab and will be continuing those discussions during our office hours.

Along with those discussions we would like to start planning for 5.4, so come and join us for a full office hours at our usual time this Wednesday, 18 November, at 1900 UTC in our Slack channel. All are welcome.

Our tentative agenda includes:

This will be our last office hours of 2019, Happy Holidays and see everyone tomorrow or in the next decade!!

P.S. I will be stepping down from leading these meetings in 2020 so if someone wants to take over leading meetings and writing notes come raise your hand.

#core-privacy, #privacy

Summary of Core Privacy Office Hours, Sept. 25th 2019

Below is a summary of the discussion from this week’s Core Privacy chat (agenda, Slack Transcript).

Agenda Item: 5.3 Bugs

The following tickets were flagged as bugs for 5.3 privacy component and focus;

  • #37782 – Duplicate Page Entry in View All Pages when generating a Menu
  • #43974 – Both personal data request processes should follow the same convention
  • #44038 – Change personal data export path stored in request meta to relative paths
  • #44314user_confirmed_action_email_content filter run on two different strings
  • #44669 – Privacy Notification doesn’t clear after dismissing notification_wp_privacy_send_erasure_fulfillment_notification.
  • #46829 – Denote the special pages in Customizer Menu editor
  • #47366 – Privacy Policy page dropdown needs a max-width

#37782 is ready to commit if any committers can provide a final review.

Agenda Item: Privacy Data Request Form

Feature Plugin Proposal – https://make.wordpress.org/core/2019/09/04/feature-plugin-proposal-privacy-data-request-form/

We (@audrasjb & @garrett-eclipse) will be joining a future #meta chat to propose adding the plugin to the Feature plugins list.

Agenda Item: Consent and Logging Mechanism for User Privacy

Feature Plugin Discussion – https://make.wordpress.org/core/2019/08/07/feature-plugin-discussion-a-consent-and-logging-mechanism-for-user-privacy/

@idea15 mentioned there was some great comments on the thread many of which support the idea and proposal.

Next steps were discussed and @williampatton offered to review and start on the momentum for the work required.

@idea15 mentioned it would be nice to have the work ready to roll at least 60 days before the CCPA deadline believed to be on July 1st.

Agenda Item: WP User/Pro Survey

@idea15 flagged some earlier discussions on the survey with several questions put forth regarding user needs for privacy;
https://make.wordpress.org/updates/2019/06/28/updates-to-the-wordpress-user-developer-survey/

We also touched on that in the consent and logging proposal  https://make.wordpress.org/core/2019/08/07/feature-plugin-discussion-a-consent-and-logging-mechanism-for-user-privacy/#comment-36281 

The consensus was that like other teams, we need data on what users and contributors actually need from us – what their concerns are, what their business needs are, what resources they expect from us, what tools they need us to build.

In this week’s post on the survey (above), which links to the full set of questions https://docs.google.com/document/d/171KgbxvNukyuuHwLiY14yhqfbs7X5KBkw6hvbEcQZ9k/edit

There are no questions about user needs there, for us or for any other team.

It feels like all the feedback about what should go on the survey was ignored.

So, this is worrisome that the once-a-year opportunity to gain critical information to support our work is at risk of being lost.

So, let’s all take a day or two to review both posts and the draft script, with a goal to feedback with a team comment on Friday.

@idea15 started a gDoc (https://docs.google.com/document/d/1ZXfT-Mvvfxa-ZjD9cSQG9BKvtTAhXuZb0QS5lK47BGY/edit?usp=sharing) in order to collaborate on some suggested questions for privacy.


#core-privacy, #privacy

Privacy Office Hours Agenda: Wednesday September 25th, 2019

The following is the agenda for the privacy weekly office hours meeting. The meeting is held every Wednesday at 19:00 UTC in the #core-privacy room of the Making WordPress Slack.

  • Announcements / Housekeeping
  • Upcoming Release (5.3) Planning
    Note: We have 7 bugs (5 in Privacy component and 2 in privacy focus) pending for 5.3, they will need to be committed or punted by the Release Candidate scheduled for Oct. 15th, 2019.
    • #37782 – Duplicate Page Entry in View All Pages when generating a Menu
    • #43974 – Both personal data request processes should follow the same convention
    • #44038 – Change personal data export path stored in request meta to relative paths
    • #44314user_confirmed_action_email_content filter run on two different strings
    • #44669 – Privacy Notification doesn’t clear after dismissing notification
    • #46829 – Denote the special pages in Customizer Menu editor
    • #47366 – Privacy Policy page dropdown needs a max-width
  • Feature Plugin Proposal: Privacy Data Request Form
  • Feature Plugin Discussion: Consent and Logging Mechanism for User Privacy
  • Discussion / Open Floor

If you have anything to propose for the agenda or specific items related to those listed above, please leave a comment below.

#core-privacy, #privacy

Summary of Core Privacy Office Hours, Sept. 18th 2019

Below is a summary of the discussion from this week’s Core Privacy chat (agenda, Slack Transcript).

Agenda Item: 5.3 Enhancements

The following tickets were flagged as enhancements for 5.3 privacy component;

  • #43890 – Allow Admin to Skip e-mail confirmation for Export/Anonymization.
  • #44133 – Should the Data Export indicate when we have no information on the user.
  • #44135 – Have Erasure button workflow follow Export button workflow replacing with static link.
  • #44588 – Denote the Copy action is complete by updating the Copy button to state ‘Copied’.
  • #46303 – Update wp_privacy_send_personal_data_export_email to provide the same filters as _wp_privacy_send_erasure_fulfillment_notification.
  • #46895 – Personal Data Export Report: A way to display the group count.

#44133, #44135, #46303 and #46895 are all nearing completion but will need another set of eyes and review/testing before they can be marked commit.

#43890 and #44588 will need some work either a refresh or initial patch.
#43890 needs discussion but @garrett-eclipse is leaning towards the use of checkboxes instead of dropdown.
#44588 has site health example to follow and just needs coding.

@pputzer graciously offered to review some of these tickets.

Agenda Item: Privacy Data Request Form

Feature Plugin Proposal – https://make.wordpress.org/core/2019/09/04/feature-plugin-proposal-privacy-data-request-form/

Not much feedback has been received yet so will let it gestate a little more. Initial feedback is pointing towards plugin territory over a core merge.

@audrasjb indicated it would be nice to test as a featured plugin so will determine how that can be accomplished.

Agenda Item: Consent and Logging Mechanism for User Privacy

Feature Plugin Discussion – https://make.wordpress.org/core/2019/08/07/feature-plugin-discussion-a-consent-and-logging-mechanism-for-user-privacy/

@garrett-eclipse asked if the effort needs to be setup like the WP-Notify #feature-notifications team and meetings.

Neither @idea15 nor @garrett-eclipse have capacity currently to spearhead the effort so decided to collect names of interested parties to create a working group. If anyone is interested in working on the consent/logging mechanism please feel free to comment on this thread or reach out in #core-privacy on Slack.

#privacy

Privacy Office Hours Agenda: Wednesday September 18th, 2019

The following is the agenda for the privacy weekly office hours meeting. The meeting is held every Wednesday at 19:00 UTC in the #core-privacy room of the Making WordPress Slack.

  • Announcements / Housekeeping
  • Upcoming Release (5.3) Discussion & Planning
    Note: We have 6 enhancements pending for 5.3, they will need to be committed or punted by Sept. 23rd, 2019.
    • #43890 – Allow Admin to Skip e-mail confirmation for Export/Anonymization.
    • #44133 – Should the Data Export indicate when we have no information on the user.
    • #44135 – Have Erasure button workflow follow Export button workflow replacing with static link.
    • #44588 – Denote the Copy action is complete by updating the Copy button to state ‘Copied’.
    • #46303 – Update wp_privacy_send_personal_data_export_email to provide the same filters as _wp_privacy_send_erasure_fulfillment_notification.
    • #46895 – Personal Data Export Report: A way to display the group count.
  • Feature Plugin Proposal: Privacy Data Request Form
  • Feature Plugin Discussion: Consent and Logging Mechanism for User Privacy
  • Discussion / Open Floor

If you have anything to propose for the agenda or specific items related to those listed above, please leave a comment below.

#core-privacy, #privacy

Privacy Office Hours Agenda: July 24th, 2019

The following is the agenda for the privacy weekly office hours meeting. The meeting is held every Wednesday at 19:00 UTC in the #core-privacy room of the Making WordPress Slack.

  • Announcements
  • Upcoming Release (5.3) Discussion & Planning
  • New ICO cookie guidance – https://ico.org.uk/for-organisations/guide-to-pecr/guidance-on-the-use-of-cookies-and-similar-technologies/how-do-we-comply-with-the-cookie-rules/
  • Data Request Form feature plugin and direction
  • Open Floor

If you have anything to propose for the agenda or specific items related to those listed above, please leave a comment below.

#privacy, #core-privacy