Hi Guys,
Toolset Maps is an absolutely wonderful plugin, however I noticed that it loads Google stuff also on pages where it is not needed.
I'm a bit confused, because according to this thread, the new version of Maps should only load Google API when needed:
https://toolset.com/forums/topic/google-maps-api-also-loads-on-pages-not-using-it/
But on my site and also on Toolset Reference site it also loads on a page where there are no maps:
hidden link
These two two things seem to be loaded everywhere:
hidden link
hidden link
It's only that on pages with maps, of course, much more is loaded from Google.
If I deactivate Autoptimize I see these two JS on pages without maps:
/wp-content/plugins/toolset-maps/resources/js/wpv_addon_maps.js
/wp-content/plugins/toolset-maps/resources/js/views_filter_distance_frontend.js
But these two Toolset JS are very small and their impact on load times is negligible, especially when concatenated with Autoptimize.
The Google scripts, on the contrary, sometimes are by far the slowest element on a page. But perhaps wpv_addon_maps.js is the one causing Google API to load?
According to GTmetrix, "googleapis.com/maps/api/js?libraries=place" is parsed during initial page load and blocks page rendering.
My site is optimized for speed, and generally I am quite satisfied with the results in speed tests, however these two Google scripts are often 'the offenders'. Sometimes they load OK, but sometimes they significantly affect page load times. Because they are not cacheable, they also affect negatively speed scores which can be shown to clients.
I only use maps on 2 custom post types and on 3 specific pages. Is there a way to conditionally dequeue (or whatever the correct term is) the maps API everywhere else with a function? Or perhaps some other method to deactivate them when not needed?
Best regards
Tom
By the way, the support forum has been acting strange for quite some time. It tells me that I opened some support tickets, but I haven't even participated in those threads... The count of my support threads seems wrong, too. EDIT: it seems that support threads attributed to me were started by forum moderators ?