Skip to content

Instantly share code, notes, and snippets.

@wayheming
Last active November 16, 2021 14:43
Show Gist options
  • Save wayheming/a2a47fe7a101602a48d175833cea0e47 to your computer and use it in GitHub Desktop.
Save wayheming/a2a47fe7a101602a48d175833cea0e47 to your computer and use it in GitHub Desktop.
New theme rules
Use wp_kses create custom contexts (like on space) with alowed html tags
Print image by wp default funtions not print <img>
Add alt="" for images generated by JS or static
Translate all strings
Use phpcs from WP with custom settings
Use jslint from WP
Not use <a> tag for buttons
Add aria-label="" for empty <a> tags
Try to use wp_remote_get() instead of file_get_contents()
Use phpdoc for all and use PHPDocumentator
Add phpdoc to apply_filters
Create function to print SVG like Tag or Image
Create function to print image by url with alt=""
Not use background image try to use image with object-fit CSS
Try to write documentation about settings,names,ids
Create documentation about all hooks wp, init ets.
Divide all css, js filest and include only if needed.
Include php files for admin only in admin area.
Use Query Monitor to check all query.
Try to write JS code and run after user move cursor or click.
Try to write tests
Try to use OOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment