I’m the author of the Category Country Aware WordPress (CCA) plugin. By using the CCA plugin together with a single line edit of Cookie Notice’s code I’m displaying the Cookie bar to EU visitors only.
For those happy modifying code: somewhere around line 665 in cookie-notice.php immediately below
public function cookie_setted() {
insert a new line
if (class_exists('CCAgeoip') && ! apply_filters( 'cca_is_EU',FALSE)) return TRUE;
If you have the CCA plugin installed then your good to go.
I’m not sure if I’ve picked the best place in cookie-notice.php for the check (done in a hurry as I’m away next week) but it works for me.
The filter checks visitor IP and returns true for this list of country codes “BE,BG,CZ,DK,DE,EE,IE,GR,ES,FR,HR,IT,CY,LV,LT,LU,
HU,MT,NL,AT,PL,PT,RO,SI,SK,FI,SE,GB”. You can alternatively use your own list in the filter e.g.
apply_filters('cca_is_EU',TRUE,"YO,UR,LI,ST"))
You can also check for specific countries apply_filters(cca_geoip_lookup,'ccode') == "IT"
e.g. to cater for stricter Italian laws
Issues:
You will have to reinsert this line whenever the Cookie Notice plugin is updated. (I’d be more than happy if dFactory added this filter to the Cookie plugin!).
Don’t do it if you are also using a caching plugin. Caching and geo-location do not usually work properly together. I’m also the author of Country Caching Extensions for Zen Cache and WPSC but even I don’t recommend their use with the above until modified to work efficiently with an EU “group” (another couple of weeks).