Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version is breaking my code, causing error 500 on AMP articles #1120

Closed
beeriz opened this issue May 5, 2018 · 5 comments
Closed

Comments

@beeriz
Copy link

beeriz commented May 5, 2018

Hello.
Since the update to 7.0, i'm seeing an error on top on every article, regarding some CSS classes.
Is there any way to "ignore" them?

@westonruter
Copy link
Member

@beeriz Please share the error.

@westonruter
Copy link
Member

And share the URL to an article that has the problem.

@beeriz
Copy link
Author

beeriz commented May 5, 2018

Hey, only after reverting to the older version that the URL in AMP can work :

This is an exemple that output error 500 if I upgrade to 7.0 :
Error on server side :

Warning: There is content that fails AMP validation; it will be stripped when served as AMP.

Invalid elements: script (2)
Invalid attributes: alignnone

Thank you Weston

@westonruter
Copy link
Member

@beeriz If you get a 500 error then it is most likely due to having the Glue for Yoast SEO & AMP plugin installed. Do you have it? There is a bug in that Yoast plugin which we have a workaround for (and proposed permanent fix): https://wordpress.org/support/topic/the-latest-amp-plugin-cause-500-error/

In regards to the AMP warning notice that is appearing in your post, this is helping you know what is wrong with your post for AMP. In 1.0 we'll add the ability to acknowledge and ignore specific errors. But that's not yet part of 0.7. For now you can fix the errors to prevent them from being warned about.

In regards to alignnone this is being reported because this is being used in fact as not a class:

<figure id="attachment_4847" alignnone style="width: auto">

You should change this to:

<figure id="attachment_4847" class="alignnone" style="width: auto">

The warnings about script tags look like they are related to ads being injected into the content of the page, for example:

<div class="quads-location quads-ad11" id="quads-ad11" style="float:none;margin:15px 0px 25px 0px;text-align:center;">
    <script async data-cfasync="false" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script type="text/javascript" data-cfasync="false">
    var quads_screen_width = document.body.clientWidth;
    </script>
</div>

You should be injecting amp-ad tags into the content instead when is_amp_endpoint(). Note also we're looking into automatically converting the most common scripts to their AMP equivalents in #1032.

@beeriz
Copy link
Author

beeriz commented May 5, 2018

Thank you so much, I was able to prevent the 500 error using the fix proposed by you.

I will try to fix the alignnone non-sens that we have missed for months !
For the quads Ads, I will see if the developper can help because they offer full compatibility for AMP for paid plugin.

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants