• I am getting the following errors and I don’t know how to fix them

    The attribute ‘href’ in tag ‘link rel=stylesheet for fonts’ is set to the invalid value wp-includes/css/dist/block-library/style.min.css?ver=5.5′.
    line 37, column 0

    The mandatory attribute ‘amp-custom’ is missing in tag ‘style amp-custom’.
    line 38, column 0

    The attribute ‘href’ in tag ‘link rel=stylesheet for fonts’ is set to the invalid value ‘wp-includes/css/dist/block-library/theme.min.css?ver=5.5’.
    line 41, column 0

    The mandatory attribute ‘amp-custom’ is missing in tag ‘style amp-custom’.
    line 42, column 1

    The mandatory attribute ‘amp-custom’ is missing in tag ‘style amp-custom’.
    line 546, column 1

    The tag ‘img’ may only appear as a descendant of tag ‘noscript’. Did you mean ‘amp-img’?
    line 578, column 3

    The tag ‘audio’ may only appear as a descendant of tag ‘noscript’. Did you mean ‘amp-audio’?
    line 581, column 0

    The parent tag of tag ‘style amp-custom’ is ‘a’, but it can only be ‘head’.
    line 583, column 282

    The tag ‘amp-analytics’ requires including the ‘amp-analytics’ extension JavaScript.
    line 608, column 1

    The tag ‘amp-analytics extension .json script’ requires including the ‘amp-analytics’ extension JavaScript.
    line 608, column 57

    The mandatory tag ‘noscript enclosure for boilerplate’ is missing or incorrect.
    line 610, column 7

    The mandatory tag ‘head > style[amp-boilerplate]’ is missing or incorrect.
    line 610, column 7

    The mandatory tag ‘noscript > style[amp-boilerplate]’ is missing or incorrect.
    line 610, column 7

    The mandatory tag ‘amphtml engine v0.js script’ is missing or incorrect.
    line 610, column 7

    • This topic was modified 4 years, 3 months ago by Tee.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    You need to share the URL of the AMP page that has this problem.

    Thread Starter Tee

    (@teenow)

    done

    • This reply was modified 4 years, 3 months ago by Tee.
    • This reply was modified 4 years, 3 months ago by Tee.

    I’m also getting most of these errors too!

    Rather than creating another ticket, mine is happening on several pages including this one: https://nutritiouslife.com/recipes/thai-zucchini-noodles-pan-roasted-halibut/amp/

    I’m also getting amp-analytics errors, in which I’m quite sure I have it configured correctly.

    
    {
      "vars": {
        "account": "UA-xxxxxxxx-x"
      },
      "triggers": {
        "trackPageview": {
          "on": "visible",
          "request": "pageview"
        }
      }
    }
    

    In which i get errors like:

    The tag 'amp-analytics' requires including the 'amp-analytics' extension JavaScript.

    Thanks

    Plugin Author Weston Ruter

    (@westonruter)

    @coop920 please share your Site Health info. You can do so via this form.

    Done. Thank you

    Plugin Author Weston Ruter

    (@westonruter)

    @coop920 Thank you. I can see 2 unique fatal errors in the error log. Do you mind if I post them here?

    • This reply was modified 4 years, 3 months ago by Weston Ruter.

    That’s fine. If they could be the AMP specific ones, that would be great.

    Plugin Author Weston Ruter

    (@westonruter)

    There are two errors specifically:

    PHP Fatal error: Uncaught Error: Call to a member function format() on bool in …/wp-content/themes/wordpress-starter-template/functions.php:925
    Stack trace:
    #0 …/wp-includes/class-wp-hook.php(287): nl_amp_set_schema_type(Array, Object(WP_Post))
    #1 …/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
    #2 …/wp-content/plugins/amp/includes/amp-helper-functions.php(1794): apply_filters('amp_post_templa...', Array, Object(WP_Post))
    #3 …/wp-content/plugins/amp/src/Transformer/AmpSchemaOrgMetadataConfiguration.php(41): amp_get_schemaorg_metadata()
    #4 …/wp-content/plugins/amp/vendor/ampproject/optimizer/src/Configuration/BaseTransformerConfiguration.php(34): AmpProject\\AmpWP\\Transformer\\AmpSchemaOrgMetadataConfiguration->getAllowedKeys()
    #5 …/wp-content/plugins/amp/vendor/ampproject/optimizer/src/Configuration.php(191): in …/wp-content/themes/wordpress-starter-template/functions.php on line 925

    And:

    PHP Fatal error: Uncaught Error: Call to undefined function get_rocket_option() in …/wp-content/plugins/wp-rocket/inc/front/process.php:358
    Stack trace:
    #0 [internal function]: do_rocket_callback('###############...', 9)
    #1 …/wp-includes/functions.php(4669): ob_end_flush()
    #2 …/wp-includes/class-wp-hook.php(287): wp_ob_end_flush_all('')
    #3 …/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #4 …/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #5 …/wp-includes/load.php(1001): do_action('shutdown')
    #6 [internal function]: shutdown_action_hook()
    #7 {main}
     thrown in …/wp-content/plugins/wp-rocket/inc/front/process.php on line 358

    The second may be caused by the first.

    There seems to be a bug in the nl_amp_set_schema_type() function defined in your theme. Since the theme is not publicly available it is difficult for me to determine what the conflict is, however.

    Plugin Author Weston Ruter

    (@westonruter)

    Your theme is apparently doing something like this:

    add_filter( 'amp_post_template_metadata', 'nl_amp_set_schema_type' );

    But it apparently has a bug in it. If you could share the source code for the nl_amp_set_schema_type() function here that would be helpful.

    https://gist.github.com/Coop920/b2b06197ab3e4f06d5ee827edfd50516

    It was code that I inherited….so perhaps at this point it is no longer relavant?

    Plugin Author Weston Ruter

    (@westonruter)

    It appears there is a bug with this line:

    $metadata['totalTime'] = $f->diff($e)->format("PT%hH%iM");

    The diff method is returning false apparently, which happens when the difference fails to be computed.

    Try commenting out that line.

    In any case, we’ll add some better error checking to surface these kinds of errors in the next release. It’s difficult to see what’s going wrong at present when a fatal error occurs.

    Thread Starter Tee

    (@teenow)

    I submitted my site information on the form can you check it please @westonruter

    Plugin Author Weston Ruter

    (@westonruter)

    @teenow You didn’t supply the contents of your PHP error log.

    Plugin Author Weston Ruter

    (@westonruter)

    Nevertheless, please also try turning off the Endurance Page Cache, if it is enabled. There may be a conflict with that plugin.

    Otherwise, please try deactivating each plugin one-by-one to identify if something else is causing a conflict. If the page validates as AMP when one of those plugins is deactivated, then that one plugin is causing the problem. Please share what plugin is causing issues.

    Thread Starter Tee

    (@teenow)

    the endurance page cache has always been turned off and I deactivated all the plugins and still no change. I have completed another form. @westonruter

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘error’ is closed to new replies.