Contributing Guidelines
How to Contribute
We welcome contributions to the Private Comments plugin! Whether you're fixing a bug, adding a feature, or improving documentation, your help is appreciated. Follow these guidelines to ensure a smooth contribution process.
Reporting Issues
Before writing code, please check the existing issues to see if your concern has already been addressed.
- Bug Reports: Provide a clear description of the bug, steps to reproduce it, and your environment details (WordPress version, PHP version).
- Feature Requests: Describe the proposed feature and why it would be beneficial to the plugin users.
Development Workflow
To contribute code changes, follow the standard GitHub fork-and-pull-request workflow:
- Fork the Repository: Create your own copy of the repository by clicking the "Fork" button at the top of the GitHub page.
- Clone the Fork: Download your fork to your local development environment.
git clone https://github.com/your-username/wp-private-comments.git - Create a Branch: Create a new branch for your specific fix or feature. Use a descriptive name.
git checkout -b fix/issue-description # OR git checkout -b feature/new-capability - Implement Changes: Make your changes, ensuring they align with the project's goal of restricting comment visibility.
- Commit and Push: Write clear, concise commit messages.
git add . git commit -m "Brief description of changes" git push origin your-branch-name - Submit a Pull Request: Navigate back to the original repository on GitHub and open a Pull Request (PR) from your branch.
Coding Standards
To maintain a consistent codebase, we follow the WordPress Coding Standards. Please ensure your code adheres to these guidelines:
- PHP: Use standard WordPress formatting for arrays, control structures, and function naming (snake_case).
- Documentation: All new functions should include PHPDoc blocks explaining the parameters and return types.
- Security: Always sanitize, validate, and escape data. Use WordPress built-in functions like
sanitize_text_field(),absint(), andesc_html().
Pull Request Checklist
When submitting a PR, ensure the following:
- The code is well-commented and easy to understand.
- Changes do not break existing functionality.
- If you are introducing a new filter or action, it is documented in the PR description.
- The PR targets the
mainbranch.
Licensing
By contributing to this project, you agree that your contributions will be licensed under the same GPLv2 or later license as the rest of the plugin.