WP Manifestindependent plugin directory
manifest / privacy / youtube-cookieyes-wp

CookieYes & YouTube

Manage YouTube embeds based on CookieYes consent

by Thomas McMahon · github.com/twistermc/youtube-cookieyes-wp · website

0stars
0forks

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/twistermc/youtube-cookieyes-wp/archive/refs/heads/main.zip

Readme

CookieYes & YouTube Consent Manager

A WordPress plugin that manages YouTube video embeds based on CookieYes cookie consent settings. The plugin shows an overlay on YouTube videos when required cookie consents are not granted and allows users to easily update their consent preferences.

Currently only works with Elementor videos.

Features

  • Integrates with CookieYes cookie consent management
  • Blocks YouTube video loading until required consents are granted
  • Shows a user-friendly overlay with consent information
  • Supports both standard YouTube embeds and Elementor video widgets
  • Automatically detects CookieYes consent changes
  • Responsive design that works on all devices

Requirements

  • WordPress 5.0 or higher
  • CookieYes Cookie Consent Plugin
  • Active cookie categories for:
    • Functional
    • Advertisement
  • Elementor

Installation

  1. Upload the plugin files to the /wp-content/plugins/cookieyes-youtube directory
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Ensure CookieYes is installed and configured with Functional and Advertisement cookie categories

Usage

The plugin works automatically with:

  • Standard YouTube embeds using the youtube-video class
  • Elementor YouTube video widgets

No additional configuration is required. Once activated, the plugin will:

  1. Check for required cookie consents (Functional and Advertisement)
  2. Show an overlay on YouTube videos if either consent is missing
  3. Allow users to update their consent preferences by clicking the overlay
  4. Automatically show videos once all required consents are granted

Customization

CSS Classes

The plugin provides the following CSS classes for styling:

.youtube-video          /* Container for YouTube videos */
.youtube-consent-overlay /* Overlay shown when consent is needed */

You can customize the appearance by adding CSS rules to your theme.

Hooks

The plugin provides WordPress hooks for developers:

// Actions
do_action('cookieYes.youtube.consentGranted');  // Fired when consent is granted
do_action('cookieYes.youtube.consentDenied');   // Fired when consent is denied

// Events
'cookieyes_youtube_consent_granted'  // Custom event when consent is granted
'cookieyes_youtube_consent_denied'   // Custom event when consent is denied

Security

  • Implements WordPress nonces for AJAX requests
  • Uses Content Security Policy (CSP) headers
  • Sanitizes all input and output
  • Includes integrity checks for JavaScript files

License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

Support

Found a bug? Please create an issue in the GitHub repository.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Translations

The plugin comes with the following translations:

  • English (default)
  • Spanish (es_ES)

To add a new translation:

  1. Copy languages/cookieyes-youtube.pot to languages/cookieyes-youtube-{locale}.po
  2. Edit the PO file with a translation editor like Poedit
  3. Generate the MO file
  4. Submit a pull request with both PO and MO files

Current translatable strings:

  • Overlay message for required cookies
  • Update preferences button text

Read the full README on GitHub →