Skip to content

Commit a810847

Browse files
authored
Update
1 parent 5a0f1ec commit a810847

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

.github/copilot-instructions.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ applyTo: '**'
1717
## 📋 Essential Requirements
1818

1919
### WordPress Compatibility
20+
2021
- **WordPress:** 6.5+ minimum
2122
- **PHP:** 7.4+ minimum
2223
- **WooCommerce:** 5.0+ (when applicable)
2324
- Follow [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/) for PHP, JS, CSS, HTML, and accessibility
2425

2526
### Code Quality Standards
27+
2628
1. **Security First:** Always sanitize input (`sanitize_*()`) and escape output (`esc_*()`)
2729
2. **WordPress APIs:** Use WP functions instead of raw PHP/SQL
2830
3. **Hook System:** Proper use of `add_action()` and `add_filter()`
@@ -55,8 +57,7 @@ applyTo: '**'
5557

5658
**Version Release Process (only when instructed):**
5759
- Follow semantic versioning (MAJOR.MINOR.PATCH)
58-
- Update version in: plugin header, README.md, readme.txt, CHANGELOG.md
59-
- Update version in: constants section, .pot files, package.json, composer.json
60+
- Update version in: plugin header, README.md, readme.txt, CHANGELOG.md, GEMINI.md, and `.pot` language files, constants section, package.json, and composer.json
6061
- Move "Unreleased" changes to new version section in both changelogs
6162
- **Never auto-update versions** - wait for explicit instruction
6263

@@ -65,6 +66,11 @@ applyTo: '**'
6566
- Write clear function/class descriptions
6667
- Document security considerations and hooks used
6768

69+
**Internationalization (i18n):**
70+
- Update `.pot` language files when adding or modifying translatable strings
71+
- Always use the correct text domain when dealing with translation functions
72+
- Mark all user-facing strings with `__()`, `_e()`, `esc_html__()`, `esc_attr__()`, etc.
73+
6874
## ⚡ Performance & Quality
6975

7076
**Performance Optimization:**

GEMINI.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Project-specific instructions for Gemini AI
2-
# This file provides context about the Optimizations ACE MC WordPress plugin
3-
# to help Gemini understand the codebase and provide better analysis
4-
51
# Optimizations ACE MC - WordPress Plugin
62

73
## Project Overview
4+
85
This is a lightweight WordPress optimization plugin designed specifically for a single-site deployment with guaranteed WooCommerce and WP Store Locator plugin availability.
96

107
## Plugin Details
8+
119
- **Name:** Optimizations ACE MC
1210
- **Version:** Latest
1311
- **WordPress Compatibility:** 6.5+
@@ -18,7 +16,9 @@ This is a lightweight WordPress optimization plugin designed specifically for a
1816
## Architecture & Design Patterns
1917

2018
### Singleton Pattern
19+
2120
The main plugin class uses the singleton pattern to ensure only one instance exists:
21+
2222
```php
2323
protected static $instance = null;
2424
public static function instance() {
@@ -30,6 +30,7 @@ public static function instance() {
3030
```
3131

3232
### File Structure
33+
3334
- `optimizations-ace-mc.php` - Main plugin bootstrap file
3435
- `class-optimizations-ace-mc.php` - Core plugin functionality
3536
- `languages/` - Translation files
@@ -38,20 +39,23 @@ public static function instance() {
3839
## WordPress Coding Standards
3940

4041
### Naming Conventions
42+
4143
- **Functions:** `snake_case` (WordPress standard)
4244
- **Classes:** `PascalCase_With_Underscores` (WordPress standard)
4345
- **Variables:** `$snake_case`
4446
- **Constants:** `UPPER_SNAKE_CASE`
4547
- **Files:** `lowercase-with-hyphens.php`
4648

4749
### Security Requirements
50+
4851
- Always use `esc_html()`, `esc_attr()`, `esc_url()` for output
4952
- Sanitize input with `sanitize_text_field()`, `absint()`, etc.
5053
- Use `current_user_can()` for capability checks
5154
- Implement proper nonce verification for forms
5255
- Use WordPress database functions, never raw SQL
5356

5457
### WordPress Integration
58+
5559
- **Hooks:** Prefer actions and filters over direct function calls
5660
- **Database:** Use WordPress functions (`get_option`, `get_post_meta`, etc.)
5761
- **Internationalization:** All strings must use `__()` or `esc_html__()`
@@ -60,7 +64,9 @@ public static function instance() {
6064
## Plugin-Specific Context
6165

6266
### Single-Site Deployment
67+
6368
This plugin is designed for a dedicated environment where:
69+
6470
- WooCommerce is guaranteed to be active (no activation checks needed)
6571
- WP Store Locator is guaranteed to be active (no activation checks needed)
6672
- Performance optimizations can be more aggressive
@@ -69,29 +75,34 @@ This plugin is designed for a dedicated environment where:
6975
### Core Functionality
7076

7177
#### WooCommerce Optimizations
78+
7279
- Show empty product categories
7380
- Hide category product counts
7481
- Add order count column to admin users list
7582
- Admin-only functionality with proper capability checks
7683

77-
#### WP Store Locator Optimizations
84+
#### WP Store Locator Optimizations
85+
7886
- Add store categories to location metadata
7987
- Customize info window templates
8088
- Disable REST API for store post types
8189
- Category display in map popups
8290

8391
#### WordPress Admin Enhancements
92+
8493
- Registration date column in users list
8594
- Sortable custom columns
8695
- Admin-only features with security checks
8796

8897
### Performance Considerations
98+
8999
- Database queries should be cached where possible
90100
- WooCommerce order count queries run per user (consider caching)
91101
- Store category queries run per location (consider caching)
92102
- All admin features properly scoped to admin area only
93103

94104
### Security Focus Areas
105+
95106
- Input sanitization for all user data
96107
- Output escaping for all dynamic content
97108
- Proper capability checks for admin functionality
@@ -100,18 +111,21 @@ This plugin is designed for a dedicated environment where:
100111
## Development Standards
101112

102113
### Error Handling
114+
103115
- Graceful degradation when dependencies missing
104116
- Proper validation of function parameters
105117
- No PHP errors or warnings in production
106118
- Meaningful error messages for debugging
107119

108120
### Documentation
121+
109122
- Complete PHPDoc blocks for all methods
110123
- Inline comments for complex logic
111124
- README files for repository information
112125
- Changelog maintenance with semantic versioning
113126

114127
### Testing & Quality Assurance
128+
115129
- PHPStan static analysis (Level 5)
116130
- PHPCS WordPress coding standards
117131
- PHPMD mess detection
@@ -121,20 +135,23 @@ This plugin is designed for a dedicated environment where:
121135
## When Reviewing Code
122136

123137
### Critical Issues to Flag
138+
124139
1. **Security vulnerabilities** (SQL injection, XSS, CSRF)
125140
2. **WordPress standard violations**
126141
3. **Performance bottlenecks** (uncached database queries)
127142
4. **Missing input validation or output escaping**
128143
5. **Capability check bypasses**
129144

130145
### Positive Patterns to Recognize
146+
131147
1. Proper use of WordPress APIs
132148
2. Consistent error handling
133149
3. Performance optimizations
134150
4. Security best practices
135151
5. Clear documentation
136152

137153
### Suggestions to Provide
154+
138155
1. WordPress-specific solutions over generic PHP
139156
2. Performance improvements through caching
140157
3. Security enhancements

0 commit comments

Comments
 (0)