Remove duplicate wiki directory and ensure .wiki is up-to-date

This commit is contained in:
2025-04-21 20:54:37 +01:00
parent e5edff8cfa
commit d058898022
10 changed files with 51 additions and 1132 deletions

51
PR-DESCRIPTION.md Normal file
View File

@@ -0,0 +1,51 @@
# Add Comprehensive Testing Framework for Single Site and Multisite
This PR adds a comprehensive testing framework for our WordPress plugin template that allows testing in both single site and multisite WordPress environments. The focus is purely on testing functionality, not on adding any multisite-specific features to the plugin itself.
## Changes
- Added wp-env configuration for both single site and multisite environments
- Created Cypress e2e tests for both environments
- Added GitHub Actions workflow to run tests automatically on PRs
- Created a unified setup script for test environments
- Added detailed documentation in the wiki
- Updated README.md to reference the new testing approach
- Added placeholder files for multisite functionality
## Testing
The testing framework can be used as follows:
### Single Site Testing
```bash
# Set up single site environment
npm run setup:single
# Run tests in interactive mode
npm run test:single
# Run tests in headless mode
npm run test:single:headless
```
### Multisite Testing
```bash
# Set up multisite environment
npm run setup:multisite
# Run tests in interactive mode
npm run test:multisite
# Run tests in headless mode
npm run test:multisite:headless
```
## Documentation
Detailed documentation is available in the [Testing Framework](.wiki/Testing-Framework.md) wiki page.
## Inspiration
This implementation was inspired by the e2e testing approach mentioned in [wp-multisite-waas issue #55](https://github.com/superdav42/wp-multisite-waas/issues/55), but focuses specifically on testing our plugin in different WordPress environments without adding any of the domain mapping or other multisite-specific functionality from that plugin.

View File

@@ -1,86 +0,0 @@
# Changelog
All notable changes to this project should be documented both here and in the main Readme files.
#### [0.1.9] - 2025-04-18
#### Changed
- Alphabetized AI IDE list in README.md
#### [0.1.8] - 2025-04-19
#### Added
- More informative badges to README.md (Build Status, Requirements, WP.org placeholders, Release, Issues, Contributors, Wiki).
#### [0.1.7] - 2025-04-19
#### Fixed
- GitHub Actions tests workflow with proper file paths and dependencies
#### Improved
- Workflow names for better clarity in GitHub Actions UI
#### [0.1.6] - 2025-04-19
#### Fixed
- GitHub Actions workflows permissions for releases and wiki sync
#### [0.1.5] - 2025-04-19
#### Fixed
- Release workflow to use correct plugin directory name
#### Added
- Testing setup with wp-env and Cypress
- Multisite compatibility
- npm scripts for development and testing
#### [0.1.3] - 2025-04-19
#### Added
- Improved AI IDE context recommendations in documentation
- Enhanced Starter Prompt with guidance on pinning .ai-assistant.md and .ai-workflows/
#### Changed
- Updated README.md and readme.txt with AI IDE context recommendations
- Improved documentation for AI-assisted development
- Moved Starter Prompt to the wiki for better organization
#### [0.1.2] - 2025-04-18
#### Added
- STARTER-PROMPT.md with comprehensive guide for customizing the template
- Additional AI workflow files for better development guidance
#### Changed
- Updated documentation files with improved instructions
#### [0.1.1] - 2025-04-18
#### Changed
- Updated LICENSE file with correct GPL-2.0 text
#### [0.1.0] - 2025-04-17
#### Added
- Initial release with basic template structure
- Core plugin architecture with OOP approach
- Admin interface components and styling
- Update mechanism with multiple source options
- Documentation templates for users and developers
- AI workflow documentation for AI-assisted development
- GitHub Actions workflows for automated tasks
- Wiki documentation templates

View File

@@ -1,290 +0,0 @@
# Coding Standards
This document outlines the coding standards used in this plugin. Following these standards ensures consistency, readability, and maintainability of the codebase.
## PHP Coding Standards
This plugin follows the [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/) with some additional guidelines.
### File Structure
* Each PHP file should begin with the PHP opening tag `<?php` (no closing tag)
* Files should use the Unix line endings (LF)
* Files should be encoded in UTF-8 without BOM
### Naming Conventions
* **Classes**: Use `PascalCase` for class names
```php
class MyClassName {}
```
* **Methods and Functions**: Use `snake_case` for method and function names
```php
function my_function_name() {}
public function my_method_name() {}
```
* **Variables**: Use `snake_case` for variable names
```php
$my_variable_name = 'value';
```
* **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
```php
define('MY_CONSTANT', 'value');
const MY_CLASS_CONSTANT = 'value';
```
* **Namespaces**: Use `PascalCase` for namespace segments
```php
namespace WPALLSTARS\PluginStarterTemplate;
```
* **Hooks**: Prefix hooks with the plugin's prefix
```php
do_action('wpst_hook_name');
apply_filters('wpst_filter_name', $value);
```
### Indentation and Formatting
* Use 4 spaces for indentation (not tabs)
* Opening braces for classes and functions should be on the same line
* Control structures should have one space between the statement and the opening parenthesis
* Each line should be no longer than 100 characters
```php
if ($condition) {
// Code here
} elseif ($another_condition) {
// More code
} else {
// Default code
}
```
### Documentation
* All classes, methods, and functions should be documented using PHPDoc
* Include a description, parameters, return values, and exceptions
```php
/**
* Short description of the function.
*
* Longer description if needed.
*
* @param string $param1 Description of the parameter.
* @param int $param2 Description of the parameter.
* @return bool Description of the return value.
* @throws Exception When something goes wrong.
*/
function my_function($param1, $param2) {
// Function code
}
```
### Object-Oriented Programming
* Each class should have a single responsibility
* Use visibility declarations for all properties and methods (public, protected, private)
* Use type hints for parameters and return types when possible
```php
class MyClass {
/**
* Property description.
*
* @var string
*/
private $property;
/**
* Method description.
*
* @param string $param Description of the parameter.
* @return bool Description of the return value.
*/
public function my_method(string $param): bool {
// Method code
}
}
```
## JavaScript Coding Standards
This plugin follows the [WordPress JavaScript Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/).
### Naming Conventions
* **Variables and Functions**: Use `camelCase` for variable and function names
```javascript
var myVariableName = 'value';
function myFunctionName() {}
```
* **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
```javascript
var MY_CONSTANT = 'value';
```
### Indentation and Formatting
* Use 4 spaces for indentation (not tabs)
* Opening braces should be on the same line as the statement
* Each line should be no longer than 100 characters
```javascript
if (condition) {
// Code here
} else if (anotherCondition) {
// More code
} else {
// Default code
}
```
### Documentation
* Use JSDoc for documenting functions and objects
```javascript
/**
* Short description of the function.
*
* @param {string} param1 - Description of the parameter.
* @param {number} param2 - Description of the parameter.
* @returns {boolean} Description of the return value.
*/
function myFunction(param1, param2) {
// Function code
}
```
## CSS Coding Standards
This plugin follows the [WordPress CSS Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/).
### Naming Conventions
* Use lowercase for selectors
* Use hyphens to separate words in class and ID names
* Prefix classes and IDs with the plugin's prefix
```css
.wpst-container {
margin: 0;
}
#wpst-header {
padding: 10px;
}
```
### Indentation and Formatting
* Use 4 spaces for indentation (not tabs)
* Each property should be on its own line
* Include a space after the colon in property declarations
* End each declaration with a semicolon
* Use single quotes for attribute selectors and property values
```css
.wpst-container {
margin: 0;
padding: 10px;
font-family: 'Helvetica', sans-serif;
}
```
## Automated Code Checking
This plugin uses automated tools to enforce coding standards:
### Local Development Tools
1. **PHP_CodeSniffer (PHPCS)**: Checks PHP code against the WordPress Coding Standards
```bash
composer run phpcs
```
2. **PHP Code Beautifier and Fixer (PHPCBF)**: Automatically fixes some coding standard violations
```bash
composer run phpcbf
```
3. **ESLint**: Checks JavaScript code against the WordPress Coding Standards
```bash
npm run lint:js
```
4. **Stylelint**: Checks CSS code against the WordPress Coding Standards
```bash
npm run lint:css
```
### Continuous Integration Tools
This project integrates with several code quality tools that automatically analyze your code when you create a pull request. These tools are free for public repositories and should be integrated into any new repositories based on this template.
1. **CodeRabbit**: AI-powered code review tool
* Provides automated feedback on pull requests
* Identifies potential issues and suggests improvements
* [Website](https://www.coderabbit.ai/)
2. **CodeFactor**: Continuous code quality monitoring
* Provides a grade for your codebase
* Identifies issues related to code style, complexity, and potential bugs
* Tracks code quality over time
* [Website](https://www.codefactor.io/)
3. **Codacy**: Code quality and static analysis
* Provides a grade for your codebase
* Identifies issues related to code style, security, and performance
* Tracks code quality over time
* [Website](https://www.codacy.com/)
4. **SonarCloud**: Code quality and security analysis
* Provides detailed analysis of code quality
* Identifies security vulnerabilities and technical debt
* Tracks code quality over time
* [Website](https://sonarcloud.io/)
### How to Pass Code Quality Checks
To ensure your code passes the quality checks from these tools, follow these guidelines:
1. **Run Local Checks First**
* Before pushing your code, run PHPCS and PHPCBF locally
* Fix any issues identified by these tools
2. **Address Common Issues**
* **Indentation**: Use 4 spaces for indentation (not tabs)
* **Line Length**: Keep lines under 100 characters
* **Naming Conventions**: Follow WordPress naming conventions
* **Documentation**: Add PHPDoc comments to classes, methods, and functions
* **Error Handling**: Implement proper error handling
* **Security**: Validate and sanitize input, escape output
* **Markdown**: Use asterisks (*) for bullet points, not hyphens (-)
3. **Using AI Assistants with Code Quality Tools**
* When you receive feedback from code quality tools, you can use AI assistants to help address the issues
* Copy the output from the code quality tool and paste it into your AI assistant chat
* Ask the AI to help you understand and resolve the issues
* Example prompt:
```text
I received the following feedback from [Tool Name]. Please help me understand and resolve these issues:
[Paste the tool output here]
```
4. **Iterative Improvement**
* Address issues one at a time, starting with the most critical
* Commit and push your changes to see if they resolve the issues
* Continue this process until all issues are resolved
## Conclusion
Following these coding standards ensures that the plugin's code is consistent, readable, and maintainable. All contributors should adhere to these standards when submitting code to the project.

View File

@@ -1,180 +0,0 @@
# Contributing
Thank you for considering contributing to this project! This document provides guidelines and instructions for contributing.
## Code of Conduct
By participating in this project, you agree to abide by our code of conduct:
- Be respectful and inclusive
- Be patient and welcoming
- Be considerate
- Be collaborative
- Be open-minded
## How to Contribute
### Reporting Bugs
If you find a bug, please report it by creating an issue on GitHub:
1. Go to the [Issues](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues) page
2. Click "New Issue"
3. Select "Bug Report"
4. Fill out the template with as much detail as possible
5. Submit the issue
Please include:
- A clear, descriptive title
- Steps to reproduce the bug
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Your environment (WordPress version, PHP version, browser, etc.)
### Suggesting Enhancements
If you have an idea for an enhancement:
1. Go to the [Issues](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues) page
2. Click "New Issue"
3. Select "Feature Request"
4. Fill out the template with as much detail as possible
5. Submit the issue
Please include:
- A clear, descriptive title
- A detailed description of the enhancement
- Why this enhancement would be useful
- Any relevant examples or mockups
### Pull Requests
If you want to contribute code:
1. Fork the repository
2. Create a new branch for your feature or bugfix
3. Make your changes
4. Run tests to ensure your changes don't break anything
5. Submit a pull request
#### Pull Request Process
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. Clone your fork: `git clone https://github.com/YOUR-USERNAME/wp-plugin-starter-template-for-ai-coding.git`
3. Create your feature branch: `git checkout -b feature/amazing-feature`
4. Make your changes
5. Commit your changes: `git commit -m 'Add some amazing feature'`
6. Push to the branch: `git push origin feature/amazing-feature`
7. Submit a pull request
#### Pull Request Guidelines
- Follow the coding standards (see [Coding Standards](Coding-Standards))
- Write tests for your changes
- Update documentation as needed
- Keep pull requests focused on a single change
- Write a clear, descriptive title and description
- Reference any related issues
- Ensure your code passes the automated code quality checks (see below)
#### Code Quality Tools
This project uses several automated code quality tools to ensure high standards. These tools are free for public repositories and will automatically analyze your code when you create a pull request:
1. **CodeRabbit**: AI-powered code review tool
- [Website](https://www.coderabbit.ai/)
- Provides automated feedback on pull requests
2. **CodeFactor**: Continuous code quality monitoring
- [Website](https://www.codefactor.io/)
- Provides a grade for your codebase
3. **Codacy**: Code quality and static analysis
- [Website](https://www.codacy.com/)
- Identifies issues related to code style, security, and performance
4. **SonarCloud**: Code quality and security analysis
- [Website](https://sonarcloud.io/)
- Provides detailed analysis of code quality and security
#### Using AI Assistants with Code Quality Tools
When you receive feedback from these code quality tools, you can use AI assistants to help address the issues:
1. Copy the output from the code quality tool
2. Paste it into your AI assistant chat
3. Ask the AI to help you understand and resolve the issues
4. Apply the suggested fixes
5. Commit the changes and verify that the issues are resolved
Example prompt for AI assistants:
```text
I received the following feedback from [Tool Name]. Please help me understand and resolve these issues:
[Paste the tool output here]
```
## Development Environment
To set up your development environment:
1. Clone the repository: `git clone https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git`
2. Install dependencies: `composer install && npm install`
3. Start the development environment: `npm run start`
### Testing
Before submitting a pull request, make sure to run the tests:
* PHP Unit Tests: `npm run test:php`
* End-to-End Tests: `npm run test:e2e`
* Coding Standards: `npm run lint:php`
#### Code Quality Checks
To ensure your code meets the quality standards, run these commands before submitting a pull request:
* Check coding standards: `composer run phpcs`
* Fix coding standards automatically: `composer run phpcbf`
* Check JavaScript coding standards: `npm run lint:js`
* Check CSS coding standards: `npm run lint:css`
These checks will help identify and fix issues before they are caught by the automated code quality tools in the pull request process.
## Documentation
If you're adding a new feature or changing existing functionality, please update the documentation:
* Update the README.md file if necessary
* Update the readme.txt file if necessary
* Update or create wiki pages as needed
* Update code comments
## Community
Join our community to discuss the project:
* [GitHub Discussions](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/discussions)
* [Gitea Issues](https://gitea.wpallstars.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues)
## Recognition
Contributors will be recognized in the following ways:
* Added to the contributors list in readme.txt
* Mentioned in release notes for significant contributions
* Thanked in the Changelog for specific contributions
## License
By contributing to this project, you agree that your contributions will be licensed under the project's [GPL-2.0+ License](https://www.gnu.org/licenses/gpl-2.0.html).
## Questions?
If you have any questions about contributing, please open an issue or contact the maintainers.
Thank you for your contributions!

View File

@@ -1,119 +0,0 @@
# Frequently Asked Questions
This page answers common questions about the WordPress Plugin Starter Template.
## General Questions
### What is the WordPress Plugin Starter Template?
The WordPress Plugin Starter Template is a comprehensive starting point for developing WordPress plugins. It provides a well-structured codebase, documentation templates, and best practices to help you create high-quality WordPress plugins efficiently.
### Who is this template for?
This template is designed for:
- WordPress plugin developers looking for a solid foundation
- Developers who want to leverage AI assistance in their development workflow
- Anyone who wants to create a WordPress plugin following best practices
### Is this template suitable for all types of plugins?
Yes, this template provides a solid foundation for most WordPress plugins. It's designed to be flexible and can be adapted for various types of plugins, from simple utilities to complex applications.
## Usage Questions
### How do I use this template?
This template is meant to be a starting point for your own plugin development. You should:
1. Copy the template files to your new plugin directory
2. Rename files and update namespaces to match your plugin name
3. Update plugin headers in the main PHP file
4. Customize the functionality to meet your specific needs
5. Update documentation to reflect your plugin's features
For detailed instructions, see the [Usage Instructions](Usage-Instructions) page.
### Do I need to keep the original credits?
While not strictly required, we appreciate if you keep a reference to the original template in your plugin's documentation. This helps others discover the template and contributes to the open-source community.
### Can I use this template for commercial plugins?
Yes, you can use this template for both free and commercial plugins. The template is licensed under GPL-2.0+, which allows for commercial use.
## Technical Questions
### What PHP version is required?
The template requires PHP 7.0 or higher, which is the minimum recommended version for WordPress plugins today.
### Does this template support Gutenberg blocks?
The template doesn't include Gutenberg blocks by default, but it provides a structure that makes it easy to add them. You can extend the template to include block registration and block-specific assets.
### How do I add custom post types or taxonomies?
To add custom post types or taxonomies:
1. Create a new class in `includes/` for your post type or taxonomy
2. Register the post type or taxonomy in the class constructor
3. Initialize the class in `includes/plugin.php`
### How do I handle plugin updates?
The template includes an update mechanism that supports multiple sources:
- WordPress.org
- GitHub
- Gitea
To configure the update mechanism:
1. Update the plugin headers in the main PHP file
2. Customize the `updater.php` file if needed
3. Ensure your repository follows the required structure for updates
## AI-Assisted Development Questions
### How does this template support AI-assisted development?
The template includes:
1. Detailed documentation in the `.ai-assistant.md` file
2. Workflow guidelines in the `.ai-workflows/` directory
3. Clear code structure and comments that help AI understand the codebase
4. Best practices for AI-friendly code organization
### What AI tools work best with this template?
This template is designed to work well with various AI coding assistants, including:
- GitHub Copilot
- Claude
- ChatGPT
- Other AI coding assistants
### How do I use the AI workflow documentation?
The AI workflow documentation in the `.ai-workflows/` directory provides guidelines for AI assistants working with this template. These files help ensure consistent, high-quality code and documentation when using AI tools for development.
## Contributing Questions
### How can I contribute to this template?
Contributions are welcome! Please feel free to:
1. Report bugs or issues
2. Suggest new features or improvements
3. Submit pull requests with bug fixes or enhancements
For more information, see the [Contributing](Contributing) page.
### Where can I report issues?
You can report issues on the [GitHub repository](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues).
### Is there a roadmap for future development?
Yes, we maintain a roadmap of planned features and improvements. You can find it in the [GitHub repository](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/projects).

View File

@@ -1,41 +0,0 @@
# WordPress Plugin Starter Template
Welcome to the documentation wiki for the WordPress Plugin Starter Template.
This template provides a solid foundation for developing WordPress plugins with best practices for AI-assisted development.
## Quick Links
- [Starter Prompt](Starter-Prompt)
- [Installation Guide](Installation-Guide)
- [Usage Instructions](Usage-Instructions)
- [Frequently Asked Questions](Frequently-Asked-Questions)
- [Contributing](Contributing)
- [Changelog](Changelog)
## About This Template
The WordPress Plugin Starter Template is designed to help developers quickly create new WordPress plugins with a solid foundation of best practices. It incorporates modern coding standards, comprehensive documentation, and AI-assisted development workflows.
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
- **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
## Getting Started
To get started with this template, check out the [Starter Prompt](Starter-Prompt) for a comprehensive guide on customizing the template for your specific plugin needs.
**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.
## Support
If you encounter any issues or have questions about the template, please check the [Frequently Asked Questions](Frequently-Asked-Questions) section. If you still need help, you can [open an issue](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues) on GitHub.

View File

@@ -1,81 +0,0 @@
# Installation Guide
This guide provides instructions for installing and setting up the WordPress Plugin Starter Template.
## Prerequisites
Before installing the plugin, ensure you have:
- WordPress 5.0 or higher
- PHP 7.0 or higher
- A WordPress site with administrator access
## Installation Methods
### Method 1: From WordPress.org (For Released Plugins)
1. Log in to your WordPress admin dashboard.
2. Navigate to **Plugins > Add New**.
3. Search for "WordPress Plugin Starter Template".
4. Click **Install Now** next to the plugin.
5. After installation, click **Activate**.
### Method 2: Manual Installation
1. Download the latest release from the [GitHub repository](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/releases).
2. Log in to your WordPress admin dashboard.
3. Navigate to **Plugins > Add New**.
4. Click the **Upload Plugin** button at the top of the page.
5. Click **Choose File** and select the downloaded ZIP file.
6. Click **Install Now**.
7. After installation, click **Activate**.
### Method 3: Using as a Template for Your Plugin
1. Clone or download the repository:
```bash
git clone https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git your-plugin-name
```
2. Navigate to your plugin directory:
```bash
cd your-plugin-name
```
3. Rename files and update namespaces:
- Rename `wp-plugin-starter-template.php` to your plugin name (e.g., `your-plugin-name.php`)
- Update the namespace from `WPALLSTARS\PluginStarterTemplate` to your own
- Update text domain from `wp-plugin-starter-template` to your own
4. Update plugin headers in the main PHP file.
5. Install dependencies:
```bash
composer install
```
6. Upload the plugin to your WordPress site or use the local development script:
```bash
./scripts/deploy-local.sh
```
## Post-Installation
After installing and activating the plugin, you should:
1. Review the plugin settings (if applicable).
2. Customize the plugin for your specific needs.
3. Update documentation to reflect your plugin's features.
## Troubleshooting Installation Issues
If you encounter any issues during installation, please check the following:
1. **Plugin Conflicts**: Deactivate other plugins to check for conflicts.
2. **Server Requirements**: Ensure your server meets the minimum requirements.
3. **File Permissions**: Check that your WordPress installation has the correct file permissions.
4. **Memory Limit**: Increase PHP memory limit if you encounter memory-related errors.
## Next Steps
After installation, refer to the [Usage Instructions](Usage-Instructions) to learn how to use and customize the plugin.

View File

@@ -1,190 +0,0 @@
# WordPress Plugin Starter Template - AI Assistant Prompt
This document provides a comprehensive prompt to help you get started with creating your own WordPress plugin using this starter template with the assistance of AI tools like GitHub Copilot, Claude, or ChatGPT.
## Important: Optimize AI Context
**Before starting, 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. This will help the AI understand the project structure and follow the established best practices.
## Initial Setup Prompt
Use the following prompt to guide the AI assistant in helping you set up your new plugin based on this template:
```
I'm creating a new WordPress plugin based on the wp-plugin-starter-template-for-ai-coding template. Please help me customize this template for my specific plugin needs.
Here are the details for my new plugin:
- Plugin Name: [YOUR PLUGIN NAME]
- Plugin Slug: [YOUR-PLUGIN-SLUG]
- Text Domain: [your-plugin-text-domain]
- Namespace: [VENDOR]\[PluginName]
- Description: [BRIEF DESCRIPTION OF YOUR PLUGIN]
- Version: 0.1.0 (starting version)
- Author: [YOUR NAME/ORGANIZATION]
- Author URI: [YOUR WEBSITE]
- License: GPL-2.0+ (or specify another compatible license)
- Requires WordPress: [MINIMUM WP VERSION, e.g., 5.0]
- Requires PHP: [MINIMUM PHP VERSION, e.g., 7.0]
- GitHub Repository: [YOUR GITHUB REPO URL]
- Gitea Repository (if applicable): [YOUR GITEA REPO URL]
I need help with the following tasks:
1. Updating all template placeholders with my plugin information
2. Customizing the plugin structure for my specific needs
3. Setting up the initial functionality for my plugin
I've added the .ai-assistant.md and .ai-workflows/ directory to the chat context to ensure you have all the necessary information about the project structure and best practices.
Please guide me through this process step by step, starting with identifying all files that need to be updated with my plugin information.
```
## Files That Need Updating
The AI will help you identify and update the following files with your plugin information:
1. **Main Plugin File**: Rename `wp-plugin-starter-template.php` to `your-plugin-slug.php` and update all plugin header information
2. **README.md**: Update with your plugin details, features, and installation instructions
3. **readme.txt**: Update WordPress.org plugin repository information
4. **CHANGELOG.md**: Initialize with your starting version
5. **composer.json**: Update package name and description
6. **languages/pot file**: Rename and update the POT file
7. **.github/workflows/**: Update GitHub Actions workflows with your repository information
8. **.wiki/**: Update wiki documentation with your plugin information
9. **.ai-assistant.md**: Update AI assistant guidance for your specific plugin
10. **includes/plugin.php**: Update namespace and class references
11. **includes/core.php**: Update namespace and customize core functionality
12. **admin/lib/admin.php**: Update namespace and customize admin functionality
## Customization Process
After providing the initial information, follow this process with your AI assistant:
### 1. File Renaming
Ask the AI to help you identify all files that need to be renamed:
```
Please list all files that need to be renamed to match my plugin slug, and provide the commands to rename them.
```
### 2. Namespace Updates
Ask the AI to help you update all namespace references:
```
Please help me update all namespace references from WPALLSTARS\PluginStarterTemplate to [VENDOR]\[PluginName] throughout the codebase.
```
### 3. Text Domain Updates
Ask the AI to help you update all text domain references:
```
Please help me update all text domain references from 'wp-plugin-starter-template' to '[your-plugin-text-domain]' throughout the codebase.
```
### 4. Function Prefix Updates
Ask the AI to help you update any function prefixes:
```
Please help me update any function prefixes from 'wpst_' to '[your_prefix]_' throughout the codebase.
```
### 5. Customizing Core Functionality
Ask the AI to help you customize the core functionality for your specific plugin needs:
```
Now I'd like to customize the core functionality for my plugin. Here's what my plugin should do:
[DESCRIBE YOUR PLUGIN'S CORE FUNCTIONALITY]
Please help me modify the includes/core.php file to implement this functionality.
```
### 6. Customizing Admin Interface
Ask the AI to help you customize the admin interface for your specific plugin needs:
```
I'd like to customize the admin interface for my plugin. Here's what I need in the admin area:
[DESCRIBE YOUR PLUGIN'S ADMIN INTERFACE NEEDS]
Please help me modify the admin/lib/admin.php file and any other necessary files to implement this.
```
### 7. Testing Setup
Ask the AI to help you set up testing for your plugin:
```
Please help me update the testing setup to match my plugin's namespace and functionality. I want to ensure I have proper test coverage for the core features.
```
## Additional Customization Areas
Depending on your plugin's needs, you might want to ask the AI for help with:
1. **Custom Post Types**: Setting up custom post types and taxonomies
2. **Settings API**: Implementing WordPress Settings API for your plugin options
3. **Shortcodes**: Creating shortcodes for front-end functionality
4. **Widgets**: Developing WordPress widgets
5. **REST API**: Adding custom REST API endpoints
6. **Blocks**: Creating Gutenberg blocks
7. **Internationalization**: Ensuring proper i18n setup
8. **Database Tables**: Creating custom database tables if needed
9. **Cron Jobs**: Setting up WordPress cron jobs
10. **User Roles and Capabilities**: Managing custom user roles and capabilities
## Final Review
Once you've completed the customization, ask the AI to help you review everything:
```
Please help me review all the changes we've made to ensure:
1. All template placeholders have been replaced with my plugin information
2. All namespaces, text domains, and function prefixes have been updated consistently
3. The plugin structure matches my specific needs
4. The initial functionality is properly implemented
5. All documentation (README.md, readme.txt, wiki) is updated and consistent
Are there any issues or inconsistencies that need to be addressed?
```
## Building and Testing
Finally, ask the AI to guide you through building and testing your plugin:
```
Please guide me through the process of building and testing my plugin:
1. How do I use the build script to create a deployable version?
2. What tests should I run to ensure everything is working correctly?
3. How do I set up a local testing environment?
4. What should I check before releasing the first version?
```
## Optimizing AI Assistance
To ensure the AI assistant has all the necessary context about your plugin's structure and best practices:
```
Please add the .ai-assistant.md 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. This will help the AI understand the project structure and follow the established best practices.
```
## Remember
- This template is designed to be a starting point. Feel free to add, remove, or modify components as needed for your specific plugin.
- The AI assistant can help you understand the existing code and make appropriate modifications, but you should review all changes to ensure they meet your requirements.
- Always test your plugin thoroughly before releasing it.
- Keep documentation updated as you develop your plugin.
- Pin the .ai-assistant.md and .ai-workflows/ files in your AI IDE chat to ensure the AI has the necessary context for each interaction.
## Credits
This plugin is based on the [WordPress Plugin Starter Template for AI Coding](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding) by WPALLSTARS.

View File

@@ -1,121 +0,0 @@
# Usage Instructions
This guide provides instructions for using and customizing the WordPress Plugin Starter Template for your own plugin development.
## Basic Usage
The WordPress Plugin Starter Template is designed to be a starting point for your WordPress plugin development. It provides a well-structured codebase that you can customize to create your own plugin.
### Template Structure
The template follows a modular structure:
- `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
### Customizing 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
2. **Update Plugin Headers**:
- Edit the plugin headers in the main PHP file
- Update GitHub/Gitea repository URLs
3. **Customize Functionality**:
- Modify the core functionality in `includes/core.php`
- Add your own classes as needed
- Customize admin interfaces in the `admin/` directory
4. **Update Documentation**:
- Update README.md and readme.txt with your plugin information
- Customize wiki documentation in the `.wiki/` directory
## Advanced Usage
### Adding Admin Pages
The template includes a structure for adding admin pages to the WordPress dashboard. To add an admin page:
1. Uncomment the `add_admin_menu` method in `admin/lib/admin.php`
2. Customize the menu parameters to match your plugin
3. Create the corresponding render method for your admin page
4. Create template files in an `admin/templates/` directory
### Adding Settings
To add settings to your plugin:
1. Create a settings class in `includes/settings.php`
2. Register settings using the WordPress Settings API
3. Create form fields for your settings
4. Handle settings validation and sanitization
### Adding Custom Post Types or Taxonomies
To add custom post types or taxonomies:
1. Create a new class in `includes/` for your post type or taxonomy
2. Register the post type or taxonomy in the class constructor
3. Initialize the class in `includes/plugin.php`
### Internationalization
The template is ready for internationalization. To make your plugin translatable:
1. Use translation functions for all user-facing strings:
- `__()` for simple strings
- `_e()` for echoed strings
- `esc_html__()` for escaped strings
2. Update the text domain in all translation functions
3. Generate a POT file for translations
### Update Mechanism
The template includes an update mechanism that supports multiple sources:
- WordPress.org
- GitHub
- Gitea
To configure the update mechanism:
1. Update the plugin headers in the main PHP file
2. Customize the `updater.php` file if needed
3. Ensure your repository follows the required structure for updates
## Building and Releasing
The template includes scripts for building and releasing your plugin:
1. **Building the Plugin**:
```bash
./build.sh <version>
```
2. **Deploying to a Local WordPress Installation**:
```bash
./scripts/deploy-local.sh
```
3. **Creating a Release**:
- Tag a new version in Git
- Push the tag to GitHub
- The GitHub Actions workflow will create a release
## Next Steps
After customizing the template for your needs, refer to the [Architecture Overview](Architecture-Overview) to understand the plugin's structure in more detail.

View File

@@ -1,24 +0,0 @@
## User Documentation
* [Home](Home)
* [Installation Guide](Installation-Guide)
* [Usage Instructions](Usage-Instructions)
* [Frequently Asked Questions](Frequently-Asked-Questions)
* [Troubleshooting](Troubleshooting)
## Developer Documentation
* [Architecture Overview](Architecture-Overview)
* [Customization Guide](Customization-Guide)
* [Extending the Plugin](Extending-the-Plugin)
* [Coding Standards](Coding-Standards)
* [Release Process](Release-Process)
## AI Documentation
* [AI Workflow Documentation](AI-Workflow-Documentation)
## Additional Resources
* [Changelog](Changelog)
* [Contributing](Contributing)