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

Get WordPress 3 Plugin Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.