Skip to content

Contributing

Nick edited this page Mar 8, 2026 · 2 revisions

Contributing

Thanks for your interest in contributing to Dispatch for Telex. This guide covers setting up a local environment, running tests, and submitting a pull request.

Prerequisites

  • PHP 8.2+ with the openssl and mysqli extensions
  • Composer (getcomposer.org)
  • Node.js 24+ and npm
  • MySQL 8.0+ or MariaDB 10.5+ (for PHP tests)
  • WP-CLI (wp-cli.org) — optional but recommended
  • Make — available on macOS and Linux by default

Setup

git clone https://github.com/RegionallyFamous/dispatch.git
cd dispatch
make setup

make setup runs composer install and npm install.

Building JavaScript

npm run start    # Development build with file watching
make build       # Production build

Built files go to build/. This directory is not committed.

Linting

make lint         # Run all linters (JS, CSS, PHP)

npm run lint:js   # ESLint via @wordpress/scripts
npm run lint:css  # Stylelint via @wordpress/scripts
npm run lint:php  # PHP_CodeSniffer (WordPress-Extra + WordPress-Docs)

All three must pass with zero errors before a PR is merged.

Running Tests

PHP tests

Set up the WordPress test suite first:

bash bin/install-wp-tests.sh wordpress_test root '' localhost latest

Then run:

make test       # Runs PHPUnit
composer test   # Alias

JavaScript tests

npm run test:js
npm run test:js:coverage   # With coverage report

Static analysis

php -d memory_limit=2G vendor/bin/phpstan analyse --memory-limit=2G

Using wp-env

npm run env:start   # Start a local WP environment at http://localhost:8888
npm run env:stop

Coding Standards

  • PHP: WordPress Coding Standards via PHP_CodeSniffer. PHPDoc on every public method.
  • JavaScript: ESLint + Prettier via @wordpress/scripts.
  • CSS: Stylelint via @wordpress/scripts.
  • Commits: Imperative messages — Add circuit breaker reset command, not fixed stuff.
  • Branches: Use feature/, fix/, or chore/ prefixes.
  • No dead code: No var_dump, console.log, commented-out blocks, or TODOs in committed code.

Pull Request Checklist

  • make lint passes with zero errors
  • make test passes
  • make build produces a clean build
  • New PHP classes follow the Telex_* naming convention
  • New features include tests in tests/
  • CHANGELOG.md is updated for user-facing changes

Creating a Release

make release

This runs make clean, make build, and bin/build-zip.sh, producing dispatch-for-telex.zip in the repo root. Tagged releases on GitHub trigger the CI release workflow automatically.

Security Issues

Please read SECURITY.md before reporting a vulnerability. Do not open a public issue.

Clone this wiki locally