Skip to content

Imgur post embed gives 404 error #4697

@dharmin

Description

@dharmin

Bug Description

The Imgur post embed generates AMP tag, it uses post id as data-imgur-id, and it creates incorrect embed URL: https://imgur.com/2q6AS6i/embed?pub so it’s not displayed on the AMP page.

<amp-imgur
    data-imgur-id="2q6AS6i"
    layout="responsive"
    width="540"
    height="633"
  >
  </amp-imgur>

In the official AMP documentation, there is no information available for Imgur post embed.
https://amp.dev/documentation/components/amp-imgur/

And there is a merged PR to add the support for Imgur posts:
ampproject/amphtml#23829

Expected Behaviour

The Imgur post embed should generate data-imgur-id as a/<post_id>. It generates the correct embed URL https://imgur.com/a/2q6AS6i/embed?pub.

<amp-imgur
    data-imgur-id="a/2q6AS6i"
    layout="responsive"
    width="540"
    height="633"
  >
  </amp-imgur>

Steps to reproduce

  1. Edit/Create WordPress post.
  2. Add an Imgur post URL. eg. https://imgur.com/gallery/2q6AS6i
  3. Submit the post.
  4. View it on AMP mode

Screenshots

C3r0URGdKN

Additional context

  • WordPress version: 5.4
  • Plugin version: 1.5.3
  • AMP plugin template mode: Standad
  • PHP version: 7.4
  • OS: Windows 10
  • Browser: Google Chrome

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingChangeloggedWhether the issue/PR has been added to release notes.EmbedsWS:CoreWork stream for Plugin core

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions