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.

New Release: VIP Coding Standards 2.3.0

We’re excited to announce that version 2.3.0 of the VIP Coding Standards (VIPCS) has been officially released!

We highly encourage updating your PHP_CodeSniffer (PHPCS) setup to use this latest version. For details of what’s changed, please see the official changelog.

The minimum requirements have not changed from VIPCS 2.2.0. They are:

  • PHP 5.4+
  • PHPCS 3.5.5+*
  • WordPress Coding Standards (WPCS) 2.3.0+

As of 2.3.0, VIPCS includes the phpcodesniffer-composer-installer plugin as a dev dependency and you do not need to list it separately in your composer.json file. The following will install the latest version of VIPCS and compatible dev dependencies:

composer require --dev automattic/vipwpcs

* With PHPCS 3.6.0 available, we recommend upgrading to it for better PHP 8 language support.

Code Analysis Bot

Our code analysis bot for VIP Go clients will be updated to use VIPCS 2.3.0 on Monday, 3rd May. This gives customer developers an opportunity to update their local setup and build processes to use the new version of VIPCS, and to address any new violations that come from the improved checks in the VIPCS ruleset, or WPCS sniffs that VIPCS uses, before the code analysis bot starts commenting on them.

If you are unsure how to install or update your current version of VIP Coding Standards, we recommend taking a look at our guide.

If you have any further questions, feel free to open a support ticket with details and we will be happy to assist.

New Release: VIP Coding Standards 2.2

We’re excited to announce that version 2.2.0 of the VIP Coding Standards (VIPCS) has been officially released!

We highly encourage updating your PHP_CodeSniffer (PHPCS) setup to use this latest version. For details of what’s changed, please see the official changelog.

The minimum requirements have not changed from VIPCS 2.1.0. They are:

  • PHP 5.4+
  • PHPCS 3.5.5+
  • WordPress Coding Standards (WPCS) 2.3.0+

Please note that since VIPCS already includes the correct dependencies, you do not need to list WPCS separately in your composer.json file. The following will install the latest version of VIPCS and compatible versions of WPCS and PHPCS:

composer require automattic/vipwpcs

If you already have VIPCS installed, then you can run the following either at the global or project level:

composer update

Code Analysis Bot

Our code analysis bot for VIP Go clients will be updated to use VIPCS 2.2.0 on Monday, 21st September. This gives customer developers an opportunity to update their local setup and build processes to use the new version of VIPCS, and to address any new violations that come from the improved checks in the VIPCS ruleset, or WPCS sniffs that VIPCS uses, before the code analysis bot starts commenting on them.

If you are unsure how to install or update your current version of VIP Coding Standards, we recommend taking a look at our guide.

If you have any further questions, feel free to open a support ticket with details and we will be happy to assist.

New Release: VIP Coding Standards 2.1

We’re excited to announce that version 2.1.0 of the VIP Coding Standards (VIPCS) has been officially released!

We highly encourage updating your PHP_CodeSniffer (PHPCS) setup to use this latest version. For details of what’s changed, please see the official changelog.

The minimum requirements are:

  • PHP 5.4+ (down from 5.6+)
  • PHPCS 3.5.5+
  • WordPress Coding Standards (WPCS) 2.3.0+

Please note that since VIPCS already includes the correct dependencies, you do not need to list WPCS separately in your composer.json file. The following will install the latest version of VIPCS 2.1.0 and compatible versions of WPCS and PHPCS:

composer require automattic/vipwpcs

If you already have VIPCS installed, then you can run the following either at the global or project level:

composer update

Our Review Bot for VIP Go clients will be updated to use VIPCS 2.1.0 on Monday, July 13th. This gives client developers an opportunity to update their local setup and build processes to use VIPCS 2.1.0, and to address any new violations that come from the improved checks in the VIPCS ruleset, or WPCS sniffs that VIPCS uses, before the Review Bot starts commenting on them.

If you are unsure how to install or update your current version of VIP Coding Standards, we recommend taking a look at our guide. If you have any further questions, feel free to open a support ticket with details and we will be happy to assist!

New Release: VIP Coding Standards 2.0

We’re pleased to announce that version 2.0 of the VIP Coding Standards (VIPCS) has been released!

We highly encourage updating your PHP_CodeSniffer (PHPCS) setup to use this latest version. For details of what’s changed, please see the official changelog.

There is one significant change in this release that you should be aware of. VIPCS is now compatible with WordPress Coding Standards (WPCS) 2.x (specifically, 2.1+). It is not compatible with WPCS 1.x. As such, you must switch to WPCS 2 to be able to use VIPCS 2.

Since VIPCS already includes the correct dependencies, you do not need to list WPCS separately in your composer.json file. The following will install the latest versions of VIPCS 2, WPCS 2 and PHPCS itself:

{
    ...
    "require-dev": {
        "automattic/vipwpcs": "^2"
    },
    ...
}

Our review bot for VIP Go clients will be updated to use VIPCS 2 on Monday 22nd July. This gives client developers an opportunity to update their local setup and build processes to use VIPCS 2, and to address any new violations that come from the improved checks in the WPCS 2 sniffs that VIPCS uses before the bot starts commenting on them.

If you are unsure how to install or update your current version of VIP Coding Standards, we recommend taking a look at our guide. If you have any further questions, feel free to open a support ticket with details and we will be happy to assist!

New Release: VIP Coding Standards 1.0

We’re pleased to announce that version 1.0 of the VIP Coding Standards (VIPCS) has been released!

We highly encourage updating or installing (if you haven’t already), as it includes many new additions and bug fixes. For more details, please see the official changelog.

However, we would like to make note of some important changes:

  • Sniffs were reorganized into different categories with new sniff names and violation codes — if you are referencing any old violations in your codebase or custom rulesets, please update accordingly
  • WordPress Coding Standards (WPCS) 1.* is still required for compatibility, but we plan on supporting WPCS 2.* in a future version of VIPCS (2.0)

If you are unsure how to install or update your current version of VIP Coding Standards, we recommend taking a look at our guide. Feel free to open a support ticket with details and we will be happy to assist if you have any questions!