vip-scanner
vip-scanner copied to clipboard
Added class to check for forbidden functions only in template files
Addresses issue #23
Updated error slugs to based on conversation in PR #187.
Any particular reason why this check was added to the WP.com Theme Review Type?
I made it part of this type since the issue #23 specified that redirects should not be placed in template files, so this would affect all theme reviews, not just VIP theme reviews.
@fklein-lu do you have any specific objections?
I don’t have any objections against including this in the WP.com Theme Review Type, although I consider this to be an edge case.
But as far as I can see, the new check never gets added to the VIP Theme Review Type. So that would have to be done, since that’s where the check makes the most sense.
I like the template detection code, and I see other checks that would only be applicable for template files. So I wonder if we can move the code that indentifies the template files outside of this check into a method. That way it could be usable in other checks without any code duplication.
What else than line 37 in config-vip-scanner.php in this PR do you see as required to add this new check to the VIP Theme Review? I tested this code and it executed the new checks.