-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate submitted patterns #22
Comments
Some of the points here aligns closely with the need to validate the block markup of full site editing themes when they are submitted to the directory. |
My 2 cents: If you want to have a fast validation that doesn't depend on a human being since that's slow (coming from experience with theme reviews), why not explore the option to implement machine learning algorithms for It's not like these aren't out there (link, link (archived), link). I'm sure there are people who would be up to the task of using some of these and programing some kind of validation tool that would speed up the process. |
I started some validation in #38, pulling out my comments so they're not lost in the PR: Does it contain JS or inline CSS? Is the markup minimally valid? |
As an alternative to e2e for markup validation, could we use kses? Create an API endpoint that basically just runs a specially configured kses and returns the sanitized output. That's not the same as validation obviously but it might eliminate the need to validate. |
The content should already be run through kses by core, and if we set up our own kses rules we would need to keep track of what features GB adds, in case they add support for a new attribute or something, we could unexpectedly invalidate blocks. If someone manages to save invalid HTML, it would be obvious to anyone searching the pattern directory, because the preview would be broken. Is there a case you're thinking of where we'd want this extra sanitization? |
I think we might want to consider restricting the use of images in the pattern builder. Perhaps seeding the media library with a number of worry-free images, remove permissions to upload to the media library, and including some validation around hot linking to un-allowed images. |
I think the only remaining task here is to add an Akismet check over the pattern content for spam. We'll be relying on community reporting for standards checking and other issues under the "Last" list. |
@dd32 Are you able to look into adding a spam check step to the pattern validation? |
It's still on my list, but I don't have anything to show for it right now.. |
Closing this issue now that Akismet is spam-checking patterns (#406). If, as patterns are submitted, we realize we need more checks, we can create new specific issues for that. |
Patterns need to be checked for validity during the submission process. Probably different levels of validation at different points:
Early:
Later:
Last:
I imagine the Early checks would be applied before saving a pattern at all. Later checks would need to pass in order to submit a pattern for publication. And the Last checks would be made at least in part by humans, before approving a pattern for inclusion in the public directory.
If we assume that "private" patterns will eventually become a thing, then the Early checks might be sufficient for saving a pattern for private use only.
The text was updated successfully, but these errors were encountered: