• This plugin doesn’t seem to work correctly when using Cloudflare for caching? With Cloudflare enabled it displays the animated loading gif and nothing else. Disabling it makes it work as intended.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Joel James

    (@joelcj91)

    Hi @scuderiadank,

    Sorry to hear that. Is animated gif loaded upon page load?

    Thread Starter scuderiadank

    (@scuderiadank)

    Yes, the animated loading gif displays but nothing else. Tried with the ‘on click’ method too, but clicking the button doesn’t reveal the comments either.

    anonymized-11892634

    (@anonymized-11892634)

    Also not working on CloudFlare for me. Are there any plans to make the plugin compatible? It would be awesome ??

    Plugin Author Joel James

    (@joelcj91)

    Hi @philclothier,

    Sure! I will make sure to fix these issues through next update.

    anonymized-11892634

    (@anonymized-11892634)

    @joelcj91 Great! Let me know if you need any help testing

    • This reply was modified 7 years, 8 months ago by anonymized-11892634.

    same problem on cloudflare, a 403 seen on click of button.

    but after down debugging i found out that it due to the well-known incompatibility between caching and nonces that the plugin uses on the front end of non-logged in users.

    so i cleared stale cache (>24hrs) because a WordPress generated nonce validity is up to 24hrs. then each fresh page came a newly generated nonce which worked for anonymous users.

    so the solution would be to either remove the nonce on the front end for non-logged in users, or to disable caching (CDN and/or caching plugins) for articles’ HTML which would be hard.

    Joel, i read that best practices recommend using nonces for Ajax loading (your plugin uses a POST to admin-ajax) but since we’re not doing any puts or deletes so can we have an option to remove the nonce entirely?

    Thanks for the great plugin!

    Plugin Author Joel James

    (@joelcj91)

    Hi @leojonathanoh,

    Are you sure, it will work when you remove nonce check? If so, I will consider changing nonce check to something else.

    @joelcj91 pretty sure on this one. When I got a 403 on a cached page I opened up Developer Tools and changed the <input llc_ajax_nonce>’s value to a newly generated llc_ajax_nonce on another page that I cleared the cache on, and it went through.

    At least for now I applied is_user_logged_in so the nonce is not checked for non-logged in users
    /lazy-load-for-comments/public/class-llc-public.php

    if (is_user_logged_in())
    	check_ajax_referer( 'llc-ajax-nonce', 'llc_ajax_nonce' );

    Perhaps we could add in a referrer check. Can’t suggest much since I don’t do WP development.

    Plugin Author Joel James

    (@joelcj91)

    Hey @leojonathanoh, @scuderiadank and @philclothier,

    Please review this upcoming version and give me your feedback. I have removed nonce check and changed the ajax request to GET method. I will push this to live once you confirm the fix.

    • This reply was modified 7 years, 7 months ago by Joel James.

    @joel James: Doesn’t work for me. (Cloudflare + Jetpack). Tests with the Github-Version.

    Plugin Author Joel James

    (@joelcj91)

    Have you cleared your cache, @caschy? (From CloudFlare). If yes, can you try disabling Jetpack?

    PS: This plugin does not support Jetpack comments yet.

    @joelcj91: “This plugin does not support Jetpack comments yet.” I’m sorry, i did not see this. So it’s useless for my site atm, true?

    • This reply was modified 7 years, 7 months ago by caschy.
    Plugin Author Joel James

    (@joelcj91)

    Hi @caschy,

    Like this plugin description says, this plugin lazy loads default WordPress comments. If you are using normal WordPress comments, while Jetpack is enabled, it should work.

    The GitHub version of this plugin does work with Cloudflare.

    I just wanted to follow up for anyone still following this thread. I was having a similar problem when using the Cloudflare’s full-page fully static caching. Comments wouldn’t load for non-logged in users since the plugin uses nonce keys (which were being cached on the edge by Cloudflare). As per @joelcj91’s suggestion, I tested the GitHub version of the plugin, and it works great! I look forward to seeing it published to the .org repo. ??

    Hello, can I know if a page really load faster with this plugin ? It sound a bit weird that someone needs a special plugin just to lazy load comments !
    Thank you.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Doesn’t work with Cloudflare’ is closed to new replies.