Add native asset cachebusting and redundant-plugin notice - #11
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Note
|
| Layer / File(s) | Summary |
|---|---|
Local asset cachebusting inc/class-cachebusting.php |
Local script and style URLs use guarded filesystem resolution and cached filemtime() values to rewrite the ver query argument, while external and unresolved assets remain unchanged. |
Redundant plugin detection inc/class-redundant-plugins-notice.php |
A slug-keyed registry identifies active redundant plugins through plugin paths, names, and multisite network activation. |
Dismissible admin notices inc/class-redundant-plugins-notice.php |
Authorized administrators see undismissed notices, and nonce-checked AJAX requests persist per-user dismissals. |
Plugin integration and release metadata {{PLUGIN_SLUG}}.php, CHANGELOG.md |
Both modules are loaded during initialization, version values are bumped to 0.2.0, and the new features are documented. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Sequence Diagram(s)
Asset version rewriting
sequenceDiagram
participant WordPress
participant CachebustingFilter
participant MtimeCache
participant PathResolver
WordPress->>CachebustingFilter: Filter script/style URL
CachebustingFilter->>MtimeCache: Get mtime for cleaned local URL
MtimeCache->>PathResolver: Resolve URL to filesystem path
PathResolver-->>MtimeCache: Return validated path
MtimeCache-->>CachebustingFilter: Return cached filemtime
CachebustingFilter-->>WordPress: Return URL with updated ver
Redundant plugin notice dismissal
sequenceDiagram
participant Administrator
participant AdminNotice
participant DismissalAjax
participant UserMeta
Administrator->>AdminNotice: Load admin page
AdminNotice->>UserMeta: Read dismissed slugs
AdminNotice-->>Administrator: Render matching notice
Administrator->>DismissalAjax: Dismiss notice with nonce and slug
DismissalAjax->>UserMeta: Store dismissed slug
DismissalAjax-->>Administrator: Return JSON success
Possibly related issues
- Native asset versioning to replace Cachebuster ls-starter-theme#2 — Both changes implement native asset cachebusting to replace the Cachebuster plugin, although this plugin uses URL filters and
filemtime()rewriting.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly matches the main change set: native cachebusting plus a redundant-plugin notice. |
| Linked Issues check | ✅ Passed | The summary indicates the cachebusting, notice, version bump, and changelog updates align with the linked issue requirements. |
| Out of Scope Changes check | ✅ Passed | No clearly unrelated changes are indicated beyond the requested implementation, version bump, and changelog update. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
feat/native-cachebusting
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 @coderabbitai help to get the list of available commands.
|
Tick the box to add this pull request to the merge queue (same as
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@inc/class-cachebusting.php`:
- Around line 47-62: Update the containment check in the path-resolution flow
around $real_base and $real_path to require either an exact base-directory match
or a path beginning with the normalized base directory followed by a directory
separator. Preserve the existing false returns for unresolved paths and reject
sibling paths such as similarly prefixed directories.
In `@inc/class-redundant-plugins-notice.php`:
- Around line 28-46: Update ls_starter_redundant_plugins_registry and
ls_starter_redundant_plugins_notice so the safe-svg entry is marked with a
planned/status value and rendered with an informational-only template that does
not recommend deactivation; preserve the existing deactivation notice for
entries without that status.
🪄 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.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e43fc17-2f6d-4e70-af7e-da6c17b2bf16
📒 Files selected for processing (4)
CHANGELOG.mdinc/class-cachebusting.phpinc/class-redundant-plugins-notice.php{{PLUGIN_SLUG}}.php
|
Both points applied.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Closes #10
Test plan
Summary by CodeRabbit
New Features
Bug Fixes
Documentation