Updated redirect handler to use "redirect_post_location" filter instead of "wp_insert_post" action. This filter runs after all WordPress actions have taken place, like publishing a new post. This ensures WordPress has done everything it needs to do before our redirect fires off
Removed debugging 1 second of sleep in ajax request
Code aesthetically edited for consistency