mcp-wordpress 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -182
- package/dist/cache/CacheInvalidation.d.ts +3 -3
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/cache/CacheInvalidation.js +119 -119
- package/dist/cache/CacheInvalidation.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +5 -0
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +26 -16
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
- package/dist/cache/HttpCacheWrapper.js +29 -29
- package/dist/cache/HttpCacheWrapper.js.map +1 -1
- package/dist/cache/__tests__/CacheInvalidation.test.js +96 -94
- package/dist/cache/__tests__/CacheInvalidation.test.js.map +1 -1
- package/dist/cache/__tests__/CacheManager.test.js +113 -113
- package/dist/cache/__tests__/CacheManager.test.js.map +1 -1
- package/dist/cache/__tests__/CachedWordPressClient.test.js +102 -99
- package/dist/cache/__tests__/CachedWordPressClient.test.js.map +1 -1
- package/dist/cache/__tests__/HttpCacheWrapper.test.js +98 -95
- package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +1 -1
- package/dist/cache/index.d.ts +7 -7
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +4 -4
- package/dist/cache/index.js.map +1 -1
- package/dist/client/CachedWordPressClient.d.ts +4 -4
- package/dist/client/CachedWordPressClient.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.js +55 -51
- package/dist/client/CachedWordPressClient.js.map +1 -1
- package/dist/client/api.d.ts +10 -10
- package/dist/client/api.js +158 -158
- package/dist/client/api.js.map +1 -1
- package/dist/client/auth.d.ts +2 -2
- package/dist/client/auth.js +72 -72
- package/dist/client/managers/AuthenticationManager.d.ts +2 -2
- package/dist/client/managers/AuthenticationManager.js +46 -46
- package/dist/client/managers/BaseManager.d.ts +1 -1
- package/dist/client/managers/BaseManager.js +9 -9
- package/dist/client/managers/RequestManager.d.ts +5 -3
- package/dist/client/managers/RequestManager.d.ts.map +1 -1
- package/dist/client/managers/RequestManager.js +39 -19
- package/dist/client/managers/RequestManager.js.map +1 -1
- package/dist/client/managers/index.d.ts +3 -3
- package/dist/client/managers/index.js +3 -3
- package/dist/config/ConfigurationSchema.d.ts +2 -2
- package/dist/config/ConfigurationSchema.d.ts.map +1 -1
- package/dist/config/ConfigurationSchema.js +40 -40
- package/dist/config/ConfigurationSchema.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts +2 -2
- package/dist/config/ServerConfiguration.js +35 -35
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
- package/dist/docs/DocumentationGenerator.js +296 -255
- package/dist/docs/DocumentationGenerator.js.map +1 -1
- package/dist/docs/MarkdownFormatter.d.ts +1 -1
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
- package/dist/docs/MarkdownFormatter.js +60 -51
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/docs/index.d.ts +3 -3
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp-wordpress-1.3.0.tgz +0 -0
- package/dist/performance/MetricsCollector.d.ts +3 -3
- package/dist/performance/MetricsCollector.d.ts.map +1 -1
- package/dist/performance/MetricsCollector.js +33 -27
- package/dist/performance/MetricsCollector.js.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts +12 -12
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js +200 -154
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/performance/PerformanceMonitor.d.ts +5 -5
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
- package/dist/performance/PerformanceMonitor.js +53 -52
- package/dist/performance/PerformanceMonitor.js.map +1 -1
- package/dist/performance/index.d.ts +6 -6
- package/dist/performance/index.d.ts.map +1 -1
- package/dist/performance/index.js +3 -3
- package/dist/security/InputValidator.d.ts +1 -1
- package/dist/security/InputValidator.d.ts.map +1 -1
- package/dist/security/InputValidator.js +111 -88
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts +5 -5
- package/dist/security/SecurityConfig.js +92 -92
- package/dist/security/SecurityConfig.js.map +1 -1
- package/dist/server/ConnectionTester.d.ts +1 -1
- package/dist/server/ConnectionTester.d.ts.map +1 -1
- package/dist/server/ConnectionTester.js +4 -4
- package/dist/server/ConnectionTester.js.map +1 -1
- package/dist/server/ToolRegistry.d.ts +2 -2
- package/dist/server/ToolRegistry.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js +35 -32
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/tools/BaseToolManager.js +5 -5
- package/dist/tools/auth.d.ts +2 -2
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +32 -31
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/cache.d.ts +1 -1
- package/dist/tools/cache.d.ts.map +1 -1
- package/dist/tools/cache.js +71 -71
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/comments.d.ts +2 -2
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +79 -79
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/index.d.ts +10 -10
- package/dist/tools/index.js +10 -10
- package/dist/tools/media.d.ts +2 -2
- package/dist/tools/media.js +80 -80
- package/dist/tools/pages.d.ts +2 -2
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +75 -75
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/performance.d.ts +1 -1
- package/dist/tools/performance.d.ts.map +1 -1
- package/dist/tools/performance.js +311 -287
- package/dist/tools/performance.js.map +1 -1
- package/dist/tools/posts.d.ts +2 -2
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +94 -94
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/site.d.ts +2 -2
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +60 -60
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/taxonomies.d.ts +2 -2
- package/dist/tools/taxonomies.js +89 -89
- package/dist/tools/users.d.ts +2 -2
- package/dist/tools/users.js +68 -68
- package/dist/tools/users.js.map +1 -1
- package/dist/types/client.d.ts +13 -13
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +12 -12
- package/dist/types/client.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/mcp.d.ts +7 -7
- package/dist/types/wordpress.d.ts +21 -21
- package/dist/types/wordpress.d.ts.map +1 -1
- package/dist/utils/debug.d.ts +2 -2
- package/dist/utils/debug.js +28 -28
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js +13 -13
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/toolWrapper.d.ts.map +1 -1
- package/dist/utils/toolWrapper.js +5 -5
- package/dist/utils/toolWrapper.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +41 -31
- package/dist/utils/validation.js.map +1 -1
- package/docs/CACHING.md +36 -2
- package/docs/DOCKER.md +24 -18
- package/docs/PERFORMANCE_MONITORING.md +49 -1
- package/docs/SECURITY_TESTING.md +30 -1
- package/docs/api/README.md +9 -1
- package/docs/api/summary.json +1 -1
- package/docs/contract-testing.md +24 -3
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +8 -2
- package/docs/developer/MAINTENANCE.md +29 -3
- package/docs/developer/MIGRATION_GUIDE.md +13 -1
- package/docs/developer/NPM_AUTH_SETUP.md +13 -2
- package/docs/developer/REFACTORING.md +31 -1
- package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +18 -7
- package/docs/releases/RELEASE_NOTES_v1.1.2.md +31 -5
- package/docs/user-guides/DOCKER_SETUP.md +264 -0
- package/docs/user-guides/DTX_SETUP.md +327 -0
- package/docs/user-guides/NPM_SETUP.md +109 -0
- package/docs/user-guides/NPX_SETUP.md +281 -0
- package/docs/wordpress-rest-api-authentication-troubleshooting.md +13 -2
- package/package.json +27 -8
- package/src/cache/CacheInvalidation.ts +140 -132
- package/src/cache/CacheManager.ts +40 -29
- package/src/cache/HttpCacheWrapper.ts +105 -68
- package/src/cache/__tests__/CacheInvalidation.test.ts +123 -118
- package/src/cache/__tests__/CacheManager.test.ts +156 -152
- package/src/cache/__tests__/CachedWordPressClient.test.ts +131 -116
- package/src/cache/__tests__/HttpCacheWrapper.test.ts +118 -115
- package/src/cache/index.ts +13 -13
- package/src/client/CachedWordPressClient.ts +90 -80
- package/src/client/api.ts +205 -205
- package/src/client/auth.ts +80 -80
- package/src/client/managers/AuthenticationManager.ts +61 -61
- package/src/client/managers/BaseManager.ts +11 -11
- package/src/client/managers/RequestManager.ts +79 -47
- package/src/client/managers/index.ts +3 -3
- package/src/config/ConfigurationSchema.ts +44 -44
- package/src/config/ServerConfiguration.ts +39 -39
- package/src/docs/DocumentationGenerator.ts +402 -295
- package/src/docs/MarkdownFormatter.ts +94 -69
- package/src/docs/index.ts +4 -4
- package/src/index.ts +24 -21
- package/src/performance/MetricsCollector.ts +90 -58
- package/src/performance/PerformanceAnalytics.ts +386 -262
- package/src/performance/PerformanceMonitor.ts +152 -118
- package/src/performance/index.ts +9 -9
- package/src/security/InputValidator.ts +148 -91
- package/src/security/SecurityConfig.ts +94 -94
- package/src/server/ConnectionTester.ts +21 -15
- package/src/server/ToolRegistry.ts +64 -51
- package/src/server.ts +2 -2
- package/src/tools/BaseToolManager.ts +6 -6
- package/src/tools/auth.ts +42 -37
- package/src/tools/cache.ts +85 -81
- package/src/tools/comments.ts +93 -91
- package/src/tools/index.ts +10 -10
- package/src/tools/media.ts +89 -89
- package/src/tools/pages.ts +89 -87
- package/src/tools/performance.ts +443 -352
- package/src/tools/posts.ts +109 -107
- package/src/tools/site.ts +86 -77
- package/src/tools/taxonomies.ts +102 -102
- package/src/tools/users.ts +77 -77
- package/src/types/client.ts +157 -60
- package/src/types/index.ts +49 -27
- package/src/types/mcp.ts +15 -15
- package/src/types/wordpress.ts +57 -29
- package/src/utils/debug.ts +37 -37
- package/src/utils/error.ts +47 -25
- package/src/utils/toolWrapper.ts +12 -8
- package/src/utils/validation.ts +116 -65
- package/dist/client/WordPressClient.d.ts +0 -81
- package/dist/client/WordPressClient.d.ts.map +0 -1
- package/dist/client/WordPressClient.js +0 -354
- package/dist/client/WordPressClient.js.map +0 -1
- package/dist/performance/AnomalyDetector.d.ts +0 -63
- package/dist/performance/AnomalyDetector.d.ts.map +0 -1
- package/dist/performance/AnomalyDetector.js +0 -222
- package/dist/performance/AnomalyDetector.js.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.d.ts +0 -67
- package/dist/performance/BenchmarkAnalyzer.d.ts.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.js +0 -301
- package/dist/performance/BenchmarkAnalyzer.js.map +0 -1
- package/dist/performance/TrendAnalyzer.d.ts +0 -69
- package/dist/performance/TrendAnalyzer.d.ts.map +0 -1
- package/dist/performance/TrendAnalyzer.js +0 -203
- package/dist/performance/TrendAnalyzer.js.map +0 -1
- package/dist/tools/BaseToolClass.d.ts +0 -76
- package/dist/tools/BaseToolClass.d.ts.map +0 -1
- package/dist/tools/BaseToolClass.js +0 -104
- package/dist/tools/BaseToolClass.js.map +0 -1
- package/dist/tools/base.d.ts +0 -37
- package/dist/tools/base.d.ts.map +0 -1
- package/dist/tools/base.js +0 -60
- package/dist/tools/base.js.map +0 -1
- package/docs/user-guides/CLAUDE_DESKTOP_SETUP.md +0 -187
|
@@ -13,6 +13,7 @@ The performance monitoring system consists of three main components:
|
|
|
13
13
|
## 🚀 Key Features
|
|
14
14
|
|
|
15
15
|
### Real-Time Monitoring
|
|
16
|
+
|
|
16
17
|
- **Response Time Tracking**: Monitor API response times with percentile analysis (P50, P95, P99)
|
|
17
18
|
- **Error Rate Monitoring**: Track success/failure rates across all operations
|
|
18
19
|
- **Cache Performance**: Monitor cache hit rates, memory usage, and efficiency
|
|
@@ -20,12 +21,14 @@ The performance monitoring system consists of three main components:
|
|
|
20
21
|
- **Tool Usage Analytics**: Monitor which MCP tools are used most frequently
|
|
21
22
|
|
|
22
23
|
### Historical Analysis
|
|
24
|
+
|
|
23
25
|
- **Performance Trends**: Analyze performance changes over time
|
|
24
26
|
- **Predictive Analytics**: Forecast future performance based on historical data
|
|
25
27
|
- **Anomaly Detection**: Automatically detect unusual performance patterns
|
|
26
28
|
- **Benchmark Comparisons**: Compare against industry standards
|
|
27
29
|
|
|
28
30
|
### Intelligent Insights
|
|
31
|
+
|
|
29
32
|
- **Optimization Recommendations**: Get actionable suggestions for performance improvements
|
|
30
33
|
- **ROI Estimates**: Understand the impact of potential optimizations
|
|
31
34
|
- **Alert System**: Receive notifications for performance issues
|
|
@@ -36,6 +39,7 @@ The performance monitoring system consists of three main components:
|
|
|
36
39
|
The system provides 6 new MCP tools for performance management:
|
|
37
40
|
|
|
38
41
|
### 1. `wp_performance_stats`
|
|
42
|
+
|
|
39
43
|
Get real-time performance statistics and metrics.
|
|
40
44
|
|
|
41
45
|
```bash
|
|
@@ -50,11 +54,13 @@ wp_performance_stats --site=site1 --category=all
|
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
**Parameters:**
|
|
57
|
+
|
|
53
58
|
- `site` (optional): Specific site ID for multi-site setups
|
|
54
59
|
- `category`: `overview`, `requests`, `cache`, `system`, `tools`, `all` (default: `overview`)
|
|
55
60
|
- `format`: `summary`, `detailed`, `raw` (default: `summary`)
|
|
56
61
|
|
|
57
62
|
**Example Output:**
|
|
63
|
+
|
|
58
64
|
```json
|
|
59
65
|
{
|
|
60
66
|
"success": true,
|
|
@@ -73,6 +79,7 @@ wp_performance_stats --site=site1 --category=all
|
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
### 2. `wp_performance_history`
|
|
82
|
+
|
|
76
83
|
Get historical performance data and trend analysis.
|
|
77
84
|
|
|
78
85
|
```bash
|
|
@@ -87,12 +94,14 @@ wp_performance_history --timeframe=6h --includeTrends=true
|
|
|
87
94
|
```
|
|
88
95
|
|
|
89
96
|
**Parameters:**
|
|
97
|
+
|
|
90
98
|
- `site` (optional): Specific site ID
|
|
91
99
|
- `timeframe`: `1h`, `6h`, `12h`, `24h`, `7d` (default: `24h`)
|
|
92
100
|
- `metrics`: Array of specific metrics to include
|
|
93
101
|
- `includeTrends`: Include trend analysis (default: `true`)
|
|
94
102
|
|
|
95
103
|
### 3. `wp_performance_benchmark`
|
|
104
|
+
|
|
96
105
|
Compare current performance against industry benchmarks.
|
|
97
106
|
|
|
98
107
|
```bash
|
|
@@ -104,11 +113,13 @@ wp_performance_benchmark --category=response_time --includeRecommendations=true
|
|
|
104
113
|
```
|
|
105
114
|
|
|
106
115
|
**Parameters:**
|
|
116
|
+
|
|
107
117
|
- `site` (optional): Specific site ID
|
|
108
118
|
- `category`: `response_time`, `cache_performance`, `error_rate`, `system_resources`, `all`
|
|
109
119
|
- `includeRecommendations`: Include improvement suggestions (default: `true`)
|
|
110
120
|
|
|
111
121
|
**Example Output:**
|
|
122
|
+
|
|
112
123
|
```json
|
|
113
124
|
{
|
|
114
125
|
"benchmarks": [
|
|
@@ -131,6 +142,7 @@ wp_performance_benchmark --category=response_time --includeRecommendations=true
|
|
|
131
142
|
```
|
|
132
143
|
|
|
133
144
|
### 4. `wp_performance_alerts`
|
|
145
|
+
|
|
134
146
|
Get performance alerts and anomaly detection results.
|
|
135
147
|
|
|
136
148
|
```bash
|
|
@@ -145,6 +157,7 @@ wp_performance_alerts --category=cache --includeAnomalies=true
|
|
|
145
157
|
```
|
|
146
158
|
|
|
147
159
|
**Parameters:**
|
|
160
|
+
|
|
148
161
|
- `site` (optional): Specific site ID
|
|
149
162
|
- `severity`: `info`, `warning`, `error`, `critical`
|
|
150
163
|
- `category`: `performance`, `cache`, `system`, `wordpress`
|
|
@@ -152,6 +165,7 @@ wp_performance_alerts --category=cache --includeAnomalies=true
|
|
|
152
165
|
- `includeAnomalies`: Include detected anomalies (default: `true`)
|
|
153
166
|
|
|
154
167
|
### 5. `wp_performance_optimize`
|
|
168
|
+
|
|
155
169
|
Get optimization recommendations and insights.
|
|
156
170
|
|
|
157
171
|
```bash
|
|
@@ -166,6 +180,7 @@ wp_performance_optimize --priority=all --includePredictions=true
|
|
|
166
180
|
```
|
|
167
181
|
|
|
168
182
|
**Parameters:**
|
|
183
|
+
|
|
169
184
|
- `site` (optional): Specific site ID
|
|
170
185
|
- `focus`: `speed`, `reliability`, `efficiency`, `scaling` (default: `speed`)
|
|
171
186
|
- `priority`: `quick_wins`, `medium_term`, `long_term`, `all` (default: `all`)
|
|
@@ -173,6 +188,7 @@ wp_performance_optimize --priority=all --includePredictions=true
|
|
|
173
188
|
- `includePredictions`: Include performance predictions (default: `true`)
|
|
174
189
|
|
|
175
190
|
**Example Output:**
|
|
191
|
+
|
|
176
192
|
```json
|
|
177
193
|
{
|
|
178
194
|
"recommendations": [
|
|
@@ -195,6 +211,7 @@ wp_performance_optimize --priority=all --includePredictions=true
|
|
|
195
211
|
```
|
|
196
212
|
|
|
197
213
|
### 6. `wp_performance_export`
|
|
214
|
+
|
|
198
215
|
Export comprehensive performance report.
|
|
199
216
|
|
|
200
217
|
```bash
|
|
@@ -209,6 +226,7 @@ wp_performance_export --format=summary --includeAnalytics=true
|
|
|
209
226
|
```
|
|
210
227
|
|
|
211
228
|
**Parameters:**
|
|
229
|
+
|
|
212
230
|
- `site` (optional): Specific site ID
|
|
213
231
|
- `format`: `json`, `csv`, `summary` (default: `json`)
|
|
214
232
|
- `includeHistorical`: Include historical data (default: `true`)
|
|
@@ -218,12 +236,14 @@ wp_performance_export --format=summary --includeAnalytics=true
|
|
|
218
236
|
## 📊 Performance Metrics
|
|
219
237
|
|
|
220
238
|
### Response Time Metrics
|
|
239
|
+
|
|
221
240
|
- **Average Response Time**: Mean response time across all requests
|
|
222
241
|
- **Percentiles**: P50 (median), P95, P99 response times
|
|
223
242
|
- **Min/Max**: Fastest and slowest response times
|
|
224
243
|
- **Requests Per Second**: Request throughput rate
|
|
225
244
|
|
|
226
245
|
### Cache Performance Metrics
|
|
246
|
+
|
|
227
247
|
- **Hit Rate**: Percentage of requests served from cache
|
|
228
248
|
- **Cache Size**: Number of cached entries
|
|
229
249
|
- **Memory Usage**: Estimated memory consumption
|
|
@@ -231,12 +251,14 @@ wp_performance_export --format=summary --includeAnalytics=true
|
|
|
231
251
|
- **Cache Efficiency**: Overall cache performance rating
|
|
232
252
|
|
|
233
253
|
### System Metrics
|
|
254
|
+
|
|
234
255
|
- **Memory Usage**: Current memory consumption percentage
|
|
235
256
|
- **CPU Usage**: Estimated CPU utilization
|
|
236
257
|
- **Uptime**: System operational time
|
|
237
258
|
- **Active Connections**: Number of concurrent connections
|
|
238
259
|
|
|
239
260
|
### Tool Usage Metrics
|
|
261
|
+
|
|
240
262
|
- **Most Used Tool**: Tool with highest usage count
|
|
241
263
|
- **Tool Performance**: Response times and success rates per tool
|
|
242
264
|
- **Usage Distribution**: Frequency of tool usage
|
|
@@ -244,6 +266,7 @@ wp_performance_export --format=summary --includeAnalytics=true
|
|
|
244
266
|
## 🔍 Performance Analysis
|
|
245
267
|
|
|
246
268
|
### Trend Analysis
|
|
269
|
+
|
|
247
270
|
The system automatically analyzes performance trends using linear regression:
|
|
248
271
|
|
|
249
272
|
- **Direction**: `improving`, `declining`, or `stable`
|
|
@@ -252,6 +275,7 @@ The system automatically analyzes performance trends using linear regression:
|
|
|
252
275
|
- **Predictions**: Forecasted future values
|
|
253
276
|
|
|
254
277
|
### Anomaly Detection
|
|
278
|
+
|
|
255
279
|
Automatic detection of unusual performance patterns:
|
|
256
280
|
|
|
257
281
|
- **Z-Score Analysis**: Statistical deviation from normal patterns
|
|
@@ -260,6 +284,7 @@ Automatic detection of unusual performance patterns:
|
|
|
260
284
|
- **Possible Causes**: AI-generated suggestions for anomaly causes
|
|
261
285
|
|
|
262
286
|
### Benchmark Comparisons
|
|
287
|
+
|
|
263
288
|
Compare against industry standards:
|
|
264
289
|
|
|
265
290
|
- **Response Time**: `<200ms` (excellent), `200-500ms` (good), `500ms-1s` (average)
|
|
@@ -272,16 +297,19 @@ Compare against industry standards:
|
|
|
272
297
|
The performance monitoring system is deeply integrated with the intelligent caching system:
|
|
273
298
|
|
|
274
299
|
### Automatic Cache Metrics
|
|
300
|
+
|
|
275
301
|
- **Real-time cache statistics** from all registered cache managers
|
|
276
302
|
- **Site-specific cache isolation** for multi-site installations
|
|
277
303
|
- **Cache efficiency calculations** with performance impact analysis
|
|
278
304
|
|
|
279
305
|
### Cache Performance Insights
|
|
306
|
+
|
|
280
307
|
- **Cache warming recommendations** based on usage patterns
|
|
281
308
|
- **TTL optimization suggestions** for different data types
|
|
282
309
|
- **Memory optimization** recommendations
|
|
283
310
|
|
|
284
311
|
### Cache Management Integration
|
|
312
|
+
|
|
285
313
|
- Performance monitoring **automatically registers** with cache managers
|
|
286
314
|
- **Request interception** for transparent performance tracking
|
|
287
315
|
- **Cache invalidation tracking** for data consistency monitoring
|
|
@@ -289,12 +317,14 @@ The performance monitoring system is deeply integrated with the intelligent cach
|
|
|
289
317
|
## 🚨 Alert System
|
|
290
318
|
|
|
291
319
|
### Alert Types
|
|
320
|
+
|
|
292
321
|
- **Performance Degradation**: Response times exceeding thresholds
|
|
293
322
|
- **Error Rate Spikes**: Increased failure rates
|
|
294
323
|
- **Cache Performance Issues**: Low hit rates or high memory usage
|
|
295
324
|
- **System Resource Warnings**: High memory or CPU usage
|
|
296
325
|
|
|
297
326
|
### Alert Configuration
|
|
327
|
+
|
|
298
328
|
Configure alert thresholds in your monitoring setup:
|
|
299
329
|
|
|
300
330
|
```javascript
|
|
@@ -310,6 +340,7 @@ const monitor = new PerformanceMonitor({
|
|
|
310
340
|
```
|
|
311
341
|
|
|
312
342
|
### Alert Severity Levels
|
|
343
|
+
|
|
313
344
|
- **🔴 Critical**: Immediate attention required
|
|
314
345
|
- **🟠 Error**: Significant performance impact
|
|
315
346
|
- **🟡 Warning**: Performance degradation detected
|
|
@@ -318,31 +349,37 @@ const monitor = new PerformanceMonitor({
|
|
|
318
349
|
## 📈 Optimization Workflow
|
|
319
350
|
|
|
320
351
|
### 1. Monitor Current Performance
|
|
352
|
+
|
|
321
353
|
```bash
|
|
322
354
|
wp_performance_stats --format=detailed
|
|
323
355
|
```
|
|
324
356
|
|
|
325
357
|
### 2. Analyze Historical Trends
|
|
358
|
+
|
|
326
359
|
```bash
|
|
327
360
|
wp_performance_history --timeframe=7d --includeTrends=true
|
|
328
361
|
```
|
|
329
362
|
|
|
330
363
|
### 3. Compare Against Benchmarks
|
|
364
|
+
|
|
331
365
|
```bash
|
|
332
366
|
wp_performance_benchmark --includeRecommendations=true
|
|
333
367
|
```
|
|
334
368
|
|
|
335
369
|
### 4. Check for Alerts and Anomalies
|
|
370
|
+
|
|
336
371
|
```bash
|
|
337
372
|
wp_performance_alerts --includeAnomalies=true
|
|
338
373
|
```
|
|
339
374
|
|
|
340
375
|
### 5. Get Optimization Recommendations
|
|
376
|
+
|
|
341
377
|
```bash
|
|
342
378
|
wp_performance_optimize --focus=speed --includeROI=true
|
|
343
379
|
```
|
|
344
380
|
|
|
345
381
|
### 6. Export Comprehensive Report
|
|
382
|
+
|
|
346
383
|
```bash
|
|
347
384
|
wp_performance_export --format=json --includeAnalytics=true
|
|
348
385
|
```
|
|
@@ -350,6 +387,7 @@ wp_performance_export --format=json --includeAnalytics=true
|
|
|
350
387
|
## 🔧 Configuration
|
|
351
388
|
|
|
352
389
|
### Performance Monitor Configuration
|
|
390
|
+
|
|
353
391
|
```javascript
|
|
354
392
|
const config = {
|
|
355
393
|
collectInterval: 30000, // 30 seconds
|
|
@@ -368,6 +406,7 @@ const config = {
|
|
|
368
406
|
```
|
|
369
407
|
|
|
370
408
|
### Metrics Collector Configuration
|
|
409
|
+
|
|
371
410
|
```javascript
|
|
372
411
|
const config = {
|
|
373
412
|
enableRealTime: true,
|
|
@@ -380,6 +419,7 @@ const config = {
|
|
|
380
419
|
```
|
|
381
420
|
|
|
382
421
|
### Analytics Configuration
|
|
422
|
+
|
|
383
423
|
```javascript
|
|
384
424
|
const config = {
|
|
385
425
|
enablePredictiveAnalysis: true,
|
|
@@ -393,21 +433,25 @@ const config = {
|
|
|
393
433
|
## 🎯 Best Practices
|
|
394
434
|
|
|
395
435
|
### 1. Regular Monitoring
|
|
436
|
+
|
|
396
437
|
- Check performance stats daily with `wp_performance_stats`
|
|
397
438
|
- Review weekly trends with `wp_performance_history --timeframe=7d`
|
|
398
439
|
- Monitor alerts regularly with `wp_performance_alerts`
|
|
399
440
|
|
|
400
441
|
### 2. Proactive Optimization
|
|
442
|
+
|
|
401
443
|
- Implement quick wins from `wp_performance_optimize --priority=quick_wins`
|
|
402
444
|
- Address critical alerts immediately
|
|
403
445
|
- Follow benchmark recommendations
|
|
404
446
|
|
|
405
447
|
### 3. Data-Driven Decisions
|
|
448
|
+
|
|
406
449
|
- Use historical data to identify patterns
|
|
407
450
|
- Compare before/after optimization results
|
|
408
451
|
- Export reports for stakeholder communication
|
|
409
452
|
|
|
410
453
|
### 4. Multi-Site Management
|
|
454
|
+
|
|
411
455
|
- Monitor each site individually
|
|
412
456
|
- Compare performance across sites
|
|
413
457
|
- Implement site-specific optimizations
|
|
@@ -417,6 +461,7 @@ const config = {
|
|
|
417
461
|
### Common Issues
|
|
418
462
|
|
|
419
463
|
**1. High Response Times**
|
|
464
|
+
|
|
420
465
|
```bash
|
|
421
466
|
# Check current performance
|
|
422
467
|
wp_performance_stats --category=requests
|
|
@@ -426,6 +471,7 @@ wp_performance_optimize --focus=speed
|
|
|
426
471
|
```
|
|
427
472
|
|
|
428
473
|
**2. Low Cache Hit Rates**
|
|
474
|
+
|
|
429
475
|
```bash
|
|
430
476
|
# Check cache performance
|
|
431
477
|
wp_performance_stats --category=cache
|
|
@@ -435,6 +481,7 @@ wp_performance_optimize --focus=efficiency
|
|
|
435
481
|
```
|
|
436
482
|
|
|
437
483
|
**3. System Resource Issues**
|
|
484
|
+
|
|
438
485
|
```bash
|
|
439
486
|
# Check system metrics
|
|
440
487
|
wp_performance_stats --category=system
|
|
@@ -444,6 +491,7 @@ wp_performance_optimize --focus=scaling
|
|
|
444
491
|
```
|
|
445
492
|
|
|
446
493
|
### Performance Debugging
|
|
494
|
+
|
|
447
495
|
1. **Enable detailed logging** in development environments
|
|
448
496
|
2. **Use benchmark comparisons** to identify problem areas
|
|
449
497
|
3. **Monitor trends** to catch performance degradation early
|
|
@@ -468,4 +516,4 @@ To contribute to the performance monitoring system:
|
|
|
468
516
|
|
|
469
517
|
---
|
|
470
518
|
|
|
471
|
-
**🚀 The performance monitoring system helps you maintain optimal WordPress MCP server performance with real-time insights, intelligent analysis, and actionable recommendations.**
|
|
519
|
+
**🚀 The performance monitoring system helps you maintain optimal WordPress MCP server performance with real-time insights, intelligent analysis, and actionable recommendations.**
|
package/docs/SECURITY_TESTING.md
CHANGED
|
@@ -84,6 +84,7 @@ npm test tests/security/security-validation.test.js -- --grep "XSS"
|
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
**Covered Attack Vectors:**
|
|
87
|
+
|
|
87
88
|
- Script tag injection
|
|
88
89
|
- Event handler injection
|
|
89
90
|
- JavaScript URL schemes
|
|
@@ -91,6 +92,7 @@ npm test tests/security/security-validation.test.js -- --grep "XSS"
|
|
|
91
92
|
- HTML entity encoding
|
|
92
93
|
|
|
93
94
|
**Example Test:**
|
|
95
|
+
|
|
94
96
|
```javascript
|
|
95
97
|
test('should reject script tags in safe strings', () => {
|
|
96
98
|
const maliciousInput = 'Hello <script>alert("XSS")</script> World';
|
|
@@ -105,6 +107,7 @@ npm test tests/security/security-validation.test.js -- --grep "SQL"
|
|
|
105
107
|
```
|
|
106
108
|
|
|
107
109
|
**Covered Attack Vectors:**
|
|
110
|
+
|
|
108
111
|
- Union-based injection
|
|
109
112
|
- Boolean-based blind injection
|
|
110
113
|
- Time-based blind injection
|
|
@@ -112,6 +115,7 @@ npm test tests/security/security-validation.test.js -- --grep "SQL"
|
|
|
112
115
|
- Comment-based injection
|
|
113
116
|
|
|
114
117
|
**Example Test:**
|
|
118
|
+
|
|
115
119
|
```javascript
|
|
116
120
|
test('should reject SQL injection patterns', () => {
|
|
117
121
|
const maliciousQueries = [
|
|
@@ -133,6 +137,7 @@ npm test tests/security/security-validation.test.js -- --grep "Path"
|
|
|
133
137
|
```
|
|
134
138
|
|
|
135
139
|
**Covered Attack Vectors:**
|
|
140
|
+
|
|
136
141
|
- Directory traversal (../)
|
|
137
142
|
- Encoded path traversal
|
|
138
143
|
- Windows path traversal (..\\)
|
|
@@ -145,6 +150,7 @@ npm test tests/security/penetration-tests.test.js
|
|
|
145
150
|
```
|
|
146
151
|
|
|
147
152
|
**Comprehensive Attack Simulation:**
|
|
153
|
+
|
|
148
154
|
- Command injection attempts
|
|
149
155
|
- Authentication bypass
|
|
150
156
|
- Header injection
|
|
@@ -156,11 +162,13 @@ npm test tests/security/penetration-tests.test.js
|
|
|
156
162
|
### Adding Security to New Tools
|
|
157
163
|
|
|
158
164
|
1. **Import Security Framework:**
|
|
165
|
+
|
|
159
166
|
```typescript
|
|
160
167
|
import { validateSecurity, ToolSchemas } from '../security/InputValidator.js';
|
|
161
168
|
```
|
|
162
169
|
|
|
163
170
|
2. **Apply Validation Decorator:**
|
|
171
|
+
|
|
164
172
|
```typescript
|
|
165
173
|
export class MyTools {
|
|
166
174
|
@validateSecurity(ToolSchemas.postData)
|
|
@@ -171,6 +179,7 @@ export class MyTools {
|
|
|
171
179
|
```
|
|
172
180
|
|
|
173
181
|
3. **Custom Validation Schema:**
|
|
182
|
+
|
|
174
183
|
```typescript
|
|
175
184
|
const customSchema = z.object({
|
|
176
185
|
customField: SecuritySchemas.safeString,
|
|
@@ -217,11 +226,13 @@ async function toolMethod(params: any) {
|
|
|
217
226
|
## 🚨 Security Testing Commands
|
|
218
227
|
|
|
219
228
|
### Run All Security Tests
|
|
229
|
+
|
|
220
230
|
```bash
|
|
221
231
|
npm run test:security
|
|
222
232
|
```
|
|
223
233
|
|
|
224
234
|
### Run Specific Security Test Categories
|
|
235
|
+
|
|
225
236
|
```bash
|
|
226
237
|
# Input validation tests
|
|
227
238
|
npm test tests/security/security-validation.test.js
|
|
@@ -237,6 +248,7 @@ npm test -- --grep "SQL"
|
|
|
237
248
|
```
|
|
238
249
|
|
|
239
250
|
### Security Test Coverage
|
|
251
|
+
|
|
240
252
|
```bash
|
|
241
253
|
npm run test:coverage -- tests/security/
|
|
242
254
|
```
|
|
@@ -244,6 +256,7 @@ npm run test:coverage -- tests/security/
|
|
|
244
256
|
## 📊 Security Monitoring
|
|
245
257
|
|
|
246
258
|
### Error Logging
|
|
259
|
+
|
|
247
260
|
Security validation errors are automatically logged:
|
|
248
261
|
|
|
249
262
|
```typescript
|
|
@@ -260,6 +273,7 @@ Security validation errors are automatically logged:
|
|
|
260
273
|
```
|
|
261
274
|
|
|
262
275
|
### Rate Limiting Monitoring
|
|
276
|
+
|
|
263
277
|
```typescript
|
|
264
278
|
{
|
|
265
279
|
timestamp: "2024-01-01T00:00:00.000Z",
|
|
@@ -274,6 +288,7 @@ Security validation errors are automatically logged:
|
|
|
274
288
|
## 🔍 Security Audit Checklist
|
|
275
289
|
|
|
276
290
|
### ✅ Input Validation
|
|
291
|
+
|
|
277
292
|
- [ ] All user inputs validated with Zod schemas
|
|
278
293
|
- [ ] XSS protection on all text fields
|
|
279
294
|
- [ ] SQL injection protection on search/query fields
|
|
@@ -281,24 +296,28 @@ Security validation errors are automatically logged:
|
|
|
281
296
|
- [ ] Length limits enforced on all inputs
|
|
282
297
|
|
|
283
298
|
### ✅ Output Encoding
|
|
299
|
+
|
|
284
300
|
- [ ] HTML entities encoded in output
|
|
285
301
|
- [ ] JSON responses properly escaped
|
|
286
302
|
- [ ] Error messages sanitized
|
|
287
303
|
- [ ] Log entries do not contain sensitive data
|
|
288
304
|
|
|
289
305
|
### ✅ Authentication & Authorization
|
|
306
|
+
|
|
290
307
|
- [ ] Rate limiting implemented
|
|
291
308
|
- [ ] Secure password handling
|
|
292
309
|
- [ ] Session management (if applicable)
|
|
293
310
|
- [ ] Permission checks on all operations
|
|
294
311
|
|
|
295
312
|
### ✅ Error Handling
|
|
313
|
+
|
|
296
314
|
- [ ] Sensitive information not exposed in errors
|
|
297
315
|
- [ ] Consistent error response format
|
|
298
316
|
- [ ] Proper logging without data leakage
|
|
299
317
|
- [ ] Graceful handling of edge cases
|
|
300
318
|
|
|
301
319
|
### ✅ File Operations
|
|
320
|
+
|
|
302
321
|
- [ ] Upload restrictions enforced
|
|
303
322
|
- [ ] File type validation
|
|
304
323
|
- [ ] Size limits implemented
|
|
@@ -307,6 +326,7 @@ Security validation errors are automatically logged:
|
|
|
307
326
|
## 🛠️ Security Tools Integration
|
|
308
327
|
|
|
309
328
|
### ESLint Security Rules
|
|
329
|
+
|
|
310
330
|
```javascript
|
|
311
331
|
{
|
|
312
332
|
"extends": ["plugin:security/recommended"],
|
|
@@ -319,6 +339,7 @@ Security validation errors are automatically logged:
|
|
|
319
339
|
```
|
|
320
340
|
|
|
321
341
|
### Automated Security Scanning
|
|
342
|
+
|
|
322
343
|
```bash
|
|
323
344
|
# Add to package.json
|
|
324
345
|
{
|
|
@@ -331,6 +352,7 @@ Security validation errors are automatically logged:
|
|
|
331
352
|
```
|
|
332
353
|
|
|
333
354
|
### CI/CD Security Pipeline
|
|
355
|
+
|
|
334
356
|
```yaml
|
|
335
357
|
# GitHub Actions workflow
|
|
336
358
|
- name: Security Audit
|
|
@@ -343,18 +365,21 @@ Security validation errors are automatically logged:
|
|
|
343
365
|
## 📚 Best Practices
|
|
344
366
|
|
|
345
367
|
### Input Validation Best Practices
|
|
368
|
+
|
|
346
369
|
1. **Validate Early**: Check inputs at the entry point
|
|
347
370
|
2. **Use Allow Lists**: Define what is allowed, not what is blocked
|
|
348
371
|
3. **Sanitize and Validate**: Both sanitize and validate inputs
|
|
349
372
|
4. **Fail Securely**: Default to rejecting invalid input
|
|
350
373
|
|
|
351
374
|
### Error Handling Best Practices
|
|
375
|
+
|
|
352
376
|
1. **Generic Error Messages**: Don't expose implementation details
|
|
353
377
|
2. **Log Detailed Errors**: Log full details for debugging (securely)
|
|
354
378
|
3. **Rate Limit Errors**: Prevent information gathering
|
|
355
379
|
4. **Sanitize Stack Traces**: Remove sensitive information
|
|
356
380
|
|
|
357
381
|
### Security Testing Best Practices
|
|
382
|
+
|
|
358
383
|
1. **Test All Input Vectors**: Every parameter that accepts user input
|
|
359
384
|
2. **Use Real Attack Payloads**: Test with actual malicious inputs
|
|
360
385
|
3. **Automate Security Tests**: Include in CI/CD pipeline
|
|
@@ -363,12 +388,14 @@ Security validation errors are automatically logged:
|
|
|
363
388
|
## 🚀 Continuous Security
|
|
364
389
|
|
|
365
390
|
### Regular Security Updates
|
|
391
|
+
|
|
366
392
|
- Monthly dependency audits
|
|
367
393
|
- Quarterly penetration testing
|
|
368
394
|
- Annual security architecture review
|
|
369
395
|
- Continuous monitoring and alerting
|
|
370
396
|
|
|
371
397
|
### Security Metrics
|
|
398
|
+
|
|
372
399
|
- Number of blocked malicious requests
|
|
373
400
|
- Rate limiting effectiveness
|
|
374
401
|
- Input validation error rates
|
|
@@ -377,12 +404,14 @@ Security validation errors are automatically logged:
|
|
|
377
404
|
## 📞 Security Incident Response
|
|
378
405
|
|
|
379
406
|
### If You Discover a Vulnerability
|
|
407
|
+
|
|
380
408
|
1. **Do Not** create a public issue
|
|
381
409
|
2. **Do** email security concerns privately
|
|
382
410
|
3. **Include** steps to reproduce
|
|
383
411
|
4. **Provide** impact assessment if possible
|
|
384
412
|
|
|
385
413
|
### Response Timeline
|
|
414
|
+
|
|
386
415
|
- **24 hours**: Initial acknowledgment
|
|
387
416
|
- **72 hours**: Preliminary assessment
|
|
388
417
|
- **7 days**: Fix development and testing
|
|
@@ -390,4 +419,4 @@ Security validation errors are automatically logged:
|
|
|
390
419
|
|
|
391
420
|
---
|
|
392
421
|
|
|
393
|
-
**🔒 Security is a shared responsibility - implement, test, and monitor continuously!**
|
|
422
|
+
**🔒 Security is a shared responsibility - implement, test, and monitor continuously!**
|
package/docs/api/README.md
CHANGED
|
@@ -11,12 +11,20 @@
|
|
|
11
11
|
|
|
12
12
|
The WordPress MCP Server provides **59 tools** across **10 categories** for comprehensive WordPress management through the Model Context Protocol.
|
|
13
13
|
|
|
14
|
-
**Last Updated:**
|
|
14
|
+
**Last Updated:** 3.7.2025
|
|
15
15
|
**Version:** 1.2.0
|
|
16
16
|
**Coverage:** 59/59 tools with examples
|
|
17
17
|
|
|
18
18
|
## Quick Start
|
|
19
19
|
|
|
20
|
+
**First, install and configure the MCP WordPress server:**
|
|
21
|
+
|
|
22
|
+
📖 **Setup Guides:**
|
|
23
|
+
- **[NPX Setup](../user-guides/NPX_SETUP.md)** - Zero installation method (recommended)
|
|
24
|
+
- **[NPM Setup](../user-guides/NPM_SETUP.md)** - Local development
|
|
25
|
+
- **[Docker Setup](../user-guides/DOCKER_SETUP.md)** - Containerized deployment
|
|
26
|
+
- **[DTX Setup](../user-guides/DTX_SETUP.md)** - Desktop Extension package
|
|
27
|
+
|
|
20
28
|
### Basic Usage
|
|
21
29
|
```bash
|
|
22
30
|
# List all posts
|