Working with AMP pages
-
it seems that AMP blocks the plug in functionality to register the votes. I see the form at the bottom of the page, but pressing yes or no does nothing. any way I can work around this?
-
This is the AMP error:
Invalid markup:
<script … >
code
invalid_element
node_attributes
type: text/javascript
src: https://nootro.info/wp-content/plugins/helpful/core/assets/js/frontend.js?ver=__normalized__
node_name
script
parent_name
body
type
js_error
sources
[
{
“type”: “plugin”,
“name”: “helpful”,
“function”: “HelpfulCore::frontend_enqueue”,
“hook”: “wp_enqueue_scripts”,
“handle”: “helpful-frontend”
},
{
“type”: “core”,
“name”: “wp-includes”,
“function”: “wp_enqueue_scripts”,
“hook”: “wp_head”,
“handle”: “helpful-frontend”
},
{
“type”: “core”,
“name”: “wp-includes”,
“function”: “wp_print_footer_scripts”,
“hook”: “wp_footer”
},
{
“type”: “core”,
“name”: “wp-includes”,
“function”: “_wp_footer_scripts”,
“hook”: “wp_print_footer_scripts”
}
]@alalimoe currently i’ve no idea. The script must be loaded in the footer. I think a plugin is minify everything.
I’m not working with AMP so you have to wait until i find a solution, or you have to use a other plugin for votes.
Its a beautiful plugin. I’ll be looking for a solution as well and will update if I find a way to integrate it. Thanks a lot!
@alalimoe so i’ve checked some topics in the internet. Custom JS is not allowed so helpful does not work for you.
https://ww.wp.xz.cn/support/topic/amp-critical-error-custom-javascript-is-not-allowed/
I’ve no solution for you. Sorry for this.
No worries. Although I am sure there is a workaround to make it work. My code experience is quite limited but I thought this is worth taking a look at: https://www.ampproject.org/docs/reference/components/amp-iframe.html
@alalimoe the problem is that wordpress works with enqueue scripts and not supporting anything like this.
AMP not working with JS, that’s the “pro” of AMP, because pages without JS are fast. Helpful use JS vor ajax requests.
I’ll definitely look at that, but I can not promise anything.
-
This reply was modified 7 years, 3 months ago by
Pixelbart.
@alalimoe i’ve asked a friend. Maybe he has a tip or something. Please let me know, if you find a solution. 🙂
@pixelbart it’d be possible to implement it in another way by using a button component (https://ampstart.com/components#buttons) – but that would be done manually outside of the plugin. I’ve never created or edited a plugin so I don’t know about the possibilities of extending the functionality of Helpful to have the option to be used on AMP via those components, but I’m sure you’ll find this somewhat insightful. (if you’re interested, check this out too: https://ampbyexample.com)
@alalimoe html is no problem. The problem with AMP is JS. JS is not allowed. Helpful cant go in a iframe. So it is no solution available for helpful.
I’ve asking a friend and he say the same to me. No developer friend of mine is working with amp, because it is not working for developers.
I mark this topic as “not a support” question. Helpful just not working with AMP because Javascript is not supported. I have updated the readme, so it is official that helpful does not support AMP.
If you find a working solution, just let me know it. I will fix it.
-
This reply was modified 7 years, 3 months ago by
Pixelbart.
-
This reply was modified 7 years, 3 months ago by
The topic ‘Working with AMP pages’ is closed to new replies.