WordPress Coding Standards – phpcs Warnings WordPress Coding Standards – phpcs Warnings wordpress wordpress

WordPress Coding Standards – phpcs Warnings


Historically, WordPress has avoided cleaning up the Core code style, for several reasons:

  • The tools for checking coding standards were not particularly reliable. This has changed in recent years, with the WordPress Coding Standards (WPCS) project maturing, and many of the little edge cases being fixed in PHPCS.
  • With no reliable automated tools, this would be a manual job, requiring many commits. This causes unnecessary code churn, and makes it harder to look through revision logs.
  • It just hasn't been a high priority. ~4% of WordPress' PHP violates the coding standard, so most folks just don't encounter it.

With the tools maturing, that position changed recently, there's now an in-progress effort to get PHPCS and WPCS working with WordPress Core. With appropriate automated testing, WordPress will continue to match it's own coding standards in the future.