Contribution Workflow
Contribution Workflow
This guide outlines the standardized process for identifying, developing, and submitting contributions to WordPress Core through this repository. We follow the official WordPress Core development standards while maintaining a streamlined internal process for weekly updates.
1. Identify an Issue
Before writing code, identify a ticket on the WordPress Trac or a task within our internal project board.
- Trac Search: Look for tickets labeled
good-first-bug,has-patch, or specific components likeMediaorRest API. - Coordination: If you are picking up a new Trac ticket, leave a comment on the ticket to signal you are working on it to avoid duplicate efforts.
2. Environment Setup
We use wp-env for a consistent development environment. Ensure you have Docker and Node.js installed.
# Clone the repository
git clone https://github.com/UditAkhourii/wordpress.git
cd wordpress
# Install dependencies
npm install
# Start the local environment
npm run dev
The local site will be available at http://localhost:8889.
3. Create a Feature Branch
Always create a new branch for every contribution. Use a naming convention that references the Trac ticket number if available.
# Format: ticket/[ticket-number]-[short-description]
git checkout -b ticket/58421-fix-media-caption-styles
4. Development Standards
All contributions must adhere to the WordPress Coding Standards (WPCS).
- PHP: Use tabs for indentation, not spaces.
- JavaScript: Follow the WordPress ESlint configuration.
- Linting: Run the following command to check your code before committing:
# Lint PHP and JS
npm run lint
# Automatically fix fixable issues
npm run format
5. Running Tests
Do not submit a contribution without verifying it passes existing tests and, where applicable, includes new test coverage.
PHPUnit Tests
# Run all core tests
npm run test:php
# Run tests for a specific group
npm run test:php -- --group media
End-to-End (Playwright) Tests
# Run E2E tests
npm run test:e2e
6. Submission Process
WordPress Core contributions are typically handled via Pull Requests to the WordPress/wordpress-develop mirror or by uploading a .patch file to Trac.
Our Internal Review (Weekly)
- Push to this Repo: Push your branch to
UditAkhourii/wordpress. - Open a PR: Open a PR against our
mainbranch. - Link Trac: Include the link to the WordPress Trac ticket in the PR description.
Upstream Submission
Once reviewed internally:
- Sync with Upstream: Ensure your changes are applied against the latest
wordpress-developbranch. - GitHub PR: Submit the PR to the official WordPress Core GitHub repository.
- Trac Update: Post the PR link on the relevant Trac ticket to alert the Core committers.
7. Documentation Changes
If your contribution introduces new functions or changes existing APIs, you must update the Inline Documentation (DocBlocks).
Example DocBlock Requirements:
/**
* Short description of the function.
*
* @since x.x.x (Use the current target WordPress version)
*
* @param type $variable Description.
* @return type Description.
*/