Skip Navigation

[Closed] WP Rocket Javascript deferred issue

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 1 year, 2 months ago.

Assisted by: Nigel.

Author
Posts
#2638537

Whenever I activate "Load Javascript Deferred" in WP Rocket it breaks the layout of Toolset views. Specifically, a grid layout with various columns becomes one column.

I have followed the instructions on this page: https://toolset.com/faq/how-to-use-optimization-plugins-with-toolset/

None of the exclusions seem to work.

Any ideas?

#2639349

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I looked at the settings available with WP Rocket for optimising JavaScript, and I can see that when active you can provide a list of exclusions, which you've done.

However, one of the scripts (frontend.js) isn't enqueued normally, it is added via an inline script in the page head, and I suspect that is the one causing the problem.

You can disable the custom way it is enqueued by adding the following to your wp-config.php:

define( 'TB_SCRIPT_STYLE_LAZY_LOAD', false );

Do you want to try that? It should be enqueued normally in that case, which should make it amenable to including in your list of exceptions for that setting.

#2639813

Hi Nigel,

Thanks for the idea but unfortunately it didn't seem to make a difference. Any other thoughts?

#2640031

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I see that this is now being added to your page head, but it's with an async attribute whereas the other scripts from Toolset are not.

<script async="" src="<em><u>hidden link</u></em>"></script>

Does that need adding to an exclusion list?

#2640313

I've added that but no change.

#2642241

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry I haven't had a chance to follow up before now.

Did you update Toolset Blocks? The link I shared had version 1.6.6 appended, but I see you are now on version 1.6.8 of Blocks.

I'm not sure how precise the files you added to the WP Rocket settings need to be and what kind of wildcards you can use, but it would be better not to include versions at all, otherwise you'll need to be updating them after every plugin update. (That doesn't just apply to Toolset.)

I also said you would need to add a constant to your wp-config.php, and it doesn't look like you've done that.

The topic ‘[Closed] WP Rocket Javascript deferred issue’ is closed to new replies.