GithubHelp home page GithubHelp logo

isabella232 / wp-gdpr-consent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firstandthird/wp-gdpr-consent

0.0 0.0 0.0 1002 KB

GDPR consent bar for wordpress

License: GNU General Public License v2.0

CSS 14.27% JavaScript 36.38% PHP 44.87% Shell 4.48%

wp-gdpr-consent's Introduction

GDPR Consent

A very simple consent bar.

This plugin has already been approved by Wordpress for use in VIP installations.

Installing on VIP GO

Subtree

git subtree add --prefix plugins/wp-gdpr-consent https://github.com/firstandthird/wp-gdpr-consent 2.0.0 --squash

Submodule

git submodule add https://github.com/firstandthird/wp-gdpr-consent.git plugins/wp-gdpr-consent

Add this to client-mu-plugins/plugin-loader.php or similar:

wpcom_vip_load_plugin( 'wp-gdpr-consent' );

Installing on other Wordpress installations

Download the latest release and copy the contents of the zip file to the plugins directory.

Activate the plugin.

First use

Go to Settings » GDPR Consent

Click save to set default text.

Banner should show up on site mainpage.

Wrapping scripts

Some scripts should only be run once consent has been granted. This plugin includes a helper method to queue up scripts.

if (window.gdprSafeTrack) {
  window.gdprSafeTrack(function() {
    // place your script here
  });
}

You can also use window.gdprSafeTrack to load scripts once consent has been granted:

<script>
  window.gdprSafeTrack('https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-x');
</script>

Dev setup

./run

Open browser: http://localhost:8080

Install wordpress.

Activate plugin.

yarn install

yarn dev

Debug

These hashes can be used to help debug:

  • #gdpr-debug - Logs out some useful information including when safe track callbacks are fired
  • #gdpr-debug-clean - Same as above but does not used stored cookie.
  • #gdpr-debug-cookies - Outputs any cookies set after 10 seconds.

Note: clean and cookies may be combined together: gdpr-debug-clean-cookies

Creating plugin zip

./run generate-package

wp-gdpr-consent's People

Contributors

alejandroperezmartin avatar dawnerd avatar jgallen23 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.