Читать книгу Professional WordPress Plugin Development - Brad Williams - Страница 57
CODING STANDARDS
ОглавлениеFollowing a set of standards when developing plugins professionally is important because it makes long‐term maintenance of your code easier and also allows other developers to quickly learn from or contribute to your plugin. WordPress maintains a coding standard for the core source code. It is a good starting point when building plugins. You can view the WordPress coding standards at https://make.wordpress.org/core/handbook/best-practices/coding-standards
.
WordPress has more than 15 years of legacy code, and sometimes its standards do not align with the standards of the larger PHP community. This can be off‐putting for some PHP developers new to the WordPress community. You may also want to follow PHP Recommended Standards (PSRs) created and maintained by the PHP Framework Interprop Group (PHP‐FIG) for the larger PHP community. You can find these standards at https://www.php-fig.org/psr
.
The most important thing is to maintain consistency in your code base, regardless of the coding standards that you follow.