Compare commits

..
Author SHA1 Message Date
marcus 31d475beca Fix test workflow issues with WP_Mock, PHP 7.0 compatibility, and code style
Release / Build and Release (push) Canceled after 0s
2025-04-18 16:02:17 +01:00
marcus af48e84614 Fix wiki navigation, update wiki changelog, improve documentation, and fix tests workflow 2025-04-18 15:05:49 +01:00
marcus 5083fcee50 Update wiki Home page with latest version information 2025-04-18 14:47:38 +01:00
marcus 79d1314aed Update version to 0.1.6 with GitHub Actions workflow permissions fix 2025-04-18 14:46:05 +01:00
marcus 2f4d88f8dd Add explicit permissions to GitHub Actions workflows
Release / Build and Release (push) Canceled after 0s
2025-04-18 14:43:19 +01:00
marcus bfac63799b Update to version 0.1.5 with testing setup, multisite compatibility, and npm scripts
Release / Build and Release (push) Canceled after 0s
2025-04-18 14:32:46 +01:00
marcus 9d3e67d16b Fix release workflow to use correct plugin directory name
Release / Build and Release (push) Canceled after 0s
2025-04-18 14:17:19 +01:00
marcus 843696d3a8 Remove STARTER-PROMPT.md from root directory as it's now in the wiki
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) Canceled after 0s
2025-04-18 04:25:02 +01:00
marcus 269626438e Update references to Starter Prompt to point to wiki version 2025-04-18 04:24:40 +01:00
26 changed files with 667 additions and 269 deletions

No files matched your search

+12 -4
View File
@@ -150,7 +150,15 @@ If the plugin is hosted on WordPress.org:
After releasing a new version: After releasing a new version:
1. Update the wiki documentation if needed 1. Update the wiki documentation:
2. Announce the release in relevant channels - Update the Changelog.md file in the .wiki directory to match the main CHANGELOG.md
3. Monitor for any issues or feedback - Add the new version information to the Home.md file in the Latest Updates section
4. Start planning the next release - Ensure all wiki pages are up-to-date with the new features or changes
- Verify that the _Sidebar.md file has the correct navigation structure
2. Verify that GitHub Actions workflows are running correctly:
- Check that the release workflow created the release with the correct assets
- Check that the sync-wiki workflow synced the wiki changes
- Fix any permissions issues in the workflow files if needed
3. Announce the release in relevant channels
4. Monitor for any issues or feedback
5. Start planning the next release
+5 -2
View File
@@ -8,6 +8,7 @@ The wiki documentation is organized into the following sections:
1. **User Documentation**: 1. **User Documentation**:
- Home - Home
- Starter Prompt (must be listed before Installation Guide)
- Installation Guide - Installation Guide
- Usage Instructions - Usage Instructions
- Frequently Asked Questions - Frequently Asked Questions
@@ -88,8 +89,10 @@ Documentation should be updated:
1. Identify the relevant wiki file(s) in the `.wiki/` directory 1. Identify the relevant wiki file(s) in the `.wiki/` directory
2. Make the necessary changes 2. Make the necessary changes
3. Commit and push the changes to the `main` branch 3. **Always ensure the Changelog.md in the wiki is updated to match the main CHANGELOG.md file**
4. The GitHub Actions workflow will automatically sync the changes with the GitHub wiki 4. **Always ensure the _Sidebar.md file has the correct navigation structure with Starter Prompt listed before Installation Guide**
5. Commit and push the changes to the `main` branch
6. The GitHub Actions workflow will automatically sync the changes with the GitHub wiki
### Creating New Pages ### Creating New Pages
+11 -9
View File
@@ -10,6 +10,8 @@ jobs:
build: build:
name: Build and Release name: Build and Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -36,25 +38,25 @@ jobs:
- name: Create build directory - name: Create build directory
run: | run: |
mkdir -p build/wp-plugin-starter-template mkdir -p build/wp-plugin-starter-template-for-ai-coding
cp -R *.php README.md LICENSE CHANGELOG.md readme.txt composer.json build/wp-plugin-starter-template/ cp -R *.php README.md LICENSE CHANGELOG.md readme.txt composer.json build/wp-plugin-starter-template-for-ai-coding/
cp -R admin includes languages vendor build/wp-plugin-starter-template/ cp -R admin includes languages vendor build/wp-plugin-starter-template-for-ai-coding/
mkdir -p build/wp-plugin-starter-template/assets/banner build/wp-plugin-starter-template/assets/icon build/wp-plugin-starter-template/assets/screenshots mkdir -p build/wp-plugin-starter-template-for-ai-coding/assets/banner build/wp-plugin-starter-template-for-ai-coding/assets/icon build/wp-plugin-starter-template-for-ai-coding/assets/screenshots
if [ -d "assets/banner" ]; then cp -R assets/banner/* build/wp-plugin-starter-template/assets/banner/; fi if [ -d "assets/banner" ]; then cp -R assets/banner/* build/wp-plugin-starter-template-for-ai-coding/assets/banner/; fi
if [ -d "assets/icon" ]; then cp -R assets/icon/* build/wp-plugin-starter-template/assets/icon/; fi if [ -d "assets/icon" ]; then cp -R assets/icon/* build/wp-plugin-starter-template-for-ai-coding/assets/icon/; fi
if [ -d "assets/screenshots" ]; then cp -R assets/screenshots/* build/wp-plugin-starter-template/assets/screenshots/; fi if [ -d "assets/screenshots" ]; then cp -R assets/screenshots/* build/wp-plugin-starter-template-for-ai-coding/assets/screenshots/; fi
- name: Create ZIP file - name: Create ZIP file
run: | run: |
cd build cd build
zip -r ../wp-plugin-starter-template-${{ env.VERSION }}.zip wp-plugin-starter-template -x "*.DS_Store" -x "*.git*" zip -r ../wp-plugin-starter-template-for-ai-coding-${{ env.VERSION }}.zip wp-plugin-starter-template-for-ai-coding -x "*.DS_Store" -x "*.git*"
cd .. cd ..
- name: Create Release - name: Create Release
id: create_release id: create_release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: wp-plugin-starter-template-${{ env.VERSION }}.zip files: wp-plugin-starter-template-for-ai-coding-${{ env.VERSION }}.zip
name: Version ${{ env.VERSION }} name: Version ${{ env.VERSION }}
draft: false draft: false
prerelease: false prerelease: false
+2
View File
@@ -11,6 +11,8 @@ jobs:
sync-wiki: sync-wiki:
name: Sync Wiki to GitHub name: Sync Wiki to GitHub
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v3 uses: actions/checkout@v3
+11 -2
View File
@@ -13,6 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
php-versions: ['7.0', '7.4', '8.0'] php-versions: ['7.0', '7.4', '8.0']
fail-fast: false
steps: steps:
- name: Checkout code - name: Checkout code
@@ -26,7 +27,15 @@ jobs:
tools: composer:v2 tools: composer:v2
- name: Install dependencies - name: Install dependencies
run: composer install --prefer-dist --no-progress run: |
if [[ "${{ matrix.php-versions }}" == "7.0" ]]; then
composer require --dev phpunit/phpunit:"^6.5" --update-with-dependencies
composer require --dev 10up/wp_mock:"0.3.0" --update-with-dependencies
composer require --dev antecedent/patchwork:"^2.1.21" --update-with-dependencies
else
composer install --prefer-dist --no-progress
composer require --dev 10up/wp_mock:"0.3.0" --update-with-dependencies
fi
- name: Run tests - name: Run tests
run: ./vendor/bin/phpunit run: ./vendor/bin/phpunit
@@ -50,4 +59,4 @@ jobs:
run: composer install --prefer-dist --no-progress run: composer install --prefer-dist --no-progress
- name: Run PHPCS - name: Run PHPCS
run: ./vendor/bin/phpcs --standard=WordPress run: ./vendor/bin/phpcs --standard=WordPress --runtime-set installed_paths vendor/wp-coding-standards/wpcs ./includes ./admin ./wp-plugin-starter-template.php
+43 -7
View File
@@ -2,12 +2,48 @@
This page documents all notable changes to the WordPress Plugin Starter Template. This page documents all notable changes to the WordPress Plugin Starter Template.
## Version 0.1.6 (2025-04-19)
### Fixed
- GitHub Actions workflows permissions for releases and wiki sync
## Version 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
## Version 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
## Version 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
## Version 0.1.1 (2025-04-18)
### Changed
- Updated LICENSE file with correct GPL-2.0 text
## Version 0.1.0 (2025-04-17) ## Version 0.1.0 (2025-04-17)
### Added
- Initial release with basic template structure - Initial release with basic template structure
- Added core plugin architecture with OOP approach - Core plugin architecture with OOP approach
- Added admin interface components and styling - Admin interface components and styling
- Added update mechanism with multiple source options - Update mechanism with multiple source options
- Added documentation templates for users and developers - Documentation templates for users and developers
- Added AI workflow documentation for AI-assisted development - AI workflow documentation for AI-assisted development
- Added GitHub Actions workflows for automated tasks - GitHub Actions workflows for automated tasks
- Added wiki documentation templates - Wiki documentation templates
+5
View File
@@ -4,6 +4,11 @@ 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. This template provides a solid foundation for developing WordPress plugins with best practices for AI-assisted development.
## Latest Updates
- Version 0.1.6: Fixed GitHub Actions workflows permissions for releases and wiki sync
- Version 0.1.5: Added testing setup with wp-env and Cypress, multisite compatibility
## Quick Links ## Quick Links
- [Starter Prompt](Starter-Prompt) - [Starter Prompt](Starter-Prompt)
+1
View File
@@ -1,5 +1,6 @@
## User Documentation ## User Documentation
* [Home](Home) * [Home](Home)
* [Starter Prompt](Starter-Prompt)
* [Installation Guide](Installation-Guide) * [Installation Guide](Installation-Guide)
* [Usage Instructions](Usage-Instructions) * [Usage Instructions](Usage-Instructions)
* [Frequently Asked Questions](Frequently-Asked-Questions) * [Frequently Asked Questions](Frequently-Asked-Questions)
+15 -1
View File
@@ -1,13 +1,27 @@
All notable changes to this project should be documented both here and in the main Readme files. All notable changes to this project should be documented both here and in the main Readme files.
#### [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 #### [0.1.3] - 2025-04-19
#### Added #### Added
- Improved AI IDE context recommendations in documentation - Improved AI IDE context recommendations in documentation
- Enhanced STARTER-PROMPT.md with guidance on pinning .ai-assistant.md and .ai-workflows/ - Enhanced Starter Prompt with guidance on pinning .ai-assistant.md and .ai-workflows/
#### Changed #### Changed
- Updated README.md and readme.txt with AI IDE context recommendations - Updated README.md and readme.txt with AI IDE context recommendations
- Improved documentation for AI-assisted development - Improved documentation for AI-assisted development
- Moved Starter Prompt to the wiki for better organization
#### [0.1.2] - 2025-04-18 #### [0.1.2] - 2025-04-18
#### Added #### Added
+119 -19
View File
@@ -1,4 +1,4 @@
# WordPress Plugin Starter Template # WordPress Plugin Starter Template for AI Coding
[![License](https://img.shields.io/badge/license-GPL--2.0%2B-blue.svg)](https://www.gnu.org/licenses/gpl-2.0.html) [![License](https://img.shields.io/badge/license-GPL--2.0%2B-blue.svg)](https://www.gnu.org/licenses/gpl-2.0.html)
@@ -15,18 +15,19 @@ This template is based on the experience gained from developing the "Fix 'Plugin
* **Object-Oriented Architecture**: Well-structured, maintainable code using OOP principles * **Object-Oriented Architecture**: Well-structured, maintainable code using OOP principles
* **Namespace Support**: Modern PHP namespacing for better organization and avoiding conflicts * **Namespace Support**: Modern PHP namespacing for better organization and avoiding conflicts
* **Comprehensive Documentation**: Detailed documentation for both users and developers * **Comprehensive Documentation**: Detailed documentation for both users and developers
* **Testing Framework**: PHPUnit setup for unit testing * **Testing Framework**: PHPUnit setup for unit testing and Cypress for e2e testing
* **Internationalization Ready**: Full support for translation and localization * **Internationalization Ready**: Full support for translation and localization
* **Update Source Selection**: Choose between WordPress.org, GitHub, or Gitea for plugin updates * **Update Source Selection**: Choose between WordPress.org, GitHub, or Gitea for plugin updates
* **AI Workflow Documentation**: Detailed guides for AI-assisted development * **AI Workflow Documentation**: Detailed guides for AI-assisted development
* **Wiki Documentation**: Ready-to-use wiki structure for comprehensive documentation * **Wiki Documentation**: Ready-to-use wiki structure for comprehensive documentation
* **Multisite Compatible**: Fully tested and compatible with WordPress multisite installations
### How to Use This Template ### How to Use This Template
1. Clone or download this repository 1. Clone or download this repository
2. **Important**: Begin by reading the [STARTER-PROMPT.md](STARTER-PROMPT.md) file for detailed instructions 2. **Important**: Begin by reading the [Starter Prompt](.wiki/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) 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 4. Use the prompt in the Starter Prompt file to guide the AI in customizing the template for your plugin
5. Rename files and update namespaces to match your plugin 5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs 6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features 7. Update documentation to reflect your plugin's features
@@ -38,16 +39,16 @@ This template includes comprehensive documentation for AI-assisted development:
* **.ai-assistant.md**: Guide for AI assistants to understand the project structure * **.ai-assistant.md**: Guide for AI assistants to understand the project structure
* **.ai-workflows/**: Detailed workflow documentation for common development tasks * **.ai-workflows/**: Detailed workflow documentation for common development tasks
* **STARTER-PROMPT.md**: Comprehensive prompt for AI tools to help customize the template * **Starter Prompt**: Comprehensive prompt for AI tools to help customize the template (available in the [wiki](.wiki/Starter-Prompt.md))
**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. **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 ## Installation
1. Clone or download this repository 1. Clone or download this repository
2. Read the [STARTER-PROMPT.md](STARTER-PROMPT.md) file for detailed instructions 2. Read the [Starter Prompt](.wiki/Starter-Prompt.md) file for detailed instructions
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context 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 4. Use the prompt in the Starter Prompt file to guide the AI in customizing the template
5. Rename files and update namespaces to match your plugin 5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs 6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features 7. Update documentation to reflect your plugin's features
@@ -59,16 +60,96 @@ This template includes comprehensive documentation for AI-assisted development:
To get started with this template, follow these steps: To get started with this template, follow these steps:
1. Clone this repository to your local machine: 1. In your terminal, navigate to the folder you keep you Git repositories (eg: `~/Git/`), then clone this repository to your local machine:
```bash ```bash
git clone https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git git clone https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git
``` ```
2. Open the STARTER-PROMPT.md file and follow the instructions to customize the template for your plugin. 2. Open the [Starter Prompt](.wiki/Starter-Prompt.md) file and follow the instructions to customize the template for your plugin.
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context. 3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context.
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. 4. Use an AI assistant like GitHub Copilot, Claude, or ChatGPT to help you customize the template by providing the prompt from the Starter Prompt file.
### Development Environment
This template includes configuration for WordPress Environment (wp-env) to make local development easier:
1. Install Node.js dependencies:
```bash
npm install
```
2. Start the WordPress environment:
```bash
npm run start
```
3. For multisite testing:
```bash
npm run multisite
```
4. Access your local WordPress site at http://localhost:8888 (admin credentials: admin/password)
### Testing
The template includes both PHP unit tests and end-to-end tests:
#### PHP Unit Tests
1. Install Composer dependencies:
```bash
composer install
```
2. Run PHP unit tests:
```bash
npm run test:php
```
3. Check PHP coding standards:
```bash
npm run lint:php
```
4. Fix PHP coding standards issues:
```bash
npm run fix:php
```
#### End-to-End Tests
1. Start the WordPress environment:
```bash
npm run start
```
2. Run Cypress tests in interactive mode:
```bash
npm run test:e2e
```
3. Run Cypress tests in headless mode:
```bash
npm run test:e2e:headless
```
### Building for Production
Use the included build script to create a deployable version of your plugin:
```bash
npm run build
```
Or directly:
```bash
./build.sh {VERSION}
```
This will create a ZIP file that you can install in WordPress.
### Using with Git Updater ### Using with Git Updater
@@ -95,7 +176,7 @@ This template includes functionality that allows users to choose where they want
### How do I customize this template for my plugin? ### How do I customize this template for my plugin?
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. See the [Starter Prompt](.wiki/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.
### What files do I need to update with my plugin information? ### What files do I need to update with my plugin information?
@@ -105,13 +186,14 @@ The main files you need to update include:
3. readme.txt 3. readme.txt
4. CHANGELOG.md 4. CHANGELOG.md
5. composer.json 5. composer.json
6. languages/pot file 6. package.json
7. .github/workflows/ 7. languages/pot file
8. .wiki/ 8. .github/workflows/
9. .ai-assistant.md 9. .wiki/
10. includes/plugin.php 10. .ai-assistant.md
11. includes/core.php 11. includes/plugin.php
12. admin/lib/admin.php 12. includes/core.php
13. admin/lib/admin.php
### How do I build and test my plugin? ### How do I build and test my plugin?
@@ -127,6 +209,14 @@ This will create a ZIP file that you can install in WordPress.
Customize the includes/core.php file to implement your core functionality and the admin/lib/admin.php file for admin-specific functionality. Customize the includes/core.php file to implement your core functionality and the admin/lib/admin.php file for admin-specific functionality.
### Is this template compatible with WordPress multisite?
Yes, this template is fully compatible with WordPress multisite installations. You can test multisite compatibility by running:
```bash
npm run multisite
```
## Support & Feedback ## Support & Feedback
If you need help with this template, there are several ways to get support: If you need help with this template, there are several ways to get support:
@@ -188,9 +278,19 @@ For more information on Git Updater integration, see the [Git Updater Required H
## Changelog ## Changelog
### 0.1.6
* Fixed: GitHub Actions workflows permissions for releases and wiki sync
### 0.1.5
* Fixed: Release workflow to use correct plugin directory name
* Added: Testing setup with wp-env and Cypress
* Added: Multisite compatibility
* Added: npm scripts for development and testing
### 0.1.3 ### 0.1.3
* Added: Improved AI IDE context recommendations in documentation * Added: Improved AI IDE context recommendations in documentation
* Enhanced: STARTER-PROMPT.md with guidance on pinning .ai-assistant.md and .ai-workflows/ * Enhanced: Starter Prompt with guidance on pinning .ai-assistant.md and .ai-workflows/
* Moved: Starter Prompt to the wiki for better organization
* Updated: README.md and readme.txt with AI IDE context recommendations * Updated: README.md and readme.txt with AI IDE context recommendations
* Improved: Documentation for AI-assisted development * Improved: Documentation for AI-assisted development
-190
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.
+74
View File
@@ -1 +1,75 @@
<?php <?php
/**
* Admin functionality
*
* @package WPALLSTARS\PluginStarterTemplate
*/
namespace WPALLSTARS\PluginStarterTemplate\Admin;
use WPALLSTARS\PluginStarterTemplate\Core;
/**
* Admin class
*/
class Admin {
/**
* Core instance
*
* @var Core
*/
private $core;
/**
* Constructor
*
* @param Core $core Core instance.
*/
public function __construct( $core ) {
$this->core = $core;
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_assets' ] );
}
/**
* Initialize admin
*/
public function init() {
// Initialize admin
}
/**
* Enqueue admin assets
*
* @param string $hook Current admin page.
*/
public function enqueue_admin_assets( $hook ) {
wp_enqueue_style(
'wpst-admin-styles',
WPST_PLUGIN_URL . 'assets/css/admin.css',
[],
WPST_VERSION
);
wp_enqueue_script(
'wpst-admin-scripts',
WPST_PLUGIN_URL . 'assets/js/admin.js',
[ 'jquery' ],
WPST_VERSION,
true
);
wp_localize_script(
'wpst-admin-scripts',
'wpstData',
[
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'wpst-admin-nonce' ),
'strings' => [
'success' => esc_html__( 'Success!', 'wp-plugin-starter-template' ),
'error' => esc_html__( 'Error!', 'wp-plugin-starter-template' ),
],
]
);
}
}
+5 -2
View File
@@ -14,9 +14,12 @@
"php": ">=7.0" "php": ">=7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7.5", "phpunit/phpunit": "^6.5 || ^7.5 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"wp-coding-standards/wpcs": "^2.3" "wp-coding-standards/wpcs": "^2.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"10up/wp_mock": "0.3.0",
"antecedent/patchwork": "^2.1.21"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
+30
View File
@@ -1 +1,31 @@
<?php <?php
/**
* Core functionality for the plugin
*
* @package WPALLSTARS\PluginStarterTemplate
*/
namespace WPALLSTARS\PluginStarterTemplate;
/**
* Core class
*/
class Core {
/**
* Constructor
*/
public function __construct() {
// Initialize hooks
}
/**
* Example method to filter content
*
* @param string $content The content to filter.
* @return string The filtered content.
*/
public function filter_content( $content ) {
return $content;
}
}
+53
View File
@@ -1 +1,54 @@
<?php <?php
/**
* Main plugin class
*
* @package WPALLSTARS\PluginStarterTemplate
*/
namespace WPALLSTARS\PluginStarterTemplate;
/**
* Plugin class
*/
class Plugin {
/**
* Core instance
*
* @var Core
*/
private $core;
/**
* Plugin file
*
* @var string
*/
private $plugin_file;
/**
* Plugin version
*
* @var string
*/
private $version;
/**
* Constructor
*
* @param string $plugin_file Main plugin file path.
* @param string $version Plugin version.
*/
public function __construct($plugin_file, $version) {
$this->plugin_file = $plugin_file;
$this->version = $version;
$this->core = new Core();
}
/**
* Initialize the plugin
*/
public function init() {
// Initialize plugin.
}
}
+57
View File
@@ -1 +1,58 @@
<?php <?php
/**
* Updater functionality for the plugin
*
* @package WPALLSTARS\PluginStarterTemplate
*/
namespace WPALLSTARS\PluginStarterTemplate;
/**
* Updater class
*/
class Updater {
/**
* Plugin file
*
* @var string
*/
private $plugin_file;
/**
* Constructor
*
* @param string $plugin_file Main plugin file path.
*/
public function __construct($plugin_file) {
$this->plugin_file = $plugin_file;
$this->init();
}
/**
* Initialize the updater
*/
public function init() {
add_filter('plugin_action_links_' . plugin_basename($this->plugin_file), array($this, 'add_update_source_link'));
add_action('admin_post_wpst_update_source', array($this, 'handle_update_source'));
}
/**
* Add update source link to plugin actions
*
* @param array $links Plugin action links.
* @return array Modified plugin action links.
*/
public function add_update_source_link($links) {
$update_source_link = '<a href="' . admin_url('admin-post.php?action=wpst_update_source&plugin=' . plugin_basename($this->plugin_file)) . '">' . esc_html__('Update Source', 'wp-plugin-starter-template') . '</a>';
array_unshift($links, $update_source_link);
return $links;
}
/**
* Handle update source selection
*/
public function handle_update_source() {
// Handle update source selection.
}
}
+39
View File
@@ -0,0 +1,39 @@
{
"name": "wp-plugin-starter-template-for-ai-coding",
"version": "0.1.6",
"description": "A comprehensive starter template for WordPress plugins with best practices for AI-assisted development.",
"main": "index.js",
"scripts": {
"start": "wp-env start",
"stop": "wp-env stop",
"wp-env": "wp-env",
"multisite": "wp-env start --config=.wp-env.multisite.json",
"test:e2e": "cypress open --config-file tests/e2e/cypress.json",
"test:e2e:headless": "cypress run --config-file tests/e2e/cypress.json",
"build": "./build.sh",
"lint:php": "composer run-script phpcs",
"fix:php": "composer run-script phpcbf",
"test:php": "composer run-script test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding.git"
},
"keywords": [
"wordpress",
"plugin",
"template",
"ai",
"coding"
],
"author": "WPALLSTARS",
"license": "GPL-2.0-or-later",
"bugs": {
"url": "https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/issues"
},
"homepage": "https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding#readme",
"devDependencies": {
"@wordpress/env": "^5.0.0",
"cypress": "^9.7.0"
}
}
+110 -20
View File
@@ -1,11 +1,11 @@
=== WordPress Plugin Starter Template === === WordPress Plugin Starter Template for AI Coding ===
Contributors: wpallstars Contributors: wpallstars
Donate link: https://www.wpallstars.com/ Donate link: https://www.wpallstars.com/
Tags: starter, template, boilerplate, plugin development, ai coding Tags: starter, template, boilerplate, plugin development, ai coding
Requires at least: 5.0 Requires at least: 5.0
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.0 Requires PHP: 7.0
Stable tag: 0.1.3 Stable tag: 0.1.6
License: GPL-2.0+ License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -22,24 +22,25 @@ This template is based on the experience gained from developing the "Fix 'Plugin
* **Object-Oriented Architecture**: Well-structured, maintainable code using OOP principles * **Object-Oriented Architecture**: Well-structured, maintainable code using OOP principles
* **Namespace Support**: Modern PHP namespacing for better organization and avoiding conflicts * **Namespace Support**: Modern PHP namespacing for better organization and avoiding conflicts
* **Comprehensive Documentation**: Detailed documentation for both users and developers * **Comprehensive Documentation**: Detailed documentation for both users and developers
* **Testing Framework**: PHPUnit setup for unit testing * **Testing Framework**: PHPUnit setup for unit testing and Cypress for e2e testing
* **Internationalization Ready**: Full support for translation and localization * **Internationalization Ready**: Full support for translation and localization
* **Update Source Selection**: Choose between WordPress.org, GitHub, or Gitea for plugin updates * **Update Source Selection**: Choose between WordPress.org, GitHub, or Gitea for plugin updates
* **AI Workflow Documentation**: Detailed guides for AI-assisted development * **AI Workflow Documentation**: Detailed guides for AI-assisted development
* **Wiki Documentation**: Ready-to-use wiki structure for comprehensive documentation * **Wiki Documentation**: Ready-to-use wiki structure for comprehensive documentation
* **Multisite Compatible**: Fully tested and compatible with WordPress multisite installations
= How to Use This Template = = How to Use This Template =
1. Clone or download this repository 1. Clone or download this repository
2. **Important**: Begin by reading the STARTER-PROMPT.md file for detailed instructions 2. **Important**: Begin by reading the Starter Prompt file in the wiki for detailed instructions
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context (pin them if possible) 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 4. Use the prompt in the Starter Prompt file to guide the AI in customizing the template for your plugin
5. Rename files and update namespaces to match your plugin 5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs 6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features 7. Update documentation to reflect your plugin's features
8. Build and test your plugin 8. Build and test your plugin
For detailed instructions, see the [STARTER-PROMPT.md](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/blob/main/STARTER-PROMPT.md) file. For detailed instructions, see the [Starter Prompt](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Starter-Prompt) file in the wiki.
= AI-Assisted Development = = AI-Assisted Development =
@@ -47,10 +48,74 @@ This template includes comprehensive documentation for AI-assisted development:
* **.ai-assistant.md**: Guide for AI assistants to understand the project structure * **.ai-assistant.md**: Guide for AI assistants to understand the project structure
* **.ai-workflows/**: Detailed workflow documentation for common development tasks * **.ai-workflows/**: Detailed workflow documentation for common development tasks
* **STARTER-PROMPT.md**: Comprehensive prompt for AI tools to help customize the template * **Starter Prompt**: Comprehensive prompt for AI tools to help customize the template (available in the wiki)
**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. **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.
= Development Environment =
This template includes configuration for WordPress Environment (wp-env) to make local development easier:
1. Install Node.js dependencies:
```bash
npm install
```
2. Start the WordPress environment:
```bash
npm run start
```
3. For multisite testing:
```bash
npm run multisite
```
4. Access your local WordPress site at http://localhost:8888 (admin credentials: admin/password)
= Testing =
The template includes both PHP unit tests and end-to-end tests:
**PHP Unit Tests**
1. Install Composer dependencies:
```bash
composer install
```
2. Run PHP unit tests:
```bash
npm run test:php
```
3. Check PHP coding standards:
```bash
npm run lint:php
```
4. Fix PHP coding standards issues:
```bash
npm run fix:php
```
**End-to-End Tests**
1. Start the WordPress environment:
```bash
npm run start
```
2. Run Cypress tests in interactive mode:
```bash
npm run test:e2e
```
3. Run Cypress tests in headless mode:
```bash
npm run test:e2e:headless
```
= Support & Feedback = = Support & Feedback =
If you need help with this template, there are several ways to get support: If you need help with this template, there are several ways to get support:
@@ -71,21 +136,21 @@ Contributions are welcome! Please feel free to submit a Pull Request.
== Installation == == Installation ==
1. Clone or download this repository 1. Clone or download this repository
2. Read the STARTER-PROMPT.md file for detailed instructions 2. Read the Starter Prompt file in the wiki for detailed instructions
3. Add the .ai-assistant.md file and .ai-workflows/ directory to your AI IDE chat context 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 4. Use the prompt in the Starter Prompt file to guide the AI in customizing the template
5. Rename files and update namespaces to match your plugin 5. Rename files and update namespaces to match your plugin
6. Customize the functionality for your specific needs 6. Customize the functionality for your specific needs
7. Update documentation to reflect your plugin's features 7. Update documentation to reflect your plugin's features
8. Build and test your plugin 8. Build and test your plugin
For detailed instructions, see the [STARTER-PROMPT.md](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/blob/main/STARTER-PROMPT.md) file. For detailed instructions, see the [Starter Prompt](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Starter-Prompt) file in the wiki.
== Frequently Asked Questions == == Frequently Asked Questions ==
= How do I customize this template for my plugin? = = How do I customize this template for my plugin? =
See the [STARTER-PROMPT.md](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/blob/main/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. See the [Starter Prompt](https://github.com/wpallstars/wp-plugin-starter-template-for-ai-coding/wiki/Starter-Prompt) file in the wiki 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.
= What files do I need to update with my plugin information? = = What files do I need to update with my plugin information? =
@@ -95,13 +160,14 @@ The main files you need to update include:
3. readme.txt 3. readme.txt
4. CHANGELOG.md 4. CHANGELOG.md
5. composer.json 5. composer.json
6. languages/pot file 6. package.json
7. .github/workflows/ 7. languages/pot file
8. .wiki/ 8. .github/workflows/
9. .ai-assistant.md 9. .wiki/
10. includes/plugin.php 10. .ai-assistant.md
11. includes/core.php 11. includes/plugin.php
12. admin/lib/admin.php 12. includes/core.php
13. admin/lib/admin.php
= How do I build and test my plugin? = = How do I build and test my plugin? =
@@ -125,15 +191,33 @@ You'll need to update all namespace references from WPALLSTARS\PluginStarterTemp
You'll need to update all text domain references from 'wp-plugin-starter-template' to your own text domain throughout the codebase. You'll need to update all text domain references from 'wp-plugin-starter-template' to your own text domain throughout the codebase.
= Is this template compatible with WordPress multisite? =
Yes, this template is fully compatible with WordPress multisite installations. You can test multisite compatibility by running:
```bash
npm run multisite
```
== Screenshots == == Screenshots ==
1. This is a placeholder for your plugin's screenshots. Replace with actual screenshots of your plugin in action. 1. This is a placeholder for your plugin's screenshots. Replace with actual screenshots of your plugin in action.
== Changelog == == Changelog ==
= 0.1.6 =
* Fixed: GitHub Actions workflows permissions for releases and wiki sync
= 0.1.5 =
* Fixed: Release workflow to use correct plugin directory name
* Added: Testing setup with wp-env and Cypress
* Added: Multisite compatibility
* Added: npm scripts for development and testing
= 0.1.3 = = 0.1.3 =
* Added: Improved AI IDE context recommendations in documentation * Added: Improved AI IDE context recommendations in documentation
* Enhanced: STARTER-PROMPT.md with guidance on pinning .ai-assistant.md and .ai-workflows/ * Enhanced: Starter Prompt with guidance on pinning .ai-assistant.md and .ai-workflows/
* Moved: Starter Prompt to the wiki for better organization
* Updated: README.md and readme.txt with AI IDE context recommendations * Updated: README.md and readme.txt with AI IDE context recommendations
* Improved: Documentation for AI-assisted development * Improved: Documentation for AI-assisted development
@@ -157,8 +241,14 @@ You'll need to update all text domain references from 'wp-plugin-starter-templat
== Upgrade Notice == == Upgrade Notice ==
= 0.1.6 =
Fixed GitHub Actions workflows permissions for releases and wiki sync.
= 0.1.5 =
Fixed release workflow and added testing setup with wp-env and Cypress, multisite compatibility, and npm scripts for development and testing.
= 0.1.3 = = 0.1.3 =
Added improved AI IDE context recommendations and enhanced STARTER-PROMPT.md with guidance on pinning .ai-assistant.md and .ai-workflows/ files. Added improved AI IDE context recommendations and moved Starter Prompt to the wiki with guidance on pinning .ai-assistant.md and .ai-workflows/ files.
= 0.1.1 = = 0.1.1 =
Updated LICENSE file with correct GPL-2.0 text. Updated LICENSE file with correct GPL-2.0 text.
+9
View File
@@ -0,0 +1,9 @@
{
"baseUrl": "http://localhost:8889",
"integrationFolder": "tests/e2e/cypress/integration",
"pluginsFile": "tests/e2e/cypress/plugins/index.js",
"supportFile": "tests/e2e/cypress/support/index.js",
"videosFolder": "tests/e2e/cypress/videos",
"screenshotsFolder": "tests/e2e/cypress/screenshots",
"fixturesFolder": "tests/e2e/cypress/fixtures"
}
@@ -0,0 +1,27 @@
/**
* Basic e2e test for the plugin.
*/
describe('Plugin Basic Tests', () => {
before(() => {
cy.login();
});
it('Should activate the plugin', () => {
cy.visit('/wp-admin/plugins.php');
cy.contains('WP Plugin Starter Template').should('exist');
// Check if plugin is not active, then activate it
cy.get('tr[data-slug="wp-plugin-starter-template-for-ai-coding"]')
.then(($tr) => {
if ($tr.hasClass('inactive')) {
cy.wrap($tr).find('.activate a').click();
cy.contains('Plugin activated.').should('exist');
}
});
});
it('Should have the plugin settings page', () => {
cy.visit('/wp-admin/options-general.php?page=wp-plugin-starter-template');
cy.contains('WP Plugin Starter Template Settings').should('exist');
});
});
+10
View File
@@ -0,0 +1,10 @@
/**
* Cypress plugins file.
*
* @param {Object} on - Cypress events
* @param {Object} config - Cypress config
* @return {Object} - Modified config
*/
module.exports = (on, config) => {
return config;
};
+12
View File
@@ -0,0 +1,12 @@
/**
* Custom Cypress commands.
*/
// Login command
Cypress.Commands.add('login', (username = 'admin', password = 'password') => {
cy.visit('/wp-login.php');
cy.get('#user_login').type(username);
cy.get('#user_pass').type(password);
cy.get('#wp-submit').click();
cy.get('body.wp-admin').should('exist');
});
+4
View File
@@ -0,0 +1,4 @@
/**
* Import commands.js
*/
import './commands';
+3 -3
View File
@@ -11,7 +11,7 @@ use WPALLSTARS\PluginStarterTemplate\Core;
/** /**
* Admin test case. * Admin test case.
*/ */
class AdminTest extends WP_Mock\Tools\TestCase { class AdminTest extends \WP_Mock\Tools\TestCase {
/** /**
* Test instance * Test instance
@@ -30,7 +30,7 @@ class AdminTest extends WP_Mock\Tools\TestCase {
/** /**
* Set up test environment * Set up test environment
*/ */
public function setUp(): void { public function setUp() {
parent::setUp(); parent::setUp();
// Set up mocks // Set up mocks
@@ -52,7 +52,7 @@ class AdminTest extends WP_Mock\Tools\TestCase {
/** /**
* Tear down test environment * Tear down test environment
*/ */
public function tearDown(): void { public function tearDown() {
WP_Mock::tearDown(); WP_Mock::tearDown();
parent::tearDown(); parent::tearDown();
} }
+3 -3
View File
@@ -10,7 +10,7 @@ use WPALLSTARS\PluginStarterTemplate\Core;
/** /**
* Core test case. * Core test case.
*/ */
class CoreTest extends WP_Mock\Tools\TestCase { class CoreTest extends \WP_Mock\Tools\TestCase {
/** /**
* Test instance * Test instance
@@ -22,7 +22,7 @@ class CoreTest extends WP_Mock\Tools\TestCase {
/** /**
* Set up test environment * Set up test environment
*/ */
public function setUp(): void { public function setUp() {
parent::setUp(); parent::setUp();
// Set up mocks // Set up mocks
@@ -35,7 +35,7 @@ class CoreTest extends WP_Mock\Tools\TestCase {
/** /**
* Tear down test environment * Tear down test environment
*/ */
public function tearDown(): void { public function tearDown() {
WP_Mock::tearDown(); WP_Mock::tearDown();
parent::tearDown(); parent::tearDown();
} }
+7 -7
View File
@@ -3,7 +3,7 @@
* Plugin Name: WordPress Plugin Starter Template * Plugin Name: WordPress Plugin Starter Template
* Plugin URI: https://www.wpallstars.com * Plugin URI: https://www.wpallstars.com
* Description: A comprehensive starter template for WordPress plugins with best practices for AI-assisted development. * Description: A comprehensive starter template for WordPress plugins with best practices for AI-assisted development.
* Version: 0.1.3 * Version: 0.1.6
* Author: Your Name & The WPALLSTARS Team * Author: Your Name & The WPALLSTARS Team
* Author URI: https://www.wpallstars.com * Author URI: https://www.wpallstars.com
* License: GPL-2.0+ * License: GPL-2.0+
@@ -27,12 +27,12 @@
*/ */
// If this file is called directly, abort. // If this file is called directly, abort.
if (!defined('WPINC')) { if ( ! defined( 'WPINC' ) ) {
die; die;
} }
// Load the main plugin class // Load the main plugin class.
require_once plugin_dir_path(__FILE__) . 'includes/plugin.php'; require_once plugin_dir_path( __FILE__ ) . 'includes/plugin.php';
// Initialize the plugin // Initialize the plugin.
new WPALLSTARS\PluginStarterTemplate\Plugin(__FILE__, '0.1.3'); new WPALLSTARS\PluginStarterTemplate\Plugin( __FILE__, '0.1.7' );