Genero CMP WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA #5 in Privacy & Compliance
CMP Plugin
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/generoi/genero-cmp/releases/download/v2.2.3/genero-cmp.zipOn Packagist as generoi/genero-cmp:
composer require generoi/genero-cmpCMP Plugin
Features
- YouTube block use
youtube-noockie.comdomain instead - YouTube and Google Maps iframes require marketing and statistics consent before shown.
- Event Tracking for Gravity Forms container code is removed.
- Gravity Forms Analytics analytics tag is removed.
- CTX Feed pixel is removed.
- WP Consent API integration (required for GDPR compliant WooCommerce).
- TikTok for Business pixel is removed until marketing consent has been given
- Facebook for WooCommerce pixel gets
fbq('consent', 'revoke');when initialized
Block consent settings (beta)
Blocks in the block editor are extended with an option to either hide/show based on one or multiple consents.
Note this is likely broken in some cases at the moment.
PHP API
Define necessary cookies
When withdrawing consent, all non-necessary cookies are removed. You can edit this set of cookies.
add_filter('gds_cmp_necessary_cookies', function (array $cookies) {
$cookies[] = CartServiceProvider::CART_COUNT_COOKIE;
$cookies[] = CartServiceProvider::LOGGED_IN_COOKIE;
return $cookies;
});
Alter consent categories
You can add or remove custom consent categories.
add_filter('gds_cmp_consents', function (array $consents) {
$consents[] = new \GeneroWP\GeneroCmp\Models\Consent(
id: 'custom-consent',
label: __('Custom Consent'),
description: __('Custom consent'),
wpConsentApiCategory: 'marketing',
gtmConsentModes: ['ad_storage', 'ad_user_data', 'ad_personalization'],
);
return $consents;
});
Block additional iframe embeds
By default iframes in the_content referencing youtube.com get blocked using <gds-cmp-consent consent="marketing">. You can extend this to other iframe matches or all of them.
add_filter('gds_cmp_embed_consents', function (array $consents, string $tag) {
// Block all iframes by default
if (! $consents) {
$consents[] = 'preferences';
}
return $consents;
}, 10, 2);
JavaScript API
/**
* @param {HTMLElement} modal Reference to the <gds-cmp-modal-dialog> element
* @returns {void}
*/
window.gdsCmp.modal
/**
* Show the consent dialog
*
* @returns {void}
*/
window.gdsCmp.show()
/**
* Hide the consent dialog
*
* @returns {void}
*/
window.gdsCmp.hide()
/**
* Withdraw current consent.
*
* @returns {void}
*/
window.gdsCmp.withdraw()
/**
* Return if user has granted the passed consents.
*
* @param {...Consent} consents Consent name eg. 'necessary`, `preferences`, `marketing`, `statistics`.
* @returns {boolean} if user has granted all the consents
*/
window.gdsCmp.hasConsent(...consents)
/**
* Evaluate and initialize all script tags using data-cmp-consent="" string
*
* @param {Node} context
* @returns void
*/
window.gdsCmp.evaluateTags(context = document)
Events
window.addEventListener('gds-cmp.consent', () => {
if (window.gdsCmp.hasConsent('marketing')) {
// ....
}
});
window.addEventListener('gds-cmp.consent.marketing', () => {
// ...
});
Utilities
Hide content using CSS
<div data-gds-cmp-consent-optin="necessary marketing">
Show when consent is given for necessary and marketing cookies.
</div>
<div data-gds-cmp-consent-optout="necessary marketing">
Hide when consent is given for necessary and marketing cookies.
</div>
Control cookie consent dialog
Add .js-gds-cmp-show class to any element (needs to be in DOM before DOMDocumentReady).
<a class="js-gds-cmp-show">Change consent</a>
Add [data-gds-cmp-trigger="show|hide|withdraw"] selector to any element (delegates as a document click listener)
<button data-gds-cmp-trigger="show">Change consent</button>
- Run manually with
window.gdsCmp.show() - Run
show()on the<gds-cmp-modal-dialog>element
Block elements from being loaded using [data-gds-cmp-consent] attribute
You can add data-gds-cmp-consent="marketing preferences" to an element and once consent has been given, the element will evaluate.
Supported elements are `
Releases
13 releases. Each count is every asset in that release; expand a row for the breakdown.