Automattic / vip-scanner

Deprecated: Scan all sorts of themes and files and things! Use PHPCS and the VIP coding standards instead
https://automattic.com
140 stars 51 forks source link

Notify/warn about Jetpack::is_module_active #207

Open kraftbj opened 10 years ago

kraftbj commented 10 years ago

In the dev environment, to check if Photon is active, Jetpack::is_module_active() is used since the Photon functions are always available.

On WP.com, that function doesn't exist and will fatal. Idea: Throw a note to remind devs of this?

philiparthurmoore commented 9 years ago

Just a note that this is what I've had to do to ensure the code runs fine on dev environments and .com:

if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'photon' ) ) {