O'Reilly logo

WordPress 3 Plugin Development Essentials by Everett Griffiths, Brian Bondari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing PHP modules

Sometimes, your plugin may require the use of non-standard functions that are only available if PHP was compiled using special options. You can use PHP's get_loaded_extensions() function to list all loaded extensions on the server you developed on, and you can then test against this list on the production server. This is a bit more advanced than the standard tests, but it can really help ensure that the environment is set up correctly before someone tries to run your plugin.

/** * PHP might have been compiled without some module that you require. Pass this * function an array of $required_extensions and it will register a message * about any missing modules. * * @param array $required_extensions an array of PHP modules you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required