CookieFence
Installs the CookieFence consent banner script.
by CookieFence · github.com/cookiefence/cookiefence-wordpress-plugin · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/cookiefence/cookiefence-wordpress-plugin/archive/refs/heads/main.zipReadme
CookieFence WordPress Plugin
Install the CookieFence consent banner on a WordPress site with one setting: the CookieFence site UUID copied from the CookieFence admin UI.
Installation
- Download
cookiefence-0.1.2.zip. - In WordPress, go to
Plugins > Add Plugin > Upload Plugin. - Upload the ZIP and activate CookieFence.
- Go to
Settings > CookieFence. - Paste the site UUID from CookieFence and save changes.
GitHub Releases are the preferred long-term distribution channel, but the installable ZIP is tracked in this repository for the initial public download.
When configured, the plugin adds these tags to public pages as early in wp_head as WordPress allows:
<link rel="preconnect" href="https://api.cookiefence.com" crossorigin>
<script id="CookieFence" src="https://api.cookiefence.com/tags/{uuid}.js"></script>
To use a different CookieFence host for local, staging, or other environments, define COOKIEFENCE_TAG_BASE_URL in wp-config.php before WordPress loads plugins:
define( 'COOKIEFENCE_TAG_BASE_URL', 'http://localhost:3001' );
With that override, the plugin outputs:
<link rel="preconnect" href="http://localhost:3001" crossorigin>
<script id="CookieFence" src="http://localhost:3001/tags/{uuid}.js"></script>
Development
Run a syntax check before releasing:
php -l cookiefence.php
Build an uploadable plugin ZIP:
rm -rf dist
mkdir -p dist/cookiefence releases
cp cookiefence.php readme.txt LICENSE dist/cookiefence/
(cd dist && zip -r ../releases/cookiefence-0.1.2.zip cookiefence -x "*.DS_Store")
unzip -l releases/cookiefence-0.1.2.zip
License
GPL-2.0-or-later.