Simple Way to Get Plugin Status in WordPress

Active plugin volcano.

I have previously written on how to determine if a widget is active. This is helpful for widgets, but not for plugins.

WordPress has a couple of different functions that help you determine plugin status. They are both located in wp-includes/plugin.php

  • `validate_plugin()` spits out an error if the plugin file does not ¬†exist or has an invalid header. This lets you know that the file is there.
  • `is_plugin_inactive()` lets you know if the plugin is not active (using the `is_plugin_active()` function)

A function to get plugin status

Using these two functions, I put together a one-size-fits-all function `get_plugin_status()`. Continue reading “Simple Way to Get Plugin Status in WordPress”