Add privacy policy module#1238
Open
mmaymo wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The Mollie Payments for WooCommerce plugin collects and transmits personal data (customer details, payment
information) to Mollie on every transaction, but had no mechanism to inform site administrators of this.
WordPress requires plugins that handle personal data to register suggested privacy policy text via
wp_add_privacy_policy_content()so administrators can include it in their site's privacy policy. Without this,sites using the plugin were non-compliant with the WordPress Plugin Handbook's privacy requirements, and shop
admins had no plugin-supplied text to insert when building their privacy policy.
How it works now
A new
PrivacyModuleclass insrc/Privacy/PrivacyModule.phpimplementsExecutableModule. Itsrun()methodhooks into
admin_initand callsregisterPrivacyPolicyContent(), which passes the plugin name'Mollie Payments for WooCommerce'and the prescribed policy text towp_add_privacy_policy_content(). The call isguarded by
function_exists()so that on WordPress installations older than 4.9.6 (where the function does notexist) the method returns silently and the plugin continues to operate normally.
PrivacyModuleis registeredin
inc/modules.phpalongside all other plugin modules.What to verify in review
Covered by unit tests
wp_add_privacy_policy_contentis called exactly once with'Mollie Payments for WooCommerce'as the firstargument and a non-empty string as the second
<a>tag whosehrefishttps://www.mollie.com/legal/privacyand whoseanchor text is
herewp_add_privacy_policy_contentis not yet defined in PHP (simulating WP < 4.9.6), callingregisterPrivacyPolicyContent()throws no exceptionNot covered by unit tests
__()call using text domainmollie-payments-for-woocommerce— verifiable only by reading the sourcePrivacyModuleis registered ininc/modules.phpand itsrun()method is invoked during bootstrap —requires full plugin bootstrap (integration level)
'Mollie Payments for WooCommerce'suggestion section —observable only through the browser (e2e)