Update plugin.php

Use js for the redirect to prevent wp errors in page loading