Contributing
Thank you for your interest in contributing to C3 CloudFront Cache Controller!
Development Environment Setup
Prerequisites
- PHP: 7.4 or higher
- Node.js: 20 or higher
- Git: For version control
Setup Steps
Clone the repository:
bashgit clone https://github.com/amimoto-ami/c3-cloudfront-clear-cache.git cd c3-cloudfront-clear-cacheInstall Node.js dependencies:
bashnpm installStart development environment with wp-env:
bashnpm run devInstall PHP dependencies
bashnpm run composer:install
Development Workflow
Branch Strategy
master- Production branchdevelop- Development branchfeature/*- Feature branchesbugfix/*- Bug fix branches
Creating a Feature Branch
bash
git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name
# Make changes and commit
git add .
git commit -m "feat: add your feature description"
# Create pull request
git push origin feature/your-feature-nameImportant: always branch from develop
When starting development, always create your branch from develop. Do not branch from master for feature or bugfix work.
Release Notes for Maintainers
Version consistency for WordPress.org packaging
Before release, update version numbers consistently in both files:
readme.txt(Stable tag)c3-cloudfront-clear-cache.php(Version)
If these versions are not aligned, WordPress.org SVN may not package the plugin as expected.
Version update helper script
You can use:
bash
./bin/update-version.sh 7.3.2This script updates:
package.jsonc3-cloudfront-clear-cache.phpreadme.txt(Stable tagonly)
Testing
Running Tests
bash
# Run all tests
npm run test
# Run specific test suites
wp-env run tests composer run test:unit
wp-env run tests composer run test:integrationCode Quality
Code Style Checks
bash
# PHP CodeSniffer
wp-env run tests composer run phpcs
# Auto-fix code style
wp-env run tests composer run phpcbfPull Requests
Pre-submission Checklist
- [ ] All tests pass
- [ ] Code follows style guidelines
- [ ] Documentation updated (if needed)
Pull Request Template
markdown
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Manual testing completedResources
- Contributing (published docs)
- WordPress Plugin Developer Handbook
- WordPress Coding Standards
- AWS CloudFront API Documentation
Thank you for contributing!