Skip to content

Performance: reduce Popup Editor memory and TTFB - #1317

Merged
danieliser merged 1 commit into
developfrom
agent/php-popup-editor-perf
Aug 14, 2026
Merged

Performance: reduce Popup Editor memory and TTFB#1317
danieliser merged 1 commit into
developfrom
agent/php-popup-editor-perf

Conversation

@danieliser

@danieliser danieliser commented Aug 10, 2026

Copy link
Copy Markdown
Member

Status: sequence-gated draft

Do not merge #1317 yet. #1316 must merge first; then this branch must be rebased onto the resulting develop and all exact-head gates rerun. Current checks provide evidence for the two-commit #1354 live-test draft only.

Summary

Popup Editor performance change based directly on the shared popup-query foundation merged in #1356.

  • Localizes lightweight { ID, post_title } choices only for the block-editor package.
  • Adapts the shared PUM_Helpers::popup_selectlist() output directly; it performs no private query or per-ID post lookup/validation.
  • Includes published and capability-readable private popups, preserving existing trigger-viewer labels.
  • Preserves complete popup models whenever extensions use popup_maker/block-editor_localized_vars, including priority-0 registrations.
  • Loads Popup Maker editor CSS from local plugin files for block-editor settings, avoiding server-side loopback HTTP.
  • Keeps TinyMCE public stylesheet URLs and selects the correct LTR/RTL variants.
  • Inherits all shared helper hardening and helper tests from merged Harden lightweight popup selector queries #1356; none is duplicated in this PR.

Merge sequencing

#1316 owns the Components localization used by PopupSelectControl; this PR owns the separate block-editor payload and editor styles. On the current base, #1317 avoids the second full-model localization but Components still hydrates those models once. Merge #1316 first, then rebase this branch on the resulting develop before merging #1317. The draft #1354 contains both exact patches for combined validation. Duplicating Components ownership here would recreate the overlap these PRs intentionally removed.

Exact scope

Verification

  • PHP syntax: passed for all four changed files.
  • Changed-file PHPCS: passed.
  • Focused production PHPStan: passed.
  • git diff --check: passed.
  • Query audit: no get_posts(), direct WP_Query, $wpdb, or per-popup get_post_type() in this PR.
  • Focused local PHPUnit was attempted but the local WordPress test database reports unavailable tables; exact-head GitHub CI is the full matrix authority.

Ablation retained

Focused regressions preserve the independently necessary behaviors: lightweight block-editor shaping, readable private choices, supported title-choice filtering, full-model extension fallback, TinyMCE stylesheet registration, local block-editor CSS injection, and RTL/LTR selection.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Popup Maker now injects editor styles through TinyMCE and block-editor filters. It also preserves filtered popup models or returns reduced ID and post_title choices for block-editor localization.

Changes

Editor integration and popup localization

Layer / File(s) Summary
Editor stylesheet integration
classes/Admin/Shortcode/UI.php, tests/php/tests/PUM_Admin_Shortcode_UI_Test.php
TinyMCE receives site, admin, and RTL stylesheet URLs. Block-editor settings receive readable local CSS. Tests cover standard styles, RTL styles, and local asset loading without HTTP requests.
Block-editor popup localization
classes/Controllers/Assets.php, tests/php/tests/Block_Editor_Assets_Controller_Test.php
Localization preserves full popup models when filters have callbacks. Otherwise, it returns sequential ID and post_title choices. Tests cover model preservation and filtered titles.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: 🟡 Moderate · up to 871dc

The performance changes are otherwise well validated, but one focused regression test uses a filter that this data path does not execute, so its expected localized title is not actually verified; merge should wait for that test to be corrected or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant PUM_Admin_Shortcode_UI
  participant TinyMCE
  participant BlockEditor
  participant LocalCSSFiles
  PUM_Admin_Shortcode_UI->>TinyMCE: Add editor stylesheet URLs
  TinyMCE-->>PUM_Admin_Shortcode_UI: Return filtered CSS list
  PUM_Admin_Shortcode_UI->>BlockEditor: Add local CSS to editor settings
  BlockEditor->>LocalCSSFiles: Read stylesheet contents
  LocalCSSFiles-->>BlockEditor: Return theme styles
Loading
sequenceDiagram
  participant BlockEditor
  participant AssetsController
  participant PUM_Helpers
  BlockEditor->>AssetsController: Request popup localization data
  alt Localization filter has callbacks
    AssetsController-->>BlockEditor: Return full popup models
  else No localization filter callbacks
    AssetsController->>PUM_Helpers: Build popup_selectlist choices
    PUM_Helpers-->>AssetsController: Return ID and post_title choices
    AssetsController-->>BlockEditor: Return reduced popup data
  end
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the PR's main objective: reducing Popup Editor memory usage and TTFB.
✨ 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/php-popup-editor-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: 5d7304ee8a

ℹ️ 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 classes/Helpers.php Outdated
@danieliser
danieliser force-pushed the agent/php-admin-plugin-pages-perf branch from c5d6a82 to 3f7cc9f Compare August 13, 2026 02:04
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from 5675929 to 72b2069 Compare August 13, 2026 02:04
@danieliser
danieliser changed the base branch from agent/php-admin-plugin-pages-perf to develop August 13, 2026 02:05
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from 72b2069 to d2bbec0 Compare August 13, 2026 02:05

@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: d2bbec04e9

ℹ️ 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 classes/Helpers.php Outdated
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from d2bbec0 to 484de20 Compare August 13, 2026 02:13

@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: 484de201dc

ℹ️ 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 classes/Controllers/Assets.php Outdated
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch 3 times, most recently from 4b78607 to 7b55833 Compare August 13, 2026 02:35

@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: 7b558335de

ℹ️ 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 classes/Helpers.php Outdated
Comment thread classes/Helpers.php Outdated
Comment thread classes/Controllers/Assets.php Outdated
@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: 7b558335de

ℹ️ 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/php-popup-editor-perf branch from 7b55833 to 6f63849 Compare August 13, 2026 02:50
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 6f63849b8a

ℹ️ 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

@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: f6babed14d

ℹ️ 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 classes/Helpers.php Outdated
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from f6babed to f0bac7c Compare August 13, 2026 04:23
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@danieliser

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 50 minutes.

@danieliser
danieliser marked this pull request as draft August 13, 2026 16:57
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from a0399b2 to 826092d Compare August 13, 2026 16:59
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: a0399b257b

ℹ️ 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

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 44 minutes.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 826092dc63

ℹ️ 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 the exact current head, including the readable-private popup compatibility change.

@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: 826092dc63

ℹ️ 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 classes/Controllers/Assets.php Outdated
@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from 242e61e to 2504f6b Compare August 14, 2026 03:29
@danieliser
danieliser marked this pull request as ready for review August 14, 2026 03:29
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from 2504f6b to 05cfcf2 Compare August 14, 2026 03:30
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 05cfcf25dc

ℹ️ 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/php-popup-editor-perf branch from 6e119db to a2cd5cb Compare August 14, 2026 03:48
@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: a2cd5cb17e

ℹ️ 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/php-popup-editor-perf branch from 974be17 to b62bb80 Compare August 14, 2026 03:54
@danieliser

Copy link
Copy Markdown
Member Author

@codex review

@danieliser
danieliser force-pushed the agent/php-popup-editor-perf branch from 47921f1 to 9e0b4ce Compare August 14, 2026 03:56
@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: 9e0b4cef36

ℹ️ 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 2e18236 into develop Aug 14, 2026
53 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