• Resolved Matt Keys

    (@mattkeys)


    Hello,

    We are continuing to hunt down performance issues on our site and have discovered that this plugin is loading the jQuery library site wide. Regardless of wether or not the plugin is being used to display a calculator on the page or not.

    The offending code can be found here: wp-content/plugins/cost-calculator-builder/includes/classes/CCBFrontController.php#13

    add_action(
    'wp_enqueue_scripts',
    function () {
    wp_enqueue_script( 'jquery' );
    }
    );

    This code indiscriminately loads jQuery. Instead the proper way to load jQuery would be as a dependency in calls to wp_enqueue_script. Example:

    wp_enqueue_script( 'calc-builder-main-js', CALC_URL . '/frontend/dist/bundle.js', array( 'jquery', 'cbb-sticky-sidebar-js' ), CALC_VERSION, true );

    In this way, jQuery will only load when the calc-builder-main-js script loads. So it will only load on pages that need it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mgordon7

    (@mgordon7)

    Hello,

    Thank you for the shared feedback,

    Our devs are preparing new updates for the plugin that will increase the performance of the plugin in future updates. Our devs are going to update the plugin by integrating the source code with the vue js 3

    Best regards

    Thread Starter Matt Keys

    (@mattkeys)

    We are on the latest version of this plugin now. I do see that there were many changes to vue js as you mentioned.

    However the issue I pointed out in this ticket still exists, it still is loading jQuery on every page of our site, wether that page uses this plugin or not.

    Please stop loading jQuery everywhere it is hurting our sites page speed performance.

    Hi @mattkeys,

    Thank you for letting us know about the issue.

    I have informed our development team about the issue and they will analyze it further. If possible they will improve the jQuery load.

    For now, I suggest following our changelog – https://docs.stylemixthemes.com/cost-calculator-builder/changelog/release-notes

    Best regards,
    James

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Improper enqueuing of jQuery’ is closed to new replies.