Skip to content

Add privacy policy module#1238

Open
mmaymo wants to merge 1 commit into
dev/developfrom
PIWOO-880-add-plugin-privacy-policy-text-github-1189
Open

Add privacy policy module#1238
mmaymo wants to merge 1 commit into
dev/developfrom
PIWOO-880-add-plugin-privacy-policy-text-github-1189

Conversation

@mmaymo

@mmaymo mmaymo commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

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 PrivacyModule class in src/Privacy/PrivacyModule.php implements ExecutableModule. Its run() method
hooks into admin_init and calls registerPrivacyPolicyContent(), which passes the plugin name 'Mollie Payments for WooCommerce' and the prescribed policy text to wp_add_privacy_policy_content(). The call is
guarded by function_exists() so that on WordPress installations older than 4.9.6 (where the function does not
exist) the method returns silently and the plugin continues to operate normally. PrivacyModule is registered
in inc/modules.php alongside all other plugin modules.

What to verify in review

Covered by unit tests

  • wp_add_privacy_policy_content is called exactly once with 'Mollie Payments for WooCommerce' as the first
    argument and a non-empty string as the second
  • ✓ The second argument contains an <a> tag whose href is https://www.mollie.com/legal/privacy and whose
    anchor text is here
  • ✓ When wp_add_privacy_policy_content is not yet defined in PHP (simulating WP < 4.9.6), calling
    registerPrivacyPolicyContent() throws no exception

Not covered by unit tests

  • ✗ The policy text string is wrapped in a translatable __() call using text domain
    mollie-payments-for-woocommerce — verifiable only by reading the source
  • PrivacyModule is registered in inc/modules.php and its run() method is invoked during bootstrap —
    requires full plugin bootstrap (integration level)
  • ✗ The WordPress Privacy Policy edit screen lists a 'Mollie Payments for WooCommerce' suggestion section —
    observable only through the browser (e2e)

@mmaymo mmaymo requested a review from danielhuesken June 23, 2026 09:28

@danielhuesken danielhuesken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants