[wp-trac] [WordPress Trac] #25233: Revisions metabox improvements
WordPress Trac
noreply at wordpress.org
Wed Sep 4 23:53:12 UTC 2013
#25233: Revisions metabox improvements
--------------------------+-----------------------------
Reporter: jkudish | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Revisions | Version:
Severity: normal | Keywords: needs-patch
--------------------------+-----------------------------
The revisions metabox suffers from performance degradation when unlimited
revisions are allowed and a large amount of revisions (e.g. 600+) is
achieved on a post.
Symptoms:
* Slow wp-admin page loads
* Out of memory errors and 500 errors.
This seems to be mainly due to:
* All revisions are loaded at once when a post is loaded in wp-admin
* For each revision, the entire `$post` object is loaded, when only a few
pieces of information are needed
* The queries in `get_children()` are not cached
Proposed solution:
* Rewrite the revisions meta box to load the revisions via ajax instead of
with the initial page load, possibly with pagination or some kind of
infinite scroll.
* Only load the information required and not the entire `$post` object for
each revision.
* Cache the queries involved.
Possible bottlenecks:
* The `get_children()` and `wp_get_post_revisions()` functions are used in
a bunch of different places, so it might be difficult to bake in
compatibility for everything. Might be easier to create some new functions
for the metabox specifically.
* Currently WordPress loads all the revsions in order to possibly upgrade
them to the 3.6 versioning of revisions. It does so on every post loaded
in wp-admin. It might make sense to move this to an upgrade routine or
somewhere else as it adds to the performance degradation.
If this sounds like a good approach I'd be happy to work on a patch.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25233>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list