WP Stuff
Contextual Code Injection Guard for WordPress
We all know the power of user-generated content. Accepting content from your members is a great way to make your community more engaging. Not all types of content are safe though. If you are accepting code from your visitors, you will want to make sure it is sanitized. This function can take care of that.


As you can tell, this code has different rules for HTML, JS, CSS, and PHP. It has triple layers to protect your website (input, output, runtime). It executes only safe languages and stores sanitized code as base64 in database. This could come handy for educational sites that support code sharing.












