-$check_plugins = get_option('active_plugins');
-
-// Sanity check. If the active plugin list is not an array, make it an
-// empty array.
-if ( !is_array($check_plugins) ) {
- $check_plugins = array();
- update_option('active_plugins', $check_plugins);
-}
-
-// If a plugin file does not exist, remove it from the list of active
-// plugins.
-foreach ($check_plugins as $check_plugin) {
- if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) {
- $current = get_option('active_plugins');
- $key = array_search($check_plugin, $current);
- if ( false !== $key && NULL !== $key ) {
- unset($current[$key]);
- update_option('active_plugins', $current);
- }
- }
-}