Guarded neve font pairs - #516
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The regression test relies on private implementation details instead of the repository-required public testing seam.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Prevents admin initialization failures when older Neve settings APIs lack font-pair members.
Changes:
- Guards access to Neve’s font-pair constant and default property.
- Adds fallback compatibility coverage.
File summaries
| File | Description |
|---|---|
includes/Admin.php |
Adds compatibility guards before reading Neve font pairs. |
tests/neve-font-pairs-test.php |
Tests fallback pairs with an incompatible Neve API stub. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Changes requested: The new fallback test depends on an ignored frontend build file.
A PHP 7.4 focused run reached both tests. One passed, and one errored before its assertion.
Validation details
- PHPUnit 9.6.36 ran the new class on PHP 7.4.33. It reported one pass and one missing-file error.
- PHP lint passed for both changed PHP files.
- The changed guard introduced no security boundary regression.
Untested areas
- The full repository suite was left to CI.
🤖 Automated review · run code-review-agent_6aa39da0504ae4.26384238.
🤖 Review agent — review posted ✅
- Review: CHANGES_REQUESTED · 2 findings
- Head: a5964a1
- Duration: 12 min 42 s
Run code-review-agent_6aa39da0504ae4.26384238 · trail
|
🤖 Review agent — review failed ❌
Run |
pirate-bot
left a comment
There was a problem hiding this comment.
Approved: The compatibility guard prevents the reported crash, and the focused regression test passes.
PHP 7.4 accepted the compatible guard and the incompatible test case.
Validation details
- PHPUnit 9.6.36 passed three focused tests on PHP 7.4.33 with 12 assertions.
- A PHP 7.4 guard probe accepted the compatible Neve API shape.
- The changed hunks introduced no security boundary regression.
Untested areas
- The full repository suite was left to CI.
🤖 Automated review · run code-review-agent_6aa3a4fe297b35.81310158.
Summary
Improves compatibility with older versions of the Neve theme by enhancing the guard logic in the
get_font_parings()method and adds a new test to ensure backward compatibility. The main focus is to prevent fatal errors when certain Neve settings are not present, as was the case in Neve versions prior to 3.5.0.Check before Pull Request is ready:
Closes #509