You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a shared title-and-ID label for page and View choices, including autocomplete results and selected values. Give untitled posts a readable fallback and retain the ID when a title is truncated.
The page autocomplete search strips a trailing "(ID: n)" from the term, so a prefilled label can be edited, and an all-digit term also matches the post ID. The selected autocomplete value keeps the Private and Protected title prefixes.
Dropdown regression tests: 6 tests and 22 assertions passed, including page search by prefilled label and by ID, and the private title prefix on the selected autocomplete value.
Scoped PHP syntax, PHPCS, Rector, PHP CS Fixer and Mago lint and analysis passed.
Remaining draft validation
Review duplicate titles, untitled pages, long titles, selected autocomplete values and gated-content choices in the browser.
We reviewed changes in ab4ee48...339e325 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
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.
The reason will be displayed to describe this comment to others. Learn more.
Request Changes on the current head. This is a draft, and the PR body lists browser validation as still to do. I ran the PHPUnit side and probed the autocomplete search path; one item needs fixing, the rest are smaller.
Should fix before ready: the autocomplete input is now pre-filled with Title (ID: n), but FrmSettingsController::page_search() still searches post_title LIKE term. Editing the pre-filled text finds nothing, and typing an ID finds nothing either (reproduced, see inline).
Non-blocking:FrmAppHelper::page_dropdown_label() is never hooked anywhere in the plugin, only in the new test (see inline).
Non-blocking: the selected autocomplete value now comes from get_post() instead of get_the_title(), so the Private: / Protected: title prefix is dropped (Secret now, Private: Secret before).
Tests run: vendor/bin/phpunit tests/phpunit/misc/test_FrmPostDropdownLabels.php at 89757f3 → OK (5 tests, 19 assertions). CI did not run PHPUnit, PHPCS or PHPStan on this draft, so this local run is the only execution. Not run in a browser: selected autocomplete values and long-title truncation, which the PR body also lists as open.
The reason will be displayed to describe this comment to others. Learn more.
Should fix. The label now carries (ID: n), but the query above it still only matches post_title. I ran the same FrmDb::get_results( $wpdb->posts, array( ..., 'post_title LIKE' => $term ), ... ) against a published page titled Saved Listings (ID 24):
term Saved Listings → 1 row
term Saved Listings (ID: 24) → 0 rows
term 24 → 0 rows
So the pre-filled value (FrmAppHelper::maybe_autocomplete_pages_options()) cannot be refined without losing every match, and the ID that this PR is adding cannot be used to find the page. Fix: strip a trailing (ID: n) from the term and also match an all-digit term against ID. Sketch:
and extend $where with an ID OR clause when ctype_digit( $term ). Add a test that calls page_search() (or the query) with a prefilled label and with a numeric ID.
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking.page_dropdown_label() has no caller in the plugin (grep -rn page_dropdown_label classes paypal stripe square js/src finds only this definition). Only test_page_dropdown_preserves_selection_and_escapes_titles hooks it onto list_pages, so that test proves the filter works when a test hooks it, not that any real page dropdown shows IDs. Either hook it where a Formidable screen calls wp_dropdown_pages() (none does in Lite today; Pro may), or drop the method and that test until the caller exists.
The page autocomplete now strips a trailing "(ID: n)" from the search
term and matches an all-digit term against the post ID, so a prefilled
label can be edited and a page can be found by ID.
Keep the Private and Protected title prefix on the selected autocomplete
value, and drop the unused page_dropdown_label() filter callback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Approve at 3acba6b with one non-blocking note. This is a re-review of the whole PR (my Request Changes was at 89757f3). The new commit 3acba6b fixes the blocking item and the two non-blocking ones.
Earlier items
Page search by prefilled label or ID: fixed. get_page_search_results() strips a trailing (ID: n) and also matches an all-digit term against ID. Both halves are covered by test_page_search_matches_prefilled_label_and_id, and I mutation-checked it: with the suffix strip removed the Saved Listings (ID: n) term fails, and with the digit branch removed the n term fails.
page_dropdown_label() with no caller: fixed. It is gone, and the dropdown test now goes through wp_pages_dropdown().
Private: / Protected: prefix dropped on the selected value: fixed. get_the_title( $post ) feeds the label, and the test asserts Private: Secret (ID: n).
Checked
Read the full diff again. The new SQL group keeps post_status = publish and post_type as ANDed conditions: with a draft page, a post and a page all titled ... 24, searching 24 against type page returned only the published page, and a post's ID returned nothing. The label goes through esc_html / esc_attr at the call sites, and the test covers a <script> title.
Live, in a Playground preview env (Lite at 3acba6b, 52 filler pages, two pages titled "Pricing", one untitled, one with a 190-character title, one private), in Form settings > Confirmation > Show Page Content:
"Pric" lists Pricing (ID: 62) and Pricing (ID: 63), so duplicate titles are told apart.
64 lists (no title) (ID: 64), and "A very long" lists the full long title with no truncation in the autocomplete.
A prefilled Pricing (ID: 63) still lists both Pricing pages, and picking one sets the input to Pricing (ID: 63) with the hidden value 63.
Non-blocking
Editing the prefilled label by backspacing into the suffix finds nothing until it is fully removed. The strip only matches a complete (ID: n), so Pricing (ID: 6 is searched as a literal title and returns "No items found." (also Pricing (ID:, Pricing (). Select-all and retype, and deleting the whole suffix, both work. A looser pattern in get_page_search_results() that also drops an unfinished trailing (ID... would cover it; a test line with Saved Listings (ID: would pin it.
Tests run: phpunit -c <9.x config> tests/phpunit/misc/test_FrmPostDropdownLabels.php at 3acba6b in the wordpress-develop harness (PHP 8.4, PR copied in) → OK (6 tests, 22 assertions). CI skipped PHPUnit, PHPCS and PHPStan on this draft, so that local run is the only execution.
CI note: the DeepSource: PHP check is red, with its inline comments saying assertSame, assertStringContainsString, assertLessThan and factory() are undefined on test_FrmPostDropdownLabels. Those are inherited from the WP/PHPUnit test case and the file runs green, so they look like false positives from DeepSource not resolving the base class. Someone with DeepSource access should confirm and dismiss them before merge.
Not covered
Saving the action and reloading to see the prefilled Title (ID: n) in the browser (the save click hit an ambiguous button in my driver); the render of that value is covered by the PHPUnit test only.
The plain dropdown (50 pages or fewer) and the long-title truncation in a browser, and the gated-content selector (Pro companion formidable-pro#6973). These are covered by the PHPUnit tests only.
code-review, security-review and simplify were not run.
The reason will be displayed to describe this comment to others. Learn more.
Approve. The non-blocking note from my last review is fixed at 84cdf0f, and the merge of master after it is clean. I found nothing new.
Backspacing into the suffix now works: the strip in get_page_search_results() also drops an unfinished trailing (, (I, (ID, (ID: and (ID: 6. I ran the regex over 19 inputs: every partial suffix and Pricing (ID:63 reduce to Pricing; real parentheticals such as Pricing (Inc.), (Intro) and (IDEA are left alone. The test now pins Saved Listings (ID: 6, (ID: , (ID, (I and (.
The test catches the old code: with the old \(ID: \d+\) regex put back, test_page_search_matches_prefilled_label_and_id fails; with the new one it passes.
Merge is clean:git show --remerge-diff on d7d804b is empty. The PR's own diff is still the 4 files I reviewed (FrmSettingsController, FrmAppHelper, FrmGatedContentAction, the test).
phpcs --standard=phpcs.xml over those 4 files is clean.
Tests run: phpunit tests/phpunit/misc/test_FrmPostDropdownLabels.php at d7d804b in the wordpress-develop harness (PR copied in) → OK (6 tests, 27 assertions). Wider --filter 'FrmSettings|FrmAppHelper|FrmPostDropdown|FrmGatedContent' → OK (76 tests, 355 assertions). CI skipped PHPUnit and PHPCS on this draft, so these local runs are the only execution.
Not exercised: the autocomplete input in the admin UI after this commit (the search logic ran against the real DB via PHPUnit, the typing flow did not), the Pro companion formidable-pro#6973, and the three review skills. The DeepSource: PHP check is still red with the same undefined-assert comments on the test file; they look like false positives from the base class not resolving, and someone with DeepSource access should dismiss them before merge.
franky-review was re-added at 18:25Z, but the head is still d7d804b, the commit my Approve (2026-11-11 21:24Z) covers, and there are no new commits since. The PR is still mergeable with no conflicts, so I did not repeat the review. The Approve stands. Removing the labels. Add franky-review again after the next push.
The reason will be displayed to describe this comment to others. Learn more.
Approve at 79a98a2. My Approve was at d7d804b; the head has since moved by two merges of master (0984677, 79a98a2), so this is a fresh verdict at the new head, not a relabel.
PR's own change is untouched:git show --remerge-diff is empty for both merges (clean). The PR diff is still the same 4 files. FrmSettingsController, FrmGatedContentAction and the test are byte-identical to d7d804b. The only change to FrmAppHelper.php since then is master's own hunks (long-key duplicate fix, styler colour parsing); none of them touch get_post_dropdown_label() or wp_pages_dropdown().
Nothing new found on the PR's code.
Tests run: phpunit -c phpunit9.xml tests/phpunit/misc/test_FrmPostDropdownLabels.php at 79a98a2 in the wordpress-develop harness (PHP 8.4, PR copied in) → OK (6 tests, 27 assertions). Wider --filter 'FrmSettings|FrmAppHelper|FrmPostDropdown|FrmGatedContent' → OK (77 tests, 359 assertions). CI skipped PHPUnit and PHPCS on this draft, so this local run is the only execution.
Not exercised: the autocomplete input in the admin UI at this head (the earlier live pass was at 3acba6b; the search logic ran against the real DB via PHPUnit), PHPCS at this head, the Pro companion formidable-pro#6973, and the three review skills. The DeepSource: PHP red check is the same undefined-assert false positive noted before; someone with DeepSource access should dismiss it before merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a shared title-and-ID label for page and View choices, including autocomplete results and selected values. Give untitled posts a readable fallback and retain the ID when a title is truncated.
The page autocomplete search strips a trailing "(ID: n)" from the term, so a prefilled label can be edited, and an all-digit term also matches the post ID. The selected autocomplete value keeps the Private and Protected title prefixes.
Companion Pro PR: https://github.com/Strategy11/formidable-pro/pull/6973 (uses
FrmAppHelper::get_post_dropdown_label()in the gated-content access-page selector).Testing
Remaining draft validation
Review duplicate titles, untitled pages, long titles, selected autocomplete values and gated-content choices in the browser.