Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter/𝕏 Embeds Fail When Using x.com Domain URLs #66980

Open
5 of 6 tasks
rafaucau opened this issue Nov 13, 2024 · 6 comments
Open
5 of 6 tasks

Twitter/𝕏 Embeds Fail When Using x.com Domain URLs #66980

rafaucau opened this issue Nov 13, 2024 · 6 comments
Labels
[Block] Embed Affects the Embed Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@rafaucau
Copy link

rafaucau commented Nov 13, 2024

Description

Twitter post embeds fail when attempting to use URLs from the x.com domain. While WordPress automatically converts x.com URLs to twitter.com, the initial /oembed/1.0/proxy request is made with the x.com domain. A second request is then made with the twitter.com domain, but it appears that the failed response from the x.com attempt remains cached, preventing the embed from working.

Step-by-step reproduction instructions

  1. Open the WordPress post editor
  2. Attempt to embed a post using an x.com URL (e.g, https://x.com/WordPress/status/1856736309605249213)
  3. Observe that the embed fails
  4. Even manually replacing x.com with twitter.com for this specific URL will not work due to caching
  5. Verify that other twitter.com URLs work correctly by embedding a different post (e.g. https://twitter.com/WordPress/status/1856459492046557375)

Screenshots, screen recording, code snippet

2024-11-13.21-41-40.mp4

Image
Image
Image

Environment info

  • WordPress 6.6 / 6.7
  • Chrome 131

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@rafaucau rafaucau added the [Type] Bug An existing feature does not function as intended label Nov 13, 2024
@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. [Block] Embed Affects the Embed Block labels Nov 14, 2024
@im3dabasia
Copy link
Contributor

Hi @rafaucau,

Thank you for pointing this out.

I tried reproducing the issue using WordPress 6.6 and 6.7, following the steps you mentioned. However, I wasn't able to replicate the problem. After pasting the link (https://x.com/WordPress/status/1856736309605249213) into the Embed block, the Twitter embed appeared immediately.

Please let me know if there’s anything I missed or if you're seeing this in a different scenario. I’d be happy to help further!

Thanks again.

Attaching video reference

Screen.Recording.2024-11-14.at.1.05.26.PM.mov

@rafaucau
Copy link
Author

rafaucau commented Nov 14, 2024

Thank you for looking into this.

I can consistently reproduce this issue across multiple independent production WordPress sites and fresh WordPress installations.

Could you please verify if you haven't previously embedded this specific post using a twitter.com URL? If a post was first embedded using twitter.com domain, subsequent embeds of the same post using x.com will work correctly. Could you try embedding several random x.com posts that you haven't embedded before? Also, please try pasting the x.com links into a paragraph block and let them auto-convert to embeds.

@Mayank-Tripathi32
Copy link
Contributor

@rafaucau I can confirm that embeds aren’t working with x.com for me unless I first load it through Twitter. This appears to be an issue specific to x.com rather than WordPress, but it may warrant further investigation.

Screen.Recording.2024-11-15.at.2.26.50.AM.mov

@Takshil-Kunadia
Copy link
Contributor

Takshil-Kunadia commented Nov 15, 2024

It was previously resolved in #54042. This should be available with > Gutenberg 16.8

@jonathanbossenger
Copy link
Contributor

I can replicate this issue, running WordPress 6.7.1 with Gutenberg 19.7.0 installed and active.

It happens a few times if you keep trying, and then eventually works.

https://drive.google.com/file/d/1Tho-2wZZNKUksYyux9LQvU-g9YO9671N/view?usp=sharing

I do wonder though, if this is related to recent updates to Twitter?

@jonathanbossenger
Copy link
Contributor

Reading the comments of #54042 it looks like the WordPress oEmbed endpoint doesn't support x.com URLs. So ideally, this should be fixed upstream in the oEmbed endpoint.

Digging a little further, I see there's an open ticket in tract to fix the oEmbed endpoint but at the moment its on hold until the Twtitter/X URLs are more stable.

I'm going to test that out again today to see if some stability now exists, and I will report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants