check plugins in separate function

Plugins were broken running check_config() in a separate process. Put the plugins check back into index.php as a separate function.