What is the URL to an AMP page that has the problem?
We had a few sites pop up with this today as well. According to Google, this is the problem –
<script>if (document.location.protocol != “https:”) {document.location = document.URL.replace(/^http:/i, “https:”);}</script><script type=’text/javascript’ src=’https://cdn.ampproject.org/v0.js’ async></script>
This code is not coming from the AMP plugin. It is likely coming from another plugin you have active.
Note: As of 1.0 there will be a new recommended way to serve AMP content on your WordPress site and that is by making use of the new theme support. This allows you to fully re-use your active theme’s templates and styles, with the added benefit of preventing any AMP-invalid markup from being added by a plugin. See https://github.com/Automattic/amp-wp/wiki/Adding-Theme-Support
@snecz @kimstuart This validation error regarding custom JavaScript may be fixed by adding the following code to your theme’s functions.php:
add_action( 'pre_amp_render_post', function() {
remove_all_actions( 'wp_print_scripts' );
} );
This will be fixed in the plugin via https://github.com/Automattic/amp-wp/issues/1225
Really Simple SSL javascript redirect is the cause of the issue, it turns out.
Kim
-
This reply was modified 7 years, 10 months ago by
kimstuart.
Thread Starter
snecz
(@snecz)
@westonruter Thanks that fixed the problem in GSC.
That workaround is no longer necessary if you update to v0.7.2 which we just released yesterday.
I have the same issue.
Please help me check with the sample link:
https://chandat.net/triet-hoc/vien-duong-lao-va-nguoi-gia-2-thai-cuc-van-hoa-dong-tay/
Best regards,
Tom Tran
Same here.
Here is an URL example: https://thepowermoves.com/attachment-style-quiz/amp/
I am thinking it’s probably Amazon Affiliate link.
But without that link, I don’t get commissions for sales outside US.
Any workaround?