WordPress / WordPress/performance

Allow Embed Optimizer to work in Classic block and with Classic Editor

Open
#2,226 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Plugin] Embed Optimizer [Type] Enhancement ContributorDay
Dominant language
PHP
Stars
461
Forks
165
Avg merge
11h 12m
Merged PRs (30d)
28

Description

Embed Optimizer includes this line in the description:

https://github.com/WordPress/performance/blob/191e853e6e8c99874596e8866d808fa00a337647/plugins/embed-optimizer/readme.txt#L32

I recall this was done because only Embed blocks have a FIGURE wrapper which we can use to consistently use with the intersection observer. And it's for the sake of being able to use the plugin with Optimization Detective, so the tag visitor can locate embeds via the FIGURE and child DIV with the expected classes:

https://github.com/WordPress/performance/blob/191e853e6e8c99874596e8866d808fa00a337647/plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php#L32-L62

For sites using embeds in Classic blocks with or without Optimization Detective, I think we could possibly support them by explicitly filtering the embeds to inject the FIGURE > DIV wrappers.

See also: support forum topic

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with plugins/embed-optimizer/readme.txt and plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php, especially the documented FIGURE and child DIV structure. Trace how embeds are filtered and determine how Classic blocks and the Classic Editor should receive those wrappers; done means supported Classic embeds work with and without Optimization Detective.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.