• When you try to get your WordPress website really fast you will sooner or later ditch jQuery. I did this and everything works fine. Except the “clear cache” buttons of fastest cache. They seem to rely on jQuery. Can you please use vanilla javascript or at least support the invalidation of the cache in the frontend’s topbar by using a normal url? That would be great!

    • This topic was modified 3 years, 8 months ago by Marc Toensing.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Emre Vona

    (@emrevona)

    Actually it is not possible for now ??

    Thread Starter Marc Toensing

    (@marcdk)

    And and url fallback for people without js? The main options work in the plug-in settings. But the top bar options have no fallback.

    Plugin Author Emre Vona

    (@emrevona)

    how can you use wp without the jquery library?

    Thread Starter Marc Toensing

    (@marcdk)

    How can someone use WordPress and think it can be fast with jQuery? It is the first thing you remove if you aim for 100 points of each lighthouse chrome performance test.

    Example without jQuery in front- and backend https://marc.tv/retroachievements-emulatoren-roms/

    Since this plug-in is in my opinion the very best it should support WordPress without jQuery. The most recent themes all don’t need jQuery. And of course Gutenberg does not use jQuery either.

    Plugin Author Emre Vona

    (@emrevona)

    Actually loading the jquery for the admins can be better solution. what do you think?

    Thread Starter Marc Toensing

    (@marcdk)

    Yes. I could do that somehow. But It baffles me that fastest cache is my only plug-in that depends on jQuery. Everything else from yoast, Gutenberg and lightbox gallery do not need jQuery in the front and backend.

    Plugin Author Emre Vona

    (@emrevona)

    but it is just 30KB and it is loaded for the admins only. is it ok?

    Thread Starter Marc Toensing

    (@marcdk)

    since the topbar is part of the frontend if I am logged in the standard code to disable jQuery in the theme but not in the frontend does not work for your solution in the topbar.

    I use this code to disable jQuery just in the frontend theme. Your options in the topbar to delete caches does not work.

    /** * Completely Remove jQuery From WordPress */
    function my_init() {
        if (!is_admin()) {
            wp_deregister_script('jquery');
            wp_register_script('jquery', false);
        }
    }
    add_action('init', 'my_init');

    Show me how to edit this that your topbar options work while jQuery is disabled in the theme’s frontend while I am not logged in and enabled while I am logged in.

    Plugin Author Emre Vona

    (@emrevona)

    in this case, my solution does not work. and now I realized that jquery has already been installed.

    wp_enqueue_script(“wpfc-toolbar”, plugins_url(“wp-fastest-cache/js/toolbar.js”), array(‘jquery’), time(), true);

    Thread Starter Marc Toensing

    (@marcdk)

    Okay. Maybe that would be something you could change. In times where google ranks not only by load speed of the html but also bloated javascript code I may not the only one who disabled jQuery and would like to use your toolbar options.

    Plugin Author Emre Vona

    (@emrevona)

    actually you should change your method. you can add if(is_admin()){} condition.

    Thread Starter Marc Toensing

    (@marcdk)

    I don’t understand. https://developer.www.ads-software.com/reference/functions/is_admin/ checks if the displayed page is and admin page. Not if the user is an admin. If I want to delete the cache while on a specific post, your toolbar does not work. It does not even has a fallback.

    Plugin Author Emre Vona

    (@emrevona)

    I am so sorry. you can use if(is_admin_bar_showing()){}

    Thread Starter Marc Toensing

    (@marcdk)

    Great. Thank you. This workaround should do it for now.

    /** * Remove jQuery From WordPress */
    function my_init() {
        if (!is_admin() AND !is_admin_bar_showing()) {
            wp_deregister_script('jquery');
            wp_register_script('jquery', false);
        }
    }
    add_action('init', 'my_init');
    Plugin Author Emre Vona

    (@emrevona)

    you are welcome ?? if you vote, you make me so happy.?
    https://www.ads-software.com/support/plugin/wp-fastest-cache/reviews/?rate=5#new-post

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Don’t rely on jQuery in Fastest Cache topbar options’ is closed to new replies.