• Remove the wp frontend admin bar as option. Additionally, not making it jquery dependent. As of right now, we defer the jquery lib and getting console error due to servebolt settings cache-purge-trigger.js

    Easiest would be just add option to not display in frontend or top menu. Another option is also to not load the trigger js if cache settings is not enabled?

    And last would be to stop using jquery overall vanilla js please.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello!
    Thanks for raising this issue. We are aware that our plugin is dependent on jQuery, and we are currently using the jQuery-version that WordPress supplies. We have slowly started the transition to vanilla JavaScript, but we are not quite there yet.

    Only loading the file “cache-purge-trigger.js” whenever the cache feature is active is definitely a good idea, but this is not something we’re planning to change anytime soon.

    You could disable output from the plugin to the admin bar by adding the following code:
    add_filter('sb_optimizer_display_admin_bar_menu', '__return_true');
    if (!is_admin()) { add_filter('sb_optimizer_should_load_common_assets', '__return_false'); }

    This will remove the admin bar output as well as preventing the script/style files from being loaded when viewing the front-end of your site. I understand that this is not an ideal solution, but it should at least solve the jQuery-conflict that you are experiencing.

    I hope this answered your question. Feel free to reply if something is still unclear.

    Kind regards
    Robert S?ther
    Servebolt

    Thread Starter Rookie

    (@alriksson)

    @robertservebolt Many thanks for the snippets, this was not fixed in the latest release right?

    Hello! No, we’re still dependent on jQuery, and as long as our plugin is active and the WP Admin bar is present then jQuery will be loaded (unless you add the snippet I sent you earlier). I do not have any timeframe on when we will transition away from jQuery unfortunately.

    Kind regards
    Robert S?ther
    Servebolt AS

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘cache-purge-trigger.js is causing issues once jQuery is deferred’ is closed to new replies.