mcp-wordpress 1.1.7 → 1.2.2
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 +388 -66
- package/dist/cache/CacheInvalidation.d.ts +118 -0
- package/dist/cache/CacheInvalidation.d.ts.map +1 -0
- package/dist/cache/CacheInvalidation.js +349 -0
- package/dist/cache/CacheInvalidation.js.map +1 -0
- package/dist/cache/CacheManager.d.ts +143 -0
- package/dist/cache/CacheManager.d.ts.map +1 -0
- package/dist/cache/CacheManager.js +308 -0
- package/dist/cache/CacheManager.js.map +1 -0
- package/dist/cache/HttpCacheWrapper.d.ts +121 -0
- package/dist/cache/HttpCacheWrapper.d.ts.map +1 -0
- package/dist/cache/HttpCacheWrapper.js +280 -0
- package/dist/cache/HttpCacheWrapper.js.map +1 -0
- package/dist/cache/__tests__/CacheInvalidation.test.d.ts +5 -0
- package/dist/cache/__tests__/CacheInvalidation.test.d.ts.map +1 -0
- package/dist/cache/__tests__/CacheInvalidation.test.js +236 -0
- package/dist/cache/__tests__/CacheInvalidation.test.js.map +1 -0
- package/dist/cache/__tests__/CacheManager.test.d.ts +5 -0
- package/dist/cache/__tests__/CacheManager.test.d.ts.map +1 -0
- package/dist/cache/__tests__/CacheManager.test.js +233 -0
- package/dist/cache/__tests__/CacheManager.test.js.map +1 -0
- package/dist/cache/__tests__/CachedWordPressClient.test.d.ts +5 -0
- package/dist/cache/__tests__/CachedWordPressClient.test.d.ts.map +1 -0
- package/dist/cache/__tests__/CachedWordPressClient.test.js +228 -0
- package/dist/cache/__tests__/CachedWordPressClient.test.js.map +1 -0
- package/dist/cache/__tests__/HttpCacheWrapper.test.d.ts +5 -0
- package/dist/cache/__tests__/HttpCacheWrapper.test.d.ts.map +1 -0
- package/dist/cache/__tests__/HttpCacheWrapper.test.js +296 -0
- package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +1 -0
- package/dist/cache/index.d.ts +12 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +9 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/client/CachedWordPressClient.d.ts +160 -0
- package/dist/client/CachedWordPressClient.d.ts.map +1 -0
- package/dist/client/CachedWordPressClient.js +338 -0
- package/dist/client/CachedWordPressClient.js.map +1 -0
- package/dist/client/WordPressClient.d.ts +81 -0
- package/dist/client/WordPressClient.d.ts.map +1 -0
- package/dist/client/WordPressClient.js +354 -0
- package/dist/client/WordPressClient.js.map +1 -0
- package/dist/config/ConfigurationSchema.d.ts +281 -0
- package/dist/config/ConfigurationSchema.d.ts.map +1 -0
- package/dist/config/ConfigurationSchema.js +205 -0
- package/dist/config/ConfigurationSchema.js.map +1 -0
- package/dist/config/ServerConfiguration.d.ts +38 -0
- package/dist/config/ServerConfiguration.d.ts.map +1 -0
- package/dist/config/ServerConfiguration.js +158 -0
- package/dist/config/ServerConfiguration.js.map +1 -0
- package/dist/docs/DocumentationGenerator.d.ts +184 -0
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -0
- package/dist/docs/DocumentationGenerator.js +735 -0
- package/dist/docs/DocumentationGenerator.js.map +1 -0
- package/dist/docs/MarkdownFormatter.d.ts +84 -0
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -0
- package/dist/docs/MarkdownFormatter.js +448 -0
- package/dist/docs/MarkdownFormatter.js.map +1 -0
- package/dist/docs/index.d.ts +8 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +7 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -212
- package/dist/index.js.map +1 -1
- package/dist/performance/AnomalyDetector.d.ts +63 -0
- package/dist/performance/AnomalyDetector.d.ts.map +1 -0
- package/dist/performance/AnomalyDetector.js +222 -0
- package/dist/performance/AnomalyDetector.js.map +1 -0
- package/dist/performance/BenchmarkAnalyzer.d.ts +67 -0
- package/dist/performance/BenchmarkAnalyzer.d.ts.map +1 -0
- package/dist/performance/BenchmarkAnalyzer.js +301 -0
- package/dist/performance/BenchmarkAnalyzer.js.map +1 -0
- package/dist/performance/MetricsCollector.d.ts +139 -0
- package/dist/performance/MetricsCollector.d.ts.map +1 -0
- package/dist/performance/MetricsCollector.js +320 -0
- package/dist/performance/MetricsCollector.js.map +1 -0
- package/dist/performance/PerformanceAnalytics.d.ts +162 -0
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -0
- package/dist/performance/PerformanceAnalytics.js +554 -0
- package/dist/performance/PerformanceAnalytics.js.map +1 -0
- package/dist/performance/PerformanceMonitor.d.ts +202 -0
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -0
- package/dist/performance/PerformanceMonitor.js +478 -0
- package/dist/performance/PerformanceMonitor.js.map +1 -0
- package/dist/performance/TrendAnalyzer.d.ts +69 -0
- package/dist/performance/TrendAnalyzer.d.ts.map +1 -0
- package/dist/performance/TrendAnalyzer.js +203 -0
- package/dist/performance/TrendAnalyzer.js.map +1 -0
- package/dist/performance/index.d.ts +11 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +8 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/security/InputValidator.d.ts +215 -0
- package/dist/security/InputValidator.d.ts.map +1 -0
- package/dist/security/InputValidator.js +278 -0
- package/dist/security/InputValidator.js.map +1 -0
- package/dist/security/SecurityConfig.d.ts +129 -0
- package/dist/security/SecurityConfig.d.ts.map +1 -0
- package/dist/security/SecurityConfig.js +262 -0
- package/dist/security/SecurityConfig.js.map +1 -0
- package/dist/server/ConnectionTester.d.ts +24 -0
- package/dist/server/ConnectionTester.d.ts.map +1 -0
- package/dist/server/ConnectionTester.js +61 -0
- package/dist/server/ConnectionTester.js.map +1 -0
- package/dist/server/ToolRegistry.d.ts +46 -0
- package/dist/server/ToolRegistry.d.ts.map +1 -0
- package/dist/server/ToolRegistry.js +148 -0
- package/dist/server/ToolRegistry.js.map +1 -0
- package/dist/tools/BaseToolClass.d.ts +76 -0
- package/dist/tools/BaseToolClass.d.ts.map +1 -0
- package/dist/tools/BaseToolClass.js +104 -0
- package/dist/tools/BaseToolClass.js.map +1 -0
- package/dist/tools/BaseToolManager.d.ts +26 -0
- package/dist/tools/BaseToolManager.d.ts.map +1 -0
- package/dist/tools/BaseToolManager.js +56 -0
- package/dist/tools/BaseToolManager.js.map +1 -0
- package/dist/tools/base.d.ts +37 -0
- package/dist/tools/base.d.ts.map +1 -0
- package/dist/tools/base.js +60 -0
- package/dist/tools/base.js.map +1 -0
- package/dist/tools/cache.d.ts +260 -0
- package/dist/tools/cache.d.ts.map +1 -0
- package/dist/tools/cache.js +237 -0
- package/dist/tools/cache.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/performance.d.ts +63 -0
- package/dist/tools/performance.d.ts.map +1 -0
- package/dist/tools/performance.js +865 -0
- package/dist/tools/performance.js.map +1 -0
- package/dist/types/client.d.ts +1 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js.map +1 -1
- package/dist/utils/toolWrapper.d.ts +4 -0
- package/dist/utils/toolWrapper.d.ts.map +1 -1
- package/dist/utils/toolWrapper.js +11 -0
- package/dist/utils/toolWrapper.js.map +1 -1
- package/dist/utils/validation.d.ts +68 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +185 -0
- package/dist/utils/validation.js.map +1 -0
- package/docs/CACHING.md +340 -0
- package/docs/DOCKER.md +451 -0
- package/docs/PERFORMANCE_MONITORING.md +471 -0
- package/docs/SECURITY_TESTING.md +393 -0
- package/docs/api/README.md +200 -0
- package/docs/api/categories/auth.md +40 -0
- package/docs/api/categories/cache.md +41 -0
- package/docs/api/categories/comment.md +44 -0
- package/docs/api/categories/media.md +43 -0
- package/docs/api/categories/page.md +43 -0
- package/docs/api/categories/performance.md +44 -0
- package/docs/api/categories/post.md +43 -0
- package/docs/api/categories/site.md +43 -0
- package/docs/api/categories/taxonomy.md +47 -0
- package/docs/api/categories/user.md +43 -0
- package/docs/api/openapi.json +3305 -0
- package/docs/api/summary.json +12 -0
- package/docs/api/tools/wp_approve_comment.md +98 -0
- package/docs/api/tools/wp_cache_clear.md +120 -0
- package/docs/api/tools/wp_cache_info.md +119 -0
- package/docs/api/tools/wp_cache_stats.md +119 -0
- package/docs/api/tools/wp_cache_warm.md +119 -0
- package/docs/api/tools/wp_create_application_password.md +102 -0
- package/docs/api/tools/wp_create_category.md +102 -0
- package/docs/api/tools/wp_create_comment.md +128 -0
- package/docs/api/tools/wp_create_page.md +135 -0
- package/docs/api/tools/wp_create_post.md +147 -0
- package/docs/api/tools/wp_create_tag.md +101 -0
- package/docs/api/tools/wp_create_user.md +135 -0
- package/docs/api/tools/wp_delete_application_password.md +101 -0
- package/docs/api/tools/wp_delete_category.md +100 -0
- package/docs/api/tools/wp_delete_comment.md +101 -0
- package/docs/api/tools/wp_delete_media.md +108 -0
- package/docs/api/tools/wp_delete_page.md +108 -0
- package/docs/api/tools/wp_delete_post.md +117 -0
- package/docs/api/tools/wp_delete_tag.md +100 -0
- package/docs/api/tools/wp_delete_user.md +108 -0
- package/docs/api/tools/wp_get_application_passwords.md +103 -0
- package/docs/api/tools/wp_get_auth_status.md +101 -0
- package/docs/api/tools/wp_get_category.md +103 -0
- package/docs/api/tools/wp_get_comment.md +103 -0
- package/docs/api/tools/wp_get_current_user.md +101 -0
- package/docs/api/tools/wp_get_media.md +103 -0
- package/docs/api/tools/wp_get_page.md +103 -0
- package/docs/api/tools/wp_get_page_revisions.md +103 -0
- package/docs/api/tools/wp_get_post.md +112 -0
- package/docs/api/tools/wp_get_post_revisions.md +103 -0
- package/docs/api/tools/wp_get_site_settings.md +108 -0
- package/docs/api/tools/wp_get_tag.md +103 -0
- package/docs/api/tools/wp_get_user.md +103 -0
- package/docs/api/tools/wp_list_categories.md +111 -0
- package/docs/api/tools/wp_list_comments.md +111 -0
- package/docs/api/tools/wp_list_media.md +145 -0
- package/docs/api/tools/wp_list_pages.md +145 -0
- package/docs/api/tools/wp_list_posts.md +156 -0
- package/docs/api/tools/wp_list_tags.md +110 -0
- package/docs/api/tools/wp_list_users.md +111 -0
- package/docs/api/tools/wp_performance_alerts.md +162 -0
- package/docs/api/tools/wp_performance_benchmark.md +160 -0
- package/docs/api/tools/wp_performance_export.md +162 -0
- package/docs/api/tools/wp_performance_history.md +161 -0
- package/docs/api/tools/wp_performance_optimize.md +162 -0
- package/docs/api/tools/wp_performance_stats.md +160 -0
- package/docs/api/tools/wp_search_site.md +99 -0
- package/docs/api/tools/wp_spam_comment.md +98 -0
- package/docs/api/tools/wp_switch_auth_method.md +122 -0
- package/docs/api/tools/wp_test_auth.md +96 -0
- package/docs/api/tools/wp_update_category.md +102 -0
- package/docs/api/tools/wp_update_comment.md +127 -0
- package/docs/api/tools/wp_update_media.md +129 -0
- package/docs/api/tools/wp_update_page.md +135 -0
- package/docs/api/tools/wp_update_post.md +144 -0
- package/docs/api/tools/wp_update_site_settings.md +127 -0
- package/docs/api/tools/wp_update_tag.md +102 -0
- package/docs/api/tools/wp_update_user.md +134 -0
- package/docs/api/tools/wp_upload_media.md +131 -0
- package/docs/api/types/WordPressPost.md +39 -0
- package/docs/contract-testing.md +183 -0
- package/docs/developer/NPM_AUTH_SETUP.md +3 -3
- package/docs/wordpress-rest-api-authentication-troubleshooting.md +218 -0
- package/package.json +84 -64
- package/src/cache/CacheInvalidation.ts +421 -0
- package/src/cache/CacheManager.ts +391 -0
- package/src/cache/HttpCacheWrapper.ts +372 -0
- package/src/cache/__tests__/CacheInvalidation.test.ts +299 -0
- package/src/cache/__tests__/CacheManager.test.ts +300 -0
- package/src/cache/__tests__/CachedWordPressClient.test.ts +304 -0
- package/src/cache/__tests__/HttpCacheWrapper.test.ts +359 -0
- package/src/cache/index.ts +26 -0
- package/src/client/CachedWordPressClient.ts +442 -0
- package/src/config/ConfigurationSchema.ts +246 -0
- package/src/config/ServerConfiguration.ts +215 -0
- package/src/docs/DocumentationGenerator.ts +952 -0
- package/src/docs/MarkdownFormatter.ts +494 -0
- package/src/docs/index.ts +21 -0
- package/src/index.ts +14 -274
- package/src/performance/MetricsCollector.ts +447 -0
- package/src/performance/PerformanceAnalytics.ts +762 -0
- package/src/performance/PerformanceMonitor.ts +649 -0
- package/src/performance/index.ts +28 -0
- package/src/security/InputValidator.ts +319 -0
- package/src/security/SecurityConfig.ts +301 -0
- package/src/server/ConnectionTester.ts +74 -0
- package/src/server/ToolRegistry.ts +194 -0
- package/src/tools/BaseToolManager.ts +66 -0
- package/src/tools/cache.ts +259 -0
- package/src/tools/index.ts +2 -0
- package/src/tools/performance.ts +948 -0
- package/src/types/client.ts +1 -0
- package/src/utils/toolWrapper.ts +11 -0
- package/src/utils/validation.ts +259 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
# Security Testing Guide
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
This guide covers the comprehensive security testing and validation framework implemented in the MCP WordPress Server.
|
|
8
|
+
|
|
9
|
+
## 🔒 Security Framework Overview
|
|
10
|
+
|
|
11
|
+
### Core Security Components
|
|
12
|
+
|
|
13
|
+
1. **Input Validation** (`src/security/InputValidator.ts`)
|
|
14
|
+
- Zod-based schema validation
|
|
15
|
+
- XSS protection patterns
|
|
16
|
+
- SQL injection prevention
|
|
17
|
+
- Path traversal protection
|
|
18
|
+
|
|
19
|
+
2. **Rate Limiting** (`SecurityLimiter` class)
|
|
20
|
+
- Request throttling per user/IP
|
|
21
|
+
- DoS attack prevention
|
|
22
|
+
- Automatic cleanup of expired entries
|
|
23
|
+
|
|
24
|
+
3. **Input Sanitization** (`InputSanitizer` class)
|
|
25
|
+
- HTML content sanitization
|
|
26
|
+
- Search query cleaning
|
|
27
|
+
- File path normalization
|
|
28
|
+
- Output encoding for safe display
|
|
29
|
+
|
|
30
|
+
4. **Security Testing** (`tests/security/`)
|
|
31
|
+
- Comprehensive vulnerability tests
|
|
32
|
+
- Penetration testing scenarios
|
|
33
|
+
- Edge case validation
|
|
34
|
+
|
|
35
|
+
## 🛡️ Validation Schemas
|
|
36
|
+
|
|
37
|
+
### Core Security Schemas
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// Safe string validation (XSS protection)
|
|
41
|
+
SecuritySchemas.safeString
|
|
42
|
+
.max(10000)
|
|
43
|
+
.refine(val => !SCRIPT_PATTERN.test(val))
|
|
44
|
+
.refine(val => !val.includes('javascript:'))
|
|
45
|
+
|
|
46
|
+
// URL validation
|
|
47
|
+
SecuritySchemas.url
|
|
48
|
+
.url()
|
|
49
|
+
.regex(URL_PATTERN)
|
|
50
|
+
.refine(val => !val.includes('javascript:'))
|
|
51
|
+
|
|
52
|
+
// Search query validation (SQL injection protection)
|
|
53
|
+
SecuritySchemas.searchQuery
|
|
54
|
+
.max(500)
|
|
55
|
+
.refine(val => !SQL_INJECTION_PATTERN.test(val))
|
|
56
|
+
.refine(val => !val.includes('--'))
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Tool-Specific Schemas
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// Post creation validation
|
|
63
|
+
ToolSchemas.postData = z.object({
|
|
64
|
+
site: SecuritySchemas.siteId.optional(),
|
|
65
|
+
title: SecuritySchemas.safeString.optional(),
|
|
66
|
+
content: SecuritySchemas.wpContent.optional(),
|
|
67
|
+
status: z.enum(['publish', 'draft', 'private', 'pending']).optional()
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// User management validation
|
|
71
|
+
ToolSchemas.userData = z.object({
|
|
72
|
+
username: SecuritySchemas.slug,
|
|
73
|
+
email: SecuritySchemas.email,
|
|
74
|
+
password: SecuritySchemas.safeString.optional()
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 🧪 Security Tests
|
|
79
|
+
|
|
80
|
+
### 1. XSS Protection Tests
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm test tests/security/security-validation.test.js -- --grep "XSS"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Covered Attack Vectors:**
|
|
87
|
+
- Script tag injection
|
|
88
|
+
- Event handler injection
|
|
89
|
+
- JavaScript URL schemes
|
|
90
|
+
- Data URL schemes
|
|
91
|
+
- HTML entity encoding
|
|
92
|
+
|
|
93
|
+
**Example Test:**
|
|
94
|
+
```javascript
|
|
95
|
+
test('should reject script tags in safe strings', () => {
|
|
96
|
+
const maliciousInput = 'Hello <script>alert("XSS")</script> World';
|
|
97
|
+
expect(() => SecuritySchemas.safeString.parse(maliciousInput)).toThrow();
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 2. SQL Injection Protection Tests
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm test tests/security/security-validation.test.js -- --grep "SQL"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Covered Attack Vectors:**
|
|
108
|
+
- Union-based injection
|
|
109
|
+
- Boolean-based blind injection
|
|
110
|
+
- Time-based blind injection
|
|
111
|
+
- Error-based injection
|
|
112
|
+
- Comment-based injection
|
|
113
|
+
|
|
114
|
+
**Example Test:**
|
|
115
|
+
```javascript
|
|
116
|
+
test('should reject SQL injection patterns', () => {
|
|
117
|
+
const maliciousQueries = [
|
|
118
|
+
"'; DROP TABLE wp_posts; --",
|
|
119
|
+
"1' OR '1'='1",
|
|
120
|
+
"admin'--"
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
maliciousQueries.forEach(query => {
|
|
124
|
+
expect(() => SecuritySchemas.searchQuery.parse(query)).toThrow();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 3. Path Traversal Protection Tests
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm test tests/security/security-validation.test.js -- --grep "Path"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Covered Attack Vectors:**
|
|
136
|
+
- Directory traversal (../)
|
|
137
|
+
- Encoded path traversal
|
|
138
|
+
- Windows path traversal (..\\)
|
|
139
|
+
- Absolute path injection
|
|
140
|
+
|
|
141
|
+
### 4. Penetration Testing Suite
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm test tests/security/penetration-tests.test.js
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Comprehensive Attack Simulation:**
|
|
148
|
+
- Command injection attempts
|
|
149
|
+
- Authentication bypass
|
|
150
|
+
- Header injection
|
|
151
|
+
- Rate limiting bypass
|
|
152
|
+
- Large payload attacks
|
|
153
|
+
|
|
154
|
+
## 🔧 Implementation Guide
|
|
155
|
+
|
|
156
|
+
### Adding Security to New Tools
|
|
157
|
+
|
|
158
|
+
1. **Import Security Framework:**
|
|
159
|
+
```typescript
|
|
160
|
+
import { validateSecurity, ToolSchemas } from '../security/InputValidator.js';
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
2. **Apply Validation Decorator:**
|
|
164
|
+
```typescript
|
|
165
|
+
export class MyTools {
|
|
166
|
+
@validateSecurity(ToolSchemas.postData)
|
|
167
|
+
async createPost(params: any): Promise<any> {
|
|
168
|
+
// Tool implementation
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
3. **Custom Validation Schema:**
|
|
174
|
+
```typescript
|
|
175
|
+
const customSchema = z.object({
|
|
176
|
+
customField: SecuritySchemas.safeString,
|
|
177
|
+
numericField: SecuritySchemas.wpId
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
@validateSecurity(customSchema)
|
|
181
|
+
async customTool(params: any) {
|
|
182
|
+
// Implementation
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Manual Input Sanitization
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { InputSanitizer } from '../security/InputValidator.js';
|
|
190
|
+
|
|
191
|
+
// Sanitize HTML content
|
|
192
|
+
const safeHtml = InputSanitizer.sanitizeHtml(userInput);
|
|
193
|
+
|
|
194
|
+
// Sanitize search queries
|
|
195
|
+
const safeQuery = InputSanitizer.sanitizeSearchQuery(searchInput);
|
|
196
|
+
|
|
197
|
+
// Encode output for display
|
|
198
|
+
const safeOutput = InputSanitizer.encodeOutput(userContent);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Rate Limiting Integration
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import { SecurityLimiter } from '../security/InputValidator.js';
|
|
205
|
+
|
|
206
|
+
async function toolMethod(params: any) {
|
|
207
|
+
const userId = params.userId || 'anonymous';
|
|
208
|
+
|
|
209
|
+
if (!SecurityLimiter.checkRateLimit(userId)) {
|
|
210
|
+
throw new Error('Rate limit exceeded. Please try again later.');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Continue with tool logic
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## 🚨 Security Testing Commands
|
|
218
|
+
|
|
219
|
+
### Run All Security Tests
|
|
220
|
+
```bash
|
|
221
|
+
npm run test:security
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Run Specific Security Test Categories
|
|
225
|
+
```bash
|
|
226
|
+
# Input validation tests
|
|
227
|
+
npm test tests/security/security-validation.test.js
|
|
228
|
+
|
|
229
|
+
# Penetration testing
|
|
230
|
+
npm test tests/security/penetration-tests.test.js
|
|
231
|
+
|
|
232
|
+
# XSS protection only
|
|
233
|
+
npm test -- --grep "XSS"
|
|
234
|
+
|
|
235
|
+
# SQL injection protection only
|
|
236
|
+
npm test -- --grep "SQL"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Security Test Coverage
|
|
240
|
+
```bash
|
|
241
|
+
npm run test:coverage -- tests/security/
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## 📊 Security Monitoring
|
|
245
|
+
|
|
246
|
+
### Error Logging
|
|
247
|
+
Security validation errors are automatically logged:
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
{
|
|
251
|
+
timestamp: "2024-01-01T00:00:00.000Z",
|
|
252
|
+
level: "error",
|
|
253
|
+
method: "wp_create_post",
|
|
254
|
+
error: "Security validation failed",
|
|
255
|
+
details: {
|
|
256
|
+
field: "title",
|
|
257
|
+
violation: "Script tags not allowed"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Rate Limiting Monitoring
|
|
263
|
+
```typescript
|
|
264
|
+
{
|
|
265
|
+
timestamp: "2024-01-01T00:00:00.000Z",
|
|
266
|
+
level: "warning",
|
|
267
|
+
event: "rate_limit_exceeded",
|
|
268
|
+
userId: "user123",
|
|
269
|
+
requestCount: 1001,
|
|
270
|
+
windowMs: 60000
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## 🔍 Security Audit Checklist
|
|
275
|
+
|
|
276
|
+
### ✅ Input Validation
|
|
277
|
+
- [ ] All user inputs validated with Zod schemas
|
|
278
|
+
- [ ] XSS protection on all text fields
|
|
279
|
+
- [ ] SQL injection protection on search/query fields
|
|
280
|
+
- [ ] Path traversal protection on file operations
|
|
281
|
+
- [ ] Length limits enforced on all inputs
|
|
282
|
+
|
|
283
|
+
### ✅ Output Encoding
|
|
284
|
+
- [ ] HTML entities encoded in output
|
|
285
|
+
- [ ] JSON responses properly escaped
|
|
286
|
+
- [ ] Error messages sanitized
|
|
287
|
+
- [ ] Log entries do not contain sensitive data
|
|
288
|
+
|
|
289
|
+
### ✅ Authentication & Authorization
|
|
290
|
+
- [ ] Rate limiting implemented
|
|
291
|
+
- [ ] Secure password handling
|
|
292
|
+
- [ ] Session management (if applicable)
|
|
293
|
+
- [ ] Permission checks on all operations
|
|
294
|
+
|
|
295
|
+
### ✅ Error Handling
|
|
296
|
+
- [ ] Sensitive information not exposed in errors
|
|
297
|
+
- [ ] Consistent error response format
|
|
298
|
+
- [ ] Proper logging without data leakage
|
|
299
|
+
- [ ] Graceful handling of edge cases
|
|
300
|
+
|
|
301
|
+
### ✅ File Operations
|
|
302
|
+
- [ ] Upload restrictions enforced
|
|
303
|
+
- [ ] File type validation
|
|
304
|
+
- [ ] Size limits implemented
|
|
305
|
+
- [ ] Path sanitization applied
|
|
306
|
+
|
|
307
|
+
## 🛠️ Security Tools Integration
|
|
308
|
+
|
|
309
|
+
### ESLint Security Rules
|
|
310
|
+
```javascript
|
|
311
|
+
{
|
|
312
|
+
"extends": ["plugin:security/recommended"],
|
|
313
|
+
"rules": {
|
|
314
|
+
"security/detect-sql-injection": "error",
|
|
315
|
+
"security/detect-unsafe-regex": "error",
|
|
316
|
+
"security/detect-buffer-noassert": "error"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Automated Security Scanning
|
|
322
|
+
```bash
|
|
323
|
+
# Add to package.json
|
|
324
|
+
{
|
|
325
|
+
"scripts": {
|
|
326
|
+
"security:audit": "npm audit --production",
|
|
327
|
+
"security:scan": "node scripts/security-check.js",
|
|
328
|
+
"security:fix": "npm audit fix"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### CI/CD Security Pipeline
|
|
334
|
+
```yaml
|
|
335
|
+
# GitHub Actions workflow
|
|
336
|
+
- name: Security Audit
|
|
337
|
+
run: |
|
|
338
|
+
npm audit --audit-level moderate
|
|
339
|
+
npm run test:security
|
|
340
|
+
npm run security:scan
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## 📚 Best Practices
|
|
344
|
+
|
|
345
|
+
### Input Validation Best Practices
|
|
346
|
+
1. **Validate Early**: Check inputs at the entry point
|
|
347
|
+
2. **Use Allow Lists**: Define what is allowed, not what is blocked
|
|
348
|
+
3. **Sanitize and Validate**: Both sanitize and validate inputs
|
|
349
|
+
4. **Fail Securely**: Default to rejecting invalid input
|
|
350
|
+
|
|
351
|
+
### Error Handling Best Practices
|
|
352
|
+
1. **Generic Error Messages**: Don't expose implementation details
|
|
353
|
+
2. **Log Detailed Errors**: Log full details for debugging (securely)
|
|
354
|
+
3. **Rate Limit Errors**: Prevent information gathering
|
|
355
|
+
4. **Sanitize Stack Traces**: Remove sensitive information
|
|
356
|
+
|
|
357
|
+
### Security Testing Best Practices
|
|
358
|
+
1. **Test All Input Vectors**: Every parameter that accepts user input
|
|
359
|
+
2. **Use Real Attack Payloads**: Test with actual malicious inputs
|
|
360
|
+
3. **Automate Security Tests**: Include in CI/CD pipeline
|
|
361
|
+
4. **Regular Security Reviews**: Periodic manual code reviews
|
|
362
|
+
|
|
363
|
+
## 🚀 Continuous Security
|
|
364
|
+
|
|
365
|
+
### Regular Security Updates
|
|
366
|
+
- Monthly dependency audits
|
|
367
|
+
- Quarterly penetration testing
|
|
368
|
+
- Annual security architecture review
|
|
369
|
+
- Continuous monitoring and alerting
|
|
370
|
+
|
|
371
|
+
### Security Metrics
|
|
372
|
+
- Number of blocked malicious requests
|
|
373
|
+
- Rate limiting effectiveness
|
|
374
|
+
- Input validation error rates
|
|
375
|
+
- Security test coverage percentage
|
|
376
|
+
|
|
377
|
+
## 📞 Security Incident Response
|
|
378
|
+
|
|
379
|
+
### If You Discover a Vulnerability
|
|
380
|
+
1. **Do Not** create a public issue
|
|
381
|
+
2. **Do** email security concerns privately
|
|
382
|
+
3. **Include** steps to reproduce
|
|
383
|
+
4. **Provide** impact assessment if possible
|
|
384
|
+
|
|
385
|
+
### Response Timeline
|
|
386
|
+
- **24 hours**: Initial acknowledgment
|
|
387
|
+
- **72 hours**: Preliminary assessment
|
|
388
|
+
- **7 days**: Fix development and testing
|
|
389
|
+
- **14 days**: Patched release and disclosure
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
**🔒 Security is a shared responsibility - implement, test, and monitor continuously!**
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# WordPress MCP Server - API Documentation
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The WordPress MCP Server provides **59 tools** across **10 categories** for comprehensive WordPress management through the Model Context Protocol.
|
|
13
|
+
|
|
14
|
+
**Last Updated:** 30.6.2025
|
|
15
|
+
**Version:** 1.2.0
|
|
16
|
+
**Coverage:** 59/59 tools with examples
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### Basic Usage
|
|
21
|
+
```bash
|
|
22
|
+
# List all posts
|
|
23
|
+
wp_list_posts
|
|
24
|
+
|
|
25
|
+
# Get specific post
|
|
26
|
+
wp_get_post --id=123
|
|
27
|
+
|
|
28
|
+
# Create new post
|
|
29
|
+
wp_create_post --title="My Post" --content="Post content"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Multi-Site Usage
|
|
33
|
+
```bash
|
|
34
|
+
# Target specific site
|
|
35
|
+
wp_list_posts --site=site1
|
|
36
|
+
|
|
37
|
+
# Use with different authentication
|
|
38
|
+
wp_get_site_settings --site=production
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Tool Categories
|
|
42
|
+
|
|
43
|
+
| Category | Tools | Description |
|
|
44
|
+
|----------|-------|-------------|
|
|
45
|
+
| [comment](./categories/comment.md) | 7 | comment management tools |
|
|
46
|
+
| [cache](./categories/cache.md) | 4 | Performance caching and optimization tools |
|
|
47
|
+
| [site](./categories/site.md) | 6 | Site settings and configuration tools |
|
|
48
|
+
| [taxonomy](./categories/taxonomy.md) | 10 | taxonomy management tools |
|
|
49
|
+
| [page](./categories/page.md) | 6 | page management tools |
|
|
50
|
+
| [post](./categories/post.md) | 6 | post management tools |
|
|
51
|
+
| [user](./categories/user.md) | 6 | user management tools |
|
|
52
|
+
| [media](./categories/media.md) | 5 | File upload, management, and media library tools |
|
|
53
|
+
| [auth](./categories/auth.md) | 3 | Authentication testing and management tools |
|
|
54
|
+
| [performance](./categories/performance.md) | 6 | Performance monitoring and analytics tools |
|
|
55
|
+
|
|
56
|
+
## Available Tools
|
|
57
|
+
|
|
58
|
+
| Tool | Category | Description |
|
|
59
|
+
|------|----------|-------------|
|
|
60
|
+
| [`wp_approve_comment`](./tools/wp_approve_comment.md) | comment | Approves a pending comment. |
|
|
61
|
+
| [`wp_cache_clear`](./tools/wp_cache_clear.md) | cache | Clear cache for a WordPress site. |
|
|
62
|
+
| [`wp_cache_info`](./tools/wp_cache_info.md) | cache | Get detailed cache configuration and status information. |
|
|
63
|
+
| [`wp_cache_stats`](./tools/wp_cache_stats.md) | cache | Get cache statistics for a WordPress site. |
|
|
64
|
+
| [`wp_cache_warm`](./tools/wp_cache_warm.md) | cache | Pre-warm cache with essential WordPress data. |
|
|
65
|
+
| [`wp_create_application_password`](./tools/wp_create_application_password.md) | site | Creates a new application password for a user. |
|
|
66
|
+
| [`wp_create_category`](./tools/wp_create_category.md) | taxonomy | Creates a new category. |
|
|
67
|
+
| [`wp_create_comment`](./tools/wp_create_comment.md) | comment | Creates a new comment on a post. |
|
|
68
|
+
| [`wp_create_page`](./tools/wp_create_page.md) | page | Creates a new page. |
|
|
69
|
+
| [`wp_create_post`](./tools/wp_create_post.md) | post | Creates a new post. |
|
|
70
|
+
| [`wp_create_tag`](./tools/wp_create_tag.md) | taxonomy | Creates a new tag. |
|
|
71
|
+
| [`wp_create_user`](./tools/wp_create_user.md) | user | Creates a new user. |
|
|
72
|
+
| [`wp_delete_application_password`](./tools/wp_delete_application_password.md) | site | Revokes an existing application password. |
|
|
73
|
+
| [`wp_delete_category`](./tools/wp_delete_category.md) | taxonomy | Deletes a category. |
|
|
74
|
+
| [`wp_delete_comment`](./tools/wp_delete_comment.md) | comment | Deletes a comment. |
|
|
75
|
+
| [`wp_delete_media`](./tools/wp_delete_media.md) | media | Deletes a media item. |
|
|
76
|
+
| [`wp_delete_page`](./tools/wp_delete_page.md) | page | Deletes a page. |
|
|
77
|
+
| [`wp_delete_post`](./tools/wp_delete_post.md) | post | Deletes a post. |
|
|
78
|
+
| [`wp_delete_tag`](./tools/wp_delete_tag.md) | taxonomy | Deletes a tag. |
|
|
79
|
+
| [`wp_delete_user`](./tools/wp_delete_user.md) | user | Deletes a user. |
|
|
80
|
+
| [`wp_get_application_passwords`](./tools/wp_get_application_passwords.md) | site | Lists application passwords for a specific user. |
|
|
81
|
+
| [`wp_get_auth_status`](./tools/wp_get_auth_status.md) | auth | Gets the current authentication status for a configured WordPress site. |
|
|
82
|
+
| [`wp_get_category`](./tools/wp_get_category.md) | taxonomy | Retrieves a single category by its ID. |
|
|
83
|
+
| [`wp_get_comment`](./tools/wp_get_comment.md) | comment | Retrieves a single comment by its ID. |
|
|
84
|
+
| [`wp_get_current_user`](./tools/wp_get_current_user.md) | user | Retrieves the currently authenticated user. |
|
|
85
|
+
| [`wp_get_media`](./tools/wp_get_media.md) | media | Retrieves a single media item by its ID. |
|
|
86
|
+
| [`wp_get_page`](./tools/wp_get_page.md) | page | Retrieves a single page by its ID. |
|
|
87
|
+
| [`wp_get_page_revisions`](./tools/wp_get_page_revisions.md) | page | Retrieves revisions for a specific page. |
|
|
88
|
+
| [`wp_get_post`](./tools/wp_get_post.md) | post | Retrieves a single post by its ID. |
|
|
89
|
+
| [`wp_get_post_revisions`](./tools/wp_get_post_revisions.md) | post | Retrieves revisions for a specific post. |
|
|
90
|
+
| [`wp_get_site_settings`](./tools/wp_get_site_settings.md) | site | Retrieves the general settings for a WordPress site. |
|
|
91
|
+
| [`wp_get_tag`](./tools/wp_get_tag.md) | taxonomy | Retrieves a single tag by its ID. |
|
|
92
|
+
| [`wp_get_user`](./tools/wp_get_user.md) | user | Retrieves a single user by their ID. |
|
|
93
|
+
| [`wp_list_categories`](./tools/wp_list_categories.md) | taxonomy | Lists categories from a WordPress site. |
|
|
94
|
+
| [`wp_list_comments`](./tools/wp_list_comments.md) | comment | Lists comments from a WordPress site, with filters. |
|
|
95
|
+
| [`wp_list_media`](./tools/wp_list_media.md) | media | Lists media items from a WordPress site, with filters. |
|
|
96
|
+
| [`wp_list_pages`](./tools/wp_list_pages.md) | page | Lists pages from a WordPress site, with filters. |
|
|
97
|
+
| [`wp_list_posts`](./tools/wp_list_posts.md) | post | Lists posts from a WordPress site, with filters. |
|
|
98
|
+
| [`wp_list_tags`](./tools/wp_list_tags.md) | taxonomy | Lists tags from a WordPress site. |
|
|
99
|
+
| [`wp_list_users`](./tools/wp_list_users.md) | user | Lists users from a WordPress site, with filters. |
|
|
100
|
+
| [`wp_performance_alerts`](./tools/wp_performance_alerts.md) | performance | Get performance alerts and anomaly detection results |
|
|
101
|
+
| [`wp_performance_benchmark`](./tools/wp_performance_benchmark.md) | performance | Compare current performance against industry benchmarks |
|
|
102
|
+
| [`wp_performance_export`](./tools/wp_performance_export.md) | performance | Export comprehensive performance report |
|
|
103
|
+
| [`wp_performance_history`](./tools/wp_performance_history.md) | performance | Get historical performance data and trends |
|
|
104
|
+
| [`wp_performance_optimize`](./tools/wp_performance_optimize.md) | performance | Get optimization recommendations and insights |
|
|
105
|
+
| [`wp_performance_stats`](./tools/wp_performance_stats.md) | performance | Get real-time performance statistics and metrics |
|
|
106
|
+
| [`wp_search_site`](./tools/wp_search_site.md) | site | Performs a site-wide search for content. |
|
|
107
|
+
| [`wp_spam_comment`](./tools/wp_spam_comment.md) | comment | Marks a comment as spam. |
|
|
108
|
+
| [`wp_switch_auth_method`](./tools/wp_switch_auth_method.md) | auth | Switches the authentication method for a site for the current session. |
|
|
109
|
+
| [`wp_test_auth`](./tools/wp_test_auth.md) | auth | Tests the authentication and connectivity for a configured WordPress site. |
|
|
110
|
+
| [`wp_update_category`](./tools/wp_update_category.md) | taxonomy | Updates an existing category. |
|
|
111
|
+
| [`wp_update_comment`](./tools/wp_update_comment.md) | comment | Updates an existing comment. |
|
|
112
|
+
| [`wp_update_media`](./tools/wp_update_media.md) | media | Updates the metadata of an existing media item. |
|
|
113
|
+
| [`wp_update_page`](./tools/wp_update_page.md) | page | Updates an existing page. |
|
|
114
|
+
| [`wp_update_post`](./tools/wp_update_post.md) | post | Updates an existing post. |
|
|
115
|
+
| [`wp_update_site_settings`](./tools/wp_update_site_settings.md) | site | Updates one or more general settings for a WordPress site. |
|
|
116
|
+
| [`wp_update_tag`](./tools/wp_update_tag.md) | taxonomy | Updates an existing tag. |
|
|
117
|
+
| [`wp_update_user`](./tools/wp_update_user.md) | user | Updates an existing user. |
|
|
118
|
+
| [`wp_upload_media`](./tools/wp_upload_media.md) | media | Uploads a file to the WordPress media library. |
|
|
119
|
+
|
|
120
|
+
## Authentication
|
|
121
|
+
|
|
122
|
+
All tools support multiple authentication methods:
|
|
123
|
+
- **Application Passwords** (recommended)
|
|
124
|
+
- **JWT Authentication**
|
|
125
|
+
- **Basic Authentication** (development only)
|
|
126
|
+
- **API Key Authentication**
|
|
127
|
+
|
|
128
|
+
## Error Handling
|
|
129
|
+
|
|
130
|
+
Standard error response format:
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"error": "Error type",
|
|
134
|
+
"message": "Human-readable error message",
|
|
135
|
+
"code": "ERROR_CODE",
|
|
136
|
+
"details": {
|
|
137
|
+
"endpoint": "/wp-json/wp/v2/posts",
|
|
138
|
+
"method": "GET"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Configuration
|
|
144
|
+
|
|
145
|
+
### Multi-Site Configuration
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"sites": [
|
|
149
|
+
{
|
|
150
|
+
"id": "site1",
|
|
151
|
+
"name": "My WordPress Site",
|
|
152
|
+
"config": {
|
|
153
|
+
"WORDPRESS_SITE_URL": "https://example.com",
|
|
154
|
+
"WORDPRESS_USERNAME": "username",
|
|
155
|
+
"WORDPRESS_APP_PASSWORD": "app_password"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Response Formats
|
|
163
|
+
|
|
164
|
+
All tools return responses in this format:
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"success": true,
|
|
168
|
+
"data": {
|
|
169
|
+
// Tool-specific response data
|
|
170
|
+
},
|
|
171
|
+
"metadata": {
|
|
172
|
+
"timestamp": "2024-01-01T00:00:00.000Z",
|
|
173
|
+
"site": "site1",
|
|
174
|
+
"tool": "wp_list_posts"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Performance Monitoring
|
|
180
|
+
|
|
181
|
+
The server includes comprehensive performance monitoring:
|
|
182
|
+
- Real-time metrics collection
|
|
183
|
+
- Historical performance analysis
|
|
184
|
+
- Industry benchmark comparisons
|
|
185
|
+
- Automated optimization recommendations
|
|
186
|
+
|
|
187
|
+
See [Performance Monitoring Guide](./performance/README.md) for details.
|
|
188
|
+
|
|
189
|
+
## Additional Resources
|
|
190
|
+
|
|
191
|
+
- [Tool Reference](./tools/README.md) - Detailed tool documentation
|
|
192
|
+
- [Type Definitions](./types/README.md) - TypeScript type definitions
|
|
193
|
+
- [Examples](./examples/README.md) - Usage examples and workflows
|
|
194
|
+
- [OpenAPI Specification](./openapi.json) - Machine-readable API spec
|
|
195
|
+
|
|
196
|
+
## Support
|
|
197
|
+
|
|
198
|
+
- **Documentation:** [GitHub Repository](https://github.com/docdyhr/mcp-wordpress)
|
|
199
|
+
- **Issues:** [GitHub Issues](https://github.com/docdyhr/mcp-wordpress/issues)
|
|
200
|
+
- **Discussions:** [GitHub Discussions](https://github.com/docdyhr/mcp-wordpress/discussions)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# auth Tools
|
|
2
|
+
|
|
3
|
+
Authentication testing and management tools
|
|
4
|
+
|
|
5
|
+
**Tool Count:** 3
|
|
6
|
+
|
|
7
|
+
## Available Tools
|
|
8
|
+
|
|
9
|
+
- [`wp_get_auth_status`](./tools/wp_get_auth_status.md)
|
|
10
|
+
- [`wp_switch_auth_method`](./tools/wp_switch_auth_method.md)
|
|
11
|
+
- [`wp_test_auth`](./tools/wp_test_auth.md)
|
|
12
|
+
|
|
13
|
+
## Common Usage Patterns
|
|
14
|
+
|
|
15
|
+
- Manage auth efficiently
|
|
16
|
+
- Bulk auth operations
|
|
17
|
+
- Search and filter auth
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### Basic auth Workflow
|
|
22
|
+
```bash
|
|
23
|
+
# List all auth
|
|
24
|
+
wp_list_auth
|
|
25
|
+
|
|
26
|
+
# Get specific item
|
|
27
|
+
wp_get_aut --id=123
|
|
28
|
+
|
|
29
|
+
# Create new item
|
|
30
|
+
wp_create_aut --title="Example"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Multi-Site auth Management
|
|
34
|
+
```bash
|
|
35
|
+
# Work with specific site
|
|
36
|
+
wp_list_auth --site=production
|
|
37
|
+
|
|
38
|
+
# Bulk operations
|
|
39
|
+
wp_list_auth --site=staging --limit=50
|
|
40
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# cache Tools
|
|
2
|
+
|
|
3
|
+
Performance caching and optimization tools
|
|
4
|
+
|
|
5
|
+
**Tool Count:** 4
|
|
6
|
+
|
|
7
|
+
## Available Tools
|
|
8
|
+
|
|
9
|
+
- [`wp_cache_clear`](./tools/wp_cache_clear.md)
|
|
10
|
+
- [`wp_cache_info`](./tools/wp_cache_info.md)
|
|
11
|
+
- [`wp_cache_stats`](./tools/wp_cache_stats.md)
|
|
12
|
+
- [`wp_cache_warm`](./tools/wp_cache_warm.md)
|
|
13
|
+
|
|
14
|
+
## Common Usage Patterns
|
|
15
|
+
|
|
16
|
+
- Manage cache efficiently
|
|
17
|
+
- Bulk cache operations
|
|
18
|
+
- Search and filter cache
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
### Basic cache Workflow
|
|
23
|
+
```bash
|
|
24
|
+
# List all cache
|
|
25
|
+
wp_list_cache
|
|
26
|
+
|
|
27
|
+
# Get specific item
|
|
28
|
+
wp_get_cach --id=123
|
|
29
|
+
|
|
30
|
+
# Create new item
|
|
31
|
+
wp_create_cach --title="Example"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Multi-Site cache Management
|
|
35
|
+
```bash
|
|
36
|
+
# Work with specific site
|
|
37
|
+
wp_list_cache --site=production
|
|
38
|
+
|
|
39
|
+
# Bulk operations
|
|
40
|
+
wp_list_cache --site=staging --limit=50
|
|
41
|
+
```
|