[wp-trac] [WordPress Trac] #40351: Term post re-counts scale poorly, are common and difficult to avoid
WordPress Trac
noreply at wordpress.org
Mon Nov 8 05:09:30 UTC 2021
#40351: Term post re-counts scale poorly, are common and difficult to avoid
--------------------------------------+--------------------------
Reporter: mattoperry | Owner: whyisjake
Type: enhancement | Status: reopened
Priority: normal | Milestone: 5.9
Component: Taxonomy | Version: 4.8
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+--------------------------
Comment (by peterwilsoncc):
Replying to [comment:55 johnbillion]:
> @peterwilsoncc Would you be so kind as to summarize the outstanding
issues with this change please?
There's only one issue as far as I am aware.
`_wp_prevent_term_counting()` was designed to prevent term counting when
adding/removing terms during `wp_insert_post()` and defer the changes to
the `transition_post_status` hook. This is to prevent double counting a
change (ie, adding a count of two for a single item).
Unfortunately it proved too blunt as terms added to another object (either
a different post, or another object type) went uncounted too. There are
some examples in #51630.
The LTCU plugin tracks the individual object IDs for the equivalent
functionality. I considered adding something like that but as WP is
functional, the function's signature became rather unwieldy.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40351#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list