Skip to content

Editor: Preload the author of the post summary - #86069

Closed
ellatrix wants to merge 2 commits into
trunkfrom
preload/post-summary-requests
Closed

ellatrix wants to merge 2 commits into
trunkfrom
preload/post-summary-requests

Conversation

@ellatrix

@ellatrix ellatrix commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #85081. See #85118.

Preloads the author request of the post summary, in the post editor and for pages in the site editor, so it's no longer sent after the editor loads.

Why?

#85081 switched the author field to GET /wp/v2/users?include[0]=<id>&who=authors (AuthorView in core-fields) and dropped the old author preload. The new request couldn't be preloaded: WP_User_Query reports who as deprecated, and preloading runs while the page renders, so with WP_DEBUG on the notice was printed before <!DOCTYPE html>. That's the default on wp-env development sites.

A real REST request doesn't print it: Core reports deprecated arguments in a header instead (rest_api_default_filters()). Preloaded requests didn't get that treatment.

How?

  • preload.php: the author request is preloaded with its own rest_preload_api_request() call, next to where Editor: Stabilize the DataForm-based inspector #85081 removes the old author preload, and for pages in the site editor. deprecated_argument_trigger_error returns false only around that call, so nothing else is affected. Its data goes to wp-api-fetch in its own preloading middleware.
  • edit-post: the startup kickoff requests the author with the same query as AuthorView, so the preload is used before clearPreloadedData() runs.
  • The preload e2e tests no longer allow the author request.

The site editor's templates and form config requests from #85081 are preloaded in #78521, so this PR leaves them out.

Checked locally with WP_DEBUG on, editing a post and a page:

Page starts with Deprecation notices
Without the silencing around the call <b>Deprecated</b>: Function WP_User_Query was called with an argument that is deprecated… 1
This PR <!DOCTYPE html> 0

The updated preload e2e tests fail on trunk's code (the author request is sent in both editors) and pass with this PR. I couldn't run PHPUnit locally, so the new PHP tests run first in CI.

For Core, the silencing would go around the rest_do_request() call in rest_preload_api_request(), and the path could join the post editor's preload list.

Testing Instructions

  1. With WP_DEBUG on, open a post in the post editor with the browser's network panel open.
  2. No users?…who=authors request is sent, and the author shows in the post summary.
  3. The page source starts with <!DOCTYPE html>, with no deprecation notice before it.
  4. Open a page in the site editor (site-editor.php?p=/page/<id>&canvas=edit) and check the same.

Testing Instructions for Keyboard

None, no UI change.

Screenshots or screencast

None: the change is in the network requests and the page source, shown in the table above.

Use of AI Tools

Authored with Claude Code (Claude Opus 5.5), reviewed by me.

🤖 Generated with Claude Code

The author field of the post summary queries the users collection with
`who=authors`. It wasn't preloaded because `WP_User_Query` reports `who` as
deprecated, and during a page render the notice is printed into the page.
REST requests report deprecated arguments in a header, so internal ones now
don't print them either, and the author is preloaded in the post editor and
for pages in the site editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Package] Edit Post /packages/edit-post label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

📦 Bundle size

Size Change: +38 B (0%)

Total Size: 8.57 MB

📦 View Changed
Filename Size Change
build/scripts/edit-post/index.min.js 45.3 kB +38 B (+0.08%)

c4ee52b Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 9d3c78e trunk % Change
timeToFirstByte 50.3 ms +9.54% -5.17% 48.4 ms +11.05% -2.27% 3.93%
largestContentfulPaint 84 ms +7.14% -4.76% 88 ms +2.27% -9.09% -4.55%
lcpMinusTtfb 32.3 ms +5.88% -1.55% 34.25 ms +19.71% -7.01% -5.69%
wpBeforeTemplate 24.58 ms +12.69% -2.56% 24.42 ms +10.07% -2.33% 0.66%
wpTemplate 20.39 ms +7.6% -3.38% 20.05 ms +4.29% -4.39% 1.7%
wpTotal 46.34 ms +9.21% -5.48% 44.76 ms +9.63% -3.08% 3.53%
wpMemoryUsage 7.70 MB +0% -0% 7.67 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 9d3c78e trunk % Change
timeToFirstByte 40.1 ms +4.61% -3.24% 36.45 ms +4.8% -3.57% 10.01%
largestContentfulPaint 88 ms +4.55% -0% 80 ms +5% -0% 10%
lcpMinusTtfb 49.35 ms +1.72% -2.33% 44.05 ms +1.36% -1.93% 12.03%
wpBeforeTemplate 21.36 ms +2.95% -2.95% 21.47 ms +5.22% -1.91% -0.51%
wpTemplate 15.38 ms +5.07% -4.1% 11.7 ms +4.44% -4.79% 31.45%
wpTotal 37.03 ms +4.7% -3.27% 33.58 ms +5% -3.99% 10.27%
wpMemoryUsage 6.39 MB +0% -0% 6.25 MB +0% -0% 2.32%
wpDbQueries 13 +0% -0% 9 +0% -0% 44.44%

media-processing

Metric 9d3c78e trunk % Change
mediaProcessingJpeg 393.18 ms +1% -0.38% 399.07 ms +1.18% -0.54% -1.48%
mediaProcessingAvif 5751.64 ms +1% -0.15% 5813.57 ms +0.48% -0.51% -1.07%
mediaProcessingJpegToAvif 3931.16 ms +0.17% -0.91% 4002.59 ms +0.26% -0.62% -1.78%

media-upload

Metric 9d3c78e trunk % Change
jpegUploadProcessing 1469.3 ms +33.78% -0.58% 1474.48 ms +1.53% -1.07% -0.35%
pngUploadProcessing 231.64 ms +8.91% -5.13% 241.62 ms +3.56% -7.17% -4.13%
largeJpegUploadProcessing 1454.82 ms +1.01% -0.36% 1467.47 ms +1.07% -0.96% -0.86%
multipleImageUploadProcessing 1599.97 ms +8.38% -2.43% 2028.98 ms +2.45% -5.38% -21.14%

post-editor

Metric 9d3c78e trunk % Change
serverResponse 319.92 ms +7.16% -8.42% 326.93 ms +1.88% -7.14% -2.14%
firstPaint 311.77 ms +29.11% -23.96% 389.79 ms +1.5% -28.76% -20.02%
domContentLoaded 689.48 ms +3.17% -1.18% 679.64 ms +4.36% -0.55% 1.45%
loaded 690.38 ms +3.19% -1.17% 680.51 ms +4.38% -0.53% 1.45%
firstContentfulPaint 413.42 ms +3.07% -3.42% 392.52 ms +4.31% -1.25% 5.32%
firstBlock 1759.34 ms +2.02% -1.06% 1770.84 ms +1.97% -0.94% -0.65%
type 17.3 ms +6.3% -12.37% 16.21 ms +1.42% -11.1% 6.72%
typeWithoutInspector 15.37 ms +8.39% -6.18% 15.22 ms +7.16% -9.33% 0.99%
typeWithTopToolbar 21.13 ms +14.39% -8.71% 20.98 ms +7.53% -4.39% 0.71%
typeContainer 6.76 ms +8.14% -9.62% 6.95 ms +5.04% -2.16% -2.73%
focus 98.34 ms +2.58% -6.65% 94.14 ms +3.53% -7.02% 4.46%
firstFocus 212.32 ms +0% -0% 206.74 ms +0% -0% 2.7%
selectAll 322.31 ms +1.03% -2.59% 328.24 ms +0.27% -1.35% -1.81%
undo 24.98 ms +7.37% -1.88% 26.21 ms +6.45% -3.36% -4.69%
listViewOpen 61.93 ms +4.39% -6.64% 58.94 ms +12.47% -2.56% 5.07%
inserterOpen 35.5 ms +6.79% -6.14% 35.61 ms +6.57% -2.02% -0.31%
inserterHover 9.09 ms +11.88% -3.41% 9.78 ms +4.4% -6.95% -7.06%
inserterSearch 7.56 ms +3.04% -10.98% 6.93 ms +2.45% -3.9% 9.09%
loadPatterns 517.73 ms +3.05% -1.78% 534.16 ms +3.7% -1.75% -3.08%
wpTotal 311.18 ms +7.34% -8.58% 318.24 ms +1.92% -7.35% -2.22%
wpMemoryUsage 14.75 MB +0% -0% 14.72 MB +0% -0% 0.26%
wpDbQueries 57 +0% -0% 55 +0% -0% 3.64%

site-editor

Metric 9d3c78e trunk % Change
serverResponse 254.41 ms +2.3% -7.81% 264.49 ms +1.34% -3.16% -3.81%
firstPaint 242.55 ms +11.41% -6.54% 265.9 ms +1.36% -6.39% -8.78%
domContentLoaded 550.99 ms +1.89% -1.25% 598.86 ms +1.24% -2.6% -7.99%
loaded 551.68 ms +1.9% -1.23% 599.7 ms +1.21% -2.59% -8.01%
firstContentfulPaint 322.6 ms +1.33% -1.68% 353.03 ms +4.5% -2.94% -8.62%
firstBlock 1606.11 ms +1.97% -1.4% 1704.21 ms +1.54% -1.71% -5.76%
type 13.26 ms +5.35% -14.48% 16.16 ms +2.6% -6% -17.95%
navigate 81.09 ms +8.61% -4.48% 81.36 ms +5.38% -6.06% -0.33%
loadPatterns 767.21 ms +6.1% -2.3% 739.49 ms +25.55% -6.61% 3.75%
loadPages 929.87 ms +2.1% -1.3% 936.67 ms +1.91% -2.5% -0.73%
wpTotal 248.16 ms +2.39% -8% 257.98 ms +1.3% -3.18% -3.81%
wpMemoryUsage 12.77 MB +0% -0% 12.73 MB +0% -0% 0.33%
wpDbQueries 47 +0% -0% 45 +0% -0% 4.44%

c4ee52b Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Actions are reachable via RIGHT/LEFT arrow keys (Site Editor v2) in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page One View Actions' }).getByLabel('Actions')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page One View Actions' }).getByLabel('Actions') with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page One View Actions' }).getByLabel('Actions')
    14 × locator resolved to <button type="button" tabindex="-1" aria-haspopup="menu" aria-label="Actions" aria-expanded="false" id="view-list-0-12-dropdown" class="components-button is-small has-icon">…</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:181:5
cursor in a table cell appears in the same cell for another user (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-nested-awareness-selection.spec.ts, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8889/wp-json/wp/v2/users?per_page=100
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 4449c02870
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1793553636%7C92Da4fpfbJswvXSi9luCHQcBLwZgAk5RLdgNtPR6e56%7C387ee2107857a86233e4c6e8f04922d6cec830eb90d915762bccae6420dc6c5c; wp-settings-time-1=1793380836

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:111:39)
    at RequestUtils.listUsers (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/users.ts:34:30)
    at RequestUtils.deleteAllUsers (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/users.ts:106:44)
    at CollaborationUtils.teardown (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts:609:28)
    at Object.collaborationUtils (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/fixtures/index.ts:31:5)
inserts a block should show a blue line indicator in /test/e2e/specs/editor/various/inserting-blocks.spec.js, passed after 2 failed attempts.
Error: expect(locator).toBeVisible() failed

Locator: locator('data-testid=block-list-insertion-point-indicator')
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" locator('data-testid=block-list-insertion-point-indicator') with timeout 5000ms
  - waiting for locator('data-testid=block-list-insertion-point-indicator')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inserting-blocks.spec.js:674:50
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('[name="editor-canvas"]').contentFrame().getByRole('document', { name: 'Add default block' })
    - locator resolved to <p role="document" data-empty="true" aria-multiline="true" aria-readonly="false" data-title="Paragraph" contenteditable="true" data-type="core/paragraph" aria-label="Add default block" data-wp-block-attribute-key="content" id="block-978b2d7e-5582-4e54-86bf-b4272e54f752" data-block="978b2d7e-5582-4e54-86bf-b4272e54f752" class="block-editor-rich-text__editable block-editor-block-list__block wp-block wp-block-paragraph rich-text">…</p>
  - attempting click action
    - waiting for element to be visible, enabled and stable

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inserting-blocks.spec.js:656:5
should keep correct selection when dragging outside block (-firefox) in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "1",
+       "content": "23",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:787:41
should not have a dead zone above an aligned block in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1053:39

From 6b669c0, not the current head. Run

Silencing deprecated argument notices around every REST callback reached
far beyond the one request that needs it. Preload the author with its own
call instead, and silence the notice only around that call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mamaduka

Copy link
Copy Markdown
Member

We should try to fix https://core.trac.wordpress.org/ticket/56429. I have a draft patch; I will try to submit it on Monday.

The problem with this approach is that it only solves issue for plugin. I think silencing the warning will be blocked in the backport PR.

@ellatrix

ellatrix commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Agreed, thanks @Mamaduka

@ellatrix ellatrix closed this Nov 3, 2026
@Mamaduka
Mamaduka deleted the preload/post-summary-requests branch November 4, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Post /packages/edit-post

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants