Closed bobbingwide closed 6 years ago
It seems that the HTML generated for embed__example
in one environment is different from that in another. All environments running WordPress 4.9.1.
Environment | HTML |
---|---|
qw/wordpress | iframe is not wrapped in a span |
qw/oikcom | iframe is wrapped in a span and iframe src= parameter is different |
qw/hm | as qw/oikcom |
qw/wordpress
<iframe width="480" height="360"
src="https://www.youtube.com/embed/nH228-XQ-A8?feature=oembed" frameborder="0" gesture="media" allowfullscreen>
</iframe>
qw/oikcom
<span class="embed-youtube" style="text-align:center; display: block;">
<iframe class="youtube-player" type="text/html" width="640" height="390"
src="https://www.youtube.com/embed/nH228-XQ-A8?version=3&rel=1&fs=1&autohide=2&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent" frameborder="0" allowfullscreen="true">
</iframe>
</span>
The extra HTML is due to Jetpack's Shortcode Embeds module. Note: Jetpack was backlevel ( 3.9.x ) on both of these installations. Updating to Jetpack 5.5.1 didn't make any difference. For environment independence the test case should disable the Jetpack logic.
Having deactivated Shortcode Embeds the iframe tag for qw/hm and qw/oikcom was still different from the original value saved in the test case data generated on qw/wordpres. It included
allow="encrypted-media"
before allowfullscreen
.
The reason that qw/wordpress
returned a different iframe
tag was due to the fact that the embed request had been cached. An oembed_cache
post type record already existed, created 25th November 2017. This was different from the records that have been cached more recently for qw/oikcom
and qw/hm
.
Note: The post_name
for each of the cached posts is identical: 82eaa291edeac05b611152d52f64ef2b
.
The test case should eliminate any chance of using cached embed output.
Having read https://core.trac.wordpress.org/ticket/34115 it looks like my problem with oembed_cache data being different in other environments is due to the fact that database updates are rolled back for PHPUnit tests. So, until I rerun the embed example from oik options -> Shortcode help the version stored in qw/wordpress will remain unchanged.
Changes to the way some shortcodes are expanded means we need to adjust the tests for shortcode examples functions: captionexample and embedexample.
At the same time, reconcile shared library files with the changes in oik v3.2.1, 3.2.2 and/or 3.2.3