How can I remove unused code after uninstalling apps?

Hi @OliUK

May I kindly ask you to have a look on my website: https://azkadenia.myshopify.com/
The performance is only 30% on Google-Speed-Inights

Any idea what could go in/out to speed up my web ?
Many thanks in advance.

Best
Yazeed

Hey @lsmall & @OliUK ,

Chiming in with a tangent, but a relevant one. Lsmall, your list of unused javascript contains one I’d advise you to keep. I only just discovered why myself… after assuming it was junk.

I’m no expert, but I know enough HTML, CSS & JS to send the right details to a dev team. And I found this code was connected to my store after running the home page through GTMetrix: ddg-tr-as-easylist. Well… that’s actually a link to the GiTHub page I found after Googling ddr_embed.js. And I only found that JS after inspecting my home page (pressing CMD+OPT+i to see the code) and then connects dots in the background I found this… https://spreadprivacy.com/duckduckgo-tracker-radar/.

That particular piece of Duck Duck Go’s JS may not have been used at the time your scan was run, Lsmall, but it serves a vital purpose. Most likely connected to a security app you have installed. Unless Shopify has DuckDuckGo code embedded in its approved theme’s as part of an SOP. OliUK, could you enlighten us on that?

Wait… how does this tie back to unused code? There’s so much of it! And not all of it’s bad. Plus Shopify’s 2.0 themes have removed the bulk of it becoming an issue — hallelujah! There’s a long way to go, though. I spent 3 boooooring days last month playing find the GIF. A dropshipping app I added (since removed) had a teeny-weeny GIF embedded in one particular place (nowhere else) and it somehow caused my product pages image carousel to stop working. Amongest other things… so so many other things.

The quickest route to getting rid of junk code is sending a GTMetrix URL to someone who knows what they’re doing. Like OliUK.

Lsmall, I think Lighthouse is great. Or PageSpeed Insights. Wherever you got the list of unused code from. But the reason I like GTMetrix is they have a Waterfall view that makes things instantly clear to me re what code is causing issues. You can see when code gets activated on the page & how long it takes to load after that — screenshot attached. GTMetrix also gives you a combined % score that is (pretty much) an average of the desktop and mobile versions of each page.

Once you find the unused code in the Waterfall view you can Google elements of the code file that are repeated. If they’re repeated, there’s a good chance that is either:

• The initials of the brand/company who owns the code

• An abbreviation of their primary prodcuct — app name, name of their main feature

• Name for a well known piece of open source code that you’ve never heard of, but folks on GitHub definitely have. For years, probably…

Dev teams also love it if you send the URLs for your GTMetrix searches because they’re timestamped. So the link you send will be for that particular page on your site at the particular time you ran the search. Lighthouse / PageSpeed Insights renew the search each time.

And no, I don’t work for GTMetrix. But yes, I’m clearly a nerd and borderline obsessive.

Over ā€˜n’ out for now!

T

Hi, we faced the same issue that 3rd party apps loaded a lot of Javascript on every page, even tho the apps were sometimes only required on specific pages like cart, cms etc.
We developed an app that helps to manage where to load 3rd party Javascripts and where to block it.
https://apps.shopify.com/pagespeed-javascript

The app is still in an early stage and if you have any suggestions please let me know

@OliUK

Hi Oli, you sound so helpful and sound to know a lot. Complete novic with online stuff. Could you please take a sec and have a look at www.sootandty.com and see how i can get better with page speed? Thank you

HI @ZakMillion ,
I didn’t see any low hanging fruit, but it’s been a while since I’ve looked at a Google Lighthouse report and they’ve changed a bit.

This is the unused Javascript section of your report and it looks pretty alright. Maybe running that Facebook service through Google Tag manager could help (the pixel stuff is a bit out of my wheelhouse these days though, and that might not be posssible).

Cheers,

Oli

Hi @OliUK ,

My website’s mobile performance looking bad. How can i reduce unused js or css codes.

May I ask you to have a look on my website: https://flamelilys.com/

Hi Oli.

I’m having issues with PageSpeed, particularly in mobile version. Desktop I’m at 93 Speed, but mobile is like 50s. I don’t understand, and I was hoping you could take a quick peek. http://www.thewoodbatfactory.com

Thanks!

Hi OliUK, I was wondering if you could help us with ours? Need to remove unused JavaScript to increase our page speed but not exactly sure where to start or how to do it. It says we have javascript through:

Mailchimp

Amazon

Facebook

Gameball

YouTube

Etc.

Any help would be much appreciated!

Hi @Dynamicc Speed reports are still guidelines you need to interpret not just remove whatever it says. Most of the scripts you have listed are used for necessary theme functionality on most stores. Such as if you ever use youtube videos you shouldn’t just remove or prevent youtube scripts, amazonis for payment methods,etc etc etc.

If you need a consult to understand and manage your theme , or an audit and or customization of your themes performance then contact me by mail for services.

Contact info in signature or click here to mail me directly.

ALWAYS please provide clear context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

I have two favors to ask, I had bugsnag installed and I uninstalled it but i can see its folder and three files still getting loaded on my webpage. I tried to download the theme and look for ā€œbugsnagā€ in all files with no success, it also doesnt show on the embeded apps. How can I remove these files or prevent them from getting loaded.

My number 2 issue is the slowness of my website, I have tried to decrease the amount of apps but some i do need I also have tried to optimize the images, not sure what else to do. do you see anything significant that im missing?

My website is : https://dannicowoodworks.com/

I also thought Shopify gzips resources like images automatically but when i look at the network tab its not gziped , what am i missing?

Hi @OliUK can you help me check mine. I am having the same issue. Thank you. diokollections.com

Hi @OliUK can you help me check mine. I am having the same issue. diokollections.com

hi Oli, I have been wondering this for awhile now! And even posted a question that hasn’t been answered yet :slightly_smiling_face: I would love to add a ā€˜preload’ to the main product image for each product, in the product page template, but I’m not sure what code snippet I would use. All that I have seen ask you to put in the snippet containing the actual image name.

For instance, is there something like this?

Thank you!!

Sincerely, Katie