Thank you for your interest in improving Custom Metadata Manager. Contributions of all kinds are welcome, whether that is reporting a bug, suggesting an enhancement, improving the documentation, or submitting a code change. This guide explains how to set up a local environment and how we work so that your contribution can be reviewed and merged smoothly.
We want this to be a welcoming and respectful project for everyone. Please be considerate and constructive in all interactions, whether in issues, pull requests or discussions.
You will need Git, Composer, and Node.js (which provides npm) installed.
-
Fork and clone the repository:
git clone https://github.com/Automattic/custom-metadata.git cd custom-metadata -
Install the PHP dependencies:
composer install
-
Install
@wordpress/envif you do not already have it, then start a local WordPress environment:npm -g install @wordpress/env wp-env start
Inside the wp-env container, the plugin is mounted at
wp-content/plugins/custom-metadataand is activated for you. Once the environment is running you can visit the local site in your browser to try the plugin out.
We use a branching model where day-to-day work happens against develop, and main holds the stable, released code.
-
Create a branch from
develop:git checkout develop git pull git checkout -b my-change
-
Make your changes.
-
Add or update tests to cover the behaviour you have changed.
-
Run the linting and tests locally (see below) and make sure they pass.
-
Open a pull request against
develop.
The plugin is written in procedural PHP. We follow the WordPress VIP Coding Standards, enforced through PHP_CodeSniffer.
Check your changes against the standards:
composer csMany issues can be fixed automatically:
composer cs-fixPlease make sure composer cs reports no errors before opening a pull request.
Integration tests run through wp-env, so make sure your environment is started (wp-env start) first.
Run the single-site suite:
composer test:integrationRun the multisite suite:
composer test:integration-msIntegration tests live in tests/Integration/ and extend Yoast\WPTestUtils\WPIntegration\TestCase. When adding tests, please follow the Arrange-Act-Assert pattern and give each test a descriptive name that explains the behaviour being verified.
- Keep each pull request focused on a single change; smaller PRs are easier to review and merge.
- Write a clear description explaining what the change does and why.
- Reference any related issues, for example
Fixes #123, so they are linked and closed automatically. - Make sure all continuous integration checks pass.
- Do not commit dependencies (
vendor/) or other generated files.
Releasing is handled by the maintainers. In short, tagging a release on main triggers the GitHub release and WordPress.org deploy workflows, which build and publish the plugin. Contributors do not need to do anything for a release beyond getting their changes merged into develop.