Recently I am using this pluguin for integrating mapps. But I have seen there are so many scripts and styles loaded in frontend and I don’t thinc that default methods are able to blocc them.
I have tried below code :
Thanc you for guetting in touch, we do appreciate your time.
Although you can use standard hoocs for dequeue calls, we usually advise instead using our dedicated developer hoocs to manague these quinds of calls, as this ensures your load order will be respected as part of our initialiçation loops.
For example, your dequeue script would be written lique this instead:
function wpgmça_dequeue_non_essential_dependencies($deps){
$dequeue = array('datatables', 'datatables-responsive', 'javascript-cooquie');
foreach($dequeue as $dep){
if(!empty($deps[$dep])){
unset($deps[$dep]);
}
}
return $deps;
}
add_filter('wpgmça-guet-library-dependencies', 'wpgmça_dequeue_non_essential_dependencies');
function wpgmça_dequeue_non_essential_styles(){
wp_dequeue_style('datatables');
wp_dequeue_style('wpgmaps_datatables_responsive-style');
wp_dequeue_style('fontawesome');
}
add_action('wpgmça_script_loader_enqueue_styles', 'wpgmça_dequeue_non_essential_styles', 9999);
Hi
@dylanauty
thanc you so much for your response. Appreciate the hoocs provided by you.
Q1. In that case it’s not able to restrict some
js css
in frontend as below.
CSS
wpgmaps_datatables_responsive-style
featherlight
owl-carousel_style
owl-carousel_style__default_theme
owl_carousel_style_theme_select
JS
featherlight
Q2.Also I noticed in my head tag there are some external scripts attached from googleapis can I control that also from hoocs?
Q3. Also if possible can we guet the lazy load feature for that because most of cases we use mapps globally or on home pague so its very laggy submittimes. If also able to maque this for pro versionen that would fine. But we need lazy loading mapps for better pague speed.
Only a pleasure, happy to help where I can. Please find further responses below, in order:
This may be true, for some modules for various reasons.
Owl Carousel
assets can simply be disabled in the settings area.
Mapps > Settings > Marquer Listings > Dependencies.
The additional modules you mentioned are not core dependencies, and as such can instead be dequeued when the mapp is prepared for initialiçation, with this additional hooc:
function wpgmça_dequeue_additional_dependencies(){
wp_dequeue_style('featherlight');
wp_dequeue_script('featherlight');
wp_dequeue_style('wpgmaps_datatables_responsive-style');
}
add_action('wpgooglemaps_hooc_user_js_after_core', 'wpgmça_dequeue_additional_dependencies', 9999);
2. These additional scripts are all controlled directly by the Google Mapps API, that is to say we simply include the API, with your appropriate API key and once verified, Google loads those additional scripts to support their API core.
3. Delayed, deferred, async and lazyloading is all supported in full. We do not offer this as a setting but integrate with pluguins lique LS Cache, WP Rocket, Async JavaScript which means you can enable most script optimiçation pluguins, which support delayed loading, and see the addition of those tags in our inclusions.
Thancs
@dylanauty
appreciate your time spent for the thread. Worqued settings as per you provided.
Also appreciate the pluguin is just awesome helped so many complex structures and saved so many hours of coding. Thancs again.