Skip to content

fix: restore AJAX search_models and selectize templates removed in c687d324#784

Merged
superdav42 merged 1 commit intomainfrom
bugfix/restore-search-models
Apr 10, 2026
Merged

fix: restore AJAX search_models and selectize templates removed in c687d324#784
superdav42 merged 1 commit intomainfrom
bugfix/restore-search-models

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

  • Restores the wu_search AJAX endpoint and selectize dropdown templates that were accidentally deleted in c687d32 ("Remove jumper in support of command palette")
  • Fixes all type => 'model' settings fields (Default Registration Page, Default Login Page, etc.) which were rendering as empty/non-functional inputs
  • Also restores the settings sidebar search and user/model search used across edit pages

Root Cause

Commit c687d32 intended to remove the Jumper (replaced by the Command Palette), but the deletion was too aggressive — it removed the entire AJAX search infrastructure from inc/class-ajax.php that all selectize-based model fields depend on:

  1. wu_ajax_wu_search hook — the AJAX endpoint for all [data-model] selectize fields
  2. in_admin_footer hook — renders the <script type="text/html"> dropdown templates
  3. search_models() — main search dispatcher (pages, users, settings, WP Ultimo models)
  4. search_all_models() — cross-model search
  5. search_wp_ultimo_setting() — settings search for the sidebar
  6. search_wordpress_users() — user search
  7. render_selectize_templates() — selectize dropdown HTML templates

The Command Palette uses its own REST API (Command_Palette_Rest_Controller), so these AJAX methods are still needed by the selectize fields.

Changes

  • inc/class-ajax.php: Restored all removed methods and hook registrations. Added $query = [] initialization before first use to prevent PHP undefined variable notices (minor improvement over original).

Affected Settings Fields

All type => 'model' fields across the settings page:

  • Login & Registration: Default Registration Page, Default Login Page
  • Sites: Default Update Page, Default Block Frontend Page, Default New Site Page
  • Settings sidebar search field
  • All model selectors on edit pages (memberships, payments, domains, etc.)

Testing

  • php -l inc/class-ajax.php — no syntax errors
  • vendor/bin/phpstan analyse inc/class-ajax.php — no errors
  • Verified the selectize templates view (views/ui/selectize-templates.php) exists

…87d32

The 'Remove jumper in support of command palette' commit (c687d32)
accidentally deleted the entire AJAX search infrastructure from
class-ajax.php. The selectize-based model fields (used for page/user/
model selection across settings and edit pages) depend on the wu_search
AJAX endpoint and the selectize dropdown templates rendered in the
admin footer.

Restores: search_models(), search_all_models(), search_wp_ultimo_setting(),
search_wordpress_users(), render_selectize_templates(), and their hook
registrations. Initializes $query array before first use to avoid
PHP undefined variable notices.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 27 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20e900b7-da90-47b1-b2ba-b3e9b30e3895

📥 Commits

Reviewing files that changed from the base of the PR and between 4295272 and 6aed2e7.

📒 Files selected for processing (1)
  • inc/class-ajax.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/restore-search-models

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@superdav42 superdav42 merged commit 3d243df into main Apr 10, 2026
11 checks passed
@superdav42
Copy link
Copy Markdown
Collaborator Author

Summary

  • Restores the wu_search AJAX endpoint and selectize dropdown templates that were accidentally deleted in c687d32 ("Remove jumper in support of command palette")
  • Fixes all type => 'model' settings fields (Default Registration Page, Default Login Page, etc.) which were rendering as empty/non-functional inputs
  • Also restores the settings sidebar search and user/model search used across edit pages

Root Cause

Commit c687d32 intended to remove the Jumper (replaced by the Command Palette), but the deletion was too aggressive — it removed the entire AJAX search infrastructure from inc/class-ajax.php that all selectize-based model fields depend on:

  1. wu_ajax_wu_search hook — the AJAX endpoint for all [data-model] selectize fields
  2. in_admin_footer hook — renders the <script type="text/html"> dropdown templates
  3. search_models() — main search dispatcher (pages, users, settings, WP Ultimo models)
  4. search_all_models() — cross-model search
  5. search_wp_ultimo_setting() — settings search for the sidebar
  6. search_wordpress_users() — user search
  7. render_selectize_templates() — selectize dropdown HTML templates
    The Command Palette uses its own REST API (Command_Palette_Rest_Controller), so these AJAX methods are still needed by the selectize fields.

Changes

  • inc/class-ajax.php: Restored all removed methods and hook registrations. Added $query = [] initialization before first use to prevent PHP undefined variable notices (minor improvement over original).

Affected Settings Fields

All type => 'model' fields across the settings page:

  • Login & Registration: Default Registration Page, Default Login Page
  • Sites: Default Update Page, Default Block Frontend Page, Default New Site Page
  • Settings sidebar search field
  • All model selectors on edit pages (memberships, payments, domains, etc.)

Testing

  • php -l inc/class-ajax.php — no syntax errors
  • vendor/bin/phpstan analyse inc/class-ajax.php — no errors
  • Verified the selectize templates view (views/ui/selectize-templates.php) exists

Merged via PR #784 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).


aidevops.sh v3.6.235 spent 5m on this as a headless bash routine.

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions
Copy link
Copy Markdown

Performance Test Results

Performance test results for e0224c1 are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 40 37.73 MB 862.00 ms (+22.00 ms / +3% ) 165.00 ms (-6.50 ms / -4% ) 1094.50 ms 2036.00 ms 1946.90 ms 93.80 ms
1 56 49.02 MB 934.00 ms (-32.00 ms / -3% ) 152.00 ms 1089.50 ms (-37.00 ms / -3% ) 2096.00 ms (-42.00 ms / -2% ) 2012.30 ms 85.60 ms (+1.85 ms / +2% )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant