Coder Social home page Coder Social logo

ministryofjustice / cookie-compliance-for-wordpress Goto Github PK

View Code? Open in Web Editor NEW
12.0 6.0 3.0 2.44 MB

WP plugin that displays a cookie consent banner and opt-in setting page.

License: MIT License

PHP 29.16% JavaScript 46.50% SCSS 24.34%
wp wp-plugin gdpr cookies google moj google-tag-manager

cookie-compliance-for-wordpress's Introduction

Cookie Compliance For WordPress

This WP plugin loads a cookie consent banner at the bottom of the page and provides a visitor with a settings modal, allowing a visitor to turn cookie settings on/off and read cookie disclaimers.

Features

  • Users have the ability to consent to the cookies from Google Tag Manager.
  • Create interactive consent screens (utilises the allowlist feature of GTM)

Issues

Raise issues via https://github.com/ministryofjustice/cookie-compliance-for-wordpress/issues

Installation

Download this repository, unzip and copy the folder into your Wordpress plugin file directory.

Prerequisites

  • A working version of Wordpress to run this plugin and be running on PHP 7+.
  • You will need the following code snipped placed after the body tag in your theme.
if ( ! function_exists( 'wp_body_open' ) ) {
    /**
     * Open the body tag, pull in any hooked triggers.
     **/
    function wp_body_open() {
        do_action( 'wp_body_open' );
    }
}
wp_body_open();

Coding guidelines

This plugin follows:

Developer notes

Assets (such as CSS and JS) are compiled in this plugin using Webpack.

Get started

Compiling assets

In the root directory run:

  1. npm install. This installs all the compiling dependencies. While /node_modules/ is generated in this process, it is not tracked or commit to Git.

  2. For compiling assets while you work run, npm run watch. This starts Webpack watching your src file changes and compiling them on the fly as you edit. See further Webpack commands and configuration in package.json.

Add new functionality

This plugin uses OOP PHP and Namespaces (PSR-4 Autoloader).

If functionality is javascript based, this plugin uses the JavaScript Object Literal pattern to encapsulate functions into modules. Edit the JS file in the src folder and that will get compiled into the dist folder.

Automated linting and PHP code sniffing

We have a Git Action setup that lints, sniffs and then commits the linted PHP code in this plugin when code gets pushed to the repo.

cookie-compliance-for-wordpress's People

Contributors

bnewing avatar brown-a2 avatar earthlingdavey avatar malcolmvonmoj avatar roblowemoj avatar tblacker7 avatar wilson1000 avatar wilson1000-moj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cookie-compliance-for-wordpress's Issues

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

A branch protection setting is not enabled: administrators require review

Hi there
The default branch protection setting called administrators require review is not enabled for this repository
See repository settings/Branches/Branch protection rules
Either add a new Branch protection rule or edit the existing branch protection rule and select the Require a pull request before merging option
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

A branch protection setting is not enabled: Include administrators

Hi there
The default branch protection setting called Include administrators is not enabled for this repository
See repository settings/Branches/Branch protection rules
Either add a new Branch protection rule or edit the existing branch protection rule and select the Include administrators option
This will enable the branch protection rules to admin uses as well
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

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.