Coder Social home page Coder Social logo

pressidium / pressidium-cookie-consent Goto Github PK

View Code? Open in Web Editor NEW
38.0 8.0 2.0 6.66 MB

šŸŖ Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.

Home Page: https://wordpress.org/plugins/pressidium-cookie-consent/

License: GNU General Public License v2.0

JavaScript 54.06% PHP 34.78% SCSS 0.32% CSS 4.35% Smarty 6.49%
ccpa cookie-consent cookie-consent-banner cookies gdpr wordpress wordpress-plugin

pressidium-cookie-consent's People

Contributors

mohammad425 avatar over-engineer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

0x07h gianniszach

pressidium-cookie-consent's Issues

Region-specific settings - Opt-in/opt-out consent and/or hide cookie consent banner

One potential feature to consider is switching between ā€œopt-in consentā€ and ā€œopt-out consentā€, or even hiding the cookie consent banner altogether, depending on the userā€™s location.

  • Opt-in consent requires users to actively and explicitly agree to data collection and processing
  • Opt-out consent wouldnā€™t require users to provide explicit consent before their data is collected and processed

This would require a way to detect usersā€™ locations (e.g. EU, US, US-CA, UK, etc.) and adapt the pluginā€™s behavior based on that location.

(Related conversation on the WordPress.org support forum)

A suggestion, a query and... a bug?

Hello Konstantinos
Let's go with the three issues :)

The suggestion...
Using the plugin I have seen that it does not have options for the hover color of the primary and secondary button texts. In some cases this can generate accessibility problems due to the low contrast between the background colors and texts of the hover states of these buttons.

The query...
I can't block local cookies (such as _lscache_vary and others), neither with the script URL, nor with Regex.
Could you provide me with an example, beyond those provided in the screenshots?
I have tried replicating the Regular Expressions, literally, and I have generated my own (with and without https, with and without www) such as ^https://www.formaciongrafica.net.* but the plugins do not block, nor are they deleted when changing the cookie options in the plugin.

A bug?
When I clear the LiteSpeed cache, while editing the Pressidium options, on several occasions the Pressidium plugin is misconfigured and does not correct itself even if I force it to update.

I hope I have not been too extensive or have made an off-topic query.

Thanks again.
Placido.

PS: I attach screenshots describing each case sequentially

Pressidium Screenshots.zip

Empty blocked script breaks other scripts

Hello,

In Blocked Scripts section, if we add a row then save the form without filling a script name, it breaks the frontend because some scripts can't be loaded anymore.

A solution would be to add a required attribute on the input, or to automatically erase empty rows upon saving.

Plans to update to 3.0.0?

Stable version 3.0.0 was just released. I love how your plugin simplifies the process of adding this great, free library to Wordpress, so I'd love to see you continue with it. At the same time I understand that version 3.0.0 is quite different as stated in the release and I guess this would more or less a rewrite of this plugin. So I just wanted to check what are your plans for the future before I decide whether I stay with this plugin or go the different paid plugin road. Thank you for your great work so far and hope to hear from you about this šŸ™‚

Vendor conflicts with Sword/Bedrock

Hello,

I tried this plugin with Sword which is WordPress run inside Symfony, using a centralized Composer. It works similar to Bedrock so I guess the problem is the same using Bedrock.

The plugin has a conflict with ContainerInterface:

Fatal error: Uncaught Error: Compile Error: Declaration of League\Container\Container::has($id) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool

This is because my Psr\Container is set to ^2.0 and this plugin needs ^1.0.

Ideally this plugin should prefix all vendor namespaces using something like https://github.com/typisttech/imposter-plugin in order to avoid conflicts with any other plugin or core app.

Is this something that can be considered?

Missing "Reject all" button

The user should be able to reject all cookies without opening the preferences/settings modal.
Either/both with a close button/icon and/or 3rd button in the button group.

A quick suggestion would be to add a "Reject all" to the Secondary Button option array.
image

Edit: Actually disregard the suggestion. I guess the "Accept necessary" option technically counts as a "No thanks" button. I just noticed that CookieConsent v3 has 3 buttons that makes options more clear for the user.
image

Potential conflict with LiteSpeed cache

Initially reported by @formaciongrafica in #43.

When I clear the LiteSpeed cache, while editing the Pressidium options, on several occasions the Pressidium plugin is misconfigured and does not correct itself even if I force it to update.

The possible bug leads to all previous plugin configurations being lost.

There might be some sort of conflict with the LightSpeed Cache plugin.

Database error on plugin reactivation

Initially reported by @mohammad425 on #33:

