Fix Markdown line lengths for Codacy compliance
- Break long lines in documentation files to stay under 120 characters - Use reference-style links for long URLs - Simplify ASCII art diagram in error-checking-feedback-loops.md - Reorganize README.md badges with reference-style links
This commit is contained in:
@@ -8,8 +8,13 @@ This document provides guidance for AI assistants to help with code review for t
|
||||
|
||||
Before submitting code for review, test it with WordPress Playground:
|
||||
|
||||
* [ ] Test in single site environment: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=5)
|
||||
* [ ] Test in multisite environment: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=18)
|
||||
* [ ] Test in single site environment:
|
||||
[Open in WordPress Playground][playground-single]
|
||||
* [ ] Test in multisite environment:
|
||||
[Open in WordPress Playground][playground-multisite]
|
||||
|
||||
[playground-single]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=5
|
||||
[playground-multisite]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=18
|
||||
* [ ] Verify plugin functionality works in both environments
|
||||
* [ ] Check for any JavaScript errors in the browser console
|
||||
* [ ] Run Cypress tests locally: `npm run test:playground:single` and `npm run test:playground:multisite`
|
||||
@@ -257,10 +262,20 @@ In function `handle_remove_reference()`:
|
||||
3. The success message should be translatable:
|
||||
```php
|
||||
// Change this:
|
||||
add_settings_error('fpden', 'fpden_removed', 'Plugin reference removed successfully.', 'updated');
|
||||
add_settings_error(
|
||||
'fpden',
|
||||
'fpden_removed',
|
||||
'Plugin reference removed successfully.',
|
||||
'updated'
|
||||
);
|
||||
|
||||
// To this:
|
||||
add_settings_error('fpden', 'fpden_removed', __('Plugin reference removed successfully.', 'fix-plugin-does-not-exist-notices'), 'updated');
|
||||
add_settings_error(
|
||||
'fpden',
|
||||
'fpden_removed',
|
||||
__( 'Plugin reference removed successfully.', 'fix-plugin-does-not-exist-notices' ),
|
||||
'updated'
|
||||
);
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
@@ -365,27 +365,13 @@ function get_plugin_version() { ... }
|
||||
### Complete Feedback Loop System
|
||||
|
||||
```
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ │ │ │ │ │
|
||||
│ Code Changes │────▶│ Local Testing │────▶│ GitHub Actions │
|
||||
│ │ │ │ │ │
|
||||
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
|
||||
│ │ │
|
||||
│ │ │
|
||||
│ │ │
|
||||
┌────────▼────────┐ ┌────────▼────────┐ ┌────────▼────────┐
|
||||
│ │ │ │ │ │
|
||||
│ AI Assistant │◀────│ Error Analysis │◀────│ Status Check │
|
||||
│ │ │ │ │ │
|
||||
└────────┬────────┘ └─────────────────┘ └─────────────────┘
|
||||
│
|
||||
│
|
||||
│
|
||||
┌────────▼────────┐ ┌─────────────────┐
|
||||
│ │ │ │
|
||||
│ Fix Generation │────▶│ Human Review │ (only when necessary)
|
||||
│ │ │ │
|
||||
└─────────────────┘ └─────────────────┘
|
||||
Code Changes ──► Local Testing ──► GitHub Actions
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
AI Assistant ◀── Error Analysis ◀── Status Check
|
||||
│
|
||||
▼
|
||||
Fix Generation ──► Human Review (only when necessary)
|
||||
```
|
||||
|
||||
### Key Components
|
||||
|
||||
@@ -17,9 +17,12 @@ It uses WebAssembly, which means:
|
||||
|
||||
The easiest way to test our plugin with WordPress Playground is to use the online version:
|
||||
|
||||
1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=2)
|
||||
1. Single site testing: [Open in WordPress Playground][playground-single]
|
||||
|
||||
2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=2)
|
||||
2. Multisite testing: [Open in WordPress Playground][playground-multisite]
|
||||
|
||||
[playground-single]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=2
|
||||
[playground-multisite]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=2
|
||||
|
||||
These links automatically set up WordPress with multisite enabled and WP_DEBUG enabled.
|
||||
|
||||
@@ -117,8 +120,8 @@ We have two blueprints for testing:
|
||||
To run tests with WordPress Playground:
|
||||
|
||||
1. Open the appropriate WordPress Playground link:
|
||||
* [Single site](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=2)
|
||||
* [Multisite](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=2)
|
||||
* [Single site][playground-single]
|
||||
* [Multisite][playground-multisite]
|
||||
|
||||
2. Test the plugin manually in the browser
|
||||
|
||||
@@ -128,7 +131,8 @@ We've also included HTML files that embed WordPress Playground:
|
||||
|
||||
1. Open `playground/index.html` in your browser for single site testing
|
||||
2. Open `playground/multisite.html` in your browser for multisite testing
|
||||
3. Open `playground/test.html` in your browser for a unified interface with buttons to switch between single site and multisite
|
||||
3. Open `playground/test.html` in your browser for a unified interface with buttons
|
||||
to switch between single site and multisite
|
||||
|
||||
You can serve these files locally with a simple HTTP server:
|
||||
|
||||
@@ -169,7 +173,9 @@ This will start a local WordPress instance with your plugin installed and activa
|
||||
|
||||
You can customize the blueprints to suit your testing needs.
|
||||
|
||||
See the [WordPress Playground Blueprints documentation](https://wordpress.github.io/wordpress-playground/blueprints/) for details.
|
||||
See the [WordPress Playground Blueprints documentation][blueprints-docs] for details.
|
||||
|
||||
[blueprints-docs]: https://wordpress.github.io/wordpress-playground/blueprints/
|
||||
|
||||
## WordPress Playground JavaScript API
|
||||
|
||||
|
||||
@@ -134,9 +134,12 @@ WordPress Playground runs WordPress entirely in the browser using WebAssembly. T
|
||||
|
||||
The easiest way to test our plugin with WordPress Playground is to use the online version:
|
||||
|
||||
1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=2)
|
||||
1. Single site testing: [Open in WordPress Playground][playground-single]
|
||||
|
||||
2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=2)
|
||||
2. Multisite testing: [Open in WordPress Playground][playground-multisite]
|
||||
|
||||
[playground-single]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/blueprint.json&_t=2
|
||||
[playground-multisite]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/main/playground/multisite-blueprint.json&_t=2
|
||||
|
||||
These links automatically set up WordPress with multisite enabled and WP_DEBUG enabled.
|
||||
|
||||
@@ -148,7 +151,8 @@ We've also included HTML files that embed WordPress Playground:
|
||||
|
||||
1. Open `playground/index.html` in your browser for single site testing
|
||||
2. Open `playground/multisite.html` in your browser for multisite testing
|
||||
3. Open `playground/test.html` in your browser for a unified interface with buttons to switch between single site and multisite
|
||||
3. Open `playground/test.html` in your browser for a unified interface with buttons
|
||||
to switch between single site and multisite
|
||||
|
||||
You can serve these files locally with a simple HTTP server:
|
||||
|
||||
|
||||
25
AGENTS.md
25
AGENTS.md
@@ -99,17 +99,23 @@ For local testing with WordPress Playground, LocalWP, and wp-env, see **@.agents
|
||||
|
||||
When working in a multi-repository workspace, follow these guidelines to avoid confusion:
|
||||
|
||||
1. **Verify Repository Context**: Always check which repository you're currently working in before making any changes or recommendations.
|
||||
1. **Verify Repository Context**: Always check which repository you're currently working in
|
||||
before making any changes or recommendations.
|
||||
|
||||
2. **Limit Code Search Scope**: When searching for code or functionality, explicitly limit your search to the current repository.
|
||||
2. **Limit Code Search Scope**: When searching for code or functionality,
|
||||
explicitly limit your search to the current repository.
|
||||
|
||||
3. **Don't Assume Features**: Never assume that features present in one repository should be implemented in another. Each repository has its own specific purpose and feature set.
|
||||
3. **Don't Assume Features**: Never assume that features present in one repository
|
||||
should be implemented in another. Each repository has its own specific purpose and feature set.
|
||||
|
||||
4. **Repository-Specific Documentation**: Documentation should only reflect the actual features and functionality of the current repository.
|
||||
4. **Repository-Specific Documentation**: Documentation should only reflect the actual features
|
||||
and functionality of the current repository.
|
||||
|
||||
5. **Cross-Repository Inspiration**: If you want to implement a feature inspired by another repository, explicitly mention that it's a new feature being added, not an existing one.
|
||||
5. **Cross-Repository Inspiration**: If you want to implement a feature inspired by another
|
||||
repository, explicitly mention that it's a new feature being added, not an existing one.
|
||||
|
||||
6. **Verify Before Implementation**: Before implementing or documenting a feature, verify that it actually exists in the current repository by checking the codebase.
|
||||
6. **Verify Before Implementation**: Before implementing or documenting a feature, verify that
|
||||
it actually exists in the current repository by checking the codebase.
|
||||
|
||||
7. **Consistent Markdown Formatting**: Always use asterisks (*) for bullet points in Markdown files, not hyphens (-).
|
||||
|
||||
@@ -161,7 +167,9 @@ When working with this repository, remember these preferences:
|
||||
3. Keep code modular and maintainable
|
||||
4. Reference these preferences in future interactions
|
||||
|
||||
This ensures consistency across coding sessions and reduces the need for developers to repeatedly explain their preferences.
|
||||
This ensures consistency across coding sessions.
|
||||
|
||||
It reduces the need for developers to repeatedly explain their preferences.
|
||||
|
||||
## Autonomous CI/CD and Error Handling
|
||||
|
||||
@@ -175,7 +183,8 @@ As an AI assistant, you should:
|
||||
4. **Verify Solutions**: Ensure fixes pass all tests and quality checks
|
||||
5. **Document Resolutions**: Update documentation with solutions for future reference
|
||||
|
||||
For detailed instructions on establishing feedback loops and error checking processes, see **@.agents/error-checking-feedback-loops.md**.
|
||||
For detailed instructions on feedback loops and error checking, see
|
||||
**@.agents/error-checking-feedback-loops.md**.
|
||||
|
||||
### When to Consult Humans
|
||||
|
||||
|
||||
38
README.md
38
README.md
@@ -1,6 +1,33 @@
|
||||
# WordPress Plugin Starter Template for AI Coding
|
||||
|
||||
[](https://www.gnu.org/licenses/gpl-2.0.html) [](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/actions/workflows/tests.yml) [](https://wordpress.org/about/requirements/) [](https://wordpress.org/about/requirements/) [](https://wordpress.org/plugins/your-plugin-slug/) [](https://wordpress.org/plugins/your-plugin-slug/reviews/) [](https://wordpress.org/plugins/your-plugin-slug/) [](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/releases) [](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues) [](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/graphs/contributors) [](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki)  [](https://www.codefactor.io/repository/github/wpallstars/wp-plugin-starter-template-for-ai-coding) [](https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding) [](https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding) [](https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding) [](https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding) [](https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding) [](https://app.codacy.com/gh/wpallstars/wp-plugin-starter-template-for-ai-coding/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||
[![License][badge-license]][url-license]
|
||||
[![Build Status][badge-build]][url-build]
|
||||
[![Requires PHP][badge-php]][url-requirements]
|
||||
[![Requires WordPress][badge-wp]][url-requirements]
|
||||
[![Wiki][badge-wiki]][url-wiki]
|
||||
[![CodeRabbit Reviews][badge-coderabbit]][url-coderabbit]
|
||||
[![CodeFactor][badge-codefactor]][url-codefactor]
|
||||
[![Quality Gate Status][badge-sonar-gate]][url-sonar]
|
||||
[![Codacy Badge][badge-codacy]][url-codacy]
|
||||
|
||||
[badge-license]: https://img.shields.io/badge/license-GPL--2.0%2B-blue.svg
|
||||
[badge-build]: https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/actions/workflows/tests.yml/badge.svg
|
||||
[badge-php]: https://img.shields.io/badge/php-%3E%3D%207.4-blue.svg
|
||||
[badge-wp]: https://img.shields.io/badge/WordPress-%3E%3D%205.0-blue.svg
|
||||
[badge-wiki]: https://img.shields.io/badge/documentation-wiki-blue.svg
|
||||
[badge-coderabbit]: https://img.shields.io/coderabbit/prs/github/wpallstars/wp-plugin-starter-template-for-ai-coding?labelColor=171717&color=FF570A&label=CodeRabbit+Reviews
|
||||
[badge-codefactor]: https://www.codefactor.io/repository/github/wpallstars/wp-plugin-starter-template-for-ai-coding/badge
|
||||
[badge-sonar-gate]: https://sonarcloud.io/api/project_badges/measure?project=wpallstars_wp-plugin-starter-template-for-ai-coding&metric=alert_status
|
||||
[badge-codacy]: https://app.codacy.com/project/badge/Grade/905754fd010b481490b496fb800e6144
|
||||
|
||||
[url-license]: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
[url-build]: https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/actions/workflows/tests.yml
|
||||
[url-requirements]: https://wordpress.org/about/requirements/
|
||||
[url-wiki]: https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki
|
||||
[url-coderabbit]: https://coderabbit.ai
|
||||
[url-codefactor]: https://www.codefactor.io/repository/github/wpallstars/wp-plugin-starter-template-for-ai-coding
|
||||
[url-sonar]: https://sonarcloud.io/summary/new_code?id=wpallstars_wp-plugin-starter-template-for-ai-coding
|
||||
[url-codacy]: https://app.codacy.com/gh/wpallstars/wp-plugin-starter-template-for-ai-coding/dashboard
|
||||
|
||||
A comprehensive starter template for WordPress plugins with best practices for AI-assisted development.
|
||||
|
||||
@@ -111,9 +138,14 @@ The template includes multiple testing approaches:
|
||||
|
||||
Test your plugin directly in the browser without any local setup:
|
||||
|
||||
1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=5)
|
||||
1. Single site testing:
|
||||
[Open in WordPress Playground][playground-single-readme]
|
||||
|
||||
2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=18)
|
||||
2. Multisite testing:
|
||||
[Open in WordPress Playground][playground-multisite-readme]
|
||||
|
||||
[playground-single-readme]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=5
|
||||
[playground-multisite-readme]: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=18
|
||||
|
||||
For more details, see the [Playground Testing](.wiki/Playground-Testing.md) documentation.
|
||||
|
||||
|
||||
@@ -25,4 +25,5 @@ if ( is_multisite() ) {
|
||||
|
||||
## Testing
|
||||
|
||||
For information on testing your plugin in a multisite environment, see the [Testing Framework](../../.wiki/Testing.md) documentation.
|
||||
For information on testing your plugin in a multisite environment, see the
|
||||
[Testing Framework](../../.wiki/Testing.md) documentation.
|
||||
|
||||
Reference in New Issue
Block a user