Skip to content

Commit 2c3eeea

Browse files
authored
Release
1 parent 21986d5 commit 2c3eeea

File tree

7 files changed

+124
-57
lines changed

7 files changed

+124
-57
lines changed

.github/copilot-instructions.md

Lines changed: 3 additions & 1 deletion
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,7 +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
60+
- Update version in: plugin header, README.md, readme.txt, CHANGELOG.md, GEMINI.md, and language files (.pot)
5961
- Update version in: constants section, .pot files, package.json, composer.json
6062
- Move "Unreleased" changes to new version section in both changelogs
6163
- **Never auto-update versions** - wait for explicit instruction

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
### Added
9+
10+
### Changed
11+
12+
### Fixed
13+
14+
## [1.8.0] - 2025-10-23
15+
816
### Added
917
- Added new option to remove RSD (Really Simple Discovery) link from WordPress header
1018
- **NEW FEATURE**: Added separate DNS Prefetch option alongside Preconnect for better resource hint control

GEMINI.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Project-specific instructions for Gemini AI
2-
# This file provides context about the Simple WP Optimizer WordPress plugin
3-
# to help Gemini understand the codebase and provide better analysis
4-
5-
# Simple WP Optimizer - WordPress Plugin
62

73
## Project Overview
4+
5+
**Simple WP Optimizer - WordPress Plugin**
86
This is a WordPress performance optimization plugin that removes unnecessary features and scripts to improve site performance. Designed for WordPress administrators who want to optimize their site's speed by disabling unused functionality and reducing resource overhead.
97

108
## Plugin Details
9+
1110
- **Name:** Simple WP Optimizer
12-
- **Version:** 1.7.0
11+
- **Version:** 1.8.0
1312
- **WordPress Compatibility:** 6.5+
1413
- **PHP Compatibility:** 7.4+
1514
- **License:** GPL-3.0-or-later
@@ -18,7 +17,9 @@ This is a WordPress performance optimization plugin that removes unnecessary fea
1817
## Architecture & Design Patterns
1918

2019
### Single-File Plugin Architecture
20+
2121
The plugin follows a single-file architecture pattern for simplicity:
22+
2223
```php
2324
// All functionality contained in simple-wp-optimizer.php
2425
// Functions prefixed with 'es_optimizer_' for namespace consistency
@@ -28,7 +29,9 @@ function es_optimizer_function_name() {
2829
```
2930

3031
### Plugin Initialization
32+
3133
The plugin uses proper WordPress initialization patterns with plugins_loaded hook:
34+
3235
```php
3336
function es_optimizer_init() {
3437
// Hook admin menu creation
@@ -41,6 +44,7 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
4144
```
4245

4346
### File Structure
47+
4448
- `simple-wp-optimizer.php` - Main plugin file (all functionality)
4549
- `languages/` - Translation files (.pot file included)
4650
- `CHANGELOG.md` - Developer changelog
@@ -51,12 +55,14 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
5155
## WordPress Coding Standards
5256

5357
### Naming Conventions
58+
5459
- **Functions:** `es_optimizer_snake_case` (WordPress standard with plugin prefix)
5560
- **Variables:** `$snake_case`
5661
- **Constants:** `ES_WP_OPTIMIZER_UPPER_SNAKE_CASE`
5762
- **Text Domain:** Always use `'simple-wp-optimizer'`
5863

5964
### Security Requirements
65+
6066
- Always use `esc_html()`, `esc_attr()`, `esc_url()` for output
6167
- Sanitize input with `sanitize_text_field()`, `wp_unslash()`, etc.
6268
- Use `current_user_can( 'manage_options' )` for capability checks
@@ -65,6 +71,7 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
6571
- Use WordPress Options API for settings storage
6672

6773
### WordPress Integration
74+
6875
- **Hooks:** Proper use of actions and filters with appropriate priorities
6976
- **Performance Features:** Integration with WordPress caching and optimization APIs
7077
- **Settings API:** WordPress Settings API for admin interface
@@ -76,6 +83,7 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
7683
### Core Functionality
7784

7885
#### Performance Optimization Features
86+
7987
- **XML-RPC Disabling:** Remove XML-RPC functionality for security and performance
8088
- **JSON REST API Control:** Disable REST API for non-logged users
8189
- **jQuery Migrate Removal:** Remove unnecessary jQuery Migrate script
@@ -86,36 +94,42 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
8694
- **DNS Prefetch Management:** User-configurable DNS prefetch for external domains
8795

8896
#### Settings Management
97+
8998
- **Options Caching:** Static caching system to reduce database queries
9099
- **Conditional Admin Loading:** Admin assets only load on plugin settings page
91100
- **User-Friendly Interface:** Toggle-based settings for easy optimization control
92101
- **Input Validation:** Comprehensive validation for all user inputs
93102

94103
#### Security Features
104+
95105
- **Domain Validation:** DNS prefetch domains validated to prevent injection
96106
- **Input Sanitization:** All user inputs properly sanitized and escaped
97107
- **Capability Checks:** Admin-only access with proper permission verification
98108
- **Nonce Protection:** CSRF protection on all form submissions
99109

100110
### Performance Optimization Focus
111+
101112
- **Frontend Performance:** Reduces HTTP requests and removes unused resources
102113
- **Admin Performance:** Conditional loading of admin assets
103114
- **Database Optimization:** Option caching to minimize database queries
104115
- **Script Optimization:** Selective removal of unnecessary WordPress scripts
105116

106117
### DNS Prefetch Security
118+
107119
- **Domain Validation:** All DNS prefetch domains validated to prevent injection
108120
- **Clean Domain Enforcement:** Only clean domains without paths/parameters allowed
109121
- **Input Sanitization:** URL validation prevents malicious domain injection
110122
- **Output Escaping:** All domain outputs properly escaped for security
111123

112124
### WordPress Hook Management
125+
113126
- **Priority Handling:** High-priority hooks (PHP_INT_MAX) to ensure optimization execution
114127
- **Hook Timing:** Proper use of init, wp_head, and other WordPress lifecycle hooks
115128
- **Filter Override Protection:** Prevents other plugins from disabling optimizations
116129
- **Action Consolidation:** Organized hook management for better performance
117130

118131
### Option Caching System
132+
119133
- **Static Caching:** `es_optimizer_get_options()` function with static cache
120134
- **Database Query Reduction:** Minimizes repeated option retrieval
121135
- **Memory Efficiency:** Efficient caching without memory overhead
@@ -124,18 +138,21 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
124138
## Development Standards
125139

126140
### Error Handling
141+
127142
- **WP_Error Usage:** Consistent error object returns throughout
128143
- **Comprehensive Logging:** Structured logging with severity levels
129144
- **Security Logging:** Detailed logs for security events
130145
- **User Feedback:** Clear error messages without information disclosure
131146

132147
### Documentation
148+
133149
- **PHPDoc Compliance:** Complete documentation for all functions
134150
- **Security Comments:** Detailed security justifications
135151
- **Code Examples:** Clear usage examples in documentation
136152
- **Version Control:** Comprehensive changelog maintenance
137153

138154
### Testing & Quality Assurance
155+
139156
- **PHPStan Level 5:** Static analysis compliance
140157
- **PHPCS WordPress Standards:** Full coding standards compliance
141158
- **PHPMD Compliance:** Code quality and complexity management
@@ -144,34 +161,39 @@ add_action( 'plugins_loaded', 'es_optimizer_init' );
144161
## When Reviewing Code
145162

146163
### Critical Issues to Flag
164+
147165
1. **Performance Impact** (optimization conflicts, excessive resource usage)
148166
2. **WordPress Compatibility** (plugin/theme conflicts, hook interference)
149167
3. **Security Vulnerabilities** (input validation, output escaping)
150168
4. **WordPress Standard Violations** (coding standards, API misuse)
151169
5. **Option Management Issues** (database performance, caching problems)
152170

153171
### Plugin-Specific Security Concerns
172+
154173
1. **DNS Prefetch Validation:** Ensure domain inputs are properly validated
155174
2. **Settings Security:** Verify admin-only access and nonce verification
156175
3. **Hook Priority Conflicts:** Check for potential conflicts with other plugins
157176
4. **Input Sanitization:** Validate all user-provided domains and settings
158177
5. **Output Escaping:** Ensure all dynamic content is properly escaped
159178

160179
### Performance Focus Areas
180+
161181
1. **Frontend Optimization:** Script and style removal effectiveness
162182
2. **Admin Performance:** Conditional asset loading efficiency
163183
3. **Database Optimization:** Option caching and query reduction
164184
4. **Hook Performance:** Efficient hook management and execution
165185
5. **Memory Usage:** Optimization without excessive memory consumption
166186

167187
### Positive Patterns to Recognize
188+
168189
1. **WordPress API Compliance:** Proper use of WordPress hooks and functions
169190
2. **Performance-First Design:** Optimizations that genuinely improve site speed
170191
3. **User Experience:** Clear interface for managing optimizations
171192
4. **Compatibility Focus:** Safe optimizations that don't break functionality
172193
5. **Documentation Quality:** Clear documentation of optimization effects
173194

174195
### Suggestions to Provide
196+
175197
1. **WordPress-Specific Solutions:** Prefer WordPress APIs over generic PHP
176198
2. **Performance Enhancements:** Additional optimization opportunities
177199
3. **Compatibility Improvements:** Better plugin/theme compatibility

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![PHP Compatible](https://img.shields.io/badge/PHP-7.4%2B-purple.svg?logo=php)](https://www.php.net/)
77

88
## Current Version
9-
[![Version](https://img.shields.io/badge/Version-1.7.0-orange.svg?logo=github)](https://github.com/EngineScript/simple-wp-optimizer/releases/download/v1.7.0/simple-wp-optimizer-1.7.0.zip)
9+
[![Version](https://img.shields.io/badge/Version-1.8.0-orange.svg?logo=github)](https://github.com/EngineScript/simple-wp-optimizer/releases/download/v1.8.0/simple-wp-optimizer-1.8.0.zip)
1010

1111
## Description
1212

0 commit comments

Comments
 (0)