Conversation
…e plugins on non-proxy requests.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPlugin version bumped to 1.0.1 with security and accuracy improvements. Request URI detection now uses null-coalescing for safety. Proxy request detection rewritten to strictly match REST-path-segment namespace. Plugin filtering changed from substring to exact filename matching. ChangesPlausible Proxy Speed Module Hardening
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 1
🧹 Nitpick comments (1)
mu-plugin/plausible-proxy-speed-module.php (1)
109-111: ⚡ Quick winCompare against the full plugin basename, not only the filename.
Using
basename( $plugin )still keeps any plugin whose main file is also namedplausible-analytics.php. Sinceoption_active_pluginsalready storesdir/file.php, matching the full plugin basename would make this allowlist truly exact.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mu-plugin/plausible-proxy-speed-module.php` around lines 109 - 111, The current check uses basename($plugin) which only compares filename and can false-match plugins with the same main filename; change the comparison to use the full plugin basename (e.g. plugin_basename($plugin) or compare $plugin directly) so the allowlist ($allowed_plugin_files) is matched against the full "dir/file.php" identifier; update the loop where $active_plugins, $plugin, $allowed_plugin_files, and $filtered_plugins are used to replace basename($plugin) with the full plugin basename function or the full path string for an exact match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mu-plugin/plausible-proxy-speed-module.php`:
- Around line 71-78: The current check builds $expected from
rest_get_url_prefix() and assumes the REST root is at document root, which fails
for subdirectory installs; instead derive the full REST path from rest_url()
(e.g. $rest_path = trim( parse_url( rest_url(), PHP_URL_PATH ), '/' ) ), build
$expected using that ($expected = '/' . $rest_path . '/' . trim($namespace,
'/')), and then compare $path against this $expected (or starts with $expected .
'/'); update the logic that sets $rest_prefix/$expected and the return condition
(the symbols to edit are $rest_prefix, $expected, $path and replace or augment
rest_get_url_prefix() usage with rest_url()/parse_url).
---
Nitpick comments:
In `@mu-plugin/plausible-proxy-speed-module.php`:
- Around line 109-111: The current check uses basename($plugin) which only
compares filename and can false-match plugins with the same main filename;
change the comparison to use the full plugin basename (e.g.
plugin_basename($plugin) or compare $plugin directly) so the allowlist
($allowed_plugin_files) is matched against the full "dir/file.php" identifier;
update the loop where $active_plugins, $plugin, $allowed_plugin_files, and
$filtered_plugins are used to replace basename($plugin) with the full plugin
basename function or the full path string for an exact match.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bfb86f4e-2321-444f-910b-279a1a83ffe5
📒 Files selected for processing (1)
mu-plugin/plausible-proxy-speed-module.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
Chores
Bug Fixes