[wp-trac] [WordPress Trac] #52768: WordPress post URL oEmbed rendering blocked by iframe lazy-loading
WordPress Trac
noreply at wordpress.org
Fri Apr 2 18:02:29 UTC 2021
#52768: WordPress post URL oEmbed rendering blocked by iframe lazy-loading
-------------------------------------------------+-------------------------
Reporter: SirStuey | Owner:
| peterwilsoncc
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 5.7.1
Component: Embeds | Version: 5.7
Severity: normal | Resolution:
Keywords: needs-testing has-patch has-unit- | Focuses:
tests | performance
-------------------------------------------------+-------------------------
Comment (by SirStuey):
@joyously - the link ''is'' shown first, in the fallback blockquote.
Why are the iframes hidden by default? I am guessing that it's because the
fallback loads by default. The fallback link is displayed and then
replaced by the iframe. Hiding the iframe ensures you get one or the
other, and not both.
Let's say that a WordPress URL is embedded in a post. That referenced link
might change in time, either with a new URL, or it might be removed
entirely. I've observed that, given the current way the embed is handled,
the fallback URL will be displayed in blockquotes. If the target URL has
changed or is removed, the iframe does not redirect, the fallback is
displayed.
When that fallback link is displayed, the iframe is hidden. If that iframe
is able to load with content from the embed source, it loads visibly and
the fallback is hidden.
If there's nothing in that iframe, what's there to load? If the iframe
isn't to be hidden by default, then that fallback might be redundant and
you can have unpredictable display behavior.
If the URL has changed and is properly redirected, clicking the blockquote
link will still get you to the proper destination.
There could be other reasons the fallback behavior was created.
The question is this - can this WP embed hidden iframe behavior be
reworked or removed, while still ensuring proper fallback link display
when needed, and while keeping in mind any security concerns due to WP
embeds coming in from potentially anywhere? How long would this take, and
who might it involve, compared to the fix that the iframe lazy loading
developer already came up with?
The proposed fix should perfectly remedy things for the time being.
With that update in place, the embed behavior can then be potentially
reworked in a way that allows for iframe lazy loading. But, that's also a
much bigger task since the developers will have to think about existing
and future iframes. It also cannot be a theme-based css fix.
There are 3 main approaches to fixing this bug.
1) Revert the iframe lazy loading that was implemented in 5.7
2) Update the 5.7 update to exclude Wordpress URL embed iframes from lazy
loading
3) Rework Wordpress URL embeds
Option 2) is the fastest remedy for this issue, and it should not affect
iframes unrelated to this issue, such as YouTube embeds.
Option 3) should be the next step if lazy loading Wordpress URL embeds is
still a priority. This would have also have to take into account both
future and existing embeds.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52768#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list