• Resolved mibrito707

    (@mibrito707)


    Hello there:
    Let me thank you for this amazing plugin, it’s really very good.
    No my problem is this:
    I’m developing my own template and so far so good but in my optimization process I remove the default WP jquery registered script hook and use the google CDN also I move it to the footer to optimize even a little more.
    So long history short, now I’m trying to use the Ajaxify option (because I also using Wp Super Cache plugin) and since you insert a js code snipped in the middle of the page and the jquery is on the footer I’m getting the “WordPress Popular Posts: jQuery is not defined!”.
    I’m wondering if you can update the plugin to insert this js snipped on the footer, bellow all js includes.
    Thank you again.

    https://www.ads-software.com/plugins/wordpress-popular-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    You answered your own question in your comment: since the script is inserted in the middle of the page jQuery needs to be loaded by then or else it won’t work.

    By default WordPress inserts jQuery in the header section of your theme for this very reason: most scripts out there expect it to be in there, including of course WPP.

    Another reason to leave jQuery alone is that in practice you won’t gain that much by moving it to the footer section as Jquery’s only 32kb (when minified and gzipped). Doing so will also bring more troubles than benefits: are you planning to contact every developer out there to ask them to move their scripts to the footer or find a way around this? ??

    TLDR;

    Just leave jQuery alone. Moving it to the footer won’t give you any benefits and will break most plugins / scripts out there. It’s not worth it.

    Hi Hector,

    If you don’t mind I just put my thoughts. If your plugin had the option to remove the inline script and then add it tp the footer, it would be great and very helpful for those who are crazy on their site’s optimization. And this would be a quick fix when various optimizers used in themes (which usually take all scripts to the footer).

    For example, TOP 10 plugin does it by removing Filter and calling the tracking function wherever you need.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with Ajaxify option’ is closed to new replies.