Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi there,

    Sorry you’re having trouble. Can you try disabling any caching and minification plugins you might have? It looks like our javascript is being mangled somehow.

    Also, after you do that can you post a link to your site here so I can see the problem live? Thanks!

    Thread Starter vindicateme

    (@vindicateme)

    I’m not using any caching or minification plugins.

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    OK, can I get a link to the site to see the error live?

    Thread Starter vindicateme

    (@vindicateme)

    sorry but its not on a live environment. one thing i did notice is that give.all.min.js? is loading before jquery. should it be loading after?

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hmm… try going to “Donations > Settings” and then to the Advanced tab. At the bottom you’ll see a setting to enabled Give scripts in Footer. Try that. Also try enabling WP_DEBUG and SCRIPT_DEBUG by adding the following to your wp-config.php file:

    define('WP_DEBUG', true);
    define('SCRIPT_DEBUG', true);

    Let me know how that goes.

    andrejcremoznik

    (@andrejcremoznik)

    Give requires jquery. When the plugin is enabled it will enque the wordpress’s packaged jquery and load it in <head>.

    My guess is you’re loading an additional jquery (perhaps built with your other scripts) that’s causing a conflict.

    I had the exact same problem. That’s why it would be really nice if all plugins had config options for disabling loading of library code for us purists.

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi @andrejcremoznik

    Can you be more specific? Which scripts in Give would you like to disable? Are you familiar with Core’s wp_dequeue_script() function? That’s essentially all you would need, but generally dequeueing our scripts kinda brings everything to a halt unless I’m totally misunderstanding what you mean.

    andrejcremoznik

    (@andrejcremoznik)

    Yes I’m familiar with everything regarding script loading in WP. I’ve also read this and I understand the reasoning why Give and plugins in general handle things in a certain way.

    The way I’m using WP is as a framework + CMS. Frontend is completely customized. Dependencies (plugins) are handled with Composer, Bower for frontent libs, and Grunt for building (including script concatenation and minification) and deploying. For more details take a look at this repo Github.

    Give, like a lot of other “frontend” plugins, relies on library code. WP libraries like jQuery can be dequeued but plugins’ libs e.g. $.qtip which is bundled with Give can’t be in case I already have it included in my concatenated build file. It would be possible to just dequeue everything Give loads by using the provided hook but then looking up the entire script dependency chain, hooking it up into my concat task and also handle script translation would just be too much of a hassle and feel hackish.

    So for me as a developer the perfect solution for plugins loading JS/CSS on frontend would be a config option to disable all library code dependencies and only load application code. In case this config option is enabled the plugin would only register (wp_register_script) and localize (wp_localize_script) it’s application script but not enqueue it (wp_enqueue_script). Enqueuing would be left up to the developers in their script enqueuing function so that they’re able to ensure the order of scripts is correct. You’d have to include a list of frontend dependencies in the documentation so that devs aren’t required to read the source.

    If you’d consider this kind of approach let me know and I’ll help.

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    I see. Our approach in general is to build Give in a way that is most beneficial to 80% or more of our users, and the other more edge cases like yours we want to handle by being a developer-friendly as possible.

    For example, this documentation might be really useful for you:
    https://givewp.com/documentation/developers/conditionally-load-give-styles-and-scripts/

    Still, you make some really good points and we’ll take it into consideration for sure.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘qtip is not a function (javascript error)’ is closed to new replies.