[wp-trac] [WordPress Trac] #34560: High memory usage ( and possible server error) editing post with many/large revisions
WordPress Trac
noreply at wordpress.org
Wed Jan 20 00:52:28 UTC 2016
#34560: High memory usage ( and possible server error) editing post with many/large
revisions
-------------------------------------+-------------------------------------
Reporter: pdfernhout | Owner: adamsilverstein
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future Release
Component: Revisions | Version: 3.6
Severity: major | Resolution:
Keywords: needs-unit-tests has- | Focuses: administration,
patch dev-feedback needs-testing | performance
-------------------------------------+-------------------------------------
Comment (by DBrumbaugh10Up):
OK, Adam:
I made the constructor protected so we could not accidentally create an
instance when we did not intend to.
I added two static data members to the class. The instance we are using
and a "last post id". That way, as long as the helper is dealing with the
same post id, all the initialization will only happen once.
The static getInstance method will only reinitialize the object if the
post ID changes for any reason.
I realize that in this case we are 99.999% likely to be dealing with one
and only one post, however, the principal of loose coupling would suggest
that we not count on it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34560#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list