September 16, 2020 at 1:22 pm #55202
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.
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 greatSeptember 16, 2020 at 2:43 pm #55206
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 RegardsSeptember 17, 2020 at 11:09 am #55217
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
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
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?September 17, 2020 at 4:25 pm #55223
I will redirect this topic to the developers and they will check.
Kind RegardsSeptember 22, 2020 at 3:26 pm #55324
DukeKeymasterWP Royal Team
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 RegardsSeptember 26, 2020 at 4:32 pm #55401
Holly ThompsonParticipantPremium Member
Thank you.September 28, 2020 at 10:39 am #55413
We will take a look at the scripts used in the theme and we will update them.
You must be logged in to reply to this topic.