Build a Custom Plugin for WordPress at WSU
If you’d like to see some functionality not already available on the WSUWP platform, developing a custom plugin may be the way to go. We encourage reaching out to the web team in the WSU Web Slack or during Open Labs early in the process so that we can provide nuanced advice for your situation. We’ll discuss the idea with you and try to find ways where the functionality could be useful for others on the platform as well.
In general, start your project with the WSUWP Plugin Skeleton project. This includes a base for starting and maintaining the new plugin. A few important pieces are a part of this plugin skeleton.
First, PHP_CodeSniffer is used to help ensure that the WordPress PHP coding standards are properly applied. Using the command
grunt phpcs in the project directory will generate either a success message or a list of code standards to fix in the plugin code. Passing these code standards checks is a required element of a custom plugin.
Second, a PHPUnit configuration is available. While not absolutely necessary, relying on unit tests will always help smooth the development process and speed up the confidence of code review. See the skeleton project’s README.md file for instructions on setting up the initial environment.
Deploying a custom plugin
Our deployment process prefers that the plugin is available in a public GitHub repository. Ideally, this repository is part of the WSU GitHub organization to allow for effective collaboration. Once fully configured, all releases tagged using semantic versioning will automatically deploy to the WSUWP platform.
Code review will be an important part of the process and a required step before deployments are configured.