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

Embed Twitter block doesn't work, returns error "Sorry, you are not allowed to make proxied oEmbed requests." #51119

Open
Melatti opened this issue May 31, 2023 · 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

@Melatti
Copy link

Melatti commented May 31, 2023

Description

Running a fresh new Wordpress 6.2.2 install on a just created DigitalOcean Wordpress App, I can't embed any Twitter post. No plugins, default theme, no proxies, no changes at all.

I'm the administrator and the only user registered, so I do have edit_posts capability.

When I paste some URL gives me: Sorry, this content could not be embedded.

Opening /index.php?rest_route=%2Foembed%2F1.0%2Fproxy&url=https%3A%2F%2Ftwitter.com%2Foutcontextfelca%2Fstatus%2F1663685978366541826&_locale=user (can be any twitter post URL) in new browser window I can see:

{"code":"rest_forbidden","message":"Sorry, you are not allowed to make proxied oEmbed requests.","data":{"status":401}}

And just to be sure, I've re-installed Wordpress version 6.2.2, no changes.

Tested on Chrome and Firefox.

I would really appreciate if you have any solutions.

Step-by-step reproduction instructions

  1. Paste any Twitter post URL in the content edit page.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@Mamaduka Mamaduka added Needs Testing Needs further testing to be confirmed. [Block] Embed Affects the Embed Block labels May 31, 2023
@aurooba
Copy link
Member

aurooba commented Jun 2, 2023

Hi @Melatti, you're right that if you visit /index.php?rest_route=%2Foembed%2F1.0%2Fproxy&url=https%3A%2F%2Ftwitter.com%2Foutcontextfelca%2Fstatus%2F1663685978366541826&_locale=user you'll see the 401 error, because you're accessing the rest route as an unauthenticated user there.

I tested the exact twitter url you shared https://twitter.com/outcontextfelca/status/1663685978366541826, and was able to embed it in the Block Editor when logged in as an admin.

It's possible that the oEmbed that was cached was damaged. You could try using WP CLI to clear the oEmbed cache by running the following command in the root of your WordPress installation: wp embed cache clear. After that, please try embedding the tweet in a brand new post/page.

@Melatti
Copy link
Author

Melatti commented Jun 2, 2023

Hi @aurooba,

Thank you for the tips, but I'm affraid this is incorrect, how could I be unauthenticated user if I'm inserting a post? And I'm sure I have administrator role.

I've tried again with a brand new installation and used your tip but again, no luck, the problem remains.

I've recorded it, and can be viewed here: https://youtu.be/8oiEgJvUtmg.

After that, just to be sure, I've tried again after deactivating and deleting Fail2ban plugin, nothing changed.

Could you please give more information about your environment?

I've tried with several Wordpress websites and it doesn't work on any of them.

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jul 3, 2023
@Melatti
Copy link
Author

Melatti commented Jul 3, 2023

Yes, it is still relevant.

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jul 4, 2023
@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Jul 19, 2023
@github-actions
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 19, 2023
@jordesign jordesign removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 26, 2023
@mt8
Copy link

mt8 commented Mar 27, 2024

I tested this issue.
I've embedded humanity's first tweet.
https://x.com/jack/status/20?s=20

Interestingly, I got an error in WordPress Playground, but not in WordPress, which I host myself.

スクリーンショット 2024-03-27 20 55 26 スクリーンショット 2024-03-27 20 55 44

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

5 participants