Fixed security issue in preview script and tested with wordpress 3.8