-
Notifications
You must be signed in to change notification settings - Fork 0
Development Workflow
mab056 edited this page Feb 15, 2026
·
3 revisions
Recommended branch model:
- Base branch:
dev - Feature branch examples:
feature/<name>fix/<name>
Conventional commit prefixes:
-
feat,fix,docs,refactor,test,chore
Reference:
CONTRIBUTING.md
Architecture constraints:
- No singleton pattern
- No static methods/properties
- No final classes/methods
- Constructor dependency injection
- Interface-first contracts
Coding standards:
- WordPress Coding Standards (WPCS)
- Tab indentation
- Allman braces
Every new class MUST have the following tests in its corresponding test class:
public function test_class_is_not_final() {
$reflection = new \ReflectionClass( MyClass::class );
$this->assertFalse( $reflection->isFinal(), 'Class should NOT be final' );
}
public function test_no_static_methods() {
$reflection = new \ReflectionClass( MyClass::class );
$methods = $reflection->getMethods( \ReflectionMethod::IS_STATIC );
$static_methods = array_filter( $methods, function( $method ) {
return strpos( $method->getName(), '__' ) !== 0;
} );
$this->assertEmpty( $static_methods, 'Class should have NO static methods' );
}This is a non-negotiable requirement, verified in code review. See Testing and Quality for details.
Required cycle for any change:
- RED: write failing tests first
- GREEN: implement minimal code to pass
- REFACTOR: improve code while keeping tests green
Test placement:
- Unit:
tests/Unit/ - Integration:
tests/Integration/ - E2E (when UI/user behavior changes):
tests/e2e/
When touching admin forms or endpoints:
- Add/verify capability checks
- Add/verify nonce checks
- Sanitize all input
- Escape all output
When touching outbound HTTP:
- Route calls through
HttpClientInterface - Preserve anti-SSRF guarantees
When touching diagnostics:
- Ensure sensitive data passes through
RedactionInterface
Install dependencies:
composer install
Run quality gate:
composer testcomposer phpcscomposer analyse
Run matrix (CI-like local):
composer test:matrix
Run multisite tests (after changes to Uninstaller or multisite components):
composer test:integration:multisite
Run E2E manually:
npm cinpm run env:startbash bin/e2e-setup.shnpm run test:e2enpm run env:stop
High-level flow:
- Create a class in
src/Checks/implementingCheckInterface - Inject dependencies via constructor (no globals in business logic)
- Add unit tests and integration tests (including pattern enforcement tests)
- Register the check in
config/bootstrap.phpinsideCheckRunnersetup - Verify rendering in HealthScreen and DashboardWidget
High-level flow:
- Implement/modify channel class in
src/Channels/ - Keep settings contract in sync with
AlertSettings - Ensure channel output is safe and escaped
- Add/update tests (unit + integration)
- Validate via E2E when UI flow changes
Before merge/release, all should pass:
composer testcomposer phpcscomposer analyse- Relevant E2E scenarios (if UI flow changed)
- Pattern enforcement tests present for every new class
-
bin/build-zip.shgenerates a valid ZIP
And documentation should be updated:
CHANGELOG.md- Wiki pages impacted by the change