Users discuss a regression in Discourse’s onebox feature for WordPress 4.4 sites, where embedded previews stopped displaying correctly after upgrading. AdamCapriola reports broken previews on his site, noting that the iframe height is off and the title/excerpt are missing — though the featured image appears oversized. techAPJ identifies that mixed content errors (due to missing SSL on the WordPress site) break the embed on HTTPS Discourse instances like meta.discourse.org. codinghorror confirms WordPress 4.4 sites like blog.discourse.org should be supported and notes that onebox previously only handled permalinks with ../yyyy/mm/dd/.. structure. techAPJ later fixes this by updating onebox to also support ../yyyy/mm/slug/ URLs. Further, techAPJ observes the iframe’s height is hardcoded to 338px and lacks proper CSS max-width, causing layout issues. AdamCapriola suggests hiding the blockquoted WordPress embed link via CSS and confirms the image size is fine when embedded directly in WordPress. codinghorror emphasizes that variable-height embeds must be avoided to preserve infinite scrolling. techAPJ resolves the issue by switching WordPress embeds to use OpenGraph data instead of oEmbed, which avoids iframe height problems and provides consistent rendering — as seen in the fixed preview at sixprizes.com. The fix is implemented in this commit.
It’s broken here on meta because http://sixprizes.com (WordPress blog) does not have SSL enabled, hence causing this error:
Mixed Content: The page at 'https://meta.discourse.org/t/onebox-broken-for-wordpress-4-4-sites/36765/2' was loaded over HTTPS, but requested an insecure resource 'http://sixprizes.com/2015/12/15/silver-surfer-back-to-back-runner-up-reports-a-fiery-standout-and-some-potential-plays/embed/'. This request has been blocked; the content must be served over HTTPS.
@AdamCapriola If your Discourse instance has SSL enabled than the accompanying WordPress blog should also have SSL enabled for embeds to work properly.
Posts from http://blog.discourse.org are still not getting oneboxed because we are not providing oEmbed endpoint, will modify our WordPress theme to include oEmbed endpoint for posts.
Hmm. Yeah idk why the height is wrong. The image size is actually ok. When I try to embed the post in WordPress it looks fine.
Either way, the blockquoted link above the embed should be hidden, right?
blockquote.wp-embedded-content {
display: none;
}
Height appears to be 338 for anything (notice the whitespace below this embed):
It resizes inside of WordPress posts though (visit that link and watch the page load). So maybe there’s something going on in Discourse preventing it from resizing correctly?
We absolutely do not want embedded variable height content as it destroys our infinite scrolling – ask @techapj about Twitter embeds for this reason. If it is variable height, it cannot be allowed.