WP Manifestindependent plugin directory
manifest / privacy / meom-cookiebot-embed

MEOM Cookiebot embed WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Replace embeds with notice if videos are blocked by Cookiebot.

★ 0stars
1.1.1latest · 2 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/meom/meom-cookiebot-embed/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

When using Cookiebot, for example Youtube videos might be blocked by Cookiebot

This plugin adds placeholder text and link to Cookiebot settings where user can accept marketing cookies.

Please accept marketing-cookies to watch this video.

After accepting marketing cookies, video will show up.

Installation

Note that composer package install this plugin as must-use plugin in mu-plugins folder.

Use Composer to install the package.

composer require meom/meom-cookiebot-embed

Or if living on the edge:

composer require meom/meom-cookiebot-embed:dev-main

Styles

This plugin doesn't output any styles. Example styles for your theme styles:

.wp-block-embed__cookiebot-message {
    aspect-ratio: 16 / 9;
    background-color: #f2f2f2;
    display: grid;
    padding: 1rem;
    place-items: center;
    text-align: center;
}

Filters

By default this plugin adds Cookiebot placeholder text only for Video embed block.

This condition can be changed with meom_cookiebot_embed_condition filter.

Code example for adding placeholder text for Youtube and Vimeo videos:

/**
 * Change condition when to show Cookiebot message.
 *
 * @param string $condition     Condition.
 * @param string $block_content The block content about to be appended.
 * @param array  $block         The full block, including name and attributes.
 */
function my_prefix_cookiebot_embed_condition( $condition, $block_content, $block ) {
    $condition = 'core/embed' === $block['blockName'] && ( 'youtube' === $block['attrs']['providerNameSlug'] || 'vimeo' === $block['attrs']['providerNameSlug'] );

    return $condition;
}
add_filter( 'meom_cookiebot_embed_condition', 'my_prefix_cookiebot_embed_condition', 10, 3 );

Default placeholder text is Oops! This video will not be shown because you have disabled the marketing cookies. To see the video, <a href="%s">accept marketing cookies</a>.. Code example for changing that message:


/**
 * Filters the placeholder text added to the embed block.
 *
 * @param string $text Placeholder text.
 */
function my_prefix_cookiebot_placeholder_text( $text ) {
    $text = __( 'Oops! This embed will not be shown because you have disabled the marketing cookies. To see the embed, <a href="%s">accept marketing cookies</a>.', 'kala' );
    return $text;
}
add_filter( 'meom_cookiebot_placeholder_text', 'my_prefix_cookiebot_placeholder_text' );
``

Releases

3 releases.

Tag
Published
1.1.1 latest
May 21, 2024 2 years ago
Mar 30, 2023 3 years ago
Jan 18, 2023 3 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

MEOM Cookiebot embed 1.1.1 · audited by WP Registry

No security issues found.

Audited release
1.1.1
Findings
none
Worst severity
—
Content hash
611ad1863d4ee4f2e45e393e…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.