[wp-trac] [WordPress Trac] #30261: Split all existing shared taxonomy terms on WP upgrade
WordPress Trac
noreply at wordpress.org
Thu Aug 13 02:13:47 UTC 2015
#30261: Split all existing shared taxonomy terms on WP upgrade
-------------------------------------+---------------------------
Reporter: boonebgorges | Owner: boonebgorges
Type: enhancement | Status: reopened
Priority: high | Milestone: 4.3
Component: Taxonomy | Version:
Severity: blocker | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+---------------------------
Comment (by boonebgorges):
Let's try this again. [attachment:30261.7.diff] simplifies the term
splitting process by divorcing it altogether from the database upgrade.
When a user with 'edit_posts' visits a wp-admin page (`'admin_footer'`),
`wp_batch_split_terms()` splits 20 shared terms. This happens over and
over again until no more shared terms are found, at which point the
'shared_terms_split' flag is set, and the routine is never run again.
This strategy pretty much eliminates the possibility of out-of-memory or
timeout fatal errors, since we're only processing a small number of shared
terms on a given pageload. As such, it all but eliminates the possibility
of corrupt '_split_terms' back-compat data. It also means we don't need to
futz with wp-admin/upgrade.php at all, since plugins are loaded during
normal wp-admin pageloads. Fault tolerance is built in: it will keep
splitting until it's finished.
Potential downsides:
- Precedent: I can't think of anywhere in WP where we do anything like
this :)
- Time: I estimate that for 95%+ of all WP installations, there will be
fewer than 20 shared terms, so that the splitting will take place on the
first pageload after the db upgrade (generally, about.php). But in some
cases, it'll take more batches. Depending on wp-admin traffic, there may
be some time - hours, days - where not all shared terms are split. IMO,
this is not a serious issue, since we're not yet doing anything that
requires terms to be split.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30261#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list