Thank you for your interest in contributing to Multisite Ultimate! This document provides guidelines and information for developers.
- PHP 7.4+ (8.1+ recommended for development)
- Node.js 16+ and npm
- Composer
- Git
- WordPress Multisite environment
-
Clone and setup the repository:
git clone https://github.com/superdav42/wp-multisite-waas.git cd wp-multisite-waas npm run dev:setup -
Or setup manually:
npm run install:deps # Installs both composer and npm dependencies npm run setup:hooks # Sets up Git hooks
npm test # Run PHPUnit tests
npm run test:coverage # Run tests with coverage
npm run lint # Check code style (PHPCS)
npm run lint:fix # Fix code style automatically (PHPCBF)
npm run stan # Run static analysis (PHPStan)
npm run quality # Run lint + stan
npm run quality:fix # Run lint:fix + stan
npm run check # Run all checks before committing
npm run build # Production build
npm run build:dev # Development build
npm run clean # Clean build artifacts
npm run dev:setup # Complete development setupcomposer test # Run PHPUnit tests
composer test:coverage # Run tests with coverage
composer lint # Run PHPCS
composer lint:fix # Run PHPCBF to fix issues
composer stan # Run PHPStan
composer quality # Run lint + stan
composer setup-hooks # Setup Git hooksvendor/bin/phpunit # Run tests
vendor/bin/phpcs # Check code style
vendor/bin/phpcbf # Fix code style
vendor/bin/phpstan analyse # Static analysisWe maintain high code quality through automated tools and Git hooks:
The project includes Git hooks that run automatically:
- pre-commit: Runs PHPCS and PHPStan on changed files
- commit-msg: Enforces conventional commit format
To install hooks: npm run setup:hooks
We follow WordPress coding standards:
- PHPCS: WordPress coding standards for PHP
- PHPStan: Static analysis for type safety
- Conventional Commits: Standardized commit messages
- PHPUnit: Unit and integration tests
- Code Coverage: Aim for >80% coverage
- WordPress Test Suite: Tests run against WordPress multisite
We use Conventional Commits format:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Test-related changeschore: Build, dependencies, or maintenanceperf: Performance improvementsci: CI/CD changesbuild: Build system changesrevert: Revert previous changes
Examples:
feat(checkout): add support for discount codes
fix(gateway): resolve Stripe webhook validation
docs(readme): update installation instructions
test(models): add Customer model tests- Fork the repository and create a feature branch
- Make your changes following our coding standards
- Write/update tests for your changes
- Run quality checks:
make check - Update documentation if needed
- Submit a pull request with:
- Clear description of changes
- Reference to related issues
- Screenshots for UI changes
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test
vendor/bin/phpunit tests/WP_Ultimo/Models/Customer_Test.php- Place tests in
tests/directory - Follow existing test structure
- Include unit and integration tests
- Test both success and failure scenarios
Tests run against WordPress test suite with multisite enabled:
- Uses WP_TESTS_MULTISITE=1
- Separate test database
- Isolated from production data
We aim for high code coverage:
- Target: >80% line coverage
- Reports: Generated in
coverage-html/ - CI Integration: Automatic upload to Codecov
View coverage locally:
npm run test:coverage
open coverage-html/index.html- Create feature branch:
git checkout -b feat/feature-name - Make changes with tests
- Run checks:
npm run check - Commit: Use conventional format
- Push and create PR
- Create fix branch:
git checkout -b fix/issue-description - Write test that reproduces the bug
- Fix the issue
- Verify test passes
- Run checks:
npm run check - Commit and create PR
multisite-ultimate/
├── .github/workflows/ # GitHub Actions
├── .githooks/ # Custom Git hooks
├── bin/ # Development scripts
├── inc/ # Core PHP classes
├── tests/ # PHPUnit tests
├── assets/ # CSS/JS/images
├── views/ # Template files
├── vendor/ # Composer dependencies
├── node_modules/ # NPM dependencies
├── Makefile # Development commands
└── composer.json # PHP dependencies
Releases are automated via GitHub Actions:
- Update version numbers in plugin files
- Update CHANGELOG
- Create and push version tag:
git tag v2.x.x && git push origin v2.x.x - GitHub Action builds and creates release
- Documentation: Check existing docs and code comments
- Issues: Search existing issues before creating new ones
- Discussions: Use GitHub Discussions for questions
- Code Review: PRs get reviewed by maintainers
- Database: Use proper indexing and efficient queries
- Caching: Implement appropriate caching strategies
- Assets: Minimize and optimize CSS/JS
- Hooks: Use appropriate priority and avoid heavy operations
- Input Sanitization: Always sanitize user input
- Output Escaping: Escape output based on context
- Nonces: Use WordPress nonces for forms
- Capabilities: Check user permissions
- SQL: Use prepared statements
Enable WordPress debugging:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);Use the built-in logger:
wu_log_add('debug', 'Debug message', $context);The project includes hook profiling capabilities for performance analysis.
- Extend
Base_Model - Implement CRUD operations
- Use BerlinDB for database layer
- Extend base admin page classes
- Follow WordPress admin UI patterns
- Include proper capability checks
- Modular signup fields
- Payment gateway integration
- Customizable checkout flows
- Flexible limitation system
- Plugin/theme restrictions
- Resource limits (disk, users, etc.)
Thank you for contributing to Multisite Ultimate! 🚀