Add new empty states for forms/entries searches#3191
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Jul 16, 2026 2:49p.m. | Review ↗ | |
| JavaScript | Jul 16, 2026 2:49p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
classes/helpers/FrmEntriesListHelper.php (1)
212-215: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSimplify the generation of the "Clear search" URL.
WordPress's
remove_query_arg()automatically defaults to using the current request URI if no URL is provided. Manually constructing the absolute URL usingHTTP_HOSTandREQUEST_URIis redundant and can occasionally cause issues in complex reverse-proxy environments. Additionally,FrmAppHelper::get_server_value()applieswp_strip_all_tags(), which could inadvertently alter valid URL parameters if they happen to contain tag-like characters.You can safely simplify this to use WordPress's default behavior, as the output is correctly sanitized by
esc_url()later:
classes/helpers/FrmEntriesListHelper.php#L212-L215: Replace these lines with$clear_url = remove_query_arg( 's' );classes/helpers/FrmFormsListHelper.php#L145-L148: Replace these lines with$clear_url = remove_query_arg( 's' );🤖 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 `@classes/helpers/FrmEntriesListHelper.php` around lines 212 - 215, In classes/helpers/FrmEntriesListHelper.php lines 212-215 and classes/helpers/FrmFormsListHelper.php lines 145-148, simplify the clear-search URL generation by removing the manual HTTP_HOST/REQUEST_URI and set_url_scheme logic, and call remove_query_arg('s') without an explicit URL in each helper’s clear-URL flow.
🤖 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.
Nitpick comments:
In `@classes/helpers/FrmEntriesListHelper.php`:
- Around line 212-215: In classes/helpers/FrmEntriesListHelper.php lines 212-215
and classes/helpers/FrmFormsListHelper.php lines 145-148, simplify the
clear-search URL generation by removing the manual HTTP_HOST/REQUEST_URI and
set_url_scheme logic, and call remove_query_arg('s') without an explicit URL in
each helper’s clear-URL flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2b07d0ea-51a1-4ba6-b66a-e83d9569b4bd
📒 Files selected for processing (2)
classes/helpers/FrmEntriesListHelper.phpclasses/helpers/FrmFormsListHelper.php
Razvan requested this.
Now, the empty states for forms/entries will show a special message when there is a search query, with a link to clear the search and reload the page.
Before

After

Summary by CodeRabbit