Hi @adenmantmea,
Generally, those files shouldn’t be needed for guest visitors. You can stop them from loading by using the wp_dequeue_script and wp_dequeue_style functions.
Here are the handles for the files:
/wp-content/plugins/wicked-folders/css/admin.css: wicked-folders-admin
/wp-content/plugins/wicked-folders/js/admin.js: wicked-folders-admin
/wp-content/plugins/wicked-folders/js/app.js: wicked-folders-app
Dequeuing the ‘wicked-folders-app’ script should also remove the associated inline code block.
I hope this helps. If you have questions, please let me know.
Thank you, it seems to be working. My only request would be: is there a way this could be built in to the plugin so everyone could benefit?
For those looking at this in the future, here is the code to remove the script and style files for guest visitors, added in my theme’s functions.php file. The number at the end is to force it towards the end of the stack to make sure it has been added before we try to remove it.
/* Remove wicked folders scripts if not logged in */
function wf_dequeue_files(){
if(!is_user_logged_in()){
wp_dequeue_script('wicked-folders-admin');
wp_dequeue_script('wicked-folders-app');
wp_dequeue_style('wicked-folders-admin');
}
}
add_action( 'wp_enqueue_scripts', 'wf_dequeue_files', 2000 );
Hey @adenmantmea,
Thanks for sharing the code snippet that you used.
I like your idea of building it in and we’ll look into that (perhaps adding it as an option).