Refactored plugin to avoid debug notices and added a boolean false for strpos check on html headers