fixes WP issues on virtual-pages-with-templates

-invalid use of wp_enqueue_script, script includes should only be done when on the admin page of a particular plugin not on all admin
-issues when checking $_POST
-$_POST checks should only be done when on the admin page of a particular plugin not on all admin
fixes on undefined notices