Repository navigation
Fix YouTube embeds in plugin descriptions - #26327
Merged
crazytonyli merged 4 commits intoNov 2, 2026
Merged
Conversation
Load plugin information sections with the plugin's WordPress.org page as the base URL. YouTube needs the referrer this provides and otherwise shows Error 153. Also fit iframes to the screen width, keeping their 16:9 shape.
…in-description-youtube-embeds
crazytonyli
enabled auto-merge
November 2, 2026 20:49
crazytonyli
deleted the
bugfix/cmm-2524-plugin-description-youtube-embeds
branch
November 2, 2026 21:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes https://linear.app/a8c/issue/CMM-2524
To reproduce the issue: On a self-hosted site, go to Plugins, open a plugin that has a YouTube video in its description (Page Generator or Elementor), and tap Description. The video shows "Video player configuration error, Error 153", and the player is wider than the screen.
These are two separate problems. The HTML was loaded without a base URL, so the embed sent no HTTP referrer, which YouTube requires. And the stylesheet limits the width of images but not iframes, while WordPress.org embeds are 750x422. Setting only the base URL fixes the error and leaves the player too wide.
The base URL is the plugin's WordPress.org page, because that's where the content comes from. It's the same approach as #25929, which uses
https://wordpress.com/readerfor Reader comments. Google's terms actually ask for the app ID as the referrer domain, and neither value follows that. The videos play, and the terms only mention possible reduced functionality, so I'd look into that separately for all the web views.The iframe rule forces 16:9, because iframes don't get an aspect ratio from their size attributes. All 15 embeds I found across 7 plugins are 750x422, but an embed in another shape would be letterboxed.
Videos play fullscreen on iPhone, which is the web view's default. I didn't change that.
Note
I recommend reviewing this PR commit by commit. The first commit only moves the HTML into a method a test can call, and swift-format re-indents it.
What I ran
WordPressTest/PluginInfoSectionContentTests:Test run with 2 tests in 1 suite passedTesting instructions