ampproject / amp-wp

Enable AMP on your WordPress site, the WordPress way.
https://wordpress.org/plugins/amp/
GNU General Public License v2.0
1.79k stars 382 forks source link

Validation issue from AMP plugin on WordPress nightly #6416

Closed aaemnnosttv closed 3 years ago

aaemnnosttv commented 3 years ago

Bug Description

The AMP plugin seems to be triggering invalid AMP markup in WordPress nightly.

Validation error JSON ```json { "node_name": "script", "parent_name": "body", "code": "DISALLOWED_TAG", "type": "js_error", "node_attributes": { "src": "http://localhost:9002/wp-includes/js/dist/vendor/regenerator-runtime.js?ver=__normalized__", "id": "regenerator-runtime-js" }, "node_type": "ELEMENT", "sources": [ { "type": "plugin", "name": "amp", "file": "src/Admin/PairedBrowsing.php", "line": 126, "function": "AmpProject\\AmpWP\\Admin\\PairedBrowsing::init_frontend", "hook": "wp", "priority": 9223372036854776000, "dependency_type": "script", "handle": "amp-paired-browsing-client", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "script-loader.php", "line": 537, "function": "wp_default_packages", "hook": "wp_default_scripts", "priority": 10, "dependency_type": "script", "handle": "wp-dom-ready", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "class-wp-widget-factory.php", "line": 89, "function": "WP_Widget_Factory::_register_widgets", "hook": "widgets_init", "priority": 100, "dependency_type": "script", "handle": "wp-dom-ready", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "widgets.php", "line": 1759, "function": "wp_widgets_init", "hook": "init", "priority": 1, "dependency_type": "script", "handle": "wp-dom-ready", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "script-loader.php", "line": 537, "function": "wp_default_packages", "hook": "wp_default_scripts", "priority": 10, "dependency_type": "script", "handle": "wp-polyfill", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "class-wp-widget-factory.php", "line": 89, "function": "WP_Widget_Factory::_register_widgets", "hook": "widgets_init", "priority": 100, "dependency_type": "script", "handle": "wp-polyfill", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "widgets.php", "line": 1759, "function": "wp_widgets_init", "hook": "init", "priority": 1, "dependency_type": "script", "handle": "wp-polyfill", "dependency_handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "script-loader.php", "line": 537, "function": "wp_default_packages", "hook": "wp_default_scripts", "priority": 10, "dependency_type": "script", "handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "class-wp-widget-factory.php", "line": 89, "function": "WP_Widget_Factory::_register_widgets", "hook": "widgets_init", "priority": 100, "dependency_type": "script", "handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "widgets.php", "line": 1759, "function": "wp_widgets_init", "hook": "init", "priority": 1, "dependency_type": "script", "handle": "regenerator-runtime" }, { "type": "core", "name": "wp-includes", "file": "script-loader.php", "line": 2047, "function": "wp_print_footer_scripts", "hook": "wp_footer", "priority": 20 }, { "type": "core", "name": "wp-includes", "file": "script-loader.php", "line": 2037, "function": "_wp_footer_scripts", "hook": "wp_print_footer_scripts", "priority": 10 } ], "removed": true, "reviewed": false } ```
Site Health ``` ### wp-core ### version: 5.8-beta3-51218 site_language: en_US user_language: en_US timezone: +00:00 permalink: /%postname% https_status: false multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 5 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /var/www/html wordpress_size: loading... uploads_path: /var/www/html/wp-content/uploads uploads_size: loading... themes_path: /var/www/html/wp-content/themes themes_size: loading... plugins_path: /var/www/html/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-active-theme ### name: Twenty Twenty (twentytwenty) version: 1.7 author: the WordPress team author_website: https://wordpress.org/ parent_theme: none theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, custom-background, post-thumbnails, custom-logo, title-tag, html5, align-wide, responsive-embeds, customize-selective-refresh-widgets, editor-color-palette, editor-font-sizes, editor-styles, amp, widgets, menus, editor-style theme_path: /var/www/html/wp-content/themes/twentytwenty auto_update: Disabled ### wp-themes-inactive (10) ### Twenty Eleven: version: 3.7, author: the WordPress team, Auto-updates disabled Twenty Fifteen: version: 2.9, author: the WordPress team, Auto-updates disabled Twenty Fourteen: version: 3.1, author: the WordPress team, Auto-updates disabled Twenty Nineteen: version: 2.0, author: the WordPress team, Auto-updates disabled Twenty Seventeen: version: 2.7, author: the WordPress team, Auto-updates disabled Twenty Sixteen: version: 2.4, author: the WordPress team, Auto-updates disabled Twenty Ten: version: 3.3, author: the WordPress team, Auto-updates disabled Twenty Thirteen: version: 3.3, author: the WordPress team, Auto-updates disabled Twenty Twelve: version: 3.3, author: the WordPress team, Auto-updates disabled Twenty Twenty-One: version: 1.3, author: the WordPress team, Auto-updates disabled ### wp-mu-plugins (13) ### Disable CSS animations: author: (undefined), version: (undefined) Disable Login Autofocus: author: (undefined), version: (undefined) Disable Skip Link Script Tag in WP Footer: author: (undefined), version: (undefined) E2E Access Token Endpoint: author: (undefined), version: (undefined) E2E Assets: author: (undefined), version: (undefined) E2E Client Configuration Endpoint: author: (undefined), version: (undefined) E2E Disable jQuery Migrate: author: (undefined), version: (undefined) E2E Enable Loopback: author: (undefined), version: (undefined) E2E Feature Flag Endpoint: author: (undefined), version: (undefined) E2E Notifications API Mock: author: (undefined), version: (undefined) E2E Search Console Property Endpoint: author: (undefined), version: (undefined) E2E Site Verification Endpoint: author: (undefined), version: (undefined) E2E WP Version REST Endpoint: author: (undefined), version: (undefined) ### wp-plugins-active (2) ### AMP: version: 2.1.2, author: AMP Project Contributors, Auto-updates disabled Site Kit by Google: version: 1.34.1, author: Google (latest version: 1.35.0), Auto-updates disabled ### wp-plugins-inactive (18) ### Akismet Anti-Spam: version: 4.1.9, author: Automattic, Auto-updates disabled E2E Tests Analytics Existing Tag: author: Google, version: (undefined), Auto-updates disabled E2E Tests Apply Content Filters: author: (undefined), version: (undefined), Auto-updates disabled E2E Tests Demo Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests GCP Auth Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests GCP Credentials Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests Module Setup Analytics API Mock: author: Google, version: (undefined), Auto-updates disabled E2E Tests Module Setup Analytics API Mock No Account: author: Google, version: (undefined), Auto-updates disabled E2E Tests Module Setup TagManager API Mock: author: Google, version: (undefined), Auto-updates disabled E2E Tests Module Setup TagManager API Mock No Account: author: Google, version: (undefined), Auto-updates disabled E2E Tests oAuth Callback Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests Proxy Auth Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests Proxy Credentials Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests Reset Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests Site Verification API Mock: author: Google, version: (undefined), Auto-updates disabled E2E Tests Site Verification Plugin: author: Google, version: (undefined), Auto-updates disabled E2E Tests User Input Settings API Mock: author: Google, version: (undefined), Auto-updates disabled Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org imagick_version: 3.4.4 file_uploads: File uploads is turned off post_max_size: 8M upload_max_filesize: 2M max_effective_size: 2 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 122 MB imagick::RESOURCETYPE_DISK: 1073741824 imagick::RESOURCETYPE_FILE: 786432 imagick::RESOURCETYPE_MAP: 512 MB imagick::RESOURCETYPE_MEMORY: 256 MB imagick::RESOURCETYPE_THREAD: 6 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, BMP ghostscript_version: 9.27 ### wp-server ### server_architecture: Linux 5.10.25-linuxkit x86_64 httpd_software: Apache/2.4.38 (Debian) php_version: 7.4.16 64bit php_sapi: apache2handler max_input_variables: 1000 time_limit: 30 memory_limit: 128M admin_memory_limit: 256M max_input_time: -1 upload_max_filesize: 2M php_post_max_size: 8M curl_version: 7.64.0 OpenSSL/1.1.1d suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: false ### wp-database ### extension: mysqli server_version: 5.7.34 client_version: mysqlnd 7.4.16 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /var/www/html/wp-content WP_PLUGIN_DIR: /var/www/html/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: true WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable ### google-site-kit ### version: 1.34.1 php_version: 7.4.16 wp_version: 5.8-beta3-51218 reference_url: http://localhost:9002 amp_mode: secondary site_status: not-connected user_status: not authenticated connected_user_count: none active_modules: site-verification, search-console required_scopes: openid: ⭕ https://www.googleapis.com/auth/userinfo.profile: ⭕ https://www.googleapis.com/auth/userinfo.email: ⭕ https://www.googleapis.com/auth/siteverification: ⭕ https://www.googleapis.com/auth/webmasters: ⭕ capabilities: googlesitekit_authenticate: ✅ googlesitekit_setup: ✅ googlesitekit_view_posts_insights: ⭕ googlesitekit_view_dashboard: ⭕ googlesitekit_view_module_details: ⭕ googlesitekit_manage_options: ⭕ enabled_features: ga4setup: ⭕ helpVisibility: ⭕ ideaHubModule: ⭕ serviceSetupV2: ⭕ storeErrorNotifications: ⭕ userFeedback: ⭕ userInput: ⭕ widgets.dashboard: ⭕ widgets.pageDashboard: ⭕ widgets.moduleScreens: ⭕ search_console_property: none ### amp_wp ### amp_slug_query_var: amp amp_slug_defined_late: false amp_mode_enabled: transitional amp_reader_theme: legacy amp_templates_enabled: post, page, is_singular, is_home, is_archive, is_author, is_date, is_search, is_404, is_category, is_tag amp_serve_all_templates: true amp_css_transient_caching_disabled: false amp_css_transient_caching_threshold: 5000 transients per day amp_css_transient_caching_sampling_range: 14 days amp_css_transient_caching_transient_count: 20 amp_css_transient_caching_time_series: 20210623: 0 amp_libxml_version: 2.9.4 ```

Expected Behaviour

No validation errors from the AMP plugin 😇

Steps to reproduce

  1. Install and activate latest AMP plugin on WordPress nightly using default settings
  2. Visit homepage while logged in
  3. See validation error/warning

Additional context

See details above.


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

pierlon commented 3 years ago

Thanks for raising the issue @aaemnnosttv. We should have this fixed in the upcoming release.

pierlon commented 3 years ago

QA Passed

With the latest WordPress nightly installed (version 5.8-RC1-51270), I no longer see any validation errors regarding the regenerator-runtime script:

image