- This topic has 7 replies, 3 voices, and was last updated 2 years, 6 months ago by Ivan.
-
AuthorPosts
-
October 16, 2020 at 10:35 pm #1492779Guilherme
Hi.
My site was running with no AMP errors until I upgraded to GP 3.0.2. Now the official AMP plugin started to complain about main.min.js and about this line:
var generatepressMenu = {"toggleOpenedSubMenus":"1","openSubMenuLabel":"Open Sub-Menu","closeSubMenuLabel":"Close Sub-Menu"};
I have GPP 1.12.2 and AMP for GP installed. Everything was perfect before the update.
I restored a backup of version 2.4.2 and now it’s working fine again.I installed GP 3.0.2 on a brand new local test site and the exact same issues were reported.
Please advise.
Thank you.October 17, 2020 at 11:25 am #1493514TomLead DeveloperLead DeveloperHi there,
You’ll need to make this change to the AMP for GP plugin: https://github.com/tomusborne/amp-for-generatepress/commit/97d38e52a44bc15c008853526d6987260eee83c3
We’re planning on getting the plugin added to the repo ASAP.
October 17, 2020 at 1:11 pm #1493597GuilhermeThank you for your quick support! It worked.
After posting the issue, I found a workaround, writing a function to manually dequeue the script. I didn’t want to mess with your plugin, so I used Code Snippets.
add_action( 'wp_footer', 'gbd_dequeue_main_js',15); function gbd_dequeue_main_js() { wp_dequeue_script('generate-main'); }
Now that your plugin has that code, I can deactivate this.
Thank you once more.
October 18, 2020 at 11:57 am #1494657TomLead DeveloperLead DeveloperNo problem! Glad it worked 🙂
October 27, 2021 at 9:26 am #1978874IvanHi Tom
After upgrading to GeneratePress 3.10 and GP Premium 2.10 I get AMP faults. I have tried to change amp-for-generatepress.php in the plugin editor with the code suggested 8. October but with no luck. The url for the site is https://www.jozan.net/rug-books/
I get this messages
Invalid value for width</ property: auto
Details | Copy to clipboard
HTML attribute—
Markup Status
RemovedInformation
AMP allows a specific set of elements and attributes on valid AMP pages. Learn about the AMP HTML specification. If an element or attribute is not allowed in AMP, it must be removed for the page to be cached and eligible for prerendering.If all invalid markup is “removed” the page will be served as AMP. However, the impact that the removal has on the page must be assessed to determine if the result is acceptable. If any invalid markup is “kept” then the page will not be served as AMP.
Error code
MISSING_REQUIRED_PROPERTY_VALUE
Element attributes
name viewport
content width=auto
Invalid property
width: auto (required value: device-width)
Node name
content
Parent element
meta
Sourcesand this
Invalid inline script
Details | Copy to clipboard
JSGeneratePress
Markup Status
RemovedInformation
AMP does not allow the use of JS <script> tags unless they are for loading AMP components, which are added automatically by the AMP plugin. For any page to be served as AMP, all invalid script tags must be removed from the page. Instead of custom or third-party JS, please consider using AMP components and functionality such as amp-bind and actions and events (as opposed to JS event handler attributes like onclick). Some custom JS can be added if encapsulated in the amp-script. Learn more about how AMP works.If all invalid markup is “removed” the page will be served as AMP. However, the impact that the removal has on the page must be assessed to determine if the result is acceptable. If any invalid markup is “kept” then the page will not be served as AMP.
Error code
DISALLOWED_TAG
Invalid markup
<script … >
Element attributes
id generate-a11y
Element name
script
Parent element
body
Text content
SourcesRegards
IvanOctober 27, 2021 at 12:52 pm #1979221TomLead DeveloperLead DeveloperHi there,
Any chance you can open a new topic with your URL so we can check?
Also, make sure you’re using the latest version of our AMP for GP plugin: https://docs.generatepress.com/article/amp-compatibility/
October 27, 2021 at 1:28 pm #1979290IvanHi Tom
This solved the problem – thanks
Regards
IvanOctober 27, 2021 at 1:31 pm #1979292IvanWell – I thought it did – but it did not
I will post a new topic as suggested
Regards
Ivan -
AuthorPosts
- You must be logged in to reply to this topic.