[wp-trac] [WordPress Trac] #36767: oEmbed performance optimisation

WordPress Trac noreply at wordpress.org
Wed Jun 15 15:45:39 UTC 2016


#36767: oEmbed performance optimisation
--------------------------+--------------------------
 Reporter:  bactisme      |       Owner:  swissspidy
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.5.3
Component:  Embeds        |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------
Changes (by kraftbj):

 * keywords:  fixed-major => has-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 This needs to be tweaked slightly.

 `url_to_postid` will return 0 when none is found. Then we're passing
 `get_oembed_response_data`, which then uses `get_post`. When an empty
 value is passed to get_post, the post global is used.

 This results in some embeds being returned as an embed of the post instead
 of the intended result.

 Test plugin:
 https://gist.github.com/kraftbj/535c3cfd2df6402f5f0024d035b68a59
 In a post, add `[test id=1969]`.
 Expected: The ID is converted to an oEmbed of a TED video.
 Actual: A self-embed of the post.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36767#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list