Skip to content

Commit 3674962

Browse files
authored
Merge pull request #13 from wp-forge/codex-drop-error-log-path-tool
[codex] Drop error log path tool
2 parents 8cb4ab6 + 722a357 commit 3674962

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

src/Tools/ErrorLogTools.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ trait ErrorLogTools {
2323
* @return void
2424
*/
2525
private function add_error_log_abilities() {
26-
$this->add_ability( self::INTERNAL_PREFIX . 'get-error-log-path', 'Get Error Log Path', 'Get the WordPress debug log path used by this site', $this->schema(), function () {
27-
return array( 'path' => $this->get_debug_log_path() );
28-
}, true, 'manage_options' );
29-
3026
$this->add_ability( self::INTERNAL_PREFIX . 'read-error-log', 'Read Error Log', 'Read the tail of the WordPress debug log', $this->schema(
3127
array(
3228
'lines' => $this->int_prop( 'Number of log lines to return.', 200 ),

tests/integration/mcp-endpoint.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ const expectedTools = [
218218
'wp-forge-spam-comment',
219219
'wp-forge-get-site-health-info',
220220
'wp-forge-list-site-health-tests',
221-
'wp-forge-get-error-log-path',
222221
'wp-forge-read-error-log',
223222
'wp-forge-run-wp-cli-command',
224223
'wp-forge-get-global-styles',
@@ -405,7 +404,6 @@ await expectSuccess('wp-forge-delete-comment', { id: commentId });
405404
const siteHealthInfo = await expectSuccess('wp-forge-get-site-health-info');
406405
assert(siteHealthInfo['wp-core'], 'wp-forge-get-site-health-info did not include wp-core debug data');
407406
await expectSuccess('wp-forge-list-site-health-tests');
408-
await expectSuccess('wp-forge-get-error-log-path');
409407
await expectSuccess('wp-forge-read-error-log', { lines: 5 });
410408
await expectError('wp-forge-run-wp-cli-command', { args: ['plugin', 'list'] }, 403);
411409

tests/run.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function assert_same( $expected, $actual, $message ) {
171171
$all = $abilities->list_abilities();
172172
$names = array_column( $all, 'name' );
173173

174-
assert_same( 56, count( $all ), 'Expected the WordPress ability catalog.' );
174+
assert_same( 55, count( $all ), 'Expected the WordPress ability catalog.' );
175175
assert_true( in_array( 'wp-forge-search-content', $names, true ), 'Expected content search ability.' );
176176
assert_true( in_array( 'wp-forge-get-site-info', $names, true ), 'Expected site info ability.' );
177177
assert_true( in_array( 'wp-forge-run-api-function', $names, true ), 'Expected REST runner ability.' );
@@ -223,7 +223,6 @@ function assert_same( $expected, $actual, $message ) {
223223
'wp-forge-spam-comment',
224224
'wp-forge-get-site-health-info',
225225
'wp-forge-list-site-health-tests',
226-
'wp-forge-get-error-log-path',
227226
'wp-forge-read-error-log',
228227
'wp-forge-run-wp-cli-command',
229228
'wp-forge-get-global-styles',
@@ -254,7 +253,7 @@ function assert_same( $expected, $actual, $message ) {
254253

255254
$direct_tools = $abilities->list_tools();
256255
$direct_tool_names = array_column( $direct_tools, 'name' );
257-
assert_same( 56, count( $direct_tools ), 'Expected all abilities to be exposed as direct MCP tools.' );
256+
assert_same( 55, count( $direct_tools ), 'Expected all abilities to be exposed as direct MCP tools.' );
258257
assert_true( in_array( 'wp-forge-search-content', $direct_tool_names, true ), 'Direct tool list should include content search.' );
259258
assert_true( in_array( 'wp-forge-get-active-theme', $direct_tool_names, true ), 'Direct tool list should include active theme.' );
260259
assert_true( ! in_array( 'wp-forge-list-abilities', $direct_tool_names, true ), 'Gateway list tool should not be exposed.' );
@@ -296,11 +295,11 @@ function assert_same( $expected, $actual, $message ) {
296295
assert_same( array( 'page' ), array_column( $public_hierarchical_post_types['message']['post_types'], 'slug' ), 'Post type list should pass filters through to get_post_types().' );
297296

298297
$wp_ability_names = $abilities->get_wordpress_ability_names();
299-
assert_same( 56, count( $wp_ability_names ), 'Expected all abilities to be available for the MCP adapter.' );
298+
assert_same( 55, count( $wp_ability_names ), 'Expected all abilities to be available for the MCP adapter.' );
300299
assert_true( in_array( 'wp-forge/search-content', $wp_ability_names, true ), 'Adapter ability list should use WordPress ability names.' );
301300

302301
$abilities->register_wordpress_abilities();
303-
assert_same( 56, count( $registered_abilities ), 'Expected every ability to be registered with the WordPress Abilities API.' );
302+
assert_same( 55, count( $registered_abilities ), 'Expected every ability to be registered with the WordPress Abilities API.' );
304303
assert_true( isset( $registered_abilities['wp-forge/search-content'] ), 'Content search should be registered with the WordPress Abilities API.' );
305304
assert_same( 'Search and filter content for any registered post type', $registered_abilities['wp-forge/search-content']['description'], 'Registered ability should preserve descriptions.' );
306305
assert_same( true, $registered_abilities['wp-forge/search-content']['meta']['show_in_rest'], 'Registered abilities should be exposed through the Abilities REST API.' );
@@ -331,7 +330,7 @@ public function create_server() {
331330
assert_same( 'mcp', $adapter->args[1], 'Adapter server should keep the existing REST namespace.' );
332331
assert_same( 'wp-forge', $adapter->args[2], 'Adapter server should keep the existing REST route.' );
333332
assert_same( 'WordPress MCP', $adapter->args[3], 'Adapter server should preserve the server name.' );
334-
assert_same( 56, count( $adapter->args[9] ), 'Adapter server should expose every registered ability.' );
333+
assert_same( 55, count( $adapter->args[9] ), 'Adapter server should expose every registered ability.' );
335334
assert_true( in_array( 'wp-forge/search-content', $adapter->args[9], true ), 'Adapter server should expose content search.' );
336335

337336
echo 'Tests passed: ' . $tests_run . PHP_EOL;

0 commit comments

Comments
 (0)