Thank you for your interest in contributing to Setlist Player! This document provides guidelines and instructions for contributing to the project.
- Node.js 18+ and npm
- Composer
- WordPress development environment
# Clone the repository
git clone https://github.com/ironprogrammer/setlist-player.git
cd setlist-player
# Install dependencies
npm install
composer install
# Start development build (watches for changes)
npm start
# Build for production
npm run buildsetlist-player/
├── build/ # Compiled assets (generated by build process)
├── includes/ # PHP classes (API wrapper, REST controller, settings, block registration)
├── src/ # Source files (block.json, React components, SCSS, render.php)
├── tests/ # PHPUnit and Jest tests
└── setlist-player.php # Main plugin file
- Fork the repository
- Create a feature branch from
trunk:git checkout -b feature/amazing-feature
- Make your changes
- Write or update tests as needed
- Run linting and tests (see below)
- Commit your changes
- Push to your fork
- Open a Pull Request against
trunk
This project follows WordPress coding standards:
- PHP: WordPress PHP Coding Standards
- JavaScript: WordPress JavaScript Coding Standards
- CSS: WordPress CSS Coding Standards
Run linting checks before committing:
# Lint everything
npm run lint
# Lint specific file types
npm run lint:js # JavaScript
npm run lint:css # CSS/SCSS
npm run lint:php # PHPAuto-format code to match standards:
# Format everything
npm run format
# Format specific file types
npm run format:php # PHP onlySet up the test environment (first time only):
npm run test:setup# Run all tests (PHP + JavaScript)
npm test
# Run PHP tests only
npm run test:php
# Run JavaScript tests only
npm run test:js
# Run PHP tests after rebuilding
npm run test:php:build
# Run a specific PHP test function
npm run test:php -- --filter=test_validate_api_key
# Run a specific JavaScript test file
npm run test:js -- utils.test.js- PHP Tests: Add PHPUnit tests in
tests/test-*.php - JavaScript Tests: Add Jest tests in
tests/js/*.test.js
Follow these guidelines for commit messages:
- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Focus on what was implemented, not how you got there
- First line should be a brief summary (50 chars or less)
- Add detailed explanation in the body if needed
Add playlist export functionality
- Add export button to block toolbar
- Implement JSON export format
- Add import validation
- Update Documentation: Ensure README.md and other docs reflect your changes
- Add Tests: Include tests that cover your changes
- Run All Checks: Ensure linting and tests pass
- Update Changelog: Add an entry to the changelog section in readme.txt
- Describe Your Changes: Provide a clear description of what and why in the PR
- Link Issues: Reference any related issues in your PR description
- Code follows WordPress coding standards
- All tests pass (
npm test) - Linting passes (
npm run lint) - Documentation updated
- Commit messages follow guidelines
- No merge conflicts with
trunk
To create a WordPress.org-ready distribution package:
# Build production assets
npm run build
# Generate distribution zip
npm run plugin-zipThis creates setlist-player.zip containing only the files needed for distribution (no source files, tests, or dev dependencies).
- Bug Reports: Open an issue
- Feature Requests: Open an issue
- Questions: Start a discussion
Be respectful, constructive, and professional in all interactions. We're all here to make this plugin better!