[Resolved] Does Generatepress Use JQeury?

Home Forums Support [Resolved] Does Generatepress Use JQeury?

Home Forums Support Does Generatepress Use JQeury?

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #2049617
    Benjamin

    Hello, I use Ezoic to optimize my websites.

    They have a technologies tab of tech slowing down your website. There are 3 technologies that I’m not sure where they are coming from on my site that seem to be slowing things down a lot- namely JQuery, jQuery Migrate, and jQuery Matchheight- are these added by GP/ GP Premium possibly? Just trying to find the root.

    Thanks!

    #2049709
    David
    Staff
    Customer Support

    Hi there,

    GP only requires jQuery and only enqueues it if you have the Sticky Navigation enabled. But plenty of WP plugins require jQuery. If you’re not using sticky nav, or your disable it, and jQuery still loads then its not GP making the request.

    #2049781
    Benjamin

    Hello David,

    Thanks. I see the sticky nav falls under menu plus and I have that disabled so can’t be that. What about Generateblocks perhaps? But as you said it could be any plugin, although I only use a few.

    I’ll link the site in the private section if you want to have a look, but no need if you’re busy.

    Take care.

    #2049810
    David
    Staff
    Customer Support

    WP Show Posts uses it in some instances.
    If you force jQuery to not load then you would need to disable the matchHeight script in WP Show Posts. Tom provides a snippet for that here:

    https://wpshowposts.com/support/topic/design-question/#post-18421

    But i cannot say if there aren’t other plugins that are dependent on jQuery

    #2057407
    Benjamin

    Sure thanks,

    What exactly does the match height do? Is it fine to remove it?

    #2057785
    David
    Staff
    Customer Support

    Its for resizing grids so each column occupies the same height. Remove it and see if you notice any difference.

    #2062812
    Benjamin

    Okay cool, where does that code need to go? Functions.php? If there I’ll probably have to use the codesnippets plugin.

    #2062816
    Benjamin

    Also is this the right code-

    https://prnt.sc/2544ft8

    just want to confirm.

    #2062862
    David
    Staff
    Customer Support

    1. Yeah functions.php in Child Theme or in the Code Snippets plugin.
    2. And thats the correct Code.

    And just as a final piece add this to your functions.php:

    // Disable Jquery
    add_filter( 'wp_enqueue_scripts', 'change_default_jquery', PHP_INT_MAX );
    
    function change_default_jquery( ){
    	
    	if ( ! is_admin() ) {
        	wp_dequeue_script( 'jquery');
        	wp_deregister_script( 'jquery');   
    
    	}
    }

    This will remove jQuery from the front end. But you need to make sure there are no other plugins that require it.

    #2063016
    Benjamin

    Cool thanks. I own the perfmatters plugin for removing a bunch of scripts and I also have Ezoic which removes scripts of it own. I’ll just check if I can get rid of JQUERY there before I add the JQeury code.

    Also, as far as I know WP Show Posts will become part of GP Blocks somewhere in 2022? Will it still use the match height then as I know GP Blocks is quite lightweight. Might not want that code in there?

    #2063083
    Leo
    Staff
    Customer Support

    Also, as far as I know WP Show Posts will become part of GP Blocks somewhere in 2022?

    It will be part of GenerateBlocks pro and likely in 2022 🙂

    #2063534
    Benjamin

    Hi just regarding the code David gave to remove Jquery from the front end- this doesn’t remove Jqeury core right? (Not sure if you need Jquery core, but I think you do).

    thanks!

    #2064169
    Leo
    Staff
    Customer Support

    It should remove jQuery overall.

    #2064207
    Benjamin

    Alright sure, I’ll try it out then and see if there are conflicts. Perhaps a good idea to make sure with all the developers of the plugins I use. Luckily I don’t have many.

    I might as well start here-

      WP Show Posts (Uses Jqeury Matchheight- reason for ticket- but will test) anything else?
      Generateblocks
      Generatepress/ GP Premium

    Could you just confirm that any of these above don’t use jquery? Apart from what is mentioned.

    Thanks.

    #2064247
    Benjamin

    And while we’re at it can you just confirm if any of those use Jquery Migrate also? Thanks.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.