Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firstandthird/wp-gdpr-consent
GDPR consent bar for wordpress
https://github.com/firstandthird/wp-gdpr-consent
Last synced: 14 days ago
JSON representation
GDPR consent bar for wordpress
- Host: GitHub
- URL: https://github.com/firstandthird/wp-gdpr-consent
- Owner: firstandthird
- License: gpl-2.0
- Created: 2018-12-12T23:15:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T12:12:25.000Z (about 2 years ago)
- Last Synced: 2024-04-08T15:13:20.935Z (10 months ago)
- Language: PHP
- Size: 1.47 MB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## 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
```shell
git subtree add --prefix plugins/wp-gdpr-consent https://github.com/firstandthird/wp-gdpr-consent 2.0.0 --squash
```Submodule
```shell
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:
```php
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.
```javascript
if (window.gdprSafeTrack) {
window.gdprSafeTrack(function() {
// place your script here
});
}
```You can also use `window.gdprSafeTrack` to load scripts once consent has been granted:
```html
window.gdprSafeTrack('https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-x');
```
### 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`