Skip to content

Add Vimeo support#10

Open
eebbi wants to merge 1 commit intomasterfrom
vimeo-support
Open

Add Vimeo support#10
eebbi wants to merge 1 commit intomasterfrom
vimeo-support

Conversation

@eebbi
Copy link

@eebbi eebbi commented Nov 14, 2025

Add vimeo embed support

@eebbi eebbi requested a review from Copilot November 14, 2025 11:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Vimeo video embeds with cookie consent handling, similar to the existing YouTube handler. The implementation adds a new Vimeo handler class that intercepts Vimeo embed HTML and wraps it with consent placeholders, requiring marketing consent before displaying the video.

  • Added a new Vimeo handler class with placeholder functionality for cookie consent
  • Registered the Vimeo handler in the plugin initialization
  • Updated changelog to document the new feature

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/Handlers/Vimeo.php New handler class that adds consent placeholders to Vimeo embeds
src/CookiebotPlugin.php Registered the new Vimeo handler in the handlers array
CHANGELOG.md Added entry documenting Vimeo support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return $html;
}

$placeholder = Markup::get_wrapper_start( $this->opt_out_type );
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder variable is initialized with a wrapper start but then immediately overwritten by the switch statement logic. This initial assignment on line 102 serves no purpose and should be removed.

Suggested change
$placeholder = Markup::get_wrapper_start( $this->opt_out_type );

Copilot uses AI. Check for mistakes.
* @param string $html The placeholder HTML string.
*/
$placeholder = \apply_filters( 'cookiebot_helper_vimeo_placeholder_output', $placeholder );
$placeholder = Markup::get_wrapper_start( $this->opt_out_type ) . $placeholder . Markup::get_wrapper_end();
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrapper is being added twice: once on line 102 and again on line 129. This will result in duplicate wrapper elements around the placeholder. Remove the wrapper assignment on line 102 to fix this duplication.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant