2. –WordPress Core Handbook
“Coding standards help avoid common coding
errors, improve the readability of code, and
simplify modification. They ensure that files within
the project appear as if they were created by a
single person.”
6. Super Condensed
Overview
• HTML - It should be valid and readable
• CSS - Make it easy to follow and then comment
more, then even more.
• JS - Tough. Things are changing quickly here, not
sure how up to date it is.
8. Naming Conventions
• Functions, variables, actions should be lowercase
• Separate words with an _
• No camelCase
• Self-documenting - prefix_get_the_data();
• Class names should use capitalized words
separated by underscores. Any acronyms should
be all upper case.
• Prefix everything
13. All the things
• Functions and class methods
• Classes
• Class properties
• Requires and includes
• Hooks (actions and filters)
• Inline comments
• File headers
• Constants
14. /**
* Summary.
*
* Description.
*
* @since x.x.x
* @access (for functions: only use if private)
*
* @see Function/method/class relied on
* @link URL
* @global type $varname Description.
* @global type $varname Description.
*
* @param type $var Description.
* @param type $var Optional. Description.
* @return type Description.
*/
DocBlock for functions
20. WPPB
• Organized file structure
• Standards compliant code, file headers, inline
documentation
• Updated to keep inline with best practices
• Translation ready
21. Plugin Structure
• admin is used for all
dashboard-specific
functionality
• includes is used for all
shared functionality either as
part of the core of the plugin
or for a third-party library
• languages are where the
i18n files are kept
• public is where all public-
facing functionality is kept