This topic contains 6 replies, has 4 voices, and was last updated by  vako 2 days, 16 hours ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #55202

    design_dolphin
    Participant
    Premium Member

    Hi,

    Working on website performance at the moment, and I noticed when offloading unused scripts that custom-plugins.js is 1.2mb, that is pretty sizable.

    I tried unloading it, but then the navigation stops working.

    My questions:

    1. What part of customs-plugins.js is responsible for the navigation (and should it be)?

    2. How to safely and sanely only load the js used on a blog and reduce the bloat? Is there a way to split up the custom-plugins.js into smaller plugins, so it’s easier to customize? A caching/optimizing plugin can combine them together later for example, or does/can this cause code conflicts?

    Hope the questions aren’t too complex or too much. Just the script size of the blog was a bit on the heavy side, and it can make a difference in performance/hosting solutions, etc. to a degree, whether that is worth changing the theme over is another discussion, but I generally unload/unregister what I don’t use, and it tends to make a difference, any sane and safe solution for that would be great

     

    #55206

    vako
    Keymaster
    WP Royal Team

    Hi @design_dolphin

     

    Can you please describe your issue more detailed? Can you please share the screenshot of the issue or a link where the issue exists?

     

    Kind Regards

    #55217

    design_dolphin
    Participant
    Premium Member

    Hi @vako,

    Yes, of course. Please don’t see the below as negative or anything like that, I’m  running into a real world complication of the current implementation,  describing that, and looking for a solution

    1. Naming

    It can be confusing why basis theme functionality like drop down menus is in a file called custom-plugins.js. Since the theme comes with plugins, I would think it would only relate to that, so if you don’t use plugins, you don’t need this file, but there appears to be a code conflict there maybe

    2. Losing unused code weight safely and sanely

    In the implementation for this blog it appears that custom-plugins.js has to be called in order for the dropdown menu and mobile menu to work, as well as some other things like infinite scroll of posts on archive pages. If that is the only reason (which it appears to be), then loading 1.2mb for such  ‘simple’ processes seems to be overkill and not needed maybe

    However, I don’t want to manually start editing this js file, in case of updates and stuff. So, maybe, if the files are more distributed in individual files, it may be easier to unload ones not used in child theme

    3. Screenshots:

    Unloading custom-plugins.js file:

    After unloading custom-plugins.js the dropdown’s in menu no longer work:

    After unloading custom-plugins.js the mobile menu not working:

    Does that help?

    #55223

    vako
    Keymaster
    WP Royal Team

    Hi @design_dolphin

     

    I will redirect this topic to the developers and they will check.

     

    Kind Regards

     

    #55324

    Duke
    Keymaster
    WP Royal Team

    Hi,

    Those JS plugins combined weight 96kb without FontAwesome icons script. FontAwesome weights 1.116mb and if you are not using icons on your website you can remove it from “custom-plugins.js” file but the mobile menu, search and social icons are loaded from FontAwesome so I think there is no solution for that.

    Kind Regards

    #55401

    Holly Thompson
    Participant
    Premium Member

    This is related to the question I posted a few days ago. I did a website check using a tool from Hubspot. The results said there are javascript problems with old libraries and code which are security issues and performance issues. The javascript files I found are in the widgets. I’m sure there may be others but I am not as knowledgeable as design_dolphin.

    For Ashe to have a robust long life, these issues need to be addressed. I am far enough along in building my website that I don’t want to change themes now. Please have the developers fix the bloated and old javascript.

    Thank you.

    #55413

    vako
    Keymaster
    WP Royal Team

    Hi Holly,

     

    We will take a look at the scripts used in the theme and we will update them.

     

    Kind Regards

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.