when reactivating the plugin, a SQL error occurred due to the attempt to redefine a primary key. The error was specifically caused by the ALTER TABLE statement trying to change the primary key of the "pressidium_cookie_consents" table, which already existed in the database.

We have to check if the pressidium_cookie_consents table exists before attempting to (re)create it.

Cookie category descriptions as textareas

On wp-admin ā†’ Cookie Consent ā†’ Translations, we can set the description of each cookie category (i.e. Necessary, Analytics, Targeting, and Preferences).

Currently, thereā€™s a text field (<input type="text">) to set these descriptions. That could be improved by replacing those text fields with textareas (<textarea>), so users can easily write longer descriptions.

(originally suggested by @nikodemsky on the WordPress.org support forum)

Export/Import/Reset Settings

Itā€™d be quite convenient to have the ability to export, import, and reset the settings of the plugin.

This feature would be particularly useful if you need to apply the same settings across multiple WordPress installations.

Weā€™ll introduce three new buttons in the UI:

  • ā€œExport Settingsā€ button, which exports the settings to a JSON file.

  • ā€œImport Settingsā€ button, which imports the settings from the JSON file.

  • ā€œReset Settingsā€ button, which completely deletes the pressidium_cookie_consent_settings option from the WordPress database.


A few key points to keep in mind:

  • Both importing and resetting should immediately update the UI to reflect any changes.

  • If there are unsaved changes, clicking on ā€œExport Settingsā€ should display a warning indicating that those changes wonā€™t be included in the JSON file.

  • When clicking on ā€œReset Settingsā€ a confirmation should appear, clearly stating that this action is irreversible.

How to translate: <html lang="de-CH"? Polylang Support?

Hi! I find your plugin really promising, however, I do have some issues with language support. I would like to make it compatible with Polylang (https://wordpress.org/plugins/polylang/). I have created a language "Swiss German", that is "de-CH" for locale. Language code is: "de".

Unfortunately, it seems that your plugin expects <html lang="de" when it's actually "de_CH", the locale. At least that's what WordPress outputs inside the HTML tag. There are many "flavours" of German, and even if I set the proper German in WordPress, it will be "de_DE" not "de" that WP outputs in HTML.

Anyway, if I go to "Translations" and create "German" and use "document - Read value from of current page" it is not working. It's not showing any translation whether I switch to "de_CH" or "de_DE".

I've just done a test with a simple code like for Afrikaans that has "locale" and "code" both "af" and the translation showed up, so could you please make your plugin compatible to language codes like "xx_XX" not just "xx". Thank you!

Andy

Regex presets to block scripts

One potential feature to consider is to include presets for commonly used regular expressions (for Google Analytics, Google Tag Manager, Facebook Pixel, etc.)

We could also include presets formatted to match a domain (with or without www.), a subdomain, etc.

For example,

Main domain regex:
^(?:https?:)?\/\/(?:www\.)?website\.com

Subdomain regex:
^(?:https?:)?\/\/(?:www\.)?sub\.website\.com

Example:
^(?:https?:)?\/\/(?:www\.)?google-analytics\.com

(originally suggested by @nikodemsky on the WordPress.org support forum)

Log file cannot be created

Due to the inclusion of the logs/ in .distignore, the logs file creation fails for the plugin version on the WordPress Plugin Directory.

Not cookies blocked and not see the problem :(

Good morning and nice start to the week.

I have been trying to use the Pressidium plugin on www.formaciongrafica.net (currently temporarily deactivating it), but in different attempts I made with Vimeo cookies I was never able to block them.

I attach screenshots waiting and the code of the page when testing the script to understand if it is a bug or if I am configuring some parameter incorrectly.

The code and screen captures are in the zip, with descriptive names.

Thank you so much!
Placido Luna

Errors in Pressidium plugin instalation.zip

save button not working properly when i making chnages

Dear Team,

I hope this message finds you well. I'm reaching out to report an issue I'm experiencing with your plugin's functionality.

Upon attempting to enable the "Force Consent" feature and modifying the cookie notice layout settings, I encounter a problem where the changes do not persist after refreshing the page.

Your timely support in resolving this issue is greatly appreciated. I look forward to hearing from you at your earliest convenience.

Thank you for your attention and assistance.

6160c683-3ed8-44eb-9f8c-ffca08411ea8.webm

Google Consent Mode (GCM)

We need to implement Google Consent Mode (GCM) on our plugin.

Consent mode lets you communicate your usersā€™ cookie or app identifier consent status to Google. Tags adjust their behavior and respect usersā€™ choices.

Consent mode receives your usersā€™ consent choices from your cookie banner or widget and dynamically adapts the behavior of Analytics, Ads, and third-party tags that create or read cookies.

Source: https://support.google.com/google-ads/answer/10000067


A few key points to keep in mind:

  • We can integrate with Google tag (gtag.js) by calling gtag('consent', ...) to set the default consent state, which may differ for each region, and update the consent state
    • Consent mode doesnā€™t save consent choices. We should update the consent status as soon as a user interacts with the consent banner. After a user grants consent, we should persist their choice and call the update command accordingly on subsequent pages (refer to Update consent state for more information)
  • For Google Tag Manager (GTM) users, we can create a consent mode template
  • Regions are specified as ISO 3166-2 codes
  • There are two consent modes (refer to About consent mode and Basic versus advanced consent mode for more information)
    • Basic consent mode
      • Prevent Google tags from loading until a user interacts with the consent banner
      • No data are transmitted to Google prior to user interaction with the consent banner
    • Advanced consent mode
      • Google tags load when a user open the website
      • By default, consent will be denied
      • While consent is denied, the Google tags send cookieless pings
      • Only when a user grants consent to data collection, Google tags send the full measurement data
  • Consent mode v2 contains two additional parameters ā€” ad_user_data and ad_personalization (refer to Upgrade to consent mode v2 for more information)
  • These are 7 built-in consent types (refer to Consent state and consent types for more information).
    • ad_storage ā€” Enables storage, such as cookies, related to advertising.
    • ad_user_data ā€” Sets consent for sending user data to Google for online advertising purposes.
    • ad_personalization ā€” Sets consent for personalized advertising.
    • analytics_storage ā€” Enables storage, such as cookies, related to analytics (for example, visit duration).
    • functionality_storage ā€” Enables storage that supports the functionality of the website or app such as language settings.
    • personalization_storage ā€” Enables storage related to personalization such as video recommendations.
    • security_storage ā€” Enables storage related to security such as authentication functionality, fraud prevention, and other user protection
  • Exposing onAccept and/or onChange events/callbacks, via our global pressidiumCookieConsent object, will allow developers to use our plugin to integrate with even more services (refer to the Control programmatically section of our wiki for more information about whatā€™s already available)

Logs tab for debugging

Itā€™d be convenient to introduce a new ā€œLogsā€ tab within the pluginā€™s settings page that will display the contents of log files generated by the plugin. These logs contain valuable debugging information, making it easier for users to identify and troubleshoot issues effectively.

We could also include other useful information, like:

  • Plugin version
  • PHP version
  • WordPress version

A few key points to keep in mind:

  • Ensure that the logs displayed on the ā€œLogsā€ tab are updated whenever the user navigates to it
  • Implement a periodic update mechanism, refreshing the logs at regular intervals (e.g. every 3 seconds)
  • Include a ā€œCopy to clipboardā€ button, allowing users to easily share the logs when reporting an issue

Fallback translation and reset English translations

Hello,

Two features suggestions:

  1. It seems that the fallback translation is the one on top. If the website is not English, we need to delete English, create the fallback translation, then if we want English for English browsers we need to recreate it, and it's then empty. A nice feature would be to have a radio input giving us the choice of the fallback translation, not necessarily the first one.

  2. As the previous example, the English translation is recreated empty. The original English translations can be restored when resetting all settings, but it would also be nice to be able to restore it without restoring other settings, in case we mess things up. Actually the best would be to have these English defaults for any added translation, so the modal doesn't appear blank if none is filled.

Critical error

Error:
Fatal error: Uncaught TypeError: Pressidium\WP\CookieConsent\Admin\Settings\Settings_Page::admin_footer_info(): Argument #1 ($content) must be of type string, null given, called in /var/www/vhosts/httpdocs/wordpress/wp-includes/class-wp-hook.php on line 308 and defined in /var/www/vhosts/httpdocs/wordpress/wp-content/plugins/pressidium-cookie-consent/includes/Admin/Settings/Settings_Page.php:183 Stack trace: #0 /var/www/vhosts/httpdocs/wordpress/wp-includes/class-wp-hook.php(308): Pressidium\WP\CookieConsent\Admin\Settings\Settings_Page->admin_footer_info(NULL) #1 /var/www/vhosts/httpdocs/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array) #2 /var/www/vhosts/httpdocs/wordpress/wp-admin/admin-footer.php(48): apply_filters('admin_footer_te...', '<span id="foote...') #3 /var/www/vhosts/httpdocs/wordpress/wp-admin/admin.php(297): require_once('/var/www/vhosts...') #4 {main} thrown in /var/www/vhosts/httpdocs/wordpress/wp-content/plugins/pressidium-cookie-consent/includes/Admin/Settings/Settings_Page.php on line 183

Plugin Version: 1.0.3
WordPress Version: 6.2.2
Server architecture: Linux 4.19.0-21-amd64 x86_64
Web server: Apache
PHP version: 8.2.7 (Supports 64bit values)

Translations

Dears. I found your plugin and it is great, simple and yet powerful.
I noticed one bug. On Translate Cookie table headers translations are not saved properly and shows as undefined.

Also it would be great to have a modal window for change settings after confirming consent.
Something like this
Untitled-1

Here is my database record
a:17:{s:7:"autorun";b:1;s:13:"force_consent";b:0;s:17:"autoclear_cookies";b:0;s:12:"page_scripts";b:0;s:14:"hide_from_bots";b:1;s:9:"reconsent";b:1;s:5:"delay";i:0;s:17:"cookie_expiration";i:182;s:11:"cookie_path";s:1:"/";s:13:"cookie_domain";s:16:"test7.partner.si";s:13:"auto_language";s:7:"browser";s:11:"cookie_name";s:25:"pressidium_cookie_consent";s:9:"languages";a:2:{s:2:"en";a:2:{s:13:"consent_modal";a:4:{s:5:"title";s:14:"Cookie Consent";s:11:"description";s:219:"Hi, we use cookies to ensure the website's proper operation, to analyze traffic and performance, and to provide social media features. Cookie Settings";s:11:"primary_btn";a:2:{s:4:"text";s:10:"Accept all";s:4:"role";s:10:"accept_all";}s:13:"secondary_btn";a:2:{s:4:"text";s:16:"Accept necessary";s:4:"role";s:16:"accept_necessary";}}s:14:"settings_modal";a:7:{s:5:"title";s:18:"Cookie preferences";s:17:"save_settings_btn";s:13:"Save settings";s:14:"accept_all_btn";s:10:"Accept all";s:14:"reject_all_btn";s:10:"Reject all";s:15:"close_btn_label";s:5:"Close";s:20:"cookie_table_headers";a:5:{i:0;a:1:{s:4:"name";s:4:"Name";}i:1;a:1:{s:6:"domain";s:6:"Domain";}i:2;a:1:{s:10:"expiration";s:10:"Expiration";}i:3;a:1:{s:4:"path";s:4:"Path";}i:4;a:1:{s:11:"description";s:11:"Description";}}s:6:"blocks";a:5:{i:0;a:2:{s:5:"title";s:22:"Cookie usage šŸ“¢";s:11:"description";s:339:"We use cookies to ensure the website's proper operation, to analyze traffic and performance, and to provide social media features. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.";}i:1;a:4:{s:5:"title";s:26:"Strictly necessary cookies";s:11:"description";s:212:"These cookies are necessary for the website to function and cannot be switched off in our systems. You can set your browser to block or alert you about these cookies, but some parts of the site may not then work.";s:6:"toggle";a:3:{s:5:"value";s:9:"necessary";s:7:"enabled";b:1;s:8:"readonly";b:1;}s:12:"cookie_table";a:0:{}}i:2;a:4:{s:5:"title";s:33:"Performance and Analytics cookies";s:11:"description";s:226:"These cookies allow us to analyze visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site.";s:6:"toggle";a:3:{s:5:"value";s:9:"analytics";s:7:"enabled";b:0;s:8:"readonly";b:0;}s:12:"cookie_table";a:0:{}}i:3;a:4:{s:5:"title";s:35:"Advertisement and Targeting cookies";s:11:"description";s:344:"These cookies may be set through our site by our social media providers and/or our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device.";s:6:"toggle";a:3:{s:5:"value";s:9:"targeting";s:7:"enabled";b:0;s:8:"readonly";b:0;}s:12:"cookie_table";a:0:{}}i:4;a:2:{s:5:"title";s:16:"More information";s:11:"description";s:89:"For any queries in relation to our policy on cookies and your choices, please contact us.";}}}}s:2:"sl";a:2:{s:13:"consent_modal";a:4:{s:5:"title";s:21:"Nastavitve zasebnosti";s:11:"description";s:168:"Spletno mesto uporablja piÅ”kotke za zagotavljanje najboljÅ”e uporabniÅ”ke izkuÅ”nje. Upravljaj nastavitve";s:11:"primary_btn";a:2:{s:4:"text";s:10:"Dovoli vse";s:4:"role";s:10:"accept_all";}s:13:"secondary_btn";a:2:{s:4:"text";s:10:"Zavrni vse";s:4:"role";s:16:"accept_necessary";}}s:14:"settings_modal";a:7:{s:5:"title";s:21:"Nastavitve piÅ”kotkov";s:17:"save_settings_btn";s:17:"Shrani nastavitve";s:14:"accept_all_btn";s:10:"Dovoli vse";s:14:"reject_all_btn";s:10:"Zavrni vse";s:15:"close_btn_label";s:5:"Zapri";s:20:"cookie_table_headers";a:12:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}i:4;a:0:{}i:5;a:0:{}i:6;a:0:{}i:7;a:1:{s:4:"name";s:0:"";}i:8;a:1:{s:6:"domain";s:0:"";}i:9;a:1:{s:10:"expiration";s:0:"";}i:10;a:1:{s:4:"path";s:0:"";}i:11;a:1:{s:11:"description";s:0:"";}}s:6:"blocks";a:5:{i:0;a:2:{s:5:"title";s:18:"Uporaba piÅ”kotkov";s:11:"description";s:392:"PiÅ”kotki so majhne besedilne datoteke, ki se namestijo na uporabnikov brskalnik ob obisku spletnega mesta. Uporabljajo se za zagotavljanje osnovnih funkcionalnosti spletnega mesta in za izboljÅ”anje vaÅ”e spletne izkuÅ”nje. Za več podrobnosti v zvezi s piÅ”kotki in drugimi občutljivimi podatki preberite politiko zasebnosti.";}i:1;a:4:{s:5:"title";s:16:"Nujni piÅ”kotki ";s:11:"description";s:139:"Nujni piÅ”kotki omogočajo osnovne funkcije in so bistveni za pravilno delovanje spletnega mesta. Nujnih piÅ”kotkov ni mogoče izključiti.";s:6:"toggle";a:3:{s:5:"value";s:9:"necessary";s:7:"enabled";b:1;s:8:"readonly";b:1;}s:12:"cookie_table";a:0:{}}i:2;a:4:{s:5:"title";s:21:"Analitični piÅ”kotki";s:11:"description";s:152:"Analitični piÅ”kotki anonimno beležijo informacije o uporabi spletnega mesta in na podlagi teh informacij pomagajo izboljÅ”ati uporabniÅ”ko izkuÅ”njo.";s:6:"toggle";a:3:{s:5:"value";s:9:"analytics";s:7:"enabled";b:0;s:8:"readonly";b:0;}s:12:"cookie_table";a:0:{}}i:3;a:4:{s:5:"title";s:23:"OglaÅ”evalski piÅ”kotki";s:11:"description";s:183:"OglaÅ”evalski piÅ”kotki anonimno beležijo podatke o vaÅ”ih obiskih spletnih strani, s pomočjo katerih vam oglaÅ”evalci prikazujejo oglase, ki so ustreznejÅ”i in zanimivejÅ”i za vas.";s:6:"toggle";a:3:{s:5:"value";s:9:"targeting";s:7:"enabled";b:0;s:8:"readonly";b:0;}s:12:"cookie_table";a:0:{}}i:4;a:2:{s:5:"title";s:19:"Dodatne informacije";s:11:"description";s:27:"Poglejte politko zasebnosti";}}}}}s:11:"gui_options";a:2:{s:13:"consent_modal";a:4:{s:6:"layout";s:3:"box";s:8:"position";s:12:"bottom right";s:10:"transition";s:5:"slide";s:12:"swap_buttons";b:0;}s:14:"settings_modal";a:3:{s:6:"layout";s:3:"box";s:8:"position";s:4:"left";s:10:"transition";s:5:"slide";}}s:18:"pressidium_options";a:5:{s:16:"primary_btn_role";s:10:"accept_all";s:18:"secondary_btn_role";s:16:"accept_necessary";s:12:"cookie_table";a:3:{s:9:"necessary";a:1:{i:0;a:6:{s:4:"name";s:13:"PH_HPXY_CHECK";s:6:"domain";s:16:"test7.aprtner.si";s:10:"expiration";s:7:"Session";s:4:"path";s:0:"";s:11:"description";s:12:"Nujni kookie";s:8:"is_regex";b:0;}}s:9:"analytics";a:0:{}s:9:"targeting";a:0:{}}s:15:"blocked_scripts";a:1:{i:0;a:3:{s:3:"src";s:0:"";s:8:"category";s:9:"analytics";s:8:"is_regex";b:0;}}s:6:"colors";a:21:{s:2:"bg";s:7:"#f9faff";s:4:"text";s:7:"#112954";s:14:"btn-primary-bg";s:7:"#3859d0";s:16:"btn-primary-text";s:7:"#f9faff";s:20:"btn-primary-hover-bg";s:7:"#1d2e38";s:16:"btn-secondary-bg";s:7:"#dfe7f9";s:18:"btn-secondary-text";s:7:"#112954";s:22:"btn-secondary-hover-bg";s:7:"#c6d1ea";s:13:"toggle-bg-off";s:7:"#8fa8d6";s:12:"toggle-bg-on";s:7:"#3859d0";s:18:"toggle-bg-readonly";s:7:"#cbd8f1";s:14:"toggle-knob-bg";s:4:"#fff";s:22:"toggle-knob-icon-color";s:7:"#ecf2fa";s:24:"cookie-category-block-bg";s:7:"#ebeff9";s:30:"cookie-category-block-bg-hover";s:7:"#dbe5f9";s:14:"section-border";s:7:"#f1f3f5";s:10:"block-text";s:7:"#112954";s:19:"cookie-table-border";s:7:"#e1e7f3";s:10:"overlay-bg";s:24:"rgba(230, 235, 255, .85)";s:19:"webkit-scrollbar-bg";s:7:"#ebeff9";s:25:"webkit-scrollbar-bg-hover";s:7:"#3859d0";}}s:8:"revision";i:2;s:7:"version";s:5:"1.1.2";}

