Changeset 14711
- Timestamp:
- 03/13/2026 05:18:29 PM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/plugins/plugin-directory/tools/class-validate-readme.php
r14710 r14711 28 28 array( 29 29 'label' => 'Validate Plugin Readme', 30 'description' => 'Validates a WordPress plugin readme.txt file and returns errors, warnings, and notes.',30 'description' => 'Validates a WordPress plugin readme.txt or readme.md file and returns errors, warnings, and notes. Accepts either the file content directly or a URL to fetch it from.', 31 31 'category' => 'wporg-plugins-plugin-directory', 32 32 'input_schema' => array( … … 37 37 'description' => 'The full text content of the readme.txt or readme.md file to validate.', 38 38 ), 39 'url' => array( 40 'type' => 'string', 41 'description' => 'URL to a readme.txt or readme.md file to fetch and validate. Must end in readme.txt or readme.md.', 42 ), 39 43 ), 40 'required' => array( 'content' ),41 44 ), 42 45 'output_schema' => array( … … 75 78 76 79 /** 77 * Validate the provided readme content .80 * Validate the provided readme content or URL. 78 81 * 79 * @param array $input The tool input containing 'content' .82 * @param array $input The tool input containing 'content' or 'url'. 80 83 * @return array MCP tool result. 81 84 */ … … 89 92 } 90 93 91 $results = Validator::instance()->validate_content( $input['content'] ); 94 if ( ! empty( $input['url'] ) ) { 95 $results = Validator::instance()->validate_url( $input['url'] ); 96 } elseif ( ! empty( $input['content'] ) ) { 97 $results = Validator::instance()->validate_content( $input['content'] ); 98 } else { 99 return array( 100 'error' => 'Provide either "content" or "url".', 101 ); 102 } 92 103 93 104 // Convert HTML messages to markdown/plain text for AI agent consumption.
Note: See TracChangeset
for help on using the changeset viewer.