Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 797 forks source link

Vimeo: embed reversal fails with some vimeo URL formats #10529

Open jeherve opened 6 years ago

jeherve commented 6 years ago

Steps to reproduce the issue

  1. Make sure Jetpack's Shortcodes module is enabled on your site.
  2. Go to Posts > Add New and create a new post including the 3 following URLs, on separate lines:
    https://vimeo.com/289091934/cd1f466bcc
    https://vimeo.com/album/2838732/video/6342264
    https://vimeo.com/6342264

All 3 URL formats do work and return an embed in the post editor, since they are valid URL formats and Core's oEmbed method handles them. However, on the frontend of your site only the third video will work: the 2 first ones will only return the following error:

<!-- vimeo error: not a vimeo video -->

We would need to update our embed reversal method to support those URLs as well.

kraftbj commented 6 years ago

As mentioned in Slack, if Core handles all of the cases we're currently handling, we probably should just look to not override oEmbed. We can keep any iframe->shortcode or iframe->URL conversions though.

jeherve commented 6 years ago

if Core handles all of the cases we're currently handling, we probably should just look to not override oEmbed.

As far as I can tell they do, and they also handle the cases above.

kraftbj commented 6 years ago

Kicked off a PR for the sake of testing. I would generally trust Core's long-term maintainability of oEmbed's that they support, so want to try first just removing our handler.

stale[bot] commented 5 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

JoshuaGoode commented 4 years ago

Encountered today on a WPCOM Business site with hosting features enabled.

Video shows in editor but you get <!-- vimeo error: not a vimeo video --> on the front-end.

Had to use a different URL such as https://player.vimeo.com/video/xxxxxx and/or the iframe code to resolve.

druesome commented 4 years ago

Another issue on an AT site.

Pasting a Vimeo URL into the block editor would automatically convert into a Vimeo block, but video won't show up on the front end unless the Shortcodes module is turned off. Pasting in the https://player.vimeo.com/video/xxxxxx format works in all cases, though, but has to be placed in an HTML block to show up.

donalirl commented 4 years ago

Just reminding myself to update the support doc if this gets fixed

https://github.com/Automattic/en.support-docs-content/issues/573

druesome commented 4 years ago

Got another case on an AT site. Their private showcase only showed up in the front end when the shortcodes module was turned off.

jamiepalatnik commented 4 years ago

Noticed this on another site today, 24836304-hc

oyadeyiseun commented 4 years ago

Noticed this on another site today, 25275714-HC Vimeo URL: https://vimeo.com/466336705/59eb8d81e3

xpurichan commented 4 years ago

Experienced in 12441064-hc

kaitohm commented 3 years ago

Got another case of this here: 26070978-hc

Replacing the link structure with https://player.vimeo.com/video/xxxxxx worked.

Greatdane commented 3 years ago

Had another case of this here; 31463133-hc Follow up here; 4287210-zd-woothemes

Replacing the link structure with https://player.vimeo.com/video/xxxxxx also worked.

Note, I can consistently replicate this on an Atomic site.

JoshuaGoode commented 3 years ago

Duplicate issue opened in Calypso:

https://github.com/Automattic/wp-calypso/issues/57257

Workaround:

Deactivate Shortcodes module or use Custom HTML embeds.

Internal report and discussion:

p9F6qB-7AN-p2

4394244-zd-woothemes

carladoria commented 3 years ago

Also reported in 32373876-hc They video they are trying to embed is https://vimeo.com/575378271/2dac1e2217 I haven't found a workaround for this since this is a simple site. In a Vimeo test account, I noticed that Vimeo now asks to upgrade to Pro to access many configuration and privacy settings. The user of this chat doesn't have access to the video settings.

JoshuaGoode commented 3 years ago

Encountered on 32528438-hc

User attempted to embed https://vimeo.com/470165945/df204ef0ec

As a workaround, deactivated Shortcode module for now.

Robertght commented 2 years ago

Another case in 4578587-zen

Deactivating the shortcodes module did the trick.

edequalsawesome commented 2 years ago

Also reported in 33102724-hc, will let the customer know to use the HTML block to embed the video.

sharonlaker19 commented 2 years ago

+1 at 4626490-zen Deactivating the shortcode module worked.

jeherve commented 2 years ago

closing this again, since the problem is fixed in the development version of the plugin. The fix will ship wit the next Jetpack release.

JoshuaGoode commented 2 years ago

@ash1eygrace encountered this again on a WPCOM Atomic hosted site today. Toggling off the shortcodes module was necessary to get the video to work.

Example

Page was using an embed block.

The video URL inserted following the https://vimeo.com/XXXXXXXXX format.

The editor successfully displayed a working preview of the video.

<!-- wp:embed {"url":"https://vimeo.com/XXXXXXXXX","type":"video","providerNameSlug":"vimeo","responsive":true,"className":"wp-embed-aspect-16-9 wp-has-aspect-ratio"} -->
<figure class="wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
https://vimeo.com/XXXXXXXXX
</div></figure>
<!-- /wp:embed -->

The editor pulled in https://player.vimeo.com/video/XXXXXXXXX?h=xxxxxxxxxx&dnt=x&app_id=xxxxxx for the embed block's preview.

Frontend issues

On the frontend, the page attempts to load https://player.vimeo.com/video/XXXXXXXXX which 404 and displays the following.

Sorry This video does not exist.

Screen Shot on 2022-01-26 at 17:05:13

Workaround

Deactivate the shortcodes Jetpack module.

Internal discussion: p1643233702053900/1643232361.051700-slack-C02E26A26CT

jeherve commented 2 years ago

@JoshuaGoode I can't seem to be able to reproduce the issue at the moment. The video in your example seems to be private, and I cannot embed it, whether I use Jetpack or not. Here is how it looks like when I do not use Jetpack:

Screenshot 2022-01-28 at 18 06 55

Was the video public yesterday? Any chance you can still reproduce the problem today?

JoshuaGoode commented 2 years ago

@jeherve Looking closer, the videos from the recent report utilize domain restrictions on Vimeo's end so they can only be embedded on sites with designated domains.

The issue still occurs if we enable the shortcodes module.

jeherve commented 2 years ago

That makes sense now, thanks for the extra details. It seems like we'll need to add a Referer header to such requests, as per Vimeo documentation: https://developer.vimeo.com/api/oembed/videos

To get the complete response, including the private metadata, send the Referer header with the request, and set its value to the video's whitelisted domain.

cuemarie commented 2 years ago

Not sure if this is the same, but I ran into a simple site today having issues embedding Vimeo as well, here: 138349-hc

What Didn't Work

What Did Work

zdenys commented 2 years ago

4886160-zd-woothemes. I suggested one of the workarounds from the above comment.

aleone89 commented 2 years ago

Another report here: https://wordpress.com/forums/topic/problem-z-osadzaniem-video-z-vimeo/