[wp-trac] [WordPress Trac] #50666: Size limit not correctly applied for sitemaps index
WordPress Trac
noreply at wordpress.org
Mon Jul 20 17:59:13 UTC 2020
#50666: Size limit not correctly applied for sitemaps index
--------------------------------------+-------------------------
Reporter: swissspidy | Owner: swissspidy
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.5
Component: Sitemaps | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-------------------------
Comment (by pbiron):
[attachment:"50666.diff"] works as expected, and all tests pass (existing
and the new one).
However, I'd suggest one change to
`WP_Sitemaps_Index::get_sitemap_list()`: for efficiency, break out of the
loop as soon as `count( $sitemaps ) >= $this->max_sitemaps`, no need to
have all providers generate entries if the max has already been reached.
I'd also structure the new test a little differently.
Updated patch coming shortly.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50666#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list