# CONTRIBUTING.md

## 🤝 Contributing to CodePress CMS

Thank you for your interest in contributing to CodePress CMS!

## 📜 License Agreement

By contributing to CodePress CMS, you agree that:

1. Your contributions will be licensed under **AGPL v3**
2. You retain copyright to your contributions
3. You grant the project maintainer (E.Noorlander) the right to dual-license your contributions
4. You have the right to submit the contribution

## 📢 Notification Requirement

When contributing or modifying CodePress CMS:

### Required Steps:

1. **Fork the repository**
   ```bash
   git clone https://git.noorlander.info/E.Noorlander/CodePress.git
   ```

2. **Create a CHANGES.md** in your fork:
   ```markdown
   # Changes to CodePress CMS
   
   ## Modified by: [Your Name]
   ## Date: [Date]
   ## Original: https://git.noorlander.info/E.Noorlander/CodePress.git
   
   ### Changes:
   - [List your changes]
   
   ### Attribution:
   Based on CodePress CMS by E.Noorlander
   Licensed under AGPL v3
   ```

3. **Create an issue** before major changes:
   - Describe the change you want to make
   - Get feedback from maintainers
   - Discuss implementation approach

4. **Submit a pull request**:
   - Reference the issue number
   - Include tests if applicable
   - Update documentation
   - Follow coding standards (PSR-12)

5. **Notify the maintainer**:
   - Email: commercial@noorlander.info
   - GitLab issue: https://git.noorlander.info/E.Noorlander/CodePress.git/issues
   - Pull request notification is automatic

## 🎯 What We're Looking For

### High Priority
- 🐛 Bug fixes
- 🔒 Security improvements
- 📝 Documentation improvements
- 🧪 Test coverage
- ♿ Accessibility improvements

### Medium Priority
- ✨ New features (discuss first!)
- 🎨 UI/UX improvements
- ⚡ Performance optimizations
- 🌍 Translation additions

### Low Priority
- 🎨 Code refactoring
- 📦 Dependency updates

## 📋 Contribution Guidelines

### Code Style
- Follow PSR-12 coding standard
- Use 4 spaces for indentation
- Add PHPDoc comments to functions
- Keep functions small and focused

### Commit Messages
```
Type: Short description (max 50 chars)

Longer description if needed (max 72 chars per line)

Fixes #issue-number
```

**Types:**
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation
- `test:` Tests
- `refactor:` Code refactoring
- `perf:` Performance improvement
- `security:` Security fix

### Testing
- Add tests for new features
- Ensure all tests pass
- Run security tests (pentest.sh)
- Test in multiple browsers

### Documentation
- Update README if needed
- Update function-test docs
- Add inline comments
- Update CHANGELOG

## 🚫 What We Won't Accept

- ❌ Code that breaks existing functionality
- ❌ Contributions without proper attribution
- ❌ Code that violates AGPL v3
- ❌ Malicious or obfuscated code
- ❌ Contributions that violate copyright
- ❌ PRs without notification/communication

## 💰 Commercial Contributions

If you're contributing on behalf of a commercial entity:

1. **Company must have a commercial license** OR
2. **Release contributions as open-source** (AGPL v3)

Contact commercial@noorlander.info for licensing.

## 🎁 Recognition

Contributors will be:
- Listed in CONTRIBUTORS.md
- Credited in release notes
- Mentioned on project website (if applicable)
- Given contributor badge

## 📞 Getting Help

- **Questions:** Create a GitLab issue
- **Bugs:** Create a GitLab issue with reproduction steps
- **Features:** Discuss in GitLab issues first
- **Commercial:** Email commercial@noorlander.info

## 🔄 Development Workflow

1. **Fork** the repository
2. **Create branch** from `development`
   ```bash
   git checkout -b feature/your-feature development
   ```
3. **Make changes** and commit
4. **Push** to your fork
5. **Create Pull Request** to `development` branch
6. **Wait for review** (usually within 48 hours)
7. **Address feedback** if requested
8. **Merge** once approved

## ✅ Pull Request Checklist

Before submitting:

- [ ] Code follows PSR-12 style
- [ ] All tests pass
- [ ] Documentation updated
- [ ] CHANGES.md created/updated
- [ ] Commit messages follow convention
- [ ] Issue created and linked
- [ ] Maintainer notified
- [ ] No breaking changes (or clearly documented)
- [ ] Security implications considered
- [ ] Performance impact tested

## 🏆 Top Contributors

Recognition for significant contributors:
- 🥇 **Gold Contributor** (10+ merged PRs)
- 🥈 **Silver Contributor** (5+ merged PRs)
- 🥉 **Bronze Contributor** (1+ merged PR)

## 📄 Code of Conduct

### Be Respectful
- Respect all contributors
- Constructive criticism only
- No harassment or discrimination
- Professional communication

### Be Collaborative
- Help others learn
- Share knowledge
- Review PRs constructively
- Welcome newcomers

### Be Responsible
- Test your code
- Follow license terms
- Respect copyrights
- Report security issues privately

## 🔐 Security Issues

**DO NOT** create public issues for security vulnerabilities!

Report privately:
- Email: security@noorlander.info
- Expected response: 24 hours
- Coordinated disclosure process

## 📊 Contribution Statistics

We track:
- Lines of code contributed
- Number of commits
- Issues resolved
- PRs merged
- Test coverage improvements

## 🎓 Learning Resources

- [PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)
- [AGPL v3 License](https://www.gnu.org/licenses/agpl-3.0.html)
- [Git Workflow](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows)

## 🙏 Thank You!

Your contributions make CodePress CMS better for everyone. We appreciate your time and effort!

---

**Questions?** Contact: commercial@noorlander.info

**License:** AGPL v3 / Commercial Dual License  
**Copyright:** (C) 2025 E.Noorlander / CodePress Development Team