Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #40450


Ignore:
Timestamp:
04/14/2017 07:04:32 PM (8 years ago)
Author:
westonruter
Comment:

The patch guards against DDoS by requiring the edit_posts cap. It does't currently cache responses, but I'm guessing this would be added from what lands for #34115.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40450

    • Property Keywords has-patch needs-unit-tests added
    • Property Owner set to swissspidy
    • Property Status changed from new to reviewing
    • Property Milestone changed from Awaiting Review to 4.8
  • Ticket #40450 – Description

    initial v2  
    1 When doing oEmbed previews in the client, both in the media modal `embed` frame and in the TinyMCE embed preview, a `parse-embed` admin-ajax request is currently made to do the parsing. This request requires a `post_ID` parameter because the WP Embed logic caches oEmbed responses in postmeta (see #34115). There is a need for this in the media widgets to be able to obtain the `thumbnail_url` for a given oEmbed URL. Unfortunately the oEmbed preview in the media modal fails because there is no `post_ID` for context.
     1This essentially proposes adding the functionality from noembed.com into WordPress.
     2
     3When doing oEmbed previews in the client, both in the media modal `embed` frame and in the TinyMCE embed preview, a `parse-embed` admin-ajax request is currently made to do the parsing. This request requires a `post_ID` parameter because the WP Embed logic caches oEmbed responses in postmeta (see #34115). There is a need for this in the media widgets to be able to obtain the `thumbnail_url` for a given oEmbed URL. Unfortunately the oEmbed preview in the media modal fails because there is no `post_ID` for context. Also, the client cannot reliably make requests to oEmbed providers directly since they inconsistently support CORS.
    24
    35There is currently an `wp-json/oembed/1.0/embed` endpoint for serving oEmbed responses for posts on a given site. It would be a useful improvement to extend this endpoint to also allow for proxying the oEmbed provider lookup and fetching, as handled internally in `\WP_oEmbed::get_html()`: https://github.com/WordPress/wordpress-develop/blob/4.7/src/wp-includes/class-oembed.php#L333-L360