Skip to content

Ignore WordPress core when there is another error source in block editor AMP sidebar #6667

@delawski

Description

@delawski

Bug Description

When a plugin generates a validation error by rendering invalid code in the block editor, the AMP Validation sidebar says WordPress core is the error source:

image

It seems the logic in the editor sidebar needs to be updated to treat Gutenberg like WordPress core, and also to ignore WordPress core when there is another source (e.g. a theme/plugin).

See: #6610 (comment)


Steps to reproduce

  1. Create a new plugin that will add a shortcode. The shortcode should generate invalid AMP markup, e.g.:
<?php
/*
Plugin Name: Bad Tag Shortcode
*/

add_shortcode( 'bad-tag-shortcode', function () {
	return '<bad-tag-shortcode></bad-tag-shortcode>';
} );
  1. Create a new post and add the new [bad-tag-shortcode] (via the Shortcode block).
  2. Save and check out the AMP Validation sidebar in the block editor. It should say that the WordPress core is responsible for the <bad-tag-shortcode> error:
    Screenshot 2021-10-29 at 15 33 32

Expected Behaviour

The logic in the editor sidebar needs to be updated to treat Gutenberg like WordPress core, and also to ignore WordPress core when there is another source (e.g. a theme/plugin).

Screenshots

No response

PHP Version

No response

Plugin Version

2.2.0-alpha

AMP plugin template mode

Transitional

WordPress Version

No response

Site Health

No response

Gutenberg Version

No response

OS(s) Affected

No response

Browser(s) Affected

No response

Device(s) Affected

No response

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingChangeloggedWhether the issue/PR has been added to release notes.P0High priorityValidation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions