项目作者: doky-fr

项目描述 :
Can I Use Cookies ? WordPress plugin
高级语言: PHP
项目地址: git://github.com/doky-fr/can-i-use-cookies.git
创建时间: 2020-10-10T20:14:08Z
项目社区:https://github.com/doky-fr/can-i-use-cookies

开源协议:GNU General Public License v3.0

下载


Can I Use Cookies ? WordPress plugin

WordPress Plugin Version
WordPress Plugin Required PHP Version
WordPress Plugin: Required WP Version
WordPress Plugin: Tested WP Version

Can I Use Cookies ?

WordPress plugin that does one thing but does it right:

Ask the user for his consent about cookies and tracking.

Available on the WordPress Plugins Repository

Features

  • Display a popup on every page and ask the user for his consent about tracking
  • “Approve” and “Deny” button: compliant with GDPR and CCPA
  • Customisable texts and image on the popup
  • Customisable style of the popup using CSS
  • Available in 2 languages: English and French
  • No branding, no ad on the admin panel. Just a new menu in the settings.

How it works ?

The plugin will add a new menu under your settings, where you can set up the various texts and images used by the popup.
Then, a popup will appear on every public pages, asking the user for his consent about cookies and tracking, presenting
him with 2 choices:

  • Approve: Set a cookie cookie-consent=yes valid for 6 months
  • Deny: Set a cookie cookie-consent=no valid for 6 months

It’s then up to you, and your analytics solution, to check for the cookie-consent value and handle it according to the
user’s wishes.

How to customize the popup style ?

A default style is applied to the popup, with the strict minimum (the layout of the popup). The popup will inherit the
text style, button style and colors from your theme.

However, you can use CSS to customize the popup layout and style
(by enqueuing a stylesheet in your functions.php file, add additional CSS in your theme’s options, or whatever
technique to add CSS to your page).

For reference, here is the popup HTML code. You can use the main container id (#can-i-use-cookies)
to scope your CSS rules.

  1. <div id="can-i-use-cookies">
  2. <div class="container">
  3. <div class="subcontainer">
  4. <img class="image" src="...">
  5. <div class="text-container">
  6. <p class="title">...</p>
  7. <p class="description">...</p>
  8. </div>
  9. </div>
  10. <div class="button-bar">
  11. <button id="can-i-use-cookies-yes" class="button">...</button>
  12. <button id="can-i-use-cookies-no" class="button">...</button>
  13. </div>
  14. </div>
  15. </div>

Screenshots

Check other screenshots in the assets/ folder.

Screenshot 1
Screenshot 2

Developers

This plugin is build using node and webpack to produce an optimized JS code. Once built, the plugin is available under
the build/ directory.

To publish a new version of the plugin to WordPress’s SVN repo, follow
these example steps.

Requirements

  • Node & yarn
  • WP-CLI (for generation of translation files)
  • gettext (for build of binary translation files)

How to use

  • Install dependencies
  1. yarn run install
  • Build the plugin
  1. yarn run build
  • Test locally the plugin using docker-compose (available at localhost:8080)
  1. yarn run test

License

WordPress requires that all plugins should be under a GPLv2+ compliant license.

This code is distributed under the GPLv3 or later license.