Skip to content

Performance: prime popup bulk admin actions - #1325

Merged
danieliser merged 1 commit into
developfrom
agent/admin-popup-bulk-actions-perf
Aug 13, 2026
Merged

danieliser merged 1 commit into
developfrom
agent/admin-popup-bulk-actions-perf

Conversation

@danieliser

@danieliser danieliser commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Scope

Standalone performance change against develop for popup-list bulk actions.

Summary

  • Prime selected popup post objects before per-popup bulk processing.
  • Query only for post objects missing from the WordPress object cache; a fully warm selection adds no priming SQL.
  • Deliberately leave metadata unprimed: the write-heavy path is faster with indexed per-popup metadata reads.
  • Preserve per-popup capability checks, popup model validation, published-status checks, metadata APIs/hooks, result counts, and redirects.
  • Enforce a 62-query upper budget instead of an exact WordPress-version-dependent count.

Measured impact

Benchmark: ten fresh batches of 20 published popups, each with enabled=0, current data version, and a cleared post object cache. Timings cover only handle_bulk_actions() and use the median batch.

Metric Baseline Optimized Change
Median SQL queries 80 62 -22.5%
Median execution time 4.980 ms 3.604 ms -27.6%
Popups enabled per batch 20/20 20/20 unchanged

Warm-cache review fixture:

Metric Before follow-up After follow-up
Priming SQL with every selected post cached 1 0

Ablations:

  • Priming posts plus all metadata reduced SQL to 43 but regressed median time to 7.975 ms, so it was removed.
  • WordPress's lower-level cache primer reached 42 queries but was slower than the retained public query path and would couple this code to an internal API, so it was removed.
  • Removing the cache-miss filter reproduced the unnecessary warm-cache query; restoring it returned the fixture to zero SQL.

Validation

  • Full GitHub Tests matrix and CI - Code Quality: green on the final SHA.
  • Popup admin focus: 46 tests, 120 assertions.
  • Changed production-file PHPCS at CI error severity: passed.
  • PHP syntax and git diff --check: passed.
  • Both prior Codex findings remain fixed; no unresolved review threads.
  • Original three-commit scoped range replayed unchanged onto current develop (git range-diff exact match).

Summary by CodeRabbit

  • Performance

    • Improved bulk enabling and disabling of popups by reducing unnecessary database queries.
    • Bulk actions now process selected published popups more efficiently, especially when managing multiple items.
  • Bug Fixes

    • Improved reliability when applying bulk popup status changes to selected items.
  • Tests

    • Added coverage to verify efficient processing and correct popup enablement during bulk actions.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@danieliser, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e1d2565-9ee1-43ff-8a11-6ebb77f776c2

📥 Commits

Reviewing files that changed from the base of the PR and between 366bae7 and 398ecc3.

📒 Files selected for processing (2)
  • classes/Admin/Popups.php
  • tests/php/tests/PUM_Admin_Popups_Test.php

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 408634df-864e-4844-9197-313ee93e0a26

📥 Commits

Reviewing files that changed from the base of the PR and between 9c4e059 and 366bae7.

📒 Files selected for processing (2)
  • classes/Admin/Popups.php
  • tests/php/tests/PUM_Admin_Popups_Test.php

Walkthrough

Bulk popup enable and disable actions now prime selected popup post caches before processing. Tests cover bounded queries for uncached popups and zero-query behavior for cached posts.

Changes

Bulk popup cache handling

Layer / File(s) Summary
Prime popup caches before bulk processing
classes/Admin/Popups.php
Bulk state changes now prime selected popup posts. The helper normalizes IDs, loads uncached posts across statuses, and avoids unrelated query caches.
Validate bulk cache behavior
tests/php/tests/PUM_Admin_Popups_Test.php
Tests verify bounded query usage for 20 uncached published popups and zero queries when selected posts are already cached.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 366ba

The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Possibly related PRs

🚥 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 and concisely describes the main change: improving performance by priming popup objects during bulk admin actions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 agent/admin-popup-bulk-actions-perf

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 869c9fb979

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/php/tests/PUM_Admin_Popups_Test.php Outdated
Comment thread classes/Admin/Popups.php Outdated
@danieliser
danieliser force-pushed the agent/admin-subscriber-table-perf branch from fe59e7f to 505180a Compare August 10, 2026 18:40
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 3f75696 to b5ff37a Compare August 10, 2026 18:40
@danieliser
danieliser force-pushed the agent/admin-subscriber-table-perf branch from 505180a to 7a06417 Compare August 10, 2026 18:56
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from c3601db to 3d9cf19 Compare August 10, 2026 18:57
@danieliser
danieliser force-pushed the agent/admin-subscriber-table-perf branch from 7a06417 to 01a94b5 Compare August 10, 2026 19:06
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 3d9cf19 to 20484f9 Compare August 10, 2026 19:08
@danieliser
danieliser force-pushed the agent/admin-subscriber-table-perf branch from 27b0684 to afcc7f3 Compare August 12, 2026 07:39
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 20484f9 to 2ba8209 Compare August 12, 2026 07:39
@danieliser
danieliser force-pushed the agent/admin-subscriber-table-perf branch from afcc7f3 to c833635 Compare August 13, 2026 01:55
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 2ba8209 to ab79cea Compare August 13, 2026 01:55
@danieliser
danieliser changed the base branch from agent/admin-subscriber-table-perf to develop August 13, 2026 01:55
@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from ab14935 to ab79cea Compare August 13, 2026 01:58
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: ab79cea281

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 3598600 to 767a596 Compare August 13, 2026 02:38
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 767a596ccf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@danieliser
danieliser force-pushed the agent/admin-popup-bulk-actions-perf branch from 2e72a0d to 398ecc3 Compare August 13, 2026 12:33
@danieliser

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 398ecc3008

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danieliser
danieliser merged commit 3af804e into develop Aug 13, 2026
27 checks passed
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