Allows your site to use common javascript libraries from Google's AJAX Libraries CDN, rather than from WordPress's own copies.
A number of the javascript libraries distributed with WordPress are also
hosted on Google’s AJAX Libraries API.
This plugin allows your WordPress site to use the content distribution
network side of Google’s AJAX Library API, rather than serving these files from your WordPress install directly.
This provides numerous potential performance benefits:
For a more detailed look see Dave Ward’s 3 reasons why you should let
Google host jQuery for
you.
Better WordPress Minify version 1.2.2 does not yet support
protocol-relative URLs, but the next release is supposed to correct
this.
I’ve had reports of Gravity Forms breaking UGL, but I don’t have
access to Gravity Forms, so I’m not sure what’s going on. If you need
Gravity Forms you might need to disable UGL, or it might be fine, I’m
not really sure.
WP-Minify doesn’t yet support protocol-relative URLs. Add
‘//ajax.googleapis.com/’ as a JS and CSS exclusion.
I’ve had scattered reports that UGL is stepping out of the way when
using K2.
If you’re going to flag the plugin as “broken” in the WordPress Plugin
Directory, please try and let me know what is
broken.
I’m not a mind reader.
Use Google Libraries uses the following hooks (each with a priority of 1000).
Use Google Libraries compares it’s list of supported scripts to those
registered, and replaces the standard registrations src
with ones that
point to Google’s servers. Other attributes (like dependencies) are left
intact.
Use Google Libraries removes the ver=x.y.z
query string from the URL
used to load the requested library if it is going to load the library from
ajax.googleapis.com. Otherwise the URL is left unaltered. This both
improves the chances of the given URL already being cached, and prevents
script.aculo.us from including scripts multiple times.
If jQuery is enqued Use Google Libraries will inject a bit of
javascript before the next enqueued script enabling jQuery’s noConflict mode as it would
with the standard WordPress version.
Parts of this plugin (specificly, the dropping of the micro number,
which has since been removed for better caching performance) were
inspired by John Blackbourn’s
Google AJAX Libraries,
which has very similar goals to this plugin.
Upload the use-google-libraries
folder to the /wp-content/plugins/
folder.
Activate Use Google Libraries through the ‘Plugins’ menu in WordPress.
Er… That’s it really.
Upload the use-google-libraries
folder to the /wp-content/plugins/
folder.
Activate Use Google Libraries through the ‘Plugins’ menu in WordPress.
Er… That’s it really.
Google has stated that they intend to keep every file they’ve hosted
available indefinitely, so you shouldn’t need to worry about them
disappearing.
Firstly, if you are using a caching plugin, flush the cache or
temporarily disable it to be sure it’s not doing anything. That said,
I’ve done my best to make Use Google Libraries gracefully step out
of the way when things are not as expected. While not, perhaps,
giving you the greatest benefit it helps ensure you site doesn’t just
flat out stop working.
In general, anything that calls wp_register_script and/or
wp_eneque_script before ‘init’ causes trouble for Use Google
Libraries. I’ve made an effort to force it to try and run anyhow,
so please report any issues with this. If you have ‘WP_DEBUG’
enabled, a message will be logged letting you know this is happening.
Please see the section on Incompatible Plugins and
Incompatible Themes for specific information.
The same way you use them when Use Google Libraries isn’t installed using
‘wp_enqueue_script’. In fact you should develop your theme or plugin without
Use Google Libraries being enabled at all, then test it both ways.
Assuming some other plugin or theme isn’t the cause, Use Google Libries does
it’s very best to ensure your site behaves as it should when using the stock
WordPress scripts. If WordPress is asking for a version of a script that
Google isn’t hosting, then it will continue to use the WordPress supplied
version.
No. Use Google Libraries doesn’t do that because it would almost certainly
break WordPress. Even if it didn’t, the less ‘version specific’ URLs supported
by Google’s CDN set a short term ‘Expires’ header, so there wouldn’t be much
point.
is_ssl
rather than custom check (only foris_ssl
check.wp_remote_head
to query that the replacement URL is actuallyImplemented a pair of
suggestions
from Peter Wilson.