What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: How to clear unused code ?

How can I remove unused code after uninstalling apps?

TattooKits
Tourist
11 0 3

I found that after uninstalling the apps, the page will have a lot of unused code, affecting the speed of the page. Is there any apps that can clear all unused code of the website?

Replies 231 (231)
OliUK
Shopify Partner
235 2 56

Hi @KrisMcD ,

Yep sure, no worries.

It can be tricky finding where the request is initiated from. There's a 'request initiator chain' section in the 'network' area of Google lighthouse, but I still can't work out where the Recaptcha request is coming from.

I'd recommend looking through your apps, as well as the <head> section of your theme.liquid file. If you still can't find a mention of the recaptcha, you could download your theme's code, then use a free coding editor like TextMate's 'find in project' tool to search through the entire folder for 'recaptcha' or a similar keyword to try and work out where it's coming from.
As always, consider testing any removal you make as it might have adverse effects.

For the styles, this is harder. Unless it's styling from an unused app, I wouldn't recommend editing any stylesheets. It just gets complicated and easy to make a mistake.

Good luck,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

KrisMcD
Visitor
3 0 0

Sounds good, thank you so much for your advice!

Duncan8
Visitor
3 0 0

Hi! I have a site that has undergone maaaaaany revisions and at least like a half dozen app installs and reinstalls over the years. I'm trying to optimize it and Google is also recommending I take a look at some unused JS code. Could you look at my site and tell me what you think?

 

https://alliedlithium.com/

PaulNewton
Shopify Partner
7516 662 1577

@Duncan8 unless you've kept code in version control the main way to get rid of lots of vestigial app code is to download fresh version of the theme and transplant any custom code you want to the newer version.

 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


OliUK
Shopify Partner
235 2 56

Hi @Duncan8 

I mainly worry about the render-blocking resources section of the Google report. Your report mostly contains requests from your theme and theme's stylesheet:

URLTransfer SizePotential Savings

…css/bootstrap-theme.min.css
(netdna.bootstrapcdn.com)
3.5 KiB
910 ms
…css/bootstrap.min.css
(netdna.bootstrapcdn.com)
31.4 KiB
1,810 ms
…assets/style.css?3777
(cdn.shopify.com)
0.2 KiB
790 ms
…css/font-awesome.css
(netdna.bootstrapcdn.com)
10.6 KiB
1,210 ms
/jquery-1.9.1.min.js
(code.jquery.com)
32.2 KiB
1,820 ms
…js/bootstrap.min.js
(netdna.bootstrapcdn.com)
7.1 KiB
1,210 ms
43.8 KiB
1,990 ms
/js/csp.js
(cp.boldapps.net)
73.7 KiB
2,210 ms
0.3 KiB
870 ms
…1.9.1/jquery.lazyload.min.js
(cdnjs.cloudflare.com)
1.4 KiB
860 ms
 
 

 

Like Paul mentioned, doing a clean install of your theme and then adding only the apps you currently use back in, could be a good idea. That way you can make sure you haven't got code from previous apps on your store.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products.

 

 

Dynamicc
Visitor
2 0 0

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!

PaulNewton
Shopify Partner
7516 662 1577

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.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


lsmall
Tourist
8 0 2

Hi

I have the same problem. Rosylana.com. Thanks!

Google says remove unused javascript, what can I do about it? 

103.4 KB
77.5 KB
75.5 KB
66.4 KB
/shopify_v2.js
(cdn.judge.me)
87.1 KB
52.1 KB
/assets/ddr_embed.js?ddr_token=…
(d22ahnxn75jhdh.cloudfront.net)
68.5 KB
37.5 KB
47.9 KB
29.4 KB
32.3 KB
27.3 KB
/ellipsis.js?api_key=…
(script.metricode.com)
39 KB
23 KB
31 KB
19.5 KB
/5eef830….js
(cdn.getshogun.com)
42.7 KB
18.1 KB
25.3 KB
18.1 KB
21.7 KB
17.4 KB
16.1 KB
15.5 KB
16.9 KB
14.9 KB
…1.9.1/jquery.min.js
(ajax.googleapis.com)
33 KB
14.2 KB
31.4 KB
12.5 KB
14.1 KB
9.7 KB
13.8 KB
7.7 KB
16.9 KB
7.6 KB
18.7 KB
5.8 KB
/tag.js
(deluxe.onetag.io)
12.5 KB
5.6 KB
12.7 KB
5 KB
8.6 KB
3.7 KB
4.2 KB
2.7 KB
…2.0.0/shogun-lazysizes.js
(lib.getshogun.com)
4.8 KB
2.3 KB

 

 

OliUK
Shopify Partner
235 2 56

Hey @lsmall ,

I had a quick look at your site. There was a couple of errors you could look into, but sometimes these errors are just ungracefully managed results of fully operational apps.

The two that came up are: helpfulcrowd.com and getshowgun.com. If you're using both of these apps, then I wouldn't necessarily worry about it. Your product page load speed on my Mac is 1.58secs which seems pretty reasonable.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

Arshpreet
Visitor
3 0 0

Hey @OliUK can you help me too please my site score is just 34

here is my product page link

https://amichestore.com/collections/all/products/best-dad-ever-t-shirt

please help

OliUK
Shopify Partner
235 2 56

Hey,

On my internet your page loaded in just over 1 second, which seems pretty good. Both Paypal and Facebook pop up in the load time.

Here's Googles lighthouse report

 

Main-Thread Blocking Time

Shopify

694 KB

1,062 ms

Facebook

200 KB

101 ms

Google Analytics

38 KB

17 ms

Google CDN

65 KB

16 ms

PayPal

3 KB

13 ms

Klaviyo

18 KB

0 ms

Other Google APIs/SDKs

8 KB

0 ms

Google/Doubleclick Ads

0 KB

0 ms

 

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

KCCHUN
Visitor
2 0 0

 

@OliUK 

 

URLTransfer SizePotential Savings

493 KiB
365.8 KiB
/app.v1.0.351.js
(cdn-swell-assets.yotpo.com)
189.8 KiB
150.1 KiB
…timer-app/common.js
(cdn-spurit.com)
170.9 KiB
95.5 KiB
70.4 KiB
52.9 KiB
59 KiB
36.1 KiB
57.6 KiB
34.7 KiB
39.5 KiB
21.1 KiB
34.7 KiB
20.9 KiB

 

URLTransfer SizePotential Savings

11.4 KiB
930 ms
9.8 KiB
930 ms
29.7 KiB
1,230 ms

 

 

OliUK
Shopify Partner
235 2 56

Hi @KCCHUN ,

Could you post your URL? It's hard to know if there's requests blocking your initial page load, or whether you have optimised images from the info you included.

Cheers,

Oli

——————————

Founder @ www.preproduct.io

The smarter way to launch products.

 

 

KCCHUN
Visitor
2 0 0

@OliUK 

 

https://www.hatch.my/ is is my page. 

Cooki107
Visitor
1 0 0

Hi @OliUK,

 

ive been reading through your advice to everyone and it is very useful and helpful!

Im hoping you can advise me on a similar point?

my pagespeed load time is pretty poor (24) and i keep trying different ways to increase it such as optimising my images and using Shopify Apps to optimize the images and alt files. 

it doesnt seem to have improve it and im wondering if you can help? ive attached some screenshots of the report and the URL is: -

www.bawlersncrawlers.co.uk

 

Thanks!

 

Nathan

 

Cooki107_0-1612028316876.pngCooki107_1-1612028321673.png

Cooki107_2-1612028325941.png

 

OliUK
Shopify Partner
235 2 56

Hi @Cooki107 ,

I just had a quick look and there seem to be two requests holding up your initial page load. One is from your theme, the other I'm not so sure about:

/css?family=…
(fonts.googleapis.com)
1.8 KiB
770 ms


It's to Google's font API. There's a way in Google Chrome to see where the request was initiated from, but I can't find this one on any page of your site.

Sorry, I can't be of more help. However, your site does run nice and quickly on my Mac, so I'd take the page speed score with a hint of salt (at least for moderately powered computers with reasonable internet speed).

Oli

——————————

Founder @ www.preproduct.io

The smarter way to launch products.

 

 

 

powercube
Visitor
3 0 0

Hey @OliUK,

Not sure if you're still active here, but would you mind taking a look at my website? https://www.powercubeusa.com/

It used to have a score of 65 but now its around 38. Any help would be greatly appreciated, thank you.

OliUK
Shopify Partner
235 2 56

Hey @powercube ,

Happy to have a quick look. Yeah, there's something Google doesn't like here. Your store loaded pretty fast for me, but the report lists 'time to interactive' as 9 seconds.
Not sure what could be causing this, nothing really stands out. Your store isn't really making many requests outside of your Shopify theme and Facebook. 
There's a request for a font library which Google says directly slows your page-load down by nearly a second. This is probably from your theme, but removing it could be a big win if it's not.

So, sorry not a tonne of advice I can give here. Is it possible you've turned on a particular setting in your theme recently? That might cause the recent score change you saw.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

SteveAndLauren
Visitor
2 0 1

Hi @OliUK

I see you've been so awesome to so many people and we're hoping you could help us. 

We seem to be having the Javascript issue and it seems to be killing our mobile performance too. 

Could you take a look and let us know what you think? We would really really appreciate it!

www.MyStoryMerch.com

 

OliUK
Shopify Partner
235 2 56

Hi @SteveAndLauren ,

Yep sure, no worries.

You actually have a pretty high score from Google (I rarely see above 50 to be honest and you have 68).

In the unused Javascript department, you have an upsell app (name beginning with an 'f' I think) at the top of the list in Google's report. It's not a huge request though, so I wouldn't worry too much.
The section of the Google reports which I worry about the most is the 'remove render blocking resources', which lists the services/requests that directly slow your page load time. The report for your site doesn't seem to actually have that section, so that's a very good sign.

So all in all, I think you guys are doing pretty well on the page-speed front. I can't see anything obvious that would cause the mobile issues I'm afraid.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

SteveAndLauren
Visitor
2 0 1
Thanks so much! We really appreciate it!
thebiori
Visitor
2 0 1

Hi @OliUK ,

You really have been a savior, thank you so much for your support in advance.

Can you please share your inputs on slow performance score of my website on Mobile (30) as well as Desktop (67)?

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.houseofbiori.com%2F&hl...

I noticed 1 image is big, I will remove it, however there are other unused codes related delays.

Regards,

Sandy

OliUK
Shopify Partner
235 2 56

Hi Sandy,

No worries at all.

Yeah, good spotting. Swapping out that 1mb image would be a good start

Another good move would be to lazy load your embedded YouTube video, this can be done by adding loading=“lazy” to the youtube’s outer element/code.

On mobile, this fairly big Javascript file is being requested from YouTube: https://www.youtube.com/s/player/e0d06a61/player_ias.vflset/en_US/base.js I don’t really know what it is or why it’s needed, but it slows your mobile page speed by 616ms apparently.

Might be worth googling this.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

thebiori
Visitor
2 0 1

Hi @OliUK 

Thanks for your prompt response. I added loading="lazy" on the youtube's outside element. That did help.

For mobile, I will do more google search as I haven't been able to get to the root cause of the youtube link.

Thanks once again for your support.

 

Regards,

Sandy

Gettoss
New Member
4 0 0

Good day @OliUK 

I saw that you've helped a lot of people over years .. you're a hero.

sorry to as you this, but could you kindly take a quick look at my website too? it is  

 

my website was running fine until I started to try over +10 apps then delete them. I don't know if the issue is unused snippets or the newly currency converted that I am using

my main page loads slowly (especially on mobile view) it takes more than 3 sec to be loaded and if you click on anything before it finishes loading "such as navigation button" the page keep refreshing for some reason

 

If you could identify the issue that would be great

Thanks in advance

OliUK
Shopify Partner
235 2 56

Hi @Gettoss ,

Thanks for the kind words.

Yep sure, post your URL and I'll have a quick look.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Gettoss
New Member
4 0 0

Thank you very much here's the url: www.boldwears.com

OliUK
Shopify Partner
235 2 56

Hi @Gettoss ,

In terms of Javascript, the largest is a sizing app, then a Google code library (not sure if an app initiates this or not). Theres  a file called  nt_vendor.min.js that’s loaded (the marketing app Alexa came up when I googled the file name). There’s a couple of other smaller requests as well.

These requests don’t necessarily slow down you main page load, but if you recognise one as an app you’ve uninstalled, it might be worth reaching out to the app developers.

I couldn’t recreate your mobile issue, but I noticed you had a chat and cookie app launching on the home page, so it might be worth googling those app names and the issue you’re happening, just to see if there’s a known issue.

Good luck,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Rhawfit
Visitor
2 0 0

Hi @OliUK 

I hope all is well - 

Apologies for being another link in the chain of requests however, would it be possible to provide some assistance also?

I can see the issues reducing the website speed for mobile as they've been displayed, yet i'm not finding it clear on how to resolve the issues. 

 

Any help would be greatly appreciated. 

Thanks 

OliUK
Shopify Partner
235 2 56

Hi @Rhawfit ,

Yep, sure. If you post your store's URL, I'll have a quick look.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Ben_Neorai_Gate
Explorer
53 1 6

hey @OliUK 

Wow! you're like superTech-Man here hehe

 

Any chance for help with my data as well?

my website is www.thrivilion.com

I'm having issues with the mobile page speed time, unnecessary javascript, and also I'm having errors in the Google Search Console - 

I have this issue "Viewport not set", I have no idea how to fix it, I'm having this issue on several pages...
Also, I have those issues: "missing field price valid until" and  "server error 5xx"...
 
Any idea what I can do?

 

OliUK
Shopify Partner
235 2 56

HI @Ben_Neorai_Gate ,

I had a quick look into the viewport issue, this is what Google say:

Viewport not set

The page does not define aviewportproperty, which tells browsers how to adjust the page’s dimension and scaling to suit the screen size. Because visitors to your site use a variety of devices with varying screen sizes—from large desktop monitors, to tablets and small smartphones—your pages should specify a viewport using themeta viewporttag. Learn more inResponsive Web Design Basics.

I'm not familiar with this issue, but it sounds like something your store theme should provide. Has your theme been modified greatly? or do you suspect a chunk of code has been removed? Might be worth getting in touch with the developers.

The unused Javascipt section of your Google report isn't bad. They're all fairly small, so nothing too crazy to worry about.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

stewam2
Visitor
1 0 0

Hi @OliUK 

I wondered if you might help us also?

Our website is www.thetastytreats.co 

stewam2_0-1621920800644.png

Thank you so much!

OliUK
Shopify Partner
235 2 56

HI @stewam2 ,

I just had a quick look at your unused Javascript section. The requests from the apps are a pretty reasonable size.

The top request is big though. I'm wondering if it's coming from your store's theme, not an app. The location in your theme is assets/empire.js.
Unless you know it's from an unused app, I really wouldn't recommend removing it as my guess would be that it's the main Javascript file for your theme.

Cheers,

Oli

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Ben_Neorai_Gate
Explorer
53 1 6

@OliUK first thank you for your reply about this issue.

the developer of the theme says it has nothing to do with the theme, and it is something with the app I've added or GemPages. 

However, I have no idea how to solve this - is it something I should be bothered about now? or I can solve this along the way?

also what about the rest of the issues? any idea what to do about them (again if at all)?

 

GemPages
Shopify Partner
5625 1262 1254

Hi @Ben_Neorai_Gate,

This issue related to Google Search Console report, so we might need to check it directly on your current store.

Our higher-tech team received this inquiry and they will contact you directly.

For further information or concerns, please don't hesitate to let us know via live chat or email support ( support@gempages.help)

Thank you so much!

 

 

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
Rhawfit
Visitor
2 0 0

Ah brilliant, the URL is: rhawfit.com

Thank you very much

OliUK
Shopify Partner
235 2 56

Hi @Rhawfit ,

It looks like you have a couple of images that could be lazy loaded: 

OliUK_0-1622139688757.jpeg

 

127.2 KiB
35.3 KiB
OliUK_1-1622139689401.jpeg

 

 

Google also mentions that your server takes nearly a second to initially respond, which doesn't sound great. Maybe contact your server company and ask them if they can help.

Unused Javascript wise, most of it is coming from your theme. But, the biggest request is to Google. I can't tell what kind of service is being requested, but here's the link: https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.vQiXRrxCe40.O/m=client/rt=j/sv=1/d=1/ed=...

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

lsmall
Tourist
8 0 2

Thank you so much!

Dainius22
Visitor
1 0 0

Hi @OliUK can you maybe check my page? I have the same issue with unused Java Script. My page is gamingfnatics.com. Thank you Capture.JPG

OliUK
Shopify Partner
235 2 56

Sure @Dainius22 ,

The first time I loaded a product page, I got some failed request messages referencing ‘Laravel’, which is a web app framework, I haven’t been able to recreate this though, so I’m not sure what that was about.

Shopify takes the lion’s share of the load time, but there’s also an app called ‘size-charts-relentless’ that Google says makes the load time an additional 830ms.
Before thinking about removing the app, I would encourage you to get in touch with the developers, they're probably very happy to help and the file their app is requesting is just a very small styling (css) file: https://size-charts-relentless.herokuapp.com/css/size-charts-relentless.css
Maybe they could load this through Shopify script tags (so after the main page has loaded). I also wouldn’t take Google's report verbatim. I'm also not sure that this is happening on every page.

 

Cheers,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

shopdellrose
Visitor
2 0 0

Hey Oli,

First of all, thanks for helping so many people out with this. I already looket into our store but can't quite make sense of what exactly affects loading times, maybe you can help one more soul out! Our store is shopdellrose.com

Thanks and much appreciated!
Philipp

Michelle06
Tourist
3 0 0

hi @OliUK would you mind checking out my store aswell please? 🙂

flowerhtboxgifts.co.uk

many thanks x

OliUK
Shopify Partner
235 2 56

Hi @Michelle06 ,

Yeah, sure. I just went to have a little look for you, but the URL you posted is broken? Maybe you included an extra character by mistake?

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Michelle06
Tourist
3 0 0

@OliUK so sorry I did type it wrong 🙈

Flowerhatboxgifts.co.uk

OliUK
Shopify Partner
235 2 56

Hi @Michelle06 ,

I just had a quick look for you and sorry to say, I couldn't see any low hanging fruit in terms of ways to increase your score.

Your store loads nice and fast for me, but Google says that it has at least one page which takes 8 seconds before it can be interacted with. This wasn't my experience at all, so I'm wondering if there's one particular page that is ruining your score. Or maybe I'm misreading the report, despite this thread, page speed optimisation isn't a big strength of mine.

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

Michelle06
Tourist
3 0 0

@OliUK thank you so much.

I've resized all my pictures and then compressed them which has made a massive difference to my speed. Thank you for taking a look xx

copescoins
Visitor
2 0 0

Hi there

sorry I’m a bit late to the party on this but my store speed is just 21

my web address is www.copescoins.com and wondered if you could provide any in site in what is slowing it down so much

I have optimised my images etc but think it may be as a result of installing then uninstalling so many apps

best wishes

David

OliUK
Shopify Partner
235 2 56

Hi David,

Happy to have a quick look.

Google says that you haven't got lazy loading enabled. If you search through this thread, there' some explanations on how to do it. It basically involves adding loading=lazy to the <img tags in your theme. Only your theme seems be slowing the initial page render significantly.

There's also a file in your theme's directory called: smk-sections.js which isn't slowing down initial page-load, but is on the bigger side. Sounds like it might be from a third-party app.

Good luck,

Oli

——————————

Founder @ www.preproduct.io

The smarter way to launch products. 

 

 

duymd14
Visitor
2 0 0

Hi @OliUK , I am having the same issues with javascript. My page is www.lederschmidt-1991.de 

Could you please help me out?

 Thank You So Much

Screenshot 2021-03-05 at 11.18.21.png