#34737 closed enhancement (fixed)
Add Facebook oEmbed support
Reported by: | pento | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
Facebook are in the process of releasing their oEmbed support - documentation has been written, it's really just the announcement that needs to be made.
Attachments (2)
Change History (32)
#1
@
9 years ago
- Keywords has-patch 2nd-opinion added
- Owner set to pento
- Status changed from new to assigned
#2
@
9 years ago
- Keywords 2nd-opinion removed
- Milestone changed from Awaiting Review to 4.4
Let's git r done.
#3
@
9 years ago
- Keywords needs-patch added; has-patch removed
I think those regexes need checking. For instance, I don't think:
https?://www\.facebook\.com/.*/video(s/|.php).*
will match the last two of (from FB documentation):
https://www.facebook.com/{page-name}/videos/{video-id}/ https://www.facebook.com/{username}/videos/{video-id}/ https://www.facebook.com/video.php?id={video-id} https://www.facebook.com/video.php?v={video-id}
...due to there being an extra /
before video
. i.e. I think it should be something like:
https?://www\.facebook\.com/.*video(s/|.php).*
although that would need refining further as it would also capture something like http://www.facebook.com/wp-tutorial-videos/
#4
@
9 years ago
Facebook is not exactly known for keeping things in a backwards-compatible way. The Graph API is always changing, the WordPress plugin isn't supported anymore, .... Will the oEmbed endpoint still be available two years from now?
Besides that, Facebook's oEmbed response is not compliant with the specification:
- There's an additional
success
property - The
height
property is sometimesnull
- The
width
property is100%
by default instead of a unit-less number
See https://make.wordpress.org/core/handbook/contribute/design-decisions/#whitelisting-oembed-providers
#5
@
9 years ago
-1 on pushing this in the back door for 4.4. I don't see why this shouldn't go through the normal paces of any other provider we add to the list.
It doesn't seem like the endpoint is well-enough established yet and @swissspidy raises some valid concerns in comment:4.
#6
@
9 years ago
- Milestone changed from 4.4 to Future Release
I am not okay with doing this in 4.4 - oEmbed changes are indeed small, but they still need to be tested, vetted, and established. This is not "established", and all of @swissspidy's points are valid and important.
#7
@
9 years ago
- Keywords has-patch added; needs-patch removed
Good catch, @GaryJ - 34737.2.diff updates the regex patterns.
@swissspidy makes some good points. Some Automattic folks are working with Facebook on this, they're going to pass this ticket along, so the problems can hopefully be addressed.
#8
@
9 years ago
Current status:
- It seems they don't use
width: 100%
anymore and instead use a default width of500
(pixels). height
is stillnull
in some cases.
I think we could integrate it once the height
bug is resolved. I can live with there being an unneeded success
property in the response.
#9
@
9 years ago
oEmbed support was released publicly a few days ago:
http://media.fb.com/2015/12/14/improved-embedding-tools-embedded-video-player-api-and-oembed-support/
#10
@
9 years ago
height
is stillnull
in some cases.
To clarify: height
is only null
in the posts endpoint; videos are fine.
#11
@
8 years ago
Still the same problem with the height
property for posts.
@pento Do you know if there are still some Automattic folks working with Facebook on embeds? Do Facebook embeds work on WordPress.com?
#12
@
8 years ago
I don't think the height
thing is an issue. It's contrary to the oembed spec, but Instagram does the same thing, and that doesn't cause problems.
Facebook embeds work correctly on WordPress.com.
#13
@
8 years ago
- Keywords needs-refresh 2nd-opinion added
I think we're at a point where we can only decide if this is going in or not. The URLs that Facebook originally defined haven't changed, so I think we can call it established, or stable.
I doubt they'd be willing to change the height
property that they return, their JS handles all of that magic.
The patch needs some updates:
- the
.php
parts of the regexes need to be changed to\.php
- I'm inclined to start adding unit tests for all our trusted oEmbed providers - if their output changes, we should know about it. Building those tests (with Facebook as the first provider) may be out of scope of this ticket, though.
I'm +1 on commit, though I'd like to hear arguments either way.
#15
@
8 years ago
- Keywords 2nd-opinion removed
- Milestone changed from Future Release to 4.7
- Owner changed from pento to johnbillion
- Status changed from assigned to reviewing
#19
@
8 years ago
For some reason with this Facebook oEmbed is being returned in arabic language. Could this be a problem in Facebook's end (maybe by misidentifying the server's IP)?
#20
@
8 years ago
There's an issue with Facebook single post embeds.
The following url should embed a single post from the Wordpress account on Facebook:
https://www.facebook.com/WordPress/posts/10154412148282911
What I'm actually getting on 4.6.1 is a feed of *all* posts from that account.
You can see the correct behaviour here:
http://embed.ly/code?url=https%3A%2F%2Fwww.facebook.com%2FWordPress%2Fposts%2F10154412148282911
#21
@
8 years ago
@miraclemaker This change here is for WordPress 4.7, not 4.6.1. In 4.6.1, auto-discovery will kick in. There, Facebook provides the embed code you're seeing now. So that's expected. If you use the latest nightly build, everything works fine.
#23
@
8 years ago
$wp_embed->autoembed( $content )
doesn't appears to be working for the Facebook embed
#24
@
8 years ago
@pareshradadiya Sounds unlikely. Perhaps no connection could be made to their servers or something. Could you share some code to reproduce it?
#25
@
8 years ago
@swissspidy
Add these two links in your post content from the admin dashboard
https://youtu.be/fLoRXpvEWDo
https://www.facebook.com/aheneghana/videos/10153867925655496/
Try to access this post from frontend, you will see the embed for youtube video but not for the facebook video
#26
@
8 years ago
@pareshradadiya Embedding the video by pasting the URL works for me. Screenshot: https://cloudup.com/cVXvtICBYvI
#27
@
8 years ago
@swissspidy
Embedding the video by pasting the URL does not works for me.
Here is a screenshot for reference!
#28
@
8 years ago
@pareshradadiya That second video works well on my install as well. Which version of WordPress are you using? Do you see any errors in the browser's developer console? What meta data is stored for this post in the database?
#29
@
5 years ago
- Keywords needs-testing added; has-patch needs-refresh removed
- Type changed from enhancement to defect (bug)
- Version set to 5.2
Does anyone has problems with the facebook oembed api? When calling the API from local browser we've no issues, but calling from php and the wordpress causes timeouts on the facebook-api or "unsupported browser" issues.
the ajax-call always returns
{"success":false,"data":{"type":"not-embeddable","message":"<code>https:\/\/www.facebook.com\/burgerphilipp\/posts\/2231509943565310<\/code> konnte nicht eingebunden werden."}}
#30
@
5 years ago
- Keywords has-patch added; needs-testing removed
- Type changed from defect (bug) to enhancement
- Version 5.2 deleted
@mattla93 Please do not change keywords on a 3-year old closed ticket to indicate that it's not working for you. If there's a reproducible issue with Facebook oEmbeds in WordPress, I recommend opening a new ticket for it with as much details as possible.
To me, it sounds like Facebook has done something on their end that breaks external access. For example, when I run wp eval "print_r( wp_remote_get( 'https://www.facebook.com/burgerphilipp/posts/2231509943565310' ) );"
on a local site, I get timeouts as well. So this is not an issue with embeds specifically, but with Facebook blocking requests generally.
This is currently blocked by #34698.
@wonderboymusic: I know it's a bit late, but assuming that bug is fixed before RC 1, how do you feel about this landing in 4.4?