Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughReplaces hardcoded Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.44)Invalid configuration: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/Integration/UI/SettingsPageTest.php`:
- Around line 603-610: This test changes the global siteurl and never restores
it; capture the original siteurl with get_option('siteurl') before calling
update_option('siteurl', ...) and ensure it is restored after the assertion (use
a try/finally in the test method surrounding update_option and the
self::$parsely::get_settings_url() assertion, or restore in tearDown) so other
tests are not polluted.
In `@tests/Integration/UI/SiteHealthTest.php`:
- Around line 67-96: Capture the original siteurl before calling
update_option('siteurl', 'http://example.org/wordpress') and restore it in a
finally block so the test doesn't leak global state; e.g., store $original =
get_option('siteurl') before the update, run the existing re-instantiation and
assertions, and in finally call update_option('siteurl', $original) to revert it
(make this change inside the same test method that calls
Site_Health::__construct / Parsely and uses self::$site_health).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 300af20a-52b8-4937-b13b-af688ac11bf9
📒 Files selected for processing (10)
src/@types/assets/window.d.tssrc/UI/class-site-health.phpsrc/content-helper/common/class-content-helper-feature.phpsrc/content-helper/editor-sidebar/class-editor-sidebar.phpsrc/content-helper/editor-sidebar/tabs/sidebar-tools-tab.tsxtests/Integration/UI/SettingsPageTest.phptests/Integration/UI/SiteHealthTest.phptests/e2e/specs/front-end-metadata.spec.tstests/e2e/specs/settings-track-post-types-as.spec.tstests/js/content-helper/editor-sidebar/sidebar-tools-tab.test.tsx
Summary
Hardcoded
/wp-admin/paths were used in several places to build links to the Parse.ly settings page and the Boost Engagement dashboard. On WordPress sites installed in a subdirectory (e.g.https://example.org/wordpress), the admin URL differs from the site URL and these links would navigate to the wrong location or 404.Also fixes a pre-existing bug in
check_site_id()where the Site Health check entry was silently discarded due to a local variable never being written back to the return value.Before
class-site-health.php,class-content-helper-feature.php, andsidebar-tools-tab.tsxall used hardcoded/wp-admin/admin.php?page=...paths.check_site_id()populated a local$directvariable but returned the unmodified$testsarray, so theparselyhealth check entry was never visible.After
Parsely::get_settings_url(), which wrapsget_admin_url()and is multisite-aware.window.wpParselyAdminUrlviawp_add_inline_script, and the TSX component builds its URL from that value using the newgetBoostEngagementUrl()helper.$directbug incheck_site_id()is fixed.get_settings_url()and the Site Health check./(origin-relative, breaking on subdirectorybaseURL) now use abaseURL-relative path.getBoostEngagementUrl()for both standard and subdirectory install URLs.Summary by CodeRabbit
New Features
Bug Fixes
Tests