Repository navigation
Conversation
…r` index fully. `WP_Posts_List_Table` counts the current user's posts on every load of a posts list screen. The query excluded statuses with `post_status NOT IN (...)`, which keeps the database from using the `post_author` part of the `type_status_author` index added in [60717]. Depending on the engine, it reads every row of the post type in the index, or every row of the author, including attachments and auto-drafts that are not counted. List the statuses shown in the All list with `post_status IN (...)` instead, with placeholders. The count then reads only the rows it counts, and matches what the Mine view lists, which also leaves out posts in unregistered statuses. Follow-up to [60717]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
… in the "Mine" count test. The method has no effect since PHP 8.1 and is deprecated in PHP 8.5, where the test failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
See #58593. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Follow-up to [60717] (#50161). The "Mine" count on posts list screens used
post_status NOT IN (...), which keeps the database from using thepost_authorpart oftype_status_author(key_len164 in #50161 comment:16). Listing the statuses shown in the All list withIN (...)lets it use all three parts (key_len172). The statuses now go through placeholders.Trunk's
wp_postsschema, same data on both engines, median of 3:Never slower; up to 10x faster when the author has many rows that are not counted. Posts in unregistered statuses are no longer counted, which matches what the Mine view lists.
Trac ticket: https://core.trac.wordpress.org/ticket/58593
Testing
vendor/bin/phpunit --filter test_user_posts_count_counts_statuses_shown_in_all_listfails without the patch and passes with it.vendor/bin/phpunit --filter Tests_Admin_wpPostsListTablepasses (26 tests).Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: drafting the fix and test, and running the benchmark. I reviewed every line.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
🤖 Generated with Claude Code