how to exclude the grow script in SG optimizer
CompletedHello I am trying to install the Grow Script. I use Siteground and they say that the Grow plugin is hardcoded and not properly enqueued. This means I need to follow the instructions here to add it to php exclusions. Could you tell me what to add where it says ‘script-handle’ and ‘script-handle-2’:
add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' ); function js_combine_exclude( $exclude_list ) { $exclude_list[] = 'script-handle'; $exclude_list[] = 'script-handle-2'; return $exclude_list; }
thanks
-
Official comment
Hi Markos Koemtzopoulos ! I would give data-grow-initializer a try first - this article should help. Disabling the Combine Javascript setting in the plugin would also do the trick without having to exclude any scripts manually.
I'll also leave this thread open for the community in case others have successfully excluded the script with this method in the past.
Thanks!
-
I have found that the problem is that the plugin js is not properly enqueued. I have found out how to enqueue it but I am not sure of the path. Could you confirm that the path to the .js file is /plugins/grow-for-wp/assets/dist/admin.1.5.0.js
0 -
Hi Markos Koemtzopoulos ! Yes, that looks like the correct path.
0 -
Are you sure because nothing happens when I exclude that. Js from siteground combining it. Could It be the case that the grow js is being created by a php file like how the journey js is generated?
0 -
I have enqueued and excluded /plugins/grow-for-wp/assets/dist/admin.1.5.0.js from being combined. When I visit my profile I see this message "Grow is currently active on your site!". But when I click “Check grow connectivity” it says “There is a problem with your connectivity.”. However if I refresh the page it says ""Grow is currently active on your site!" again. Which message should I trust?
0 -
Markos Koemtzopoulos If you're intermittently getting the error, then that would mean there are still intermittent issues with the dashboard connecting. Disabling the Combine JS setting might be the best option in this case, unless someone in the community managed to find a way to exclude Grow successfully and can share the steps they took. This is only an issue with this specific plugin, since other optimization plugins list all assets or allow you to exclude a key word like “grow”, which would likely mean it's not possible to exclude many third party codes.
0
Journey is Self Supported
Please sign in to leave a comment.
Comments
6 comments