? ? NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
14 Sep 2019

This plugin uses the cookie consent script from https://cookieconsent.osano.com/ and is a joomla4 version of a plugin I wrote for a non-profit that I support.

Summary of Changes

This plugin implements a cookie consent notification compliant

Why choose Osano Cookie Consent?

  • Free and open source.
  • Super configurable. Choose your own colors, styles, type of compliance, text and more with a few clicks of the mouse.
  • The world’s most popular. Cookie Consent is seen over 2 billion times every month, across millions of websites.

Informational Consent

You tell your users that you use cookies, and that by continuing to use your website they accept them.

localhost_joomla-cms_index php_en_about(renderforest) (2)-thumb localhost_joomla-cms_index php_en_about(renderforest)-thumb localhost_joomla-cms_index php_en_about(renderforest) (1)-thumb

localhost_joomla-cms_index php_en_about(Pixel 2)-thumb

This is the approach used by most websites, and appears to be sufficient in the UK. Other countries may have stricter rules and may warrant a stricter solutions for which other extensions are available.

https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/

It provides your users with no direct control over cookies, other than through their own browser settings.

What does it look like?

There are 4 different positions

  • Top
  • Bottom
  • Floating left
  • Floating right

There are three different layouts

  • Block
  • Classic
  • Edgeless

All colours can be customised in the plugin so you dont need to make any css changes in your template.

  • Banner Colour
  • Banner Text Colour
  • Button Colour
  • Button Text Colour

The text displayed for the message, button and link are customisable in the plugin and translatable with overrides for a multilingual web site

The link is to an article you create to provide more information about cookies on your site. On a multilingual web site this will display the appropriate associated article for that language.

Consent validity

You can set the expiry date for the consent to

  • Never
  • 1 week
  • 1 month
  • 3 months
  • 1 year

Accessibility

Generally speaking this is very good accessible code but it can be improved for multilingual sites and I will submit a pull request upstream for that.

Default settings

The plugin is not enabled by default. A site owner needs to enable it.

Test Instructions

  • This requires a complete "npm i"
  • If its a new install of joomla then just go to the plugins and enable it etc
  • If its an existing install you will need to do "database fix" first and then enable the plugin
  • Once enabled the cookie consent banner will be enabled on the site with default settings
  • Try to test with all the different options
  • If you close the banner you will need to clear your cookies if you want to test further.

Todo

  • Add documentation to the docs.joomla.org site
  • Add post installation message (?)

localhost_joomla-cms_administrator_index php_option=com_plugins view=plugin layout=edit extension_id=207(renderforest)-thumb

d094689 14 Sep 2019 avatar brianteeman typo
ff9b594 14 Sep 2019 avatar brianteeman sql
avatar brianteeman brianteeman - open - 14 Sep 2019
avatar brianteeman brianteeman - change - 14 Sep 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2019
Category SQL Administration com_admin Postgresql Language & Strings Repository Installation Libraries NPM Change Front End Plugins
e27e39b 14 Sep 2019 avatar brianteeman sql
avatar brianteeman brianteeman - change - 14 Sep 2019
Labels Added: ? NPM Resource Changed ? ?
avatar brianteeman
brianteeman - comment - 14 Sep 2019

@SharkyKZ thanks for the review. I will address them all later. Be aware though that almost all the code you commented on is copy paste from other j4 plugins.

avatar infograf768
infograf768 - comment - 14 Sep 2019

Suggest to use same system used for offline message, i.e. possibility to use default (core lang string) or Custom, that last one with the possibility to use a lang constant (i.e. passing through Text::_() )

aae1d6e 14 Sep 2019 avatar brianteeman drone
avatar brianteeman
brianteeman - comment - 14 Sep 2019

possibility to use default (core lang string) or Custom, that last one with the possibility to use a lang constant (i.e. passing through Text::_() )

@infograf768 it does have that already as stated in the first post.

image
image

avatar infograf768
infograf768 - comment - 14 Sep 2019

That is not exactly what i suggested.
I suggested to have the choice between a default string which would exist in core and what you display above. similar to what we have for offline message.
this means 2 fields, not one.

avatar brianteeman
brianteeman - comment - 14 Sep 2019

this means 2 fields, not one.

No thats not a good solution at all and imho should be changed

This is the same solution used for several plugins for a long time so it is consistent behaviour with them.

43df5df 14 Sep 2019 avatar brianteeman xml
ac8a2b4 14 Sep 2019 avatar brianteeman ini
avatar brianteeman brianteeman - change - 14 Sep 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 15 Sep 2019

No thats not a good solution at all and imho should be changed

This is the same solution used for several plugins for a long time so it is consistent behaviour with them.

A few remarks and bugs

How does the user know that he has to create a totally new lang string constant in override as overriding the default

PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT by
creating an override for the default
PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT="This website uses cookies to ensure you get the best experience on our website. If you do not know you can create an override and create it for administrator and site, hard luck for you.\n\nAlso, sorry, but Clicking on 'Learn More' will not work because the administrator of this site have not chosen an article to display."

=> No message display in frontend. Bug imho.
Curiously, it displays fine when editing the plugin:
Screen Shot 2019-09-15 at 10 01 39

Let's say this is corrected: How to know this without very complex explanations?
No tip to explain that. Again something hidden in a doc somewhere?

Other test, article

Keeping the default without override:
If one does not create an article Learn More is still present. Bug.
Create an article for the Learn More:
It displays in the component area instead of a modal. I suggest to modify ths behavior.

Other test: new constant

Creating a new constant for the Message:
PLG_SYSTEM_COOKIECONSENT_MESSAGE_MYTEXT="This website uses cookies to ensure you get the best experience on our website. If you do not know you can create an override and create it for administrator, hard luck for you.\n\nAlso, sorry, but Clicking on 'Learn More' will not work because the administrator of this site have not chosen an article to display."

Screen Shot 2019-09-15 at 09 18 21

Override string
Screen Shot 2019-09-15 at 09 20 54

Result => untranslated string
Screen Shot 2019-09-15 at 09 22 39

Testing further

I added the string in en-GB.ini.
No change. =>bug.

basically, the only way I found to modify the message was to edit the string PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT in the en-GB.plg_system_cookieconsent.ini file or enter a text in the field.

Learn More

This one can be overriden fine
PLG_SYSTEM_COOKIECONSENT_POLICY_TEXT_DEFAULT="Learn more if you need"
works ok if you add in site language overrides.

Hope this helps.

avatar brianteeman
brianteeman - comment - 15 Sep 2019

I will repeat - the code/ui here is the same as for the user/terms plugin, the content/confirmconsent plugin and the user/profile plugin

avatar infograf768
infograf768 - comment - 15 Sep 2019

I will repeat - the code/ui here is the same as for the user/terms plugin, the content/confirmconsent plugin and the user/profile plugin

I have just demonstrated that it is broken for this one.
Just test.

avatar brianteeman
brianteeman - comment - 15 Sep 2019

PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT in the en-GB.plg_system_cookieconsent.ini file or enter a text in the field.

That is the expected behaviour

avatar infograf768
infograf768 - comment - 15 Sep 2019

That is the expected behaviour

I guess you are very confused. Read your own post above:
#26301 (comment)

avatar infograf768
infograf768 - comment - 15 Sep 2019

Found out the culprit for the message override.
The override created value should never contain non-escaped singlequotes or counterslashes.

avatar infograf768
infograf768 - comment - 15 Sep 2019

Or. rather, adding addslashes().
Example in .../plugins/system/cookieconsent/cookieconsent.php
$message = addslashes($this->params->get('message-text', Text::_('PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT')));

will solve the issue.
same for other possible overrides

avatar infograf768
infograf768 - comment - 15 Sep 2019

Which gives (to also take care of the absence of an article):

		// Get the settings from the plugin
		$position         = $this->params->get('position', 'bottom');
		$layout           = $this->params->get('layout', 'block');
		$bannercolour     = $this->params->get('bannercolour', '#000000');
		$buttoncolour     = $this->params->get('buttoncolour', '#ffffff');
		$buttontextcolour = $this->params->get('buttontextcolour', '#383b75');
		$bannertextcolour = $this->params->get('bannertextcolour', '#f1d600');
		$message          = addslashes($this->params->get('message-text', Text::_('PLG_SYSTEM_COOKIECONSENT_MESSAGE_TEXT_DEFAULT')));
		$dismiss          = addslashes($this->params->get('button-text', Text::_('PLG_SYSTEM_COOKIECONSENT_BUTTON_TEXT_DEFAULT')));
		$valid            = $this->params->get('valid', '-1');
		$href             = $this->getAssignedPolicylinkUrl();
		$link             = $href ? addslashes($this->params->get('policylink-text', Text::_('PLG_SYSTEM_COOKIECONSENT_POLICY_TEXT_DEFAULT'))) : '';

avatar infograf768 infograf768 - test_item - 15 Sep 2019 - Tested unsuccessfully
avatar infograf768
infograf768 - comment - 15 Sep 2019

I have tested this item ? unsuccessfully on 222c2ea

Missing addslashes as posted above.

Also, contrary to Terms and Conditions for example,the article is not loaded in a modal.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26301.
avatar unknown-sudo
unknown-sudo - comment - 15 Sep 2019

The Cookie Directive is changing to the effect that the previously used opt-out variant is then no longer permitted. With the opt-out variant, the visitor does not necessarily have to give consent to the use of cookies, but tacit consent was possible.

This is now changing to the effect that consent to the use of cookies is required or, alternatively, the deactivation of cookies should be possible. All this under the premise that the website content should also be made available if the visitor deactivates the use of cookies and if possible directly at the beginning before the actual use of the website.

In addition the possibility to maintain the external tracking scripts is missing here. If you only use Joomla session cookies you don't need the consent anyway.

avatar brianteeman
brianteeman - comment - 16 Sep 2019

The Cookie Directive is changing to the effect that the previously used opt-out variant is then no longer permitted.

I didnt find anything about this change but its not relevant to this pr anyway

In addition the possibility to maintain the external tracking scripts is missing here.

Beyond the scope of this pr as described in the original post and extensions are available for this

If you only use Joomla session cookies you don't need the consent anyway.

Its not just session cookies that joomla sets ;) I personally agree with you that they are cookies that you dont need consent for but it seems that the majority of the uninformed do not agree.

avatar brianteeman brianteeman - change - 16 Sep 2019
The description was changed
avatar brianteeman brianteeman - edited - 16 Sep 2019
avatar HLeithner
HLeithner - comment - 16 Sep 2019

The Cookie Directive is changing to the effect that the previously used opt-out variant is then no longer permitted.

I didnt find anything about this change but its not relevant to this pr anyway

I think he is talking about this german article and the paper (Un)informed Consent: Studying GDPR Consent Notices in the Field it's based on

avatar brianteeman
brianteeman - comment - 16 Sep 2019

Well then that doesn't apply here as it is not about GDPR and I prefer to work with what the law says not what an article says

avatar HLeithner
HLeithner - comment - 16 Sep 2019

Well then that doesn't apply here as it is not about GDPR and I prefer to work with what the law says not what an article says

That's what they do too ;-)

On May 25, 2018, the European Union’s General Data Protection
Regulation (GDPR; Regulation (EU) 2016/679) went into effect. Its
Article 6 contains six legal bases for the processing of personal
data of European residents, including that “the data subject has
given consent to the processing of his or her personal data for one
or more specific purposes”. Recital 32 of the GDPR and guidelines
published by EU data protection authorities [6] require for valid
consent “a clear affirmative act” that is a “freely given, [purpose-
]specific, informed and unambiguous indication of [...] agreement
to the processing of personal data.” Another document clarifies the
relationship between the ePrivacy Directive (2002/58/EC) and the
GDPR for the use of cookies: Article 5(3) of the directive governs
access to non-necessary cookies in the user’s browser, whether it
contains personal data or not, while the GDPR applies to subsequent
processing of personal data retrieved via cookies [15].

And as you mention already in your description:

This is the approach used by most websites, and appears to be sufficient in the UK. Other countries may have stricter rules and may warrant a stricter solutions for which other extensions are available.

I don't think it makes sense to only full fill the requirements to the subset of the countries requiring the cookie policy. Also the ePrivacy directive could be more strict (if it ever comes).

avatar brianteeman
brianteeman - comment - 16 Sep 2019

This is not about GDPR and personal data

avatar blueforce
blueforce - comment - 19 Oct 2019

patch could not be applied for test...
Bildschirmfoto 2019-10-19 um 12 25 17

avatar oschuldt
oschuldt - comment - 19 Oct 2019

some basic thoughts about cookie consent:
actually it is about gdpr according to Recital 78 - privacy by default (https://gdpr-info.eu/recitals/no-78/ ). But foremost it is about the Directive 2002/58/EC - Article 5 3. wich says: within the EU and for EU citizens, an explicit opt-in procedure must be used. However, this applies exclusively to the use of tracking cookies and cookies for advertising purposes.
Session cookies, user cookies or 'remember me' cookies do not need any consent or information.

I'm afraid that this plugin is not necessary in this form, and may even cause damage if someone thinks it is legally compliant.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26301.
avatar oschuldt oschuldt - test_item - 19 Oct 2019 - Tested successfully
avatar oschuldt
oschuldt - comment - 19 Oct 2019

I have tested this item successfully on 55532f0

works but is not sufficient to run a gdpr/ePrivacy compliant Website! (see comment)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26301.

avatar nadjak77 nadjak77 - test_item - 19 Oct 2019 - Tested unsuccessfully
avatar nadjak77
nadjak77 - comment - 19 Oct 2019

I have tested this item ? unsuccessfully on 55532f0

cannot test, npm i error (Cannot find module 'walk-sync')


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26301.

avatar tecpromotion
tecpromotion - comment - 19 Oct 2019

Session cookies, user cookies or 'remember me' cookies do not need any consent or information.

With this information and the hint that you may treat tracking and further analysis cookies separately and may not set cookies without consent, the question arises whether this should really be a core plugin.
However, the "Cookie Consent by Osano" script can do even more. It offers the possibilities of consent and rejection. But also not without adjustments by the user and then it again becomes very complicated for the normal user. But there are already many extensions in JED that do this partly based on the "Osano" solution or even go further than required today.

avatar brianteeman brianteeman - change - 28 Oct 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-10-28 18:02:06
Closed_By brianteeman
avatar brianteeman brianteeman - close - 28 Oct 2019

Add a Comment

Login with GitHub to post a comment