@houtini/lm 1.0.9 → 1.0.11
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/CHANGELOG.md +9 -0
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts +103 -0
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts.map +1 -0
- package/dist/prompts/analyze/wordpress-plugin-readiness.js +506 -0
- package/dist/prompts/analyze/wordpress-plugin-readiness.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.10] - 2025-01-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Increased timeout to 5 minutes** - Changed LM Studio timeout from 120000ms (2 minutes) to 300000ms (5 minutes)
|
|
12
|
+
- Prevents timeouts on large multi-file analysis and complex generation tasks
|
|
13
|
+
- Improves reliability for slower local models or heavily loaded systems
|
|
14
|
+
- Addresses timeout issues with project-wide security audits and creative functions
|
|
15
|
+
- Particularly beneficial for WordPress plugin/theme analysis and large codebase operations
|
|
16
|
+
|
|
8
17
|
## [4.1.0] - 2025-08-29
|
|
9
18
|
|
|
10
19
|
### 🎉 MAJOR RELEASE - 3-Stage Architecture Complete
|
package/dist/config.js
CHANGED
|
@@ -8,7 +8,7 @@ export const config = {
|
|
|
8
8
|
temperature: 0.1,
|
|
9
9
|
// maxTokens removed - now calculated dynamically by TokenCalculator
|
|
10
10
|
topP: 0.95,
|
|
11
|
-
timeout:
|
|
11
|
+
timeout: 300000, // Increased to 5 minutes for complex analysis and large projects
|
|
12
12
|
maxFileSize: 200 * 1024 * 1024, // 200MB limit
|
|
13
13
|
supportedFileTypes: [
|
|
14
14
|
'.csv', '.json', '.txt', '.js', '.ts', '.py', '.md', '.log',
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAW;IAC5B,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,qBAAqB;IAC/D,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,MAAM;IAChD,WAAW,EAAE,GAAG;IAChB,oEAAoE;IACpE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAW;IAC5B,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,qBAAqB;IAC/D,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,MAAM;IAChD,WAAW,EAAE,GAAG;IAChB,oEAAoE;IACpE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,MAAM,EAAE,iEAAiE;IAClF,WAAW,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,EAAG,cAAc;IAC/C,kBAAkB,EAAE;QAClB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;QAC3D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;QAC3D,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;QAC1D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,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iness Analyzer
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive WordPress plugin readiness check for security, best practices, and WordPress.org submission
|
|
5
|
+
* Analyzes plugin structure, security vulnerabilities, database operations, and coding standards
|
|
6
|
+
*/
|
|
7
|
+
import { BasePlugin } from '../../plugins/base-plugin.js';
|
|
8
|
+
import { IPromptPlugin } from '../shared/types.js';
|
|
9
|
+
import { PromptStages } from '../../types/prompt-stages.js';
|
|
10
|
+
export declare class WordPressPluginReadiness extends BasePlugin implements IPromptPlugin {
|
|
11
|
+
name: string;
|
|
12
|
+
category: "analyze";
|
|
13
|
+
description: string;
|
|
14
|
+
parameters: {
|
|
15
|
+
projectPath: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
required: boolean;
|
|
19
|
+
};
|
|
20
|
+
analysisDepth: {
|
|
21
|
+
type: "string";
|
|
22
|
+
description: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
default: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
includeSteps: {
|
|
28
|
+
type: "array";
|
|
29
|
+
description: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
default: string[];
|
|
32
|
+
items: {
|
|
33
|
+
type: "string";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
wpVersion: {
|
|
37
|
+
type: "string";
|
|
38
|
+
description: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
phpVersion: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
maxDepth: {
|
|
49
|
+
type: "number";
|
|
50
|
+
description: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
54
|
+
maxFiles: {
|
|
55
|
+
type: "number";
|
|
56
|
+
description: string;
|
|
57
|
+
required: boolean;
|
|
58
|
+
default: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
private analysisCache;
|
|
62
|
+
private multiFileAnalysis;
|
|
63
|
+
constructor();
|
|
64
|
+
execute(params: any, llmClient: any): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Generate prompt stages for WordPress plugin analysis
|
|
67
|
+
*/
|
|
68
|
+
getPromptStages(params: any): PromptStages;
|
|
69
|
+
/**
|
|
70
|
+
* Discover PHP files in the WordPress plugin
|
|
71
|
+
*/
|
|
72
|
+
private discoverPHPFiles;
|
|
73
|
+
/**
|
|
74
|
+
* Perform comprehensive plugin analysis
|
|
75
|
+
*/
|
|
76
|
+
private performPluginAnalysis;
|
|
77
|
+
/**
|
|
78
|
+
* Analyze individual file for WordPress-specific patterns
|
|
79
|
+
*/
|
|
80
|
+
private analyzeFile;
|
|
81
|
+
/**
|
|
82
|
+
* Extract directory structure from file list
|
|
83
|
+
*/
|
|
84
|
+
private extractDirectoryStructure;
|
|
85
|
+
/**
|
|
86
|
+
* Extract plugin headers from main file
|
|
87
|
+
*/
|
|
88
|
+
private extractPluginHeaders;
|
|
89
|
+
/**
|
|
90
|
+
* Generate security summary
|
|
91
|
+
*/
|
|
92
|
+
private generateSecuritySummary;
|
|
93
|
+
/**
|
|
94
|
+
* Generate database summary
|
|
95
|
+
*/
|
|
96
|
+
private generateDatabaseSummary;
|
|
97
|
+
/**
|
|
98
|
+
* Generate standards summary
|
|
99
|
+
*/
|
|
100
|
+
private generateStandardsSummary;
|
|
101
|
+
}
|
|
102
|
+
export default WordPressPluginReadiness;
|
|
103
|
+
//# sourceMappingURL=wordpress-plugin-readiness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordpress-plugin-readiness.d.ts","sourceRoot":"","sources":["../../../src/prompts/analyze/wordpress-plugin-readiness.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAiB5D,qBAAa,wBAAyB,SAAQ,UAAW,YAAW,aAAa;IAC/E,IAAI,SAAgC;IACpC,QAAQ,EAAG,SAAS,CAAU;IAC9B,WAAW,SAA+G;IAE1H,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmDR;IAEF,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,iBAAiB,CAA2B;;IAM9C,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IA0DzC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,YAAY;IAuI1C;;OAEG;YACW,gBAAgB;IAsD9B;;OAEG;YACW,qBAAqB;IAwEnC;;OAEG;YACW,WAAW;IA2EzB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAajC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAiB/B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAmB/B;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAgBjC;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress Plugin Readiness Analyzer
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive WordPress plugin readiness check for security, best practices, and WordPress.org submission
|
|
5
|
+
* Analyzes plugin structure, security vulnerabilities, database operations, and coding standards
|
|
6
|
+
*/
|
|
7
|
+
import { BasePlugin } from '../../plugins/base-plugin.js';
|
|
8
|
+
import { ThreeStagePromptManager } from '../../core/ThreeStagePromptManager.js';
|
|
9
|
+
import { withSecurity } from '../../security/integration-helpers.js';
|
|
10
|
+
import { ModelSetup, TokenCalculator, ResponseProcessor, ParameterValidator, ErrorHandler, MultiFileAnalysis } from '../../utils/plugin-utilities.js';
|
|
11
|
+
import { getAnalysisCache } from '../../cache/index.js';
|
|
12
|
+
// Common Node.js modules
|
|
13
|
+
import { basename, dirname, join, relative } from 'path';
|
|
14
|
+
import { readFile, stat, readdir } from 'fs/promises';
|
|
15
|
+
export class WordPressPluginReadiness extends BasePlugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.name = 'wordpress_plugin_readiness';
|
|
19
|
+
this.category = 'analyze';
|
|
20
|
+
this.description = 'Comprehensive WordPress plugin readiness check for security, best practices, and WordPress.org submission';
|
|
21
|
+
this.parameters = {
|
|
22
|
+
// Primary parameter - WordPress plugin directory
|
|
23
|
+
projectPath: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Path to WordPress plugin root directory',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
// Analysis configuration
|
|
29
|
+
analysisDepth: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Level of analysis detail',
|
|
32
|
+
enum: ['basic', 'detailed', 'comprehensive'],
|
|
33
|
+
default: 'comprehensive',
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
includeSteps: {
|
|
37
|
+
type: 'array',
|
|
38
|
+
description: 'Specific analysis steps to include',
|
|
39
|
+
required: false,
|
|
40
|
+
default: ['structure', 'security', 'database', 'quality', 'standards', 'performance'],
|
|
41
|
+
items: { type: 'string' }
|
|
42
|
+
},
|
|
43
|
+
// WordPress configuration
|
|
44
|
+
wpVersion: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'Target WordPress version for compatibility',
|
|
47
|
+
required: false,
|
|
48
|
+
default: '6.4'
|
|
49
|
+
},
|
|
50
|
+
phpVersion: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'Target PHP version for compatibility',
|
|
53
|
+
required: false,
|
|
54
|
+
default: '8.0'
|
|
55
|
+
},
|
|
56
|
+
// File analysis limits
|
|
57
|
+
maxDepth: {
|
|
58
|
+
type: 'number',
|
|
59
|
+
description: 'Maximum directory depth for file discovery (1-5)',
|
|
60
|
+
required: false,
|
|
61
|
+
default: 3
|
|
62
|
+
},
|
|
63
|
+
maxFiles: {
|
|
64
|
+
type: 'number',
|
|
65
|
+
description: 'Maximum number of PHP files to analyze',
|
|
66
|
+
required: false,
|
|
67
|
+
default: 50
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this.analysisCache = getAnalysisCache();
|
|
71
|
+
this.multiFileAnalysis = new MultiFileAnalysis();
|
|
72
|
+
}
|
|
73
|
+
async execute(params, llmClient) {
|
|
74
|
+
return await withSecurity(this, params, llmClient, async (secureParams) => {
|
|
75
|
+
try {
|
|
76
|
+
// 1. Validate parameters
|
|
77
|
+
ParameterValidator.validateProjectPath(secureParams);
|
|
78
|
+
ParameterValidator.validateDepth(secureParams);
|
|
79
|
+
ParameterValidator.validateEnum(secureParams, 'analysisDepth', ['basic', 'detailed', 'comprehensive']);
|
|
80
|
+
// 2. Setup model
|
|
81
|
+
const { model, contextLength } = await ModelSetup.getReadyModel(llmClient);
|
|
82
|
+
// 3. Discover PHP files in the plugin
|
|
83
|
+
const phpFiles = await this.discoverPHPFiles(secureParams.projectPath, secureParams.maxDepth, secureParams.maxFiles);
|
|
84
|
+
// 4. Analyze the plugin structure
|
|
85
|
+
const analysisResult = await this.performPluginAnalysis(phpFiles, secureParams, model, contextLength);
|
|
86
|
+
// 5. Generate comprehensive prompt
|
|
87
|
+
const promptStages = this.getPromptStages({
|
|
88
|
+
...secureParams,
|
|
89
|
+
analysisResult,
|
|
90
|
+
fileCount: phpFiles.length
|
|
91
|
+
});
|
|
92
|
+
// 6. Execute with chunking (always needed for comprehensive analysis)
|
|
93
|
+
const promptManager = new ThreeStagePromptManager();
|
|
94
|
+
const chunkSize = TokenCalculator.calculateOptimalChunkSize(promptStages, contextLength);
|
|
95
|
+
const dataChunks = promptManager.chunkDataPayload(promptStages.dataPayload, chunkSize);
|
|
96
|
+
const conversation = promptManager.createChunkedConversation(promptStages, dataChunks);
|
|
97
|
+
const messages = [
|
|
98
|
+
conversation.systemMessage,
|
|
99
|
+
...conversation.dataMessages,
|
|
100
|
+
conversation.analysisMessage
|
|
101
|
+
];
|
|
102
|
+
return await ResponseProcessor.executeChunked(messages, model, contextLength, 'wordpress_plugin_readiness', 'multifile');
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return ErrorHandler.createExecutionError('wordpress_plugin_readiness', error);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Generate prompt stages for WordPress plugin analysis
|
|
111
|
+
*/
|
|
112
|
+
getPromptStages(params) {
|
|
113
|
+
const { analysisResult, analysisDepth, includeSteps, wpVersion, phpVersion, fileCount } = params;
|
|
114
|
+
const systemAndContext = `You are a WordPress security and best practices expert conducting a comprehensive plugin readiness assessment.
|
|
115
|
+
|
|
116
|
+
Analysis Context:
|
|
117
|
+
- WordPress Version: ${wpVersion}
|
|
118
|
+
- PHP Version: ${phpVersion}
|
|
119
|
+
- Analysis Depth: ${analysisDepth}
|
|
120
|
+
- Files Analyzed: ${fileCount}
|
|
121
|
+
- Analysis Steps: ${includeSteps?.join(', ') || 'all'}
|
|
122
|
+
|
|
123
|
+
Your expertise includes:
|
|
124
|
+
- WordPress security best practices and OWASP compliance
|
|
125
|
+
- WordPress coding standards and guidelines
|
|
126
|
+
- WordPress.org plugin submission requirements
|
|
127
|
+
- Performance optimization for WordPress plugins
|
|
128
|
+
- Database security and optimization
|
|
129
|
+
- Plugin architecture and organization
|
|
130
|
+
|
|
131
|
+
CRITICAL SECURITY CHECKS:
|
|
132
|
+
|
|
133
|
+
1. INPUT VALIDATION & SANITIZATION:
|
|
134
|
+
- Direct use of $_GET, $_POST, $_REQUEST without sanitization
|
|
135
|
+
- Missing sanitize_text_field(), sanitize_email(), sanitize_url()
|
|
136
|
+
- Missing esc_html(), esc_attr(), esc_url() for output
|
|
137
|
+
|
|
138
|
+
2. SQL INJECTION PREVENTION:
|
|
139
|
+
- Database queries without $wpdb->prepare()
|
|
140
|
+
- String concatenation in SQL queries
|
|
141
|
+
- Unsafe use of $wpdb->query() with user input
|
|
142
|
+
|
|
143
|
+
3. NONCE VERIFICATION:
|
|
144
|
+
- Forms without wp_nonce_field()
|
|
145
|
+
- AJAX without check_ajax_referer()
|
|
146
|
+
- Admin actions without wp_verify_nonce()
|
|
147
|
+
|
|
148
|
+
4. CAPABILITY CHECKS:
|
|
149
|
+
- Admin functions without current_user_can()
|
|
150
|
+
- Direct role checks instead of capability checks
|
|
151
|
+
- Missing permission validation
|
|
152
|
+
|
|
153
|
+
5. FILE OPERATIONS:
|
|
154
|
+
- Unsafe file uploads without wp_handle_upload()
|
|
155
|
+
- Direct file system operations without WP_Filesystem
|
|
156
|
+
- Path traversal vulnerabilities
|
|
157
|
+
|
|
158
|
+
6. XSS PREVENTION:
|
|
159
|
+
- Unescaped output in HTML context
|
|
160
|
+
- JavaScript variables without wp_json_encode()
|
|
161
|
+
- Missing wp_kses() for rich content
|
|
162
|
+
|
|
163
|
+
Your task is to provide a comprehensive readiness assessment for WordPress.org submission.`;
|
|
164
|
+
const dataPayload = `WordPress Plugin Analysis Results:
|
|
165
|
+
|
|
166
|
+
${JSON.stringify(analysisResult, null, 2)}`;
|
|
167
|
+
const outputInstructions = `Provide a comprehensive WordPress plugin readiness report with the following sections:
|
|
168
|
+
|
|
169
|
+
**Executive Summary:**
|
|
170
|
+
Provide an overall readiness score (0-100) and a clear verdict on whether the plugin is ready for WordPress.org submission. Highlight the most critical issues that must be addressed.
|
|
171
|
+
|
|
172
|
+
**Structure Analysis:**
|
|
173
|
+
- Assess the plugin file and directory structure
|
|
174
|
+
- Identify missing essential files (readme.txt, license, etc.)
|
|
175
|
+
- Flag unnecessary files that shouldn't be in production
|
|
176
|
+
- Evaluate directory organization best practices
|
|
177
|
+
|
|
178
|
+
**Security Assessment:**
|
|
179
|
+
For each security vulnerability found, provide:
|
|
180
|
+
- **Vulnerability Type**: SQL injection, XSS, nonce missing, capability check, etc.
|
|
181
|
+
- **Severity Level**: Critical, High, Medium, or Low
|
|
182
|
+
- **Affected Files**: Specific files and approximate line numbers
|
|
183
|
+
- **Security Impact**: What could happen if exploited
|
|
184
|
+
- **Remediation**: Exact code fix with WordPress functions to use
|
|
185
|
+
- **Confidence Score**: How certain you are about this finding
|
|
186
|
+
|
|
187
|
+
**Database Operations:**
|
|
188
|
+
- Identify all database queries and their safety status
|
|
189
|
+
- Flag unprepared queries vulnerable to SQL injection
|
|
190
|
+
- Check for proper use of $wpdb->prefix
|
|
191
|
+
- Identify inefficient queries and N+1 problems
|
|
192
|
+
- Suggest query optimizations
|
|
193
|
+
|
|
194
|
+
**WordPress Standards Compliance:**
|
|
195
|
+
- **Coding Standards**: Adherence to WordPress PHP coding standards
|
|
196
|
+
- **Naming Conventions**: Function names, variable names, class names
|
|
197
|
+
- **Text Domain**: Consistency in internationalization
|
|
198
|
+
- **Deprecated Functions**: Usage of deprecated WordPress functions
|
|
199
|
+
- **API Usage**: Proper use of WordPress APIs and hooks
|
|
200
|
+
|
|
201
|
+
**Performance Analysis:**
|
|
202
|
+
- Scripts and styles loading inefficiently
|
|
203
|
+
- Database queries in loops
|
|
204
|
+
- Missing caching for expensive operations
|
|
205
|
+
- Resource-intensive operations on page load
|
|
206
|
+
- Suggest specific performance improvements
|
|
207
|
+
|
|
208
|
+
**Documentation & Metadata:**
|
|
209
|
+
- **Plugin Headers**: Completeness and accuracy
|
|
210
|
+
- **Readme.txt**: Presence and compliance with WordPress.org format
|
|
211
|
+
- **License**: Proper GPL-compatible license declaration
|
|
212
|
+
- **Inline Documentation**: PHPDoc blocks and code comments
|
|
213
|
+
|
|
214
|
+
**WordPress.org Submission Checklist:**
|
|
215
|
+
Provide a clear pass/fail for each requirement:
|
|
216
|
+
- ✅/❌ Valid plugin structure
|
|
217
|
+
- ✅/❌ No critical security vulnerabilities
|
|
218
|
+
- ✅/❌ Proper database operations
|
|
219
|
+
- ✅/❌ WordPress coding standards compliance
|
|
220
|
+
- ✅/❌ Complete readme.txt file
|
|
221
|
+
- ✅/❌ GPL-compatible license
|
|
222
|
+
- ✅/❌ No use of deprecated functions
|
|
223
|
+
- ✅/❌ Proper internationalization
|
|
224
|
+
|
|
225
|
+
**Priority Action Items:**
|
|
226
|
+
List the top 5-10 most important fixes needed, ordered by priority:
|
|
227
|
+
1. [Critical Security]: Specific issue and fix
|
|
228
|
+
2. [Required for Submission]: Missing requirement
|
|
229
|
+
3. [High Priority]: Important improvement
|
|
230
|
+
(Continue as needed)
|
|
231
|
+
|
|
232
|
+
**Recommendations for Improvement:**
|
|
233
|
+
Beyond the minimum requirements, suggest enhancements that would make this a high-quality plugin:
|
|
234
|
+
- Architecture improvements
|
|
235
|
+
- Code quality enhancements
|
|
236
|
+
- User experience optimizations
|
|
237
|
+
- Additional security hardening
|
|
238
|
+
|
|
239
|
+
Focus on being specific, actionable, and providing exact WordPress functions and patterns to use. Every finding should include a concrete solution that developers can implement immediately.`;
|
|
240
|
+
return { systemAndContext, dataPayload, outputInstructions };
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Discover PHP files in the WordPress plugin
|
|
244
|
+
*/
|
|
245
|
+
async discoverPHPFiles(projectPath, maxDepth, maxFiles) {
|
|
246
|
+
const phpFiles = [];
|
|
247
|
+
const scanDirectory = async (dir, depth = 0) => {
|
|
248
|
+
if (depth > maxDepth || phpFiles.length >= maxFiles)
|
|
249
|
+
return;
|
|
250
|
+
try {
|
|
251
|
+
const items = await readdir(dir);
|
|
252
|
+
for (const item of items) {
|
|
253
|
+
if (phpFiles.length >= maxFiles)
|
|
254
|
+
break;
|
|
255
|
+
const fullPath = join(dir, item);
|
|
256
|
+
const itemStat = await stat(fullPath);
|
|
257
|
+
if (itemStat.isDirectory()) {
|
|
258
|
+
// Skip common non-code directories
|
|
259
|
+
if (!item.startsWith('.') &&
|
|
260
|
+
item !== 'node_modules' &&
|
|
261
|
+
item !== 'vendor' &&
|
|
262
|
+
item !== 'tests' &&
|
|
263
|
+
item !== '.git') {
|
|
264
|
+
await scanDirectory(fullPath, depth + 1);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
else if (item.endsWith('.php')) {
|
|
268
|
+
phpFiles.push(fullPath);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
// Continue scanning even if one directory fails
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
await scanDirectory(projectPath);
|
|
277
|
+
// Also check for critical WordPress files in root
|
|
278
|
+
const criticalFiles = ['readme.txt', 'license.txt', 'LICENSE'];
|
|
279
|
+
for (const file of criticalFiles) {
|
|
280
|
+
const fullPath = join(projectPath, file);
|
|
281
|
+
try {
|
|
282
|
+
await stat(fullPath);
|
|
283
|
+
phpFiles.push(fullPath); // Include these for completeness check
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
// File doesn't exist, will be flagged in analysis
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return phpFiles;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Perform comprehensive plugin analysis
|
|
293
|
+
*/
|
|
294
|
+
async performPluginAnalysis(files, params, model, contextLength) {
|
|
295
|
+
const analysisResults = {
|
|
296
|
+
structure: {
|
|
297
|
+
totalFiles: files.length,
|
|
298
|
+
phpFiles: files.filter(f => f.endsWith('.php')).length,
|
|
299
|
+
hasReadme: files.some(f => basename(f).toLowerCase() === 'readme.txt'),
|
|
300
|
+
hasLicense: files.some(f => basename(f).toLowerCase().includes('license')),
|
|
301
|
+
directories: this.extractDirectoryStructure(files, params.projectPath)
|
|
302
|
+
},
|
|
303
|
+
files: [],
|
|
304
|
+
security: {
|
|
305
|
+
vulnerabilities: [],
|
|
306
|
+
summary: {}
|
|
307
|
+
},
|
|
308
|
+
database: {
|
|
309
|
+
queries: [],
|
|
310
|
+
summary: {}
|
|
311
|
+
},
|
|
312
|
+
standards: {
|
|
313
|
+
issues: [],
|
|
314
|
+
summary: {}
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
// Analyze each PHP file
|
|
318
|
+
for (const file of files.filter(f => f.endsWith('.php'))) {
|
|
319
|
+
try {
|
|
320
|
+
const content = await readFile(file, 'utf-8');
|
|
321
|
+
const fileAnalysis = await this.analyzeFile(file, content, params);
|
|
322
|
+
analysisResults.files.push(fileAnalysis);
|
|
323
|
+
// Aggregate security issues
|
|
324
|
+
if (fileAnalysis.security?.length > 0) {
|
|
325
|
+
analysisResults.security.vulnerabilities.push({
|
|
326
|
+
file: relative(params.projectPath, file),
|
|
327
|
+
issues: fileAnalysis.security
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
// Aggregate database issues
|
|
331
|
+
if (fileAnalysis.database?.length > 0) {
|
|
332
|
+
analysisResults.database.queries.push({
|
|
333
|
+
file: relative(params.projectPath, file),
|
|
334
|
+
queries: fileAnalysis.database
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
// Aggregate standards issues
|
|
338
|
+
if (fileAnalysis.standards?.length > 0) {
|
|
339
|
+
analysisResults.standards.issues.push({
|
|
340
|
+
file: relative(params.projectPath, file),
|
|
341
|
+
issues: fileAnalysis.standards
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
// Continue analyzing other files
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Generate summaries
|
|
350
|
+
analysisResults.security.summary = this.generateSecuritySummary(analysisResults.security.vulnerabilities);
|
|
351
|
+
analysisResults.database.summary = this.generateDatabaseSummary(analysisResults.database.queries);
|
|
352
|
+
analysisResults.standards.summary = this.generateStandardsSummary(analysisResults.standards.issues);
|
|
353
|
+
return analysisResults;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Analyze individual file for WordPress-specific patterns
|
|
357
|
+
*/
|
|
358
|
+
async analyzeFile(file, content, params) {
|
|
359
|
+
const analysis = {
|
|
360
|
+
filePath: relative(params.projectPath, file),
|
|
361
|
+
fileName: basename(file),
|
|
362
|
+
size: content.length,
|
|
363
|
+
lines: content.split('\n').length,
|
|
364
|
+
security: [],
|
|
365
|
+
database: [],
|
|
366
|
+
standards: []
|
|
367
|
+
};
|
|
368
|
+
// Check for plugin header (main plugin file)
|
|
369
|
+
if (content.includes('Plugin Name:') && content.includes('*/')) {
|
|
370
|
+
analysis.isMainPluginFile = true;
|
|
371
|
+
analysis.pluginHeaders = this.extractPluginHeaders(content);
|
|
372
|
+
}
|
|
373
|
+
// Security checks
|
|
374
|
+
if (content.match(/\$_(GET|POST|REQUEST|SERVER|COOKIE)\[/)) {
|
|
375
|
+
analysis.security.push({
|
|
376
|
+
type: 'INPUT_VALIDATION',
|
|
377
|
+
pattern: 'Direct superglobal usage without sanitization'
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
if (content.includes('$wpdb->query') && !content.includes('$wpdb->prepare')) {
|
|
381
|
+
analysis.security.push({
|
|
382
|
+
type: 'SQL_INJECTION',
|
|
383
|
+
pattern: 'Database query without prepare statement'
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
if (content.match(/wp_ajax_\w+/) && !content.includes('check_ajax_referer')) {
|
|
387
|
+
analysis.security.push({
|
|
388
|
+
type: 'NONCE_MISSING',
|
|
389
|
+
pattern: 'AJAX handler without nonce verification'
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
if (content.includes('add_menu_page') && !content.includes('current_user_can')) {
|
|
393
|
+
analysis.security.push({
|
|
394
|
+
type: 'CAPABILITY_CHECK',
|
|
395
|
+
pattern: 'Admin page without capability check'
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
// Database patterns
|
|
399
|
+
if (content.includes('$wpdb')) {
|
|
400
|
+
const queries = content.match(/\$wpdb->(query|get_results|get_var|get_row)/g);
|
|
401
|
+
if (queries) {
|
|
402
|
+
analysis.database = queries.map(q => ({
|
|
403
|
+
type: q.replace('$wpdb->', ''),
|
|
404
|
+
hasPrepare: content.includes('$wpdb->prepare')
|
|
405
|
+
}));
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
// Standards checks
|
|
409
|
+
if (content.match(/function [A-Z]/)) {
|
|
410
|
+
analysis.standards.push({
|
|
411
|
+
type: 'NAMING_CONVENTION',
|
|
412
|
+
pattern: 'Function name starts with uppercase (should be lowercase)'
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
if (!content.includes('defined') && !content.includes('ABSPATH')) {
|
|
416
|
+
analysis.standards.push({
|
|
417
|
+
type: 'DIRECT_ACCESS',
|
|
418
|
+
pattern: 'Missing direct file access prevention'
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
return analysis;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Extract directory structure from file list
|
|
425
|
+
*/
|
|
426
|
+
extractDirectoryStructure(files, projectPath) {
|
|
427
|
+
const directories = new Set();
|
|
428
|
+
for (const file of files) {
|
|
429
|
+
const dir = dirname(relative(projectPath, file));
|
|
430
|
+
if (dir && dir !== '.') {
|
|
431
|
+
directories.add(dir);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return Array.from(directories).sort();
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Extract plugin headers from main file
|
|
438
|
+
*/
|
|
439
|
+
extractPluginHeaders(content) {
|
|
440
|
+
const headers = {};
|
|
441
|
+
const headerPattern = /\*\s*([^:]+):\s*(.+)/g;
|
|
442
|
+
const headerBlock = content.match(/\/\*\*([\s\S]*?)\*\//);
|
|
443
|
+
if (headerBlock) {
|
|
444
|
+
let match;
|
|
445
|
+
while ((match = headerPattern.exec(headerBlock[1])) !== null) {
|
|
446
|
+
headers[match[1].trim()] = match[2].trim();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return headers;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Generate security summary
|
|
453
|
+
*/
|
|
454
|
+
generateSecuritySummary(vulnerabilities) {
|
|
455
|
+
const summary = {
|
|
456
|
+
totalFiles: vulnerabilities.length,
|
|
457
|
+
totalIssues: 0,
|
|
458
|
+
byType: {}
|
|
459
|
+
};
|
|
460
|
+
for (const fileVulns of vulnerabilities) {
|
|
461
|
+
for (const issue of fileVulns.issues) {
|
|
462
|
+
summary.totalIssues++;
|
|
463
|
+
summary.byType[issue.type] = (summary.byType[issue.type] || 0) + 1;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return summary;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Generate database summary
|
|
470
|
+
*/
|
|
471
|
+
generateDatabaseSummary(queries) {
|
|
472
|
+
const summary = {
|
|
473
|
+
totalFiles: queries.length,
|
|
474
|
+
totalQueries: 0,
|
|
475
|
+
unsafeQueries: 0
|
|
476
|
+
};
|
|
477
|
+
for (const fileQueries of queries) {
|
|
478
|
+
for (const query of fileQueries.queries) {
|
|
479
|
+
summary.totalQueries++;
|
|
480
|
+
if (!query.hasPrepare) {
|
|
481
|
+
summary.unsafeQueries++;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return summary;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Generate standards summary
|
|
489
|
+
*/
|
|
490
|
+
generateStandardsSummary(issues) {
|
|
491
|
+
const summary = {
|
|
492
|
+
totalFiles: issues.length,
|
|
493
|
+
totalIssues: 0,
|
|
494
|
+
byType: {}
|
|
495
|
+
};
|
|
496
|
+
for (const fileIssues of issues) {
|
|
497
|
+
for (const issue of fileIssues.issues) {
|
|
498
|
+
summary.totalIssues++;
|
|
499
|
+
summary.byType[issue.type] = (summary.byType[issue.type] || 0) + 1;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return summary;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
export default WordPressPluginReadiness;
|
|
506
|
+
//# sourceMappingURL=wordpress-plugin-readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordpress-plugin-readiness.js","sourceRoot":"","sources":["../../../src/prompts/analyze/wordpress-plugin-readiness.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,yBAAyB;AACzB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAW,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IA6DtD;QACE,KAAK,EAAE,CAAC;QA7DV,SAAI,GAAG,4BAA4B,CAAC;QACpC,aAAQ,GAAG,SAAkB,CAAC;QAC9B,gBAAW,GAAG,2GAA2G,CAAC;QAE1H,eAAU,GAAG;YACX,iDAAiD;YACjD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE,yCAAyC;gBACtD,QAAQ,EAAE,IAAI;aACf;YAED,yBAAyB;YACzB,aAAa,EAAE;gBACb,IAAI,EAAE,QAAiB;gBACvB,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC;gBAC5C,OAAO,EAAE,eAAe;gBACxB,QAAQ,EAAE,KAAK;aAChB;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAgB;gBACtB,WAAW,EAAE,oCAAoC;gBACjD,QA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