Site logo

Archived topic

Themes with AMP incompatibility

5 replies · Started by EDWARD on October 4, 2022

Viewing posts 1–6 of 6

Hi, I need assitance with Generate Press theme and its compatibility with AMP.

The AMP plugin for Wordpress is giving me the following error:

Because of theme issue(s) we’ve found, you’ll want to consider a different template mode below. You may also want to browse alternative AMP compatible themes.

I added the the pages that are having problems in the private section.

Below is the Validation Data

[
    {
        "url": "https://www.edwardjohnsonlaw.com/",
        "type": "is_front_page",
        "label": "Homepage",
        "amp_url": "https://www.edwardjohnsonlaw.com/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 2497,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=2497&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/blog-news/ohare-airport-cash-seizure-incident/",
        "type": "is_singular[post]",
        "label": "Post",
        "amp_url": "https://www.edwardjohnsonlaw.com/blog-news/ohare-airport-cash-seizure-incident/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8292,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8292&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/asset-money-forfeiture-attorney/",
        "type": "is_singular[page]",
        "label": "Page",
        "amp_url": "https://www.edwardjohnsonlaw.com/asset-money-forfeiture-attorney/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8204,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8204&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/category/criminal-defense-cases/",
        "type": "is_tax[category]",
        "label": "Category",
        "amp_url": "https://www.edwardjohnsonlaw.com/category/criminal-defense-cases/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8293,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8293&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/tag/chicago-criminal-defense-firm/",
        "type": "is_tax[post_tag]",
        "label": "Tag",
        "amp_url": "https://www.edwardjohnsonlaw.com/tag/chicago-criminal-defense-firm/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8294,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8294&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/2021/",
        "type": "is_date",
        "label": "Date Archive",
        "amp_url": "https://www.edwardjohnsonlaw.com/2021/",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8381,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8381&action=edit"
        }
    },
    {
        "url": "https://www.edwardjohnsonlaw.com/?s=example",
        "type": "is_search",
        "label": "Search Results",
        "amp_url": "https://www.edwardjohnsonlaw.com/?s=example",
        "validation_errors": [
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-a11y"
                },
                "text": "!function(){__DOUBLE_QUOTED_STRING__;if(__DOUBLE_QUOTED_STRING__in document&&__DOUBLE_QUOTED_STRING__in window){var e=document.body;e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.add(__DOUBLE_QUOTED_STRING__)}),e.addEventListener(__DOUBLE_QUOTED_STRING__,function(){e.classList.remove(__DOUBLE_QUOTED_STRING__)})}}();",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 453,
                        "function": "generate_do_a11y_scripts",
                        "hook": "wp_footer",
                        "priority": 10
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "id": "generate-menu-js-extra"
                },
                "text": "\nvar generatepressMenu = {__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__,__DOUBLE_QUOTED_STRING__:__DOUBLE_QUOTED_STRING__};\n",
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "extra_key": "data",
                        "text": "var generatepressMenu = {\"toggleOpenedSubMenus\":\"1\",\"openSubMenuLabel\":\"Open Sub-Menu\",\"closeSubMenuLabel\":\"Close Sub-Menu\"};",
                        "handle": "generate-menu"
                    }
                ]
            },
            {
                "node_name": "script",
                "parent_name": "body",
                "code": "DISALLOWED_TAG",
                "type": "js_error",
                "node_attributes": {
                    "src": "https://www.edwardjohnsonlaw.com/wp-content/themes/generatepress/assets/js/menu.min.js?ver=__normalized__",
                    "id": "generate-menu-js"
                },
                "node_type": 1,
                "sources": [
                    {
                        "type": "theme",
                        "name": "generatepress",
                        "file": "inc/general.php",
                        "line": 17,
                        "function": "generate_scripts",
                        "hook": "wp_enqueue_scripts",
                        "priority": 10,
                        "dependency_type": "script",
                        "handle": "generate-menu"
                    }
                ]
            }
        ],
        "stale": false,
        "error": false,
        "validated_url_post": {
            "id": 8297,
            "edit_link": "https://www.edwardjohnsonlaw.com/wp-admin/post.php?post=8297&action=edit"
        }
    }
]

Yes

Hi there,

Those errors should not be happening if you have this plugin installed: https://generatepress.com/beta/amp-for-generatepress.zip

The entire purpose of that plugin is to remove the scripts being mentioned in the validation data you shared.

Which AMP plugin are you using?

Hi there,

which Template mode is selected in the AMP plugin ?

This archived topic is closed to new replies.