Wordpress plugin not working correctly