Skip to content

WebP Module fallback.js does not support REST API plain permalinks. #456

@peterwilsoncc

Description

@peterwilsoncc

Bug Description

On sites with plain permalinks (ie not using rewrite rules) the rest requests in fallback.js result in 404 File Not Found errors.

The cause of the error is that the rest_route always appends the fields portion of the querystring with a question mark, for plain permalinks an ampersand should be used.

Steps to reproduce

  1. Configure WordPress to use plain permalinks
  2. Upload some a jpeg that will be converted to webp (ie, webp is the smaller file version)
  3. Include the image in a post and publish
  4. Visit the published post in a browser that does not support webp images
  5. In network tools observe that the REST request to get the fallback images fails. The URL will look something like /index.php?rest_route=/wp/v2/media/?_jsonp=wpPerfLab.webpUploadsFallbackWebpImages&per_page=100&include=38
  6. Observe the querystring has two question marks.

Screenshots

Screen Shot 2022-07-28 at 1 16 51 pm

Additional Context

  • PHP Version: 7.4
  • OS: Ubuntu?? (What ever exact version Chassis/Chassis uses)
  • Browser: macOS/Firefox Dev Edition 104b with image.webp.enabled set to false in about:config
  • Plugin Version: trunk at ab08abd
  • Device: Laptop

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions