Working with various WordPress websites (freelancing), I noticed something that bothers me for a while
I have seen a lot of codecanyon plugins and themeforest themes which load all the scripts they need on ALL admin pages. Not only on the page where needed, but on ALL admin pages…One theme doing this is even in top 20 on themeforest, I will not name it
Why is this wrong:
For instance, if the theme/plugin loads google maps API on ALL admin pages, even where the theme/plugin doesn’t need it, it will break other map plugins - this is because Google Maps throws an error and doesn’t work if their API is loaded twice on a page.
Just imagine that a theme incorporates a lot of shortcodes…For this, it’s loading various jQuery scripts and jQuery plugins that aren’t loaded by default by WordPress (jquery-ui-dialog, file-upload, pick-a-date, etc). And it’s loading them on ALL admin pages…Why? I don’t now.
Now just imagine that the end user will install other plugins which also load their scripts…
You can imagine how slow the admin pages will be. Not to name the conflicts…
I could give more examples, but here is an article showing one way to do this correctly, it’s applicable both for theme and plugin authors
You can google to find other solutions, but please stop loading your scripts and styles on ALL admin pages! The buyers will thank you in the end!