Thanks for answer, Gregor

Option to hide console.log messages

A nice feature would be to have a "Debug mode" option in the plugin that will show the console.log messages, and hide them all if the option is off. I think there shouldn't be any message in production mode.

Update preferences

If a user wants to change the preferences chosen, how can he do it?
In other words, the user enters the site, and accepts all cookies, then has second thoughts, and wants to accept only the necessary cookies, what can he do?

Store emoji in a database using utf8

When WordPress is installed on a database using the utf8mb4 character set, everything works correctly.

However, issues arise when WordPress is installed on a database using the utf8 charset and an emoji character is present in any text field on the pluginā€™s settings page.

MySQLā€™s utf8 charset (an alias of utf8mb3) stores up to three bytes per character, while utf8mb4 can store up to 4 bytes characters as well. We need that fourth byte to support storing emoji characters.

To prevent the plugin from breaking when used on a database using the utf8 charset, we need to convert any emoji characters into their equivalent HTML entities and store them in the database instead.

Prevent ā€œClear Recordsā€ misclicks

Ensure that users wonā€™t accidentally clear their consent records by misclicking the ā€œClear Recordsā€ button.

We could move it a bit so itā€™s not too close to the ā€œExport to CSVā€ button ā€” just to be safe.

(originally suggested by @nikodemsky on the WordPress.org support forum)

Language detection / document - polish language

It's regarding thing i have mentioned in forums:
https://wordpress.org/support/topic/language-detection-5/

It detects en-GB, de-DE properly, if checked from dropdown - but the issue is that for example polish language does not have any other options like those above and is not detected - probably, because translation plugins like WPML and Polylang(just checked on both) is using "pl-PL" and not only "pl"(like the value from option in dropdown) and core Wordpress itself too btw.

Changing <html lang> is not always possibile and by semantics not really recommended.

Here you can check full list of locales codes:
https://gist.github.com/danielbachhuber/14af08c5faac07d5c0c182eb66b19b3e

or here, more officially:
https://translate.wordpress.org/

Also by those you can see that wordpress itself is not really using "en" as locale code anywhere, so it might be good idea to switch to "en-GB" for default locale.

Hope it's doable!

Critical error on activate plugin

When installing and activating plugin there is critical error notice.
Installation was on fresh instance of wordpress (version 6.2.2.), with no plugins installed.

Installing with zip file.

Error Details

An error of type E_COMPILE_ERROR was caused in line 53 of the file /home/devpabnu/public_html/test/wp-content/plugins/pressidium-cookie-consent-master/pressidium-cookie-consent.php. Error message: require_once(): Failed opening required '/home/devpabnu/public_html/test/wp-content/plugins/pressidium-cookie-consent-master/vendor/autoload.php' (include_path='.:/opt/alt/php74/usr/share/pear')

Request feedback on plugin deactivation

Currently, we lack insights into why users deactivate our plugin. To address that, we could display a modal that asks for feedback when users choose to deactivate the plugin.

By gathering user feedback, we can better understand the reasons behind deactivation and use these insights to improve the plugin through bug fixes and future enhancements.

Weā€™ll introduce a modal containing the following components:

  • A list of reasons for deactivation with the following options:
    • I no longer need the plugin
    • I found a better plugin
    • Itā€™s missing a feature I need
    • I couldnā€™t get the plugin to work
    • Itā€™s a temporary deactivation
    • Other
  • A textarea for users to provide additional comments
  • Two buttons:
    • "Send feedback & deactivate" - When clicked, weā€™ll send the feedback along with the plugin version, PHP version, and WordPress version to our API, then proceed with deactivating the plugin
    • "Skip & deactivate" - When clicked, weā€™ll immediately deactivate the plugin without sending any data to our API

A few key points to keep in mind:

  • To maintain the pluginā€™s lightweight nature, avoid including any third-party libraries for the modal. Utilize native browser elements and/or Web APIs or features built into WordPress (for example, the <dialog> element, caniuse ref).

  • Ensure that giving feedback is entirely optional for users. They should always have the choice to skip the feedback part and proceed with the deactivation directly.

  • Only collect the essential information required for feedback purposes. That includes the selected reason for deactivation, any comments provided by the user, as well as the plugin version, PHP version, and WordPress version. Do not collect any other data related to the userā€™s website to respect their privacy. When a user chooses to skip the feedback part, do not send data to our API altogether.

  • If there are any issues with sending feedback to our API, such as networking problems or the API being down, do not hinder the deactivation process. Instead, gracefully handle any errors without displaying error messages to the user or preventing them from deactivating the plugin. The deactivation process should remain smooth and uninterrupted, regardless of any data transmission issues that may arise.

Test issue ā€” please ignore

Sed tempus nulla sit amet erat ullamcorper, at auctor velit mollis. Praesent bibendum viverra varius. Sed sed est id mi cursus egestas. Donec ac ipsum turpis. Vestibulum vel aliquet leo, consequat aliquet ligula. Nullam ac sodales metus, ac maximus felis. Nulla hendrerit elit ac sem dignissim, sit amet commodo libero congue. Nam quis nibh in erat tristique placerat eu sit amet odio. Donec maximus eros sed nulla posuere, eget pretium orci rutrum. Quisque dapibus at est bibendum imperdiet. Maecenas nibh nisi, porta id varius sed, ultricies sit amet orci. Nunc ut pellentesque massa. Vivamus dolor ligula, commodo in diam ac, auctor vestibulum diam. Aenean maximus ac ante a viverra. Integer et augue pharetra orci blandit auctor. Pellentesque posuere quis quam et pretium.

Praesent porta libero eros, in egestas tortor mattis ac. Quisque iaculis turpis nec semper tincidunt. Maecenas ac enim nec sem interdum lacinia. Nam malesuada urna in elit mattis, vel fermentum est cursus. Curabitur condimentum rhoncus convallis. Maecenas egestas pretium facilisis. In vel tortor nec leo lacinia sollicitudin a vitae purus. Vestibulum feugiat eget odio nec maximus. Donec tristique lectus vel ex mollis, sed viverra nisi fringilla. Vestibulum eget nisi eget odio placerat aliquet. In placerat eget risus nec sodales. Maecenas a hendrerit nisl. Mauris malesuada augue at facilisis sagittis. Phasellus vulputate, dui et tincidunt efficitur, tortor elit tincidunt arcu, a aliquam lacus risus non ipsum.

Don't print cookie blocking script if there are no scripts to block

Hello!

I am manually managing script blocking via setting parameters type="text/plain" and data-cookiecategory="analytics" on analytics script tags. However, I noticed that the script pressidium-cookie-consent/public/block-scripts.js is still placed in the document head. Since this is a render-blocking script I'm a bit worried that it might have an effect on page loading performance.

I do understand that it needs to be a blocking script rather than an async one so it can manage other scripts on the page but I'm not sure if it needs to be loaded if there are no blocked scripts defined in the plugin admin page. Would it be possible to only place this script in the page head if there are blocked scripts defined?

Thanks!

Enhancement: Proof of Consent Log

Hi!

From the official GDPR site (https://gdpr.eu/cookies/) on "Cookie Compliance":

"To comply with the regulations governing cookies under the GDPR and the ePrivacy Directive you must:
...
Document and store consent received from users."

You have already implemented a debug log. Do you have plans do add a consent log in the future? I've heard of problems by at least one site owner who couldn't properly prove that a user gave cookie consent. According to the GDPR website this is a requirement by the existing ePrivacy Directive (most likely its successor ePrivacy Regulation - EPR - as well).

I really like your plugin so far!

Link to reopen the banner after acceptance

Hello, and many thanks for your work.

The cookie banner disappears after we accept or refuse, and there is no way to change this setting. To be fully compliant, users need to have the possibility to change their consent settings at any time.

Is there a way to leave an icon when we close the banner so that we can reopen the settings at any time?

Is there a way for users to access the cookie banner settings and change their consent after they have accepted the cookies, perhaps with a direct link?

The Italian Authority also requests the possibility to close the banner with an "X". Clicking on the "X" means rejecting all cookies (except necessary ones). Is it possible to add this feature for users?

Can you help me? These features would be very useful for full compliance.
Many thanks.

Manage iframes

Expanding on #37, we should implement a mechanism to control iframes.

A few use cases where third-party iframes may set cookies include embedded:

  • YouTube videos
  • Vimeo videos
  • Twitch streams
  • Google Maps
  • ā€¦

A few key points to keep in mind:

  • All iframes should be completely removed initially
  • Users of the plugin should be able to set a (translatable) notice relative to that service (e.g. a different notice should be displayed for YouTube and Vimeo)
  • Iframes should be loaded only after the site visitor has given consent
  • Since weā€™re already using the Cookie Consent JS library by Orest Bida, we should consider using their iframemanager JS library (docs on integrating IframeManager with CookieConsent)

(cc: @formaciongrafica)

Message about not saving changes

Great plugin but I noticed a problem.

Changes save correctly, but when exiting the plugin page, the message "Leave page? Your changes may not be saved."

WP 6.3, PHP 7.4

Set text color when a button is hovered

Initially suggested by @formaciongrafica in #43.

Using the plugin I have seen that it does not have options for the hover color of the primary and secondary button texts. In some cases this can generate accessibility problems due to the low contrast between the background colors and texts of the hover states of these buttons.

The contrast problem is in order to comply with the GDPR, offering designs on both buttons so that they do not induce the user to choose one option over another.

We should add options to set a different color for the text when the primary/secondary buttons are hovered.

Create a new category

How to create a new category? And why can't a cookie be added to the "necessary" category?

Translate cookie descriptions and expiration dates

On wp-admin ā†’ Cookie Consent ā†’ Cookies, you can list cookies by providing their name, domain, expiration, path, description, and whether they are regex.

One potential feature to consider is being able to translate cookie descriptions and expiration dates.

(originally suggested by @nikodemsky on the WordPress.org support forum)

List necessary cookies

Expanding on #13, we should add the ability to list Necessary cookies as well, under the ā€œCookiesā€ tab.

As mentioned in #13, even though deleting necessary cookies is not a thing (since those cookies are essential for the proper functioning of the website and they do not require the explicit consent of a user), we still have to be able to list them to inform users about them.


A few key points to keep in mind:

This change may conflict with existing settings stored in the database for users who have installed versions older than 1.1.2 (the version thatā€™s going to address this issue)

Weā€™ll need to introduce a ā€œmigrationā€ process when there are already settings stored in the database.

The migration should run both when:

  • Retrieving settings from the database with a version preceding 1.1.2 (plugin has been updated but we havenā€™t saved any settings with the new version)

  • Updating settings to ensure a seamless import of exported settings from older versions of the plugin

(cc: @mohammad425)

Statistics about accepted/denied ratio under Consent Records

On wp-admin ā†’ Cookie Consent ā†’ Consent Records, we list all consent records to provide proof of consent for auditing purposes.

Itā€™d be useful to display some stats about the accepted/denied ratio.

Some things to consider is whether weā€™d need any kind of filtering, like:

  • Percentage per region
  • Percentage per category
  • Filtering a specific date range
  • etc.

Whether weā€™d need:

  • any UI for that (if so, any charts?)
  • to be able to export these stats as a file (CSV?)

(originally suggested by @nikodemsky on the WordPress.org support forum)

dataLayer.push and Google Tag Manager

HI,
Congrats on the plugin! I have a new tip. In order to correctly configure Google Tag Manager with Google Consent Mode v2, your plugin must generate triggers through a dataLayer.push({event:xxx}. For example: pressodium_necessary_consentgiven, pressodium_adv_consentgiven, pressodium_stats_consentgiven, pressodium_history_change. Through these triggers , I can start tags, for example, I can create the "Facebook Pixel" tag and give "pressidium_adv_consentgiven" as a trigger. Your plugin cannot be used by Google Tag Manager :(
Screenshot 2024-05-13 alle 21 26 02

Can't update secondary button text

Hey! Thanks for this great plugin. It's exactly what I was looking for.

However, I noticed that there's an issue where the secondary button text cannot be changed. The secondary button overwrites the primary button text when text is entered in the field.

It looks like there is a typo in this file:

...state.languages[action.payload.language].consent_modal.primary_btn,

So it should be relatively easy to fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.