After application code has been scanned locally for an updated version of PHP, and identified incompatibilities have been fixed, test the performance of the updated code on a WordPress VIP Platform environment.
1. Test code performance locally
The VIP Local Development Environment is designed to be nearly identical to a WordPress VIP Platform environment. Begin by testing the performance of updated application code locally by running a VIP Local Development Environment with an updated version of PHP.
- Set the version of PHP when creating an environment with the VIP-CLI command
vip dev-env create --php=<x.x>. Or, update an existing local environment with
vip dev-env update --php=<x.x>.
After code performance has been tested on the local environment to the best possible extent, the updated code is ready to be deployed to a non-production VIP Platform environment for additional testing.
2. Act on VIP Code Analysis Bot feedback
Once testing on the VIP Local Development Environment is complete, and identified issues in the code have been resolved, the code is ready to be deployed to a non-production VIP Platform environment for additional testing.
Create a pull request of the modified code against the branch that deploys to the non-production environment.
When code is added to a wpcomvip GitHub repository via pull request, it is automatically scanned by the VIP Code Analysis Bot (the “Bot”). The Bot is set up to run specific scanners: Vulnerability and Update Scan, PHPCS analysis, PHP linting, and SVG analysis.
PHP linting scans will be run against the code for every version of PHP that is running on environments belonging to an application. For example, if a particular repository deploys to two environments, one using PHP 8.0 and the other PHP 8.2, files will be PHP linted with both PHP 8.0 and PHP 8.2.
Results of the Bot’s scans are reported in GitHub feedback and comments of the pull request. Address all relevant issues reported by the Bot before merging the pull request to the deploying branch of the non-production environment.
3. Test on a non-production VIP Platform environment
After the updated code has been deployed, update the version of PHP running on the non-production environment in the Software Management panel of the VIP Dashboard.
Non-production VIP Platform environments are intended for rigorous testing of application code prior to deployment to a production environment. The infrastructure of non-production VIP Platform environments can provide more accurate performance testing than local environments for any updates made to application code.
Every application has its own unique combination of plugin and theme code, and its own unique criteria for functionality and performance. It is recommended to create site testing criteria that includes common actions performed on the site both by a site’s visitors and the content creators. Monitor the site’s behavior using the available debugging resources, including PHP error reporting in the Runtime Logs panel of the VIP Dashboard.
4. Update PHP on a production VIP Platform environment
After the updated application code has satisfactorily passed rigorous testing against the newer version of PHP on a non-production environment, the code is ready to be deployed to a production environment.
In a new pull request, merge the updated application code to the branch that deploys to the production environment. The VIP Code Analysis Bot will run PHPCS analysis, PHP linting, and SVG analysis scans against the code once more. It is recommended to review and act on any relevant feedback from the Bot before merging the pull request.
After the code in the merged pull request has been deployed to the production environment, the version of PHP running on the production environment can be updated in the Software Management panel of the VIP Dashboard.
Observe the environment’s performance in its updated state using the available debugging resources. Watch for any issues that might occur over a reasonable amount of time. If issues do occur, the environment can be quickly rolled back to the previous deployment from the Deployments panel of the VIP Dashboard.
Last updated: September 19, 2023