Choc Chip EU Cookie WordPress Plugin

July 12, 2012

I AM THE LAW!! OK, so contrary to Judge Dredd’s self belief, I am not the law. In fact, I know bugger all about the law, other than -

  • you shouldn’t nick stuff.
  • If you run through an old peoples home wearing nothing but a papier mache vikings helmet, there are certain figures of authority who will ‘want a word’.

The other tiny thing I know is,  a law was passed last year (though it didnt really come into effect until this year) stating that websites must warn visitors if there are cookies lurking. Known as the ‘EU Cookie Directive’, its a ridiculous law but don’t get me started because we’ll be here all day and it will inevitably end up with me upsetting someone and heading towards the nearest octogenarian’s residence in an unconvincing, home-made hat.

What’s it all about?

The EU cookie directive may not be the most welcome law but, as Voltaire said ‘in order to be free we must all be slaves to the law’. I’m not sure how true that is either, but in any case it has caused me to sit down and write this WordPress plugin to make abiding by the rules that bit easier.

What does this Choc Chip thing do?

It gives your visitors the option to opt in to any third party applications such as Google Analytics or Ad Sense and doesnt show it until. The Choc Chip Cookie Plugin then leaves a cookie of its own to remember them next time. The cookie willl expire after one year. There are a few options with this little badger to help you comply with the EU cookie directive and also pimp it up to suit your website.

Choc Chip Cookie EU Cookie Plugin Widget

This plugin comes with an opt-in widget for your sidebar. Anything added to the Choc Chip EU Cookie Plugin widget is opt in. So if you insert your Adsense code here it will only show if the visitor has accepted cookies. Cool uh?!

Options

Button Bar Text

Edit the warning text as shown on the button bar. Try something like ‘Hey you, you are browsing my website so you are having cookies’. OK maybe not qute that but something similar.

Cookie Information Page

Create a page that contains your cookie information such as what cookies are and what you use them for. Select your cookie information page from the list and this will link to the ‘More info’ button on the button bar.

Opt in header code

Third party applications such as Google Analytics leave a cookie in order to be able to track your visitors. The EU Cookie Directive wants you to warn people of this and even have them ‘opt in’ so you shouldnt track them unless they agree to it. Any text/code that you enter in the ‘opt in header code’ field will only be activated once the ‘allow’ button has been clicked. Any text/code in this field will be placed just above the </head> tag.

Comment Form Warning

WordPress leaves a cookie when a comment is left (to save the form information so it doesnt have to be filled in next time) so give your visitors a warning and let them whats going down. Try something like ‘By leaving a comment you are agreeing to have a new friend in the same shape as a cookie popped onto your hard drive’.

Appearance

Bar Position

Select the position for your button bar

Background Colour

Change the background of your button bar by entering the name of the colour or if youre a smarty pants you can enter a hex value.

Text Colour

Change the main text colour on the button bar by entering the name of the colour, now try to be sensible as ‘off white’ aint gonna cut the mustard sonny Jim.

Accept Button Text Colour

Have a guess what this does? Thats right it changes the accept button text colour. Pop your favourite colour in the box.

Accept Button Background Colour

Make that button stand out with a smashing background colour.

Accept Button Border Colour

Thats right you can even change the colour of the border of the button. Your visitors will be sad to see it disappear when they click the button.

More Info Button Text Colour

We’ve moved on to the next button so make this one just as important as the last one as it points to important information

More Info Button Background Colour

Make it shine man, make it shine

More Info Button Border Colour

Come on this is the last colour change so make it count

Now dont forget to press save after you make any changes.

Disclaimer

I am not a lawyer nor am I, nor have I ever been a policeman so my knowledge of the law is pretty limited. And to top it all off I once got into trouble for stealing sweets from my local shop, my mum was not happy and I got grounded for quite some time. But I’ve grown both mentally and physically since then. Anyway I digress, if you get into trouble for not abiding by the EU cookie law even after using this plugin, I accept no responsibility. You are welcome to use this plugin but it comes with no guarantees as to its compliance of the law. If you are in any doubt you should seek real legal advice.

Download the WordPress Plugin

If you are happy with all the above nonsense then give this little gem a try – DOWNLOAD

Download the Super Duper Choc Chip EU Cookie Plugin from the WordPress Repository

If you have something to say about this plugin then please do leave me a comment, hey who knows we could be friends. Right?!

Other than that just fill your timeline with my jibber jabber on Twitter. Follow @senoir

 

Tags: , , , , 3 Comments

3 Responses to “Choc Chip EU Cookie WordPress Plugin”

  1. Ant says:

    Hi mate, having some trouble with the cookie plugin, it works great aside from the accept button, which does nothing. Could you take a look at http://www.makejusticework.org.uk? I guess it needs the jQuery noconflict sandbox.

  2. Cor says:

    Hi there! Thank you for your nice plugin. Simple but very useful.

    I would like to ask for one small addition: the possibility to change the text on the buttons (e.g. via admin panel) or by internationalization.

    For now I changed some lines in the code of the plugin, but that is not the neatest way…

  3. Anton says:

    Hi!

    I just love your plugin and it is only that I found that elegantly solved my problems with cookies.
    That being said, I was trying to “upgrade” your plugin so it would position itself just between and . But I’m really new on plugin development for wp and I failed. I was trying to “merge” your plugin and Custom Headers and Footers plugin.
    I don’t want you now to rewrite or upgrade your plugin, just maybe a hint where should I look to be more sucesfull :D

    Thanks again.

Leave a Reply

Security Code: