I’m currently authoring the development of a plugin for wordpress, and I’m having trouble figuring out which would be the best way to add scripts to the plugin. I’m in the process of adding more scripts, and I already have JQuery (through WordPress), JQuery UI (through googleapis). Eventually I’ll be adding SWFUpload, but before I continue, I wanted to understand what would be the appropriate approach to my situation.
From what I’ve gathered, and I’m not totally sure if I’m correct on it. There’s 3 different ways to add/enqueue scripts.
The things I’m wondering about, is reliability, speed, and any standards to it, if any.
Always use the built-in versions. Don’t waste time with old WordPress installations – other plugins will break there too.
wp-includes/script-loader.php for the list of available files. Quite a lot. 🙂
And avoid remote resources. Some (Google) fail to send the scripts gzip compressed to all supporting browsers, others may not be reliable enough. There is also a privacy issue. Not everyone is happy with a log entry on other sites servers each time a user visits
And if another plugin does the right thing and loads the WordPress script parallel to your remote resource you end up with a useless request and possible script conflicts.