Remove unused JavaScript on AMP

Posted in: Newspaper
Post count: 155

Hi there!

I am receiving two messages about javascript on AMP (using mobile theme)
https://paste.pics/BR7QK
https://paste.pics/BR7QT

Is there anything to do to mitigate this?

Post count: 18283

Hello !

Since you are using the Mobile theme this issue should not be available. Again, this looks like it is going through your CDN. Can you exclude mobile theme from CDN ? Mobile theme was designed to use as few resources as possible just to make sure that it will offer the fastest user experience.

Thank you !

Post count: 155

Hi again, Vlad!

Deactivating the CDN did not resolve the issues, as you can see here:

https://paste.pics/BRGWC
https://paste.pics/BRGWN

Any other idea on what to do?

Thanks!

Post count: 18283

Hello !

You will have to remove your cache after disabling the CDN because as you can see here: https://www.screencast.com/t/qxFLTjl2WlK the elements are still coming from CDN.

Let us know the result !

Thank you !

Post count: 155

Hi, Vlad!

Not trying to be rude or anything, but you do recognize that this CDN is not mine, but from Google, right?

Something (I don’t know if from AMP plugin, or from Mobile Theme) is calling more than once this javascripts…

Post count: 18283

Hello !

A part of this should be fixed in the upcoming update that comes in the next week or two. Please wait for the new update and we will see what remains to be fixed after this.

Thank you for your patience !

Post count: 155

All I do here is wait… it does not hurt to wait a little (maybe a month?) more.

Post count: 155

Hi, Vlad!

Any news about this? The update has been released, but the problems (unused javascript and duplicate js in AMP) are still there:
https://paste.pics/C2TN7

Thanks!

Post count: 18283

Hello !

Please take a look at Tagdiv Newest tool CSS Analyzer. You can take a look at our tutorial here: https://www.youtube.com/watch?v=tnkVapqhIHc

Let us know if this was helpful !

Thank you !

Post count: 155

Hi!

What does this tutorial have to do with what I asked?
Maybe I didn’t understand, but it seems that you answered another person (and not me..)

Still waiting for an answer about the AMP javascript (and not css)…

Post count: 18283

Hello !

I am sorry for misunderstanding !

At the moment what you can do is to use the Autoptimize plugin, that will help reduce this.

Unfortunately at the moment for this there is no workaround.

Thank you !

Post count: 155

Autoptimize is not a recommended plugin, is it?
https://tagdiv.com/wordpress-plugins-compatible-with-the-newspaper-and-newsmag-wordpress-themes/

Furthermore, it is a pretty big plugin, with a lot of features and customizations. If I use it, what feature should I use? Last time I tried it, there wasn’t an option labeled “fix issues related to AMP”…

Thanks!

Post count: 18283

Hello !

Yes and no, our demos for example use Autoptimize plugin and as much as we can we do offer support for it. You can activate only some functions of autoptimize like the reduction of the JS.

I hope this was helpful !

Thank you !

Post count: 155

Hi!

The “reduction of the JS” is not an option in Autoptimize… I could find delay, defer, minification and concatanation. If I am not wrong, there is no other options (also, these options are present in another plugins – the one I use included). Am I missing something in Autoptimize?

Also, as much I use another plugins in my website, it seems that this problem is comming or from the Nespaper Theme, or the official AMP plugin (as I do not use any other plugins for serving AMP pages). Do you know where does this come from? Someone must have had this issue some other time, no?

Post count: 18283

Hello !

I have searched the e-mails too but couldn’t find anything relevant from other users to match our issue here. In Autoptimize from what I can see on our demos only this option is enabled: https://www.screencast.com/t/EzN0exRLy0pm

After you enable this make sure to clear your cache. Also if you use CDN I would wait 24-48hours to see if something has changed.

I hope this was helpful and let us know the result !

Thank you !

Post count: 155

Hi, Vlad!

I was searching a little also, and it seems that your demos use the “optimize JS” (Minification) and “aggregate JS-file” (Concatenation)… none of this options helps with the AMP issue.

But I also found a thread in GitHub that explains the issue:
https://github.com/ampproject/amphtml/issues/28638

It is a kind of false positive given by PSI. It seems that there is an ongoing issue with the AMP devs to mitigate these notifications..

Kinda sucks, but apparently there is nothing for us to do for now…

Viewing 16 posts - 1 through 16 (of 16 total)
The forum ‘Newspaper’ is closed to new topics and replies.