Update documentation with AI IDE context recommendations and improve starter prompt
Some checks failed
Tests / PHP 7.0 (push) Has been cancelled
Tests / PHP 7.4 (push) Has been cancelled
Tests / PHP 8.0 (push) Has been cancelled
Tests / Code Style (push) Has been cancelled
Release / Build and Release (push) Has been cancelled

This commit is contained in:
2025-04-18 03:57:43 +01:00
parent 66758ac0f8
commit 342eefd471
9 changed files with 1199 additions and 173 deletions

270
README.md
View File

@ -1,145 +1,217 @@
# WordPress Plugin Starter Template for AI Coding
# WordPress Plugin Starter Template
[![License](https://img.shields.io/badge/license-GPL--2.0%2B-blue.svg)](https://www.gnu.org/licenses/gpl-2.0.html)
A comprehensive starter template for WordPress plugins with best practices for AI-assisted development.
[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/wp-plugin-starter-template-for-ai-coding)](https://wordpress.org/plugins/wp-plugin-starter-template-for-ai-coding/)
[![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/rating/wp-plugin-starter-template-for-ai-coding)](https://wordpress.org/plugins/wp-plugin-starter-template-for-ai-coding/)
[![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/wp-plugin-starter-template-for-ai-coding)](https://wordpress.org/plugins/wp-plugin-starter-template-for-ai-coding/)
[![License](https://img.shields.io/github/license/wpallstars/wp-plugin-starter-template-for-ai-coding)](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/blob/main/LICENSE)
## Description
The WordPress Plugin Starter Template provides a solid foundation for developing WordPress plugins with AI assistance. It includes a well-structured codebase, documentation templates, and best practices to help you create high-quality WordPress plugins efficiently.
The WordPress Plugin Starter Template provides a solid foundation for developing WordPress plugins. It incorporates best practices, modern coding standards, and a comprehensive structure that makes it easy to get started with plugin development.
This template is based on the experience gained from developing the "Fix 'Plugin file does not exist' Notices" plugin and other successful WordPress plugins.
### Key Features
- **Well-structured codebase** following WordPress coding standards
- **Modular architecture** for easy maintenance and extension
- **Comprehensive documentation** templates for both users and developers
- **AI-friendly workflows** with detailed guidance for AI assistants
- **Git integration** with GitHub and Gitea support
- **Update mechanism** with multiple source options (WordPress.org, GitHub, Gitea)
- **Internationalization** ready with proper text domain setup
- **Admin interface** components for building settings pages
* **Object-Oriented Architecture**: Well-structured, maintainable code using OOP principles
* **Namespace Support**: Modern PHP namespacing for better organization and avoiding conflicts
* **Comprehensive Documentation**: Detailed documentation for both users and developers
* **Testing Framework**: PHPUnit setup for unit testing
* **Internationalization Ready**: Full support for translation and localization
* **Update Source Selection**: Choose between WordPress.org, GitHub, or Gitea for plugin updates
* **AI Workflow Documentation**: Detailed guides for AI-assisted development
* **Wiki Documentation**: Ready-to-use wiki structure for comprehensive documentation
### For Developers
### How to Use This Template
This template is designed to be a starting point for your WordPress plugin development. It provides:
1. Clone or download this repository
2. **Important**: Begin by reading the [STARTER-PROMPT.md](STARTER-PROMPT.md) file for detailed instructions
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context (pin them if possible)
4. Use the prompt in STARTER-PROMPT.md to guide the AI in customizing the template for your plugin
5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features
8. Build and test your plugin
- A clean, well-organized file structure
- OOP approach with namespaced classes
- Separation of concerns (admin, core functionality)
- Documentation templates for wiki and readme files
- GitHub Actions workflows for automated tasks
- AI workflow documentation for AI-assisted development
### AI-Assisted Development
This template includes comprehensive documentation for AI-assisted development:
* **.ai-assistant.md**: Guide for AI assistants to understand the project structure
* **.ai-workflows/**: Detailed workflow documentation for common development tasks
* **STARTER-PROMPT.md**: Comprehensive prompt for AI tools to help customize the template
**Important**: For the best AI assistance, add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context. In most AI IDEs, you can pin these files to ensure they're considered in each message.
## Installation
### From GitHub
1. Download the latest release from the [GitHub repository](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/releases)
2. Upload the plugin files to the `/wp-content/plugins/wp-plugin-starter-template` directory, or install the plugin through the WordPress plugins screen directly
3. Activate the plugin through the 'Plugins' screen in WordPress
### Using as a Template for Your Plugin
1. Clone or download this repository
2. Rename the plugin directory and files to match your plugin name
3. Update namespaces, function prefixes, and text domains
4. Update plugin headers in the main PHP file
5. Customize the functionality to meet your specific needs
6. Update documentation to reflect your plugin's features
2. Read the [STARTER-PROMPT.md](STARTER-PROMPT.md) file for detailed instructions
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context
4. Use the prompt in STARTER-PROMPT.md to guide the AI in customizing the template
5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features
8. Build and test your plugin
## Usage
### Basic Structure
### Getting Started
The template follows a modular structure:
To get started with this template, follow these steps:
- `wp-plugin-starter-template.php`: Main plugin file with plugin headers
- `includes/`: Core plugin functionality
- `plugin.php`: Main plugin class that initializes everything
- `core.php`: Core functionality class
- `updater.php`: Update mechanism for multiple sources
- `admin/`: Admin-specific functionality
- `lib/`: Admin classes
- `css/`: Admin stylesheets
- `js/`: Admin JavaScript files
- `languages/`: Translation files
- `.github/workflows/`: GitHub Actions workflows
- `.ai-workflows/`: Documentation for AI assistants
- `.wiki/`: Wiki documentation templates
1. Clone this repository to your local machine:
```bash
git clone https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git
```
### Customizing for Your Plugin
2. Open the STARTER-PROMPT.md file and follow the instructions to customize the template for your plugin.
1. **Rename Files and Update Namespaces**:
- Rename `wp-plugin-starter-template.php` to your plugin name
- Update the namespace from `WPALLSTARS\PluginStarterTemplate` to your own
- Update text domain from `wp-plugin-starter-template` to your own
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context.
2. **Update Plugin Headers**:
- Edit the plugin headers in the main PHP file
- Update GitHub/Gitea repository URLs
4. Use an AI assistant like GitHub Copilot, Claude, or ChatGPT to help you customize the template by providing the prompt from STARTER-PROMPT.md.
3. **Customize Functionality**:
- Modify the core functionality in `includes/core.php`
- Add your own classes as needed
- Customize admin interfaces in the `admin/` directory
### Using with Git Updater
4. **Update Documentation**:
- Update README.md and readme.txt with your plugin information
- Customize wiki documentation in the `.wiki/` directory
If you've installed this plugin from GitHub or Gitea, you'll need Git Updater to receive updates:
## Documentation
1. Install the Git Updater plugin from [git-updater.com/git-updater/](https://git-updater.com/git-updater/)
2. Go to Settings > Git Updater > Remote Management
3. Click the "Refresh Cache" button to ensure Git Updater recognizes the latest version
4. Updates will now appear in your WordPress dashboard when available
Comprehensive documentation is available in the [Wiki](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki).
### Choosing Your Update Source
### For Users
This template includes functionality that allows users to choose where they want to receive updates from:
- [Installation Guide](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Installation-Guide)
- [Usage Instructions](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Usage-Instructions)
- [Frequently Asked Questions](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Frequently-Asked-Questions)
- [Troubleshooting](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Troubleshooting)
1. In the Plugins list, find your plugin
2. Click the "Update Source" link next to the plugin
3. Select your preferred update source:
- **WordPress.org**: Updates from the official WordPress.org repository
- **GitHub**: Updates directly from the GitHub repo
- **Gitea**: Updates directly from the Gitea repo
4. Click "Save" to apply your preference
### For Developers
## Frequently Asked Questions
- [Architecture Overview](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Architecture-Overview)
- [Extending the Plugin](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Extending-the-Plugin)
- [Coding Standards](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Coding-Standards)
- [Release Process](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Release-Process)
### How do I customize this template for my plugin?
### For AI Assistants
See the [STARTER-PROMPT.md](STARTER-PROMPT.md) file for detailed instructions on customizing this template for your specific plugin needs. Make sure to add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context for the best results.
The `.ai-assistant.md` file and `.ai-workflows/` directory contain detailed guidance for AI assistants working with this template. These resources help ensure consistent, high-quality code and documentation when using AI tools for development.
### What files do I need to update with my plugin information?
The main files you need to update include:
1. Main plugin file (rename and update header)
2. README.md
3. readme.txt
4. CHANGELOG.md
5. composer.json
6. languages/pot file
7. .github/workflows/
8. .wiki/
9. .ai-assistant.md
10. includes/plugin.php
11. includes/core.php
12. admin/lib/admin.php
### How do I build and test my plugin?
Use the included build.sh script to create a deployable version of your plugin:
```bash
./build.sh {VERSION}
```
This will create a ZIP file that you can install in WordPress.
### How do I add custom functionality to my plugin?
Customize the includes/core.php file to implement your core functionality and the admin/lib/admin.php file for admin-specific functionality.
## Support & Feedback
If you need help with this template, there are several ways to get support:
* [GitHub Issues](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues)
* [Gitea Issues](https://gitea.wpallstars.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues)
## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue on the [GitHub repository](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding).
Contributions are welcome! Please feel free to submit a Pull Request.
### Development Process
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/your-feature-name`
3. Make your changes and commit them: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin feature/your-feature-name`
1. Fork the repository on [GitHub](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/) or [Gitea](https://gitea.wpallstars.com/wpallstars/wp-plugin-starter-template-for-ai-coding/)
2. Create your feature branch: `git checkout -b feature/amazing-feature`
3. Commit your changes: `git commit -m 'Add some amazing feature'`
4. Push to the branch: `git push origin feature/amazing-feature`
5. Submit a pull request
## Credits
## Developers
This template is maintained by [WPALLSTARS](https://www.wpallstars.com) and is based on the experience and best practices developed while creating the [Fix 'Plugin file does not exist' Notices](https://github.com/wpallstars/wp-fix-plugin-does-not-exist-notices) plugin.
### AI-Powered Development
This repository is configured to work with various AI-powered development tools. You can use any of the following AI IDEs to contribute to this project:
- [Augment Code](https://www.augmentcode.com/) - AI-powered coding assistant
- [Cursor](https://cursor.com/) - AI-first code editor
- [v0](https://v0.dev/) - AI-powered design and development tool
- [Windsurf](https://www.windsurf.com/) - AI coding assistant
- [Cline](https://cline.bot/) - AI terminal assistant
- [Roo Code](https://roocode.com/) - AI pair programmer
- [Loveable](https://lovable.dev/) - AI development environment
- [Bolt](https://www.bolt.new/) - AI-powered code editor
- [Cody](https://sourcegraph.com/cody) - Sourcegraph's AI coding assistant
- [Continue](https://continue.dev/) - Open-source AI coding assistant
The repository includes configuration files for all these tools to ensure a consistent development experience.
### Git Updater Integration
This template is designed to work seamlessly with the Git Updater plugin for updates from GitHub and Gitea. To ensure proper integration:
1. **Required Headers**: The plugin includes specific headers in the main plugin file that Git Updater uses to determine update sources and branches:
```php
* GitHub Plugin URI: wpallstars/wp-plugin-starter-template-for-ai-coding
* GitHub Branch: main
* Primary Branch: main
* Release Branch: main
* Release Asset: true
* Gitea Plugin URI: https://gitea.wpallstars.com/wpallstars/wp-plugin-starter-template-for-ai-coding
* Gitea Branch: main
```
2. **Tagging Releases**: When creating a new release, always tag it with the 'v' prefix (e.g., `v0.1.2`) to ensure GitHub Actions can create the proper release assets.
3. **GitHub Actions**: The repository includes a GitHub Actions workflow that automatically builds the plugin and creates a release with the .zip file when a new tag is pushed.
4. **Update Source Selection**: The template includes a feature that allows users to choose their preferred update source (WordPress.org, GitHub, or Gitea).
For more information on Git Updater integration, see the [Git Updater Required Headers documentation](https://git-updater.com/knowledge-base/required-headers/).
## Changelog
### 0.1.2
* Added: STARTER-PROMPT.md with comprehensive guide for customizing the template
* Updated: Documentation files with improved instructions
* Added: Additional AI workflow files for better development guidance
### 0.1.1
* Updated: LICENSE file with correct GPL-2.0 text
### 0.1.0
* Initial release with basic template structure
* Added: Core plugin architecture with OOP approach
* Added: Admin interface components and styling
* Added: Update mechanism with multiple source options
* Added: Documentation templates for users and developers
* Added: AI workflow documentation for AI-assisted development
* Added: GitHub Actions workflows for automated tasks
* Added: Wiki documentation templates
[View full changelog](CHANGELOG.md)
## License
This project is licensed under the GPL-2.0+ License - see the [LICENSE](LICENSE) file for details.
## Changelog
## Credits
### 0.1.1
- Updated LICENSE file with correct GPL-2.0 text
### 0.1.0
- Initial release with basic template structure
- Added core plugin architecture
- Added admin interface components
- Added documentation templates
- Added AI workflow documentation
This template is based on the experience gained from developing the ["Fix 'Plugin file does not exist' Notices"](https://github.com/wpallstars/wp-fix-plugin-does-not-exist-notices) plugin by WPALLSTARS.