Added error handling and auto-start

Added error handling and an auto-start function for all WordPress hooks.