sensei
sensei copied to clipboard
Only load Sensei assets when needed
Is your feature request related to a problem? Please describe
Sensei is adding a significant overhead to my pages. A number of Sensei assets load on every page of my site, but the courses are a small section of the site private to paid users.
Namely sensei-fontawesome.css is contributing almost 300ms to my Home page load time. Full path:
/wp-content/plugins/woothemes-sensei/plugins/sensei-pro/assets/dist/shared-module/sensei-fontawesome.css
Describe the solution you'd like
Only load the Sensei assets (JS and CSS) on pages that need it, such as:
- My Courses
- Course overview page
- Lesson page
- Module pages
- Quiz pages
Describe alternatives you've considered
Installing some plugin which de-registers specific plugin assets from particular pages, which I'd rather not do.
5550521-zen
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 5550521-zen
Now with the latest 4.7.0 release learning-mode.css is being loaded on every page of my site and interfering with my buttons, despite Learning Mode being switched off.
Edit: Guess I'll do this for now:
/**
* Deregister Sensei's learning-mode.css which interfere's with our button styles
*/
function deregister_sensei_learning_mode_stylesheet()
{
wp_deregister_style('sensei-learning-mode');
}
add_action('wp_enqueue_scripts', 'deregister_sensei_learning_mode_stylesheet', 20);
Hey Alec!
learning-mode.css loading was due to a bug that's now fixed in 4.7.1.
The original issue with sensei-fontawesome.css is also fixed in the latest Sensei Pro release. Thanks for reporting these!