Welcome Contributors
Thank you for your interest in contributing to Visual Portfolio! This guide will help you get started with the development workflow and contribution process.Prerequisites
Before you begin, ensure you have the following installed:- PHP >= 7.2
- Node.js >= 18.0
- Composer >= 2.0
- Docker (for running tests)
- Git for version control
Getting Started
1. Fork and Clone
Fork the Visual Portfolio repository and clone it to your local machine:2. Install Dependencies
Install both Node.js and PHP dependencies:composer install as a postinstall hook to set up PHP dependencies.
3. Start Development
Start the development server with hot reloading:Development Workflow
Building Assets
Code Quality Checks
Before committing your changes, ensure your code passes all quality checks. The project uses automated pre-commit and pre-push hooks powered by Husky and lint-staged.Running Tests
Always run tests before submitting a pull request:WordPress Environment
The plugin uses@wordpress/env for local WordPress development:
http://localhost:8889.
Contribution Guidelines
Code Standards
- PHP: Follow WordPress Coding Standards (WPCS)
- JavaScript: Use ESLint with WordPress configuration
- CSS/SCSS: Follow Stylelint rules with WordPress SCSS config
- Commits: Write clear, descriptive commit messages
Security Best Practices
Always follow WordPress security guidelines:Naming Conventions
- PHP Classes:
Visual_Portfolio_*prefix - Functions:
vpf_*prefix - Hooks: Use WordPress action/filter system
- Text Domain:
visual-portfolio
Pull Request Process
- Create a Branch: Use descriptive branch names (e.g.,
feature/add-masonry-layout,fix/image-loading-bug) - Make Changes: Follow the code standards and write tests
- Run Quality Checks: Ensure all linting and tests pass
- Commit Changes: Write clear commit messages
- Push to Fork: Push your changes to your forked repository
- Open Pull Request: Submit a PR with a detailed description of your changes
Pull Request Checklist
Before submitting a pull request, verify:- Code follows WordPress Coding Standards
- All linting checks pass (
npm run lint) - All tests pass (
npm test) - Code is properly documented with PHPDoc/JSDoc
- Security best practices are followed
- Translations are properly implemented
- Changes are backward compatible (or clearly documented)
- Pull request description explains the changes and their purpose
File Structure
Understanding the plugin structure helps you navigate the codebase:Version Management
The plugin uses Gulp for version bumping:Version bumping is typically handled by maintainers during the release process.
Translation
The plugin is translation-ready. To generate translation files:visual-portfolio text domain:
Getting Help
- Documentation: https://www.visualportfolio.com/docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions