VIP Coding Standards 3.0.0 is now available

VIP Coding Standards (VIPCS) 3.0.0 is now available.

What is VIPCS?

VIPCS focuses on providing developers with feedback about their code, specifically around security, performance, and compatibility with the VIP platform. It is a package for PHP_CodeSniffer (PHPCS), and it builds upon parts of the WordPress Coding Standards (WordPressCS) package, in addition to adding some custom checks (sniffs).

VIPCS is strongly recommended for use during the development of applications which are to be run on the VIP platform. PHPCS + VIPCS can be used on a local machine or as part of a Continuous Integration (CI) task.

VIPCS is also used by the VIP Code Analysis Bot. The bot will be updated to use VIPCS 3.0.0 and WordPressCS 3.0.0 on 25th September 2023. This allows developers to run VIPCS locally and update their code (or PHPCS ignore annotations) to comply before the bot gives updated feedback on pull requests.

What’s changed in VIPCS 3.0.0?

VIPCS 3.0.0 fixes a few small items but mainly adds compatibility with WordPressCS 3.0.0. This also means that PHPCS checks with VIPCS can now be run using the latest versions of PHP, regardless of which version of PHP you run your VIP application on.

As a major release, it includes breaking changes, including some renamed error codes and removing three deprecated sniffs; see the changelog for more information.

Also, remember that WordPressCS 3.0.0 has its own breaking changes, which may also affect you when using VIPCS 3.0.0.

What does the roadmap for VIPCS look like?

We quietly released VIPCS 2.3.4 on 24th August 2023. This release contained four fixes and a lot of maintenance items. This will be used by the VIP Code Analysis bot from 11th September 2023 (for two weeks). 

Development of VIPCS will continue in the 3.x branch from now on. The 2.x series will no longer receive updates.

VIPCS 4.0 is expected to consolidate the currently-nested rulesets into a newly-named standard (breaking change) and modernise all the custom sniffs to account for new PHP syntaxes, making more use of PHPCSUtils. There is no timeline for this yet.

What is WordPressCS?

The coding standards package for the WordPress community, WordPressCS, has had a new release. This 3.0.0 release is the culmination of many hours of work to greatly improve the ability and accuracy of engineers to match their code to the PHP coding standards for WordPress. It includes adding sniff support for modern PHP syntaxes and new rules that show how modern syntax should be used based on a post from 2020. As a major version release, it contains its own breaking changes.

You can read more about the WordPressCS changes in this Make WordPress Core post.

Comprehensive upgrade guides are also available for end-users/ruleset maintainers and for developers of coding standards (like VIPCS) which build on top of WordPressCS.

While VIP doesn’t require that customer application code follow the coding style for WordPress, we recommend that customers use it. Our experience has shown a benefit to following the WordPress Coding Standards as closely as possible so code from different developers (internal to the customer or agency and via third-party plugins) looks similar, making the code easier to understand.