Commit 63204bc
authored
Three findings from CodeRabbit's re-review of PR #62:
1. TemplateManagerWriteTest.php: a real test-isolation bug —
test_update_template_reports_rollback_failure_when_delete_also_fails()
added pre_insert_term/pre_delete_post filters and only removed them
after update_template() returned. An unexpected exception from that
call would skip both remove_filter() calls, leaking the filters into
every later test in the same PHP process (any subsequent
wp_insert_term()/wp_delete_post() call would be affected). Wrapped the
call in try/finally so cleanup always runs.
2. Same file: added `@var \WP_Error $result` narrowing docblocks after
four assertInstanceOf(\WP_Error::class, $result) calls, immediately
before each result's get_error_code()/get_error_data() calls.
composer analyze is already clean on develop (tests/* is excluded
from this repo's own PHPStan paths) — applied because it's a trivial,
readability-neutral-to-positive one-liner per site, not because our
gate required it.
3. src/tools/templates.ts: list_templates' description said a non-null
wp_id "is what makes a template editable via update_template" —
false. update_template()'s own description (and behavior) already
documents that a wp_id:null template is still editable: calling it
creates a new override. Reworded to describe wp_id as existing
database backing, matching get_template's accurate framing, without
implying editability requires it.
Manifest/bundle regenerated for the description change (tool count
unchanged at 33).
This is the last dispatch on the CodeRabbit-follow-up thread.
Claude-Session: https://claude.ai/code/session_013YcSbKroBJjPanX3okQrT3
1 parent 53118bd commit 63204bc
4 files changed
Lines changed: 21 additions & 11 deletions
File tree
- src/tools
- wordpress-plugin/gk-block-mcp
- assets/mcp-server
- includes/abilities
- tests/Templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53604 | 53604 | | |
53605 | 53605 | | |
53606 | 53606 | | |
53607 | | - | |
| 53607 | + | |
53608 | 53608 | | |
53609 | 53609 | | |
53610 | 53610 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2116 | 2116 | | |
2117 | 2117 | | |
2118 | 2118 | | |
2119 | | - | |
| 2119 | + | |
2120 | 2120 | | |
2121 | 2121 | | |
2122 | 2122 | | |
| |||
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
515 | 520 | | |
516 | 521 | | |
| 522 | + | |
517 | 523 | | |
518 | 524 | | |
519 | 525 | | |
| |||
600 | 606 | | |
601 | 607 | | |
602 | 608 | | |
| 609 | + | |
603 | 610 | | |
604 | 611 | | |
605 | 612 | | |
| |||
617 | 624 | | |
618 | 625 | | |
619 | 626 | | |
| 627 | + | |
620 | 628 | | |
621 | 629 | | |
622 | 630 | | |
| |||
635 | 643 | | |
636 | 644 | | |
637 | 645 | | |
| 646 | + | |
638 | 647 | | |
639 | 648 | | |
640 | 649 | | |
| |||
651 | 660 | | |
652 | 661 | | |
653 | 662 | | |
| 663 | + | |
654 | 664 | | |
655 | 665 | | |
656 | 666 | | |
| |||
0 commit comments