Title: Use Google Libraries
Author: Jason Penney
Published: <strong>2008年11月25日</strong>
Last modified: 2017年5月3日

---

プラグインを検索

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://s.w.org/plugins/geopattern-icon/use-google-libraries.svg)

# Use Google Libraries

 作者: [Jason Penney](https://profiles.wordpress.org/jczorkmid/)

[ダウンロード](https://downloads.wordpress.org/plugin/use-google-libraries.zip)

 * [詳細](https://ja.wordpress.org/plugins/use-google-libraries/#description)
 * [レビュー](https://ja.wordpress.org/plugins/use-google-libraries/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/use-google-libraries/#installation)
 * [開発](https://ja.wordpress.org/plugins/use-google-libraries/#developers)

 [サポート](https://wordpress.org/support/plugin/use-google-libraries/)

## 説明

A number of the javascript libraries distributed with WordPress are also
 hosted
on Google’s [AJAX Libraries API](http://code.google.com/apis/ajaxlibs/). 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:

 * increases the chance that a user already has these files cached
 * サーバーの負荷を削減
 * uses compressed versions of the libraries (where available)
 * Google’s servers are set up to negotiate HTTP compression with the requesting
   browser

For a more detailed look see Dave Ward’s [3 reasons why you should let
 Google host
jQuery for you.

#### サポートしているライブラリとコンポーネント

 * [Dojo](http://dojotoolkit.org/)
 * [jQuery](http://jquery.com/)
 * [jQuery UI](http://ui.jquery.com/)
 * [MooTools](http://mootools.net/)
 * [Prototype](http://www.prototypejs.org/)
 * [script.aculo.us](http://script.aculo.us/)
 * [swfobject](http://code.google.com/p/swfobject/)

#### リンク

 * [Use Google Libraries ホーム](http://jasonpenney.net/wordpress-plugins/use-google-libraries/)
 * [イシュートラッカー](http://github.com/jpenney/use-google-libraries/issues)
 * [GitHub リポジトリ](http://github.com/jpenney/use-google-libraries)
 * [サポートフォーラム](https://wordpress.org/support/plugin/use-google-libraries)

### 互換性のないプラグイン

#### WordPress Minify の改善

Better WordPress Minify version 1.2.2 does not yet support
 protocol-relative URLs,
but [the next release is supposed to correct this.

#### Gravity Forms

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

WP-Minify doesn’t yet support protocol-relative URLs. Add
 ‘//ajax.googleapis.com/’
as a JS and CSS exclusion.

### 互換性のないテーマ

#### K2

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** は以下のフックを使用します (それぞれ優先度は1000になって
います)。

#### wp_default_scripts

**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.

#### script_loader_src

**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](http://docs.jquery.com/Core/jQuery.noConflict)
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](http://lud.icro.us/wordpress-plugin-google-ajax-libraries/)**,
which has very similar goals to this plugin.

### 将来の計画

 * add ability to disable protocol relative URLs
 * add ability to disable on frontend and/or admin

## インストール

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.

## FAQ

  インストール手順 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 がライブラリのバージョンを更新するとどうなりますか ?

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 **互換性のないプラグイン** and
 **互換性のないテーマ**
for specific information.

  How do I use the libraries supplied by Use Google Libraries?

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.

  Why do some scripts continue to use the WordPress supplied versions?

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.

  Can I always load the latest version of a hosted script?

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.

## 評価

![](https://secure.gravatar.com/avatar/8363f6010a2082f6938a02f08350629ae70e8b4fce6669de76dbb5555d118532?
s=60&d=retro&r=g)

### 󠀁[Works with some modifications](https://wordpress.org/support/topic/works-with-some-modifications/)󠁿

 [robkipa](https://profiles.wordpress.org/robkipa/) 2024年9月15日

Since this hasn’t been updated in forever, some modifications are needed to enable
the plugin due to version checking. debug.log will show: Not yet qualified with 
this version of WordPress. Bypassing UGL. To fix: comment out lines 229-232 of use-
google-libraries.php: /*if ( version_compare( get_bloginfo( ‘version’ ), ‘4.8’, ‘
>=’) ) { self::debug( ‘Not yet qualified with this version of WordPress. Bypassing
UGL.’ ); return; }*/ I can confirm jquery.js then loads from Google’s AJAX library(
tested on WP 6.6.2)

![](https://secure.gravatar.com/avatar/2b81733c63c8ccc21d62ef8d9fda79a6b66378a4ba19bec5ea5b0b601a91422d?
s=60&d=retro&r=g)

### 󠀁[This Plugin is Outdated!](https://wordpress.org/support/topic/this-plugin-is-outdated-3/)󠁿

 [rngala](https://profiles.wordpress.org/rngala/) 2023年3月23日

Plugin has not been updated in awhile – 6 years+How to fix: WordPress post edit 
area – white text white backgroundYou can actually select the white paragraph text
to highlight it, and copy-paste it in a text editor, and fix the content or links–
then paste it back. Just a quick, and live fix where WP’s displays white text on
white background.

![](https://secure.gravatar.com/avatar/4970072a0907995c8991104ab4da1ccf5348fd2f0d2077188378982dea16e872?
s=60&d=retro&r=g)

### 󠀁[Not working anymore](https://wordpress.org/support/topic/not-working-anymore-205/)󠁿

 [Posandu](https://profiles.wordpress.org/posandu/) 2021年9月15日

**************

![](https://secure.gravatar.com/avatar/2a600e904c43a07d0f245b226db646e39f0dd07adbe83a0f11e05adab3fded2d?
s=60&d=retro&r=g)

### 󠀁[abandoned project](https://wordpress.org/support/topic/abandoned-project-4/)󠁿

 [Preston Reyes](https://profiles.wordpress.org/prestondhamma/) 2019年3月28日

this plugin no longer works at all. dont even bother to install. it has not been
updated in 2 years.

![](https://secure.gravatar.com/avatar/d79f7ff36432bdca85bbc8548188bcdeb1bfbce5dc988c62218aab2408feffdd?
s=60&d=retro&r=g)

### 󠀁[Фиктивный плагин](https://wordpress.org/support/topic/%d1%84%d0%b8%d0%ba%d1%82%d0%b8%d0%b2%d0%bd%d1%8b%d0%b9-%d0%bf%d0%bb%d0%b0%d0%b3%d0%b8%d0%bd/)󠁿

 [eduardbein](https://profiles.wordpress.org/eduardbein/) 2018年7月12日

Интересно в каком веке она перестала работать и почему она находится в топе ?!))
😊

![](https://secure.gravatar.com/avatar/141051f8e498ce8ec070d47af8fa6cf4ceae5842b0ee26b1585ff3c2810d9fcf?
s=60&d=retro&r=g)

### 󠀁[Doesn’t Work | WP 4.9.4 – Twenty Seventeen Theme](https://wordpress.org/support/topic/doesnt-work-wp-4-9-4-twenty-seventeen-theme/)󠁿

 [joshmakar](https://profiles.wordpress.org/joshmakar/) 2018年2月15日

Tested this plugin on a local installation of WP 4.9.4 using the Twenty Seventeen
theme but could not get it to work. Installed plugin, refreshed site and launched
the Chrome inspector. Searched “jquery” and found where jquery is being loaded from
the wp-includes folder. Thanks for writing the plugin! If I’m able to get this plugin
to work, I’ll come back and update my review.

 [ 47件のレビューをすべて表示 ](https://wordpress.org/support/plugin/use-google-libraries/reviews/)

## 貢献者と開発者

Use Google Libraries はオープンソースソフトウェアです。以下の人々がこのプラグイン
に貢献しています。

貢献者

 *   [ Jason Penney ](https://profiles.wordpress.org/jczorkmid/)

“Use Google Libraries” は6ロケールに翻訳されています。 [翻訳者](https://translate.wordpress.org/projects/wp-plugins/use-google-libraries/contributors)
のみなさん、翻訳へのご協力ありがとうございます。

[“Use Google Libraries” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/use-google-libraries)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/use-google-libraries/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/use-google-libraries/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/use-google-libraries/)
を [RSS](https://plugins.trac.wordpress.org/log/use-google-libraries/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.6.2.3

 * 対応バージョンを更新。
 * 現在マルウェアとなっているリンクを回避するため archive.org を使用

#### 1.6.2.1

 * Bypass functionality when running under 4.2+ until next version to avoid breaking
   sites.

#### 1.6.2

 * added some missing jQuery UI modules (hopefully fixes issues from support
    forums
   I couldn’t reproduce previously).

#### 1.6.1

 * 1.6と同じ (1.6の SVN の問題のため)

#### 1.6

 * Drop support for PHP4, and WordPress < 3.4
 * clean up PHP 5.x strict issues

#### 1.5.2

 * using protocol-relative URLS with WordPress >= 3.5
 * use WordPress provided `is_ssl` rather than custom check (only for
    WordPress
   < 3.5)
 * Detect if ‘jquery’ is a meta-script registration, and actual jQuery
    is loaded
   as ‘jquery-core’ tag (WordPress 3.6 Beta).

#### 1.5.1

 * fix bug in `is_ssl` check.

#### 1.5

 * using `wp_remote_head` to query that the replacement URL is actually
    hosted 
   by google. If it’s not, then the WordPress supplied version will be used.
 * Using the Transient API to store the replacement URLS, rather than
    recalculating
   and re-querying them every load.

#### 1.2.1

 * Added check for WordPress including non-standard versions of scripts (fixes
    
   WordPress 3.2.2/swfobject).
 * HTTPS チェックで不正確な場合を修正。

#### 1.2

 * Reworked handling for cases where multiple js files are combined
    into one on
   Google’s servers. In the past this has been mostly a non-issue because the dependencies
   took care of it, but due to changes in the latest jQuery UI this stopped working
   as expected.

#### 1.1.2

 * jQuery UI が WordPress 3.1rc1と共に動作するよう更新

#### 1.1.0.1

 * Re-disable script concatenation. Seemed to break widget admin page.

#### 1.1

 * No longer disable script concatenation when using WordPress 3.0 or
    greater
 * Attempt to detect when another plugin or theme has called
    ‘wp_register_script’
   and/or ‘wp_enque_script’ before ‘init’ and work around it.
 * Limited debugging output when WP_DEBUG is enabled.

#### 1.0.9.2

 * Hopefully fix issue with plugin loading for some users

#### 1.0.9.1

 * Added **互換性のないプラグイン** and **互換性のないテーマ** sections
    to the 
   README

#### 1.0.9

 * 追加 HTTPS 検出
 * インライン jQuery.noConflict()

#### 1.0.7.1

 * 過去の修正の修正 (失礼しました !)

#### 1.0.7

 * Quick and dirty workaround for scriptaculous loading (thanks to
    [Gregory Lam for
   bringing it to my attention

#### 1.0.6.1

 * README の更新履歴セクションの移動場所

#### 1.0.6

 * Disables script concatenation in WordPress 2.8, since it seems to have
    issues
   when some of the dependencies are outside of the concatenation.
 * Persists flag to load scripts in the footer in WordPress 2.8

#### 1.0.5

Implemented a pair of
 [suggestions](http://jasonpenney.net/wordpress-plugins/use-google-libraries/comment-page-1/#comment-32427)
from [Peter Wilson](http://peterwilson.cc/).

 * It should detect when a page is loaded over https and load the libraries over
   https accordingly
 * It no longer drops the micro version number from the url. The reasons for this
   are twofold:
    - It ensures the version requested is the version received.
    - Google’s servers set the expires header for 12 months for these
       urls, as 
      opposed to 1 hour. This allows clients to cache the file for up to a year 
      without needing to retrieve it again from Google’s servers. If the version
      requested by your WordPress install changes, so will the URL so there’s no
      worry that you’ll keep loading an old version.

## メタ

 *  バージョン **1.6.2.3**
 *  最終更新日 **9年前**
 *  有効インストール数 **10,000+**
 *  WordPress バージョン ** 3.4またはそれ以降 **
 *  検証済み最新バージョン: **4.7.33**
 *  言語
 * [English (US)](https://wordpress.org/plugins/use-google-libraries/)、[German](https://de.wordpress.org/plugins/use-google-libraries/)、
   [Indonesian](https://id.wordpress.org/plugins/use-google-libraries/)、[Italian](https://it.wordpress.org/plugins/use-google-libraries/)、
   [Japanese](https://ja.wordpress.org/plugins/use-google-libraries/)、[Russian](https://ru.wordpress.org/plugins/use-google-libraries/)、
   [Swedish](https://sv.wordpress.org/plugins/use-google-libraries/).
 *  [プラグインを翻訳](https://translate.wordpress.org/projects/wp-plugins/use-google-libraries)
 * タグ
 * [cdn](https://ja.wordpress.org/plugins/tags/cdn/)[google](https://ja.wordpress.org/plugins/tags/google/)
   [javascript](https://ja.wordpress.org/plugins/tags/javascript/)[jquery](https://ja.wordpress.org/plugins/tags/jquery/)
   [performance](https://ja.wordpress.org/plugins/tags/performance/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/use-google-libraries/advanced/)

## 評価

 5つ星中4.4つ星

 *  [  38 5-星レビュー     ](https://wordpress.org/support/plugin/use-google-libraries/reviews/?filter=5)
 *  [  1 4-星レビュー     ](https://wordpress.org/support/plugin/use-google-libraries/reviews/?filter=4)
 *  [  1 3-星レビュー     ](https://wordpress.org/support/plugin/use-google-libraries/reviews/?filter=3)
 *  [  1 2-星レビュー     ](https://wordpress.org/support/plugin/use-google-libraries/reviews/?filter=2)
 *  [  6 1-星レビュー     ](https://wordpress.org/support/plugin/use-google-libraries/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/use-google-libraries/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/use-google-libraries/reviews/)

## 貢献者

 *   [ Jason Penney ](https://profiles.wordpress.org/jczorkmid/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/use-google-libraries/)

## 寄付

このプラグインが今後も改善できるよう応援しませんか ?

 [ このプラグインに寄付 ](http://jasonpenney.net/donate)