Thank you for your interest in contributing to GEO AI! We welcome contributions from developers of all skill levels. This guide will help you get started.
// Classes: PascalCase with prefixclass GeoAI_Custom_Class {}// Functions: snake_case with prefixfunction geoai_custom_function() {}// Variables: snake_case$custom_variable = 'value';// Constants: UPPERCASE with prefixdefine( 'GEOAI_CUSTOM_CONSTANT', 'value' );
Spacing and Indentation
// Use tabs for indentationfunction geoai_example() { if ( $condition ) { // Code here }}// Spaces around operators$result = $value1 + $value2;// Spaces after control structuresif ( $condition ) { do_something();}
Documentation
/** * Short description. * * Longer description if needed. * * @since 1.0.0 * * @param int $post_id Post ID. * @param string $keyword Focus keyword. * @return array Analysis results. */function geoai_analyze_keyword( $post_id, $keyword ) { // Implementation}
# Install test dependenciescomposer install --dev# Set up test databasebash bin/install-wp-tests.sh wordpress_test root password localhost latest# Run testscomposer test
style: - Code style changes (formatting, no logic changes)
refactor: - Code refactoring
test: - Adding or updating tests
chore: - Build process, dependencies, etc.
Examples:
# Good commit messagesgit commit -m "feat: add keyword density analyzer"git commit -m "fix: resolve API timeout on large posts"git commit -m "docs: update REST API examples"# With detailed descriptiongit commit -m "feat: add background audit processingImplement Action Scheduler integration for running auditsin the background. This prevents timeout issues on largesites with many posts.Closes #123"
## DescriptionBrief description of what this PR does.## Type of Change- [ ] Bug fix (non-breaking change which fixes an issue)- [ ] New feature (non-breaking change which adds functionality)- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)- [ ] Documentation update## TestingDescribe the tests you ran and how to reproduce them.## Screenshots (if applicable)Add screenshots for UI changes.## Checklist- [ ] My code follows the WordPress coding standards- [ ] I have tested my changes- [ ] I have commented my code where needed- [ ] I have updated documentation- [ ] My changes generate no new warnings- [ ] I have added tests that prove my fix/feature works## Related IssuesCloses #(issue number)
## Bug DescriptionClear description of the bug.## Steps to Reproduce1. Go to '...'2. Click on '...'3. Scroll down to '...'4. See error## Expected BehaviorWhat you expected to happen.## Actual BehaviorWhat actually happened.## ScreenshotsIf applicable, add screenshots.## Environment- WordPress Version: 6.4- GEO AI Version: 1.6.0- PHP Version: 8.2- Browser: Chrome 120- Active Theme: Twenty Twenty-Four- Other Active Plugins: Yoast SEO, WooCommerce## Error MessagesPaste any error messages from:- Browser console- PHP error log- WordPress debug.log## Additional ContextAny other relevant information.
## Feature DescriptionDescribe the feature you'd like to see.## Use CaseWhy is this feature needed? What problem does it solve?## Proposed SolutionHow do you envision this working?## Alternatives ConsideredOther solutions you've thought about.## Additional ContextMockups, examples from other plugins, etc.
/** * Analyze post content for SEO optimization. * * This function runs a comprehensive SEO audit on the specified post, * analyzing content structure, keyword usage, readability, and technical * SEO factors. Results are stored in post meta and returned. * * @since 1.6.0 * * @param int $post_id The post ID to analyze. * @param array $options Optional. Analysis options. * @return array|WP_Error Analysis results or error on failure. * * @example * $results = geoai_analyze_post( 123, array( * 'focus_keyword' => 'WordPress SEO', * 'reanalyze' => true, * ) ); * * if ( ! is_wp_error( $results ) ) { * echo 'Score: ' . $results['scores']['total']; * } */function geoai_analyze_post( $post_id, $options = array() ) { // Implementation}
## [Unreleased]### Added- New keyword density analyzer- Background audit processing### Changed- Improved API error handling- Updated UI for settings page### Fixed- Fixed timeout on large posts- Resolved conflict with Yoast SEO### Deprecated- `geoai_old_function()` - Use `geoai_new_function()` instead
Your contributions make GEO AI better for everyone. Whether you’re fixing a typo, reporting a bug, or adding a major feature - every contribution matters.Happy coding! 🚀