こんにちは!
先日、数年前にWordPressで作成されたお客さんのサイト修正をしていたら、ライトボックスが動いていないのを発見しました。
私の作業が原因なのか、それとも別の方が対応した作業が原因なのかは分からないですが、このまま見て見ぬふりもできないので、原因を調査してみることにしました。
ライトボックスプラグインは他のプラグインやjsとの相性で動かなくなることが多いので、現在使用しているプラグインを停止してみたり、jsの読み込みをやめてみたり色々、試してみるとどうやら原因は「Jetpack」プラグインの「Photon」にあることが判明。
「Jetpack」プラグインとは何かというと、WordPressを利用する上で、32個もの便利な機能をパックにしたプラグインで、この32個の機能の一つである「Photon」が、非常に役に立つ機能です。
「Photon」を利用すればブログ内で使用している画像の高速化が可能になります。「Photon」についてはこれ以上の詳細は省きますが、そのお客さんのサイトにはサイトの速度改善のために、「Photon」が導入されていました。その「Photon」を導入した時に、ライトボックスプラグインが動作しなくなったみたいです。
実際に使用されていたライトボックスプラグインですが、「Simple Lightbox」プラグインが使用されていました。「Simple Lightbox」プラグインは「Photon」と相性がよくないみたいですね。
今後、「Photon」を導入する方が増えると思うので、使用頻度が高そうな「Simple Lightbox」プラグインを含めた9つのライトボックスプラグインが「Photon」で動作するかのチェックをしておきたいと思います。
環境!
↓WordPressは以下のバージョンになります。
9つのライトボックスプラグインのチェック!
FancyBox for WordPress
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
FancyBox for WordPress
Simple Lightbox
「Google Chrome(Windows)」・・・×
「Firefox(Windows)」・・・×
「Safari(Windows)」・・・×
「Internet Explorer 10(Windows)」・・・×
「Internet Explorer 9(Windows)」・・・×
「Internet Explorer 8(Windows)」・・・×
「Internet Explorer 7(Windows)」・・・×
Simple Lightbox
Easy FancyBox
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
Easy FancyBox
WP Lightbox 2
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
WP Lightbox 2
WP jQuery Lightbox
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
WP jQuery Lightbox
jQuery Colorbox
「Google Chrome(Windows)」・・・×
「Firefox(Windows)」・・・×
「Safari(Windows)」・・・×
「Internet Explorer 10(Windows)」・・・×
「Internet Explorer 9(Windows)」・・・×
「Internet Explorer 8(Windows)」・・・×
「Internet Explorer 7(Windows)」・・・×
jQuery Colorbox
WP-Slimbox2 Plugin
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
WP-Slimbox2 Plugin
WP SexyLightBox
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
WP SexyLightBox
WP Facebox Gallery
「Google Chrome(Windows)」・・・○
「Firefox(Windows)」・・・○
「Safari(Windows)」・・・○
「Internet Explorer 10(Windows)」・・・○
「Internet Explorer 9(Windows)」・・・○
「Internet Explorer 8(Windows)」・・・○
「Internet Explorer 7(Windows)」・・・○
WP Facebox Gallery
動作しなかったのは「Simple Lightbox」と「jQuery Colorbox」だけでした。もっと動かないと思っていたので、想定外でした。優秀なプラグインばかりですね。
結局どれが一番良いか?
動くんなら、どれでも良いのではないでしょうか。ただ私の一番のお気に入りのライトボックスは「FancyBox for WordPress」です。今まで一番、使用してますが、ほぼどんな状況でも動作しました。信頼度が高いプラグインです。
最後に!
今回の不具合は新しいプラグインを導入したら、他のプラグインに影響が出ないかのチェックが絶対に必要であることを再確認できる内容でした。チェックを怠った時に限って何か起こります。本当にチェックって大事ですよね。
以上「ライトボックスが動作しなくなった原因はJetpackのPhoton!」でした!
それではまた。
コメント