Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #54758


Ignore:
Timestamp:
01/07/2022 09:11:15 AM (2 years ago)
Author:
dd32
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #54758

    • Property Keywords has-patch has-unit-tests needs-testing added
  • Ticket #54758 – Description

    initial v2  
    55As an example, the WordPress.org homepage should be embeddable:
    66{{{
    7 $ curl -Is https://wordpress.org/embed/ https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
    8 HTTP/2 301
    9 location: https://wordpress.org/
     7$ curl -Is https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
    108HTTP/2 301
    119location: https://en-au.wordpress.org/
     
    1412The non-pretty embeds do however work, unfortunately WordPress doesn't link to these when rewrites are enabled:
    1513{{{
    16 $ curl -Is https://wordpress.org/?embed=1 https://en-au.wordpress.org/?embed=1 | grep -E '^(HTTP|location)'
    17 HTTP/2 200
     14$ curl -Is https://en-au.wordpress.org/?embed=1 | grep -E '^(HTTP|location)'
    1815HTTP/2 200
    1916}}}
     
    2118After the PR attached to this ticket:
    2219{{{
    23 $ curl -ILs https://wordpress.org/embed/ https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
    24 HTTP/2 200
     20$ curl -ILs https://en-au.wordpress.org/embed/ | grep -E '^(HTTP|location)'
    2521HTTP/2 200
    2622}}}
     
    2824The fix attached is a combination bugfix/enhancement, as I've fixed the bug by making canonical embed aware, so it redirects to the canonical embed location.
    2925
    30 The PR isn't complete, as it appears to still fail on one of the testcases I added, and appears to have altered (Potentially fixed?) the behaviour of another canonical test.
     26The PR isn't complete, as it appears to still fail on one of the test-cases I added, and appears to have altered (Potentially fixed?) the behaviour of another canonical test.
    3127
    3228A more targeted fix would be to disable canonical when `is_embed()` is truthful.