Skip Navigation

[Closed] Javascript optimization

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Luo Yang 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2051025
screenshot.jpg

Tell us what you are trying to do?
I'm using SG Optimizer to bring the website up to par with Google PageSpeed Insights. As long as I don't use views, the page scores in the 90s. Now that I inserted a View on the homepage, my score plummets to the 60s because of the Toolset javascript.

Is there any documentation that you are following?
I checked your solutions but SG Optimizer can't find these files (https://toolset.com/faq/how-to-use-optimization-plugins-with-toolset/). What it does find does not help the scoring.

Is there a similar example that we can see?
Launch PageSpeed Insights on hidden link

What is the link to your site?
hidden link

#2051383
gsi.JPG

Hello,

I have tried the URL you mentioned above in Google PageSpeed Insights:
hidden link
The score is 81, see my screenshot gsi.JPG

Where can I see the problem you mentioned above:

my score plummets to the 60s because of the Toolset javascript.

And there is a JS error in your website:
Uncaught SyntaxError: Identifier 'wpvViewHead' has already been declared

Above problem is from your website:
hidden link
line 5~8:

const wpvViewHead = document.getElementsByTagName( "head" )[ 0 ];
const wpvViewExtraCss = document.createElement( "style" );
wpvViewExtraCss.textContent = '';
wpvViewHead.appendChild( wpvViewExtraCss );;

You will need to remove them from above JS file of your optimization plugin

#2051613

The page speed was 81 because "Combine Javascript Files" was activated in SG Optimizer - which breaks Toolset. I deactivated it. You will now see that my score is in the 60s.

#2052737

Yes, if you want to improve the scores, according to Google PageSpeed Insights suggestions, you can install the optimization plugin.

Please provide details for the problem:

activated in SG Optimizer - which breaks Toolset

How and where "SG Optimizer" plugin break Toolset?
Did you check the JS error message I mentioned above?
https://toolset.com/forums/topic/javascript-optimization/#post-2051383

#2052745

I don't know what to do with js you mentionned. It seems to be the one generated by SG Optimizer. As you can see in the screenshot I provided, SG Optimizer offers a dropdown list of js that I can exclude from Javascript combination.

#2052901

You can restore back your website with SG Optimizer plugin activated, you should be able to see the JS error message in your browser console window, and if you still need assistance for it, please provide a test site with the same problem(activated in SG Optimizer - which breaks Toolset), fill below private message with the test site credentials.

#2053741

Thanks for the details, I can login into your website, will update if find anything

#2053903

I can see the problem in your website, since it is a compatibility issue with the plugin "SG Optimizer", but this plugin only works in their SiteGround server, it can not be activated in my localhost, in order to debug this issue, we need a live website to test and debug, you can provide current staging site "staging8.emedia.quebec" or provide another website with the same problem, so we can check and debug it closely.

Please provide the FTP/SFTP access in below private message box, thanks

#2058207

I still need help, but you requested a test site, not a staging site. So I must now recreate everything.

#2059173

Since it is a compatibility/server issue, according to our workflow, we need to provide detail steps to reproduce the same problem, it would be better to get a fresh WP installation with only Toolset plugins + "SG Optimizer", duplicate the same problem in it with a simple view, so we can debug and test it in the test site.

Private message enabled again

The topic ‘[Closed] Javascript optimization’ is closed to new replies.