pressidium / pressidium-cookie-consent

🍪 Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.
https://wordpress.org/plugins/pressidium-cookie-consent/
GNU General Public License v2.0
48 stars 2 forks source link

Hide a cookie category if it’s empty #55

Closed over-engineer closed 2 months ago

over-engineer commented 6 months ago

When a cookie category doesn’t contain any cookies, it shouldn’t be displayed in the settings modal.

Not all websites set cookies of every cookie category.

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

skrypt-nl commented 6 months ago

+1 on this

Just a thought that crossed my mind when inspecting the code: this might give issues with the new GCM mode, as the consent parameters depend on the categories in the getConsentStatesByCategories() function. If those categories are hidden because there are no cookies, and thus cannot be accepted, the consent can never be granted for those parameters. I am not sure if this is an issue, though.

over-engineer commented 2 months ago

This was addressed in 1.5.0, which was just released on the WordPress Plugin Directory.

A new option, Hide empty categories, is available in the “General” tab.

To enable it:

  1. Go to wp-admin
  2. Click on “Cookie Consent”
  3. Navigate to the “General” tab
  4. Under “Configuration,” switch “Hide empty categories” on

I’m closing this issue as resolved.


If those categories are hidden because there are no cookies, and thus cannot be accepted, the consent can never be granted for those parameters. I am not sure if this is an issue, though.

@skrypt-nl This shouldn’t be a problem since a category must have no cookies to be hidden. So, I believe that lack of consent for that category won’t affect anything. If you later add cookies to that category and the “Re-consent” option is enabled, users will be prompted to re-consent. If there’s anything I overlooked, please let me know.