Contributing to Author Profile Blocks
Guidelines for contributing to the Author Profile Blocks plugin development.
Table of contents
- TOC
Getting Started
Thank you for considering contributing to Author Profile Blocks! This document provides guidelines and instructions for contributing to the plugin’s development.
Prerequisites
Before you begin, you’ll need:
- Basic knowledge of PHP, JavaScript, and WordPress development
- Familiarity with WordPress block editor (Gutenberg) concepts
- Git and GitHub experience
- Local WordPress development environment
Setting Up the Development Environment
-
Fork the Repository: Visit the Author Profile Blocks repository and click the “Fork” button in the top-right corner.
- Clone Your Fork:
git clone https://github.com/YOUR-USERNAME/author-profile-blocks.git cd author-profile-blocks
- Install Dependencies:
npm install composer install
- Start Development Server:
npm start
- Build for Production:
npm run build
Development Workflow
Branch Organization
main
- The production branch containing stable releasesdevelop
- The development branch for upcoming releases- Feature branches - Create from
develop
for new features - Bugfix branches - Create from
develop
for bug fixes - Hotfix branches - Create from
main
for urgent production fixes
Making Changes
- Create a Branch:
git checkout develop git pull origin develop git checkout -b feature/your-feature-name
- Develop Your Feature:
- Make your changes following the coding standards
- Write tests for your changes when applicable
- Update documentation as needed
- Commit Your Changes:
git add . git commit -m "Feature: Brief description of your changes"
Use semantic commit messages:
Feature:
for new featuresFix:
for bug fixesDocs:
for documentation changesStyle:
for formatting changesRefactor:
for code refactoringTest:
for adding or modifying testsChore:
for changes to the build process or auxiliary tools
- Push Your Changes:
git push origin feature/your-feature-name
- Create a Pull Request:
- Go to the GitHub repository
- Click “New Pull Request”
- Select
develop
as the base branch and your feature branch as the compare branch - Provide a detailed description of your changes
Coding Standards
PHP Coding Standards
Author Profile Blocks follows the WordPress Coding Standards. Key points:
- Use PHP 7.4+ features where appropriate
- Follow WordPress naming conventions
- Use namespaces for class organization
- Prioritize backward compatibility
- Add proper PHPDoc comments
JavaScript Coding Standards
For JavaScript code:
- Follow WordPress JavaScript Coding Standards
- Use ES6+ features with appropriate polyfills
- Modularize code with import/export
- Use React hooks for functional components
- Add JSDoc comments for functions and components
CSS/SCSS Coding Standards
For styling:
- Follow WordPress CSS Coding Standards
- Use SCSS for preprocessed styles
- Use BEM methodology for class naming
- Create modular and reusable style components
- Ensure responsive design
- Respect theme compatibility
Documentation Standards
For documentation:
- Document all public methods, hooks, functions, and classes
- Use markdown for documentation files
- Keep examples up-to-date
- Include version numbers for API changes
- Document deprecations clearly
Testing
Unit Tests
For PHP unit testing:
composer test
End-to-End Tests
For end-to-end testing of the blocks:
npm run test:e2e
Manual Testing Checklist
Before submitting a pull request, manually test:
- All blocks in the editor
- Frontend rendering in various themes
- Responsive behavior on different screen sizes
- Compatibility with other popular plugins
- Accessibility features
Building and Packaging
Building Assets
To build the JavaScript and CSS assets:
npm run build
Creating a Release
To create a release package:
npm run package
This will create a zip file in the dist
directory.
Documentation
Code Documentation
- Add PHPDoc comments to all classes, methods, and functions
- Document hooks with examples
- Keep inline code comments current with changes
User Documentation
- Update the README.md file with significant changes
- Add or update the documentation in the
docs
directory - Create screenshots for new features or UI changes
Submitting Pull Requests
When submitting a pull request:
- Provide Context: Explain what the PR accomplishes and why it’s needed
- Reference Issues: Link to any related issues (e.g., “Fixes #123”)
- Include Tests: Add appropriate tests for your changes
- Update Documentation: Update any affected documentation
- Create a Changelog Entry: Add an entry to the changelog
- Follow Pull Request Template: Fill out all sections of the PR template
Code Review Process
What to expect during code review:
- Initial review within 1-2 weeks
- Feedback from maintainers on code quality, tests, and documentation
- Requested changes to be addressed before merging
- Final approval from at least one maintainer required
- Merge into the appropriate branch by maintainers
Release Process
The release process follows these steps:
- Code freeze on
develop
branch - Final testing of all features
- Creating a release branch from
develop
- Version bump in package.json, readme.txt, and main plugin file
- Merging the release branch into
main
- Creating a GitHub release with detailed changelog
- Building and deploying to WordPress.org
Getting Help
If you need help with your contribution:
- Questions: Open an issue with the “question” label
- Discussions: Participate in GitHub Discussions
- WordPress.org: Post in the plugin’s support forum
- Documentation: Refer to this contributing guide and other documentation
Code of Conduct
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Focus on constructive feedback
- Avoid personal attacks or inflammatory language
- Report inappropriate behavior to the maintainers
- Follow the WordPress community guidelines
Recognition
All contributors will be recognized in these ways:
- Listed in the CONTRIBUTORS.md file
- Mentioned in release notes for significant contributions
- Acknowledged in WordPress.org plugin page credits
License
By contributing to Author Profile Blocks, you agree that your contributions will be licensed under the GPL v2 or later.
Thank you for contributing to Author Profile Blocks!