WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#20665 closed defect (bug) (fixed)

wp.getUsersBlogs method runs out of memory when there are too many blogs

Reported by: mohanjith Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.0
Component: XML-RPC Keywords: has-patch needs-unit-tests commit
Focuses: Cc:

Description

wp.getUsersBlogs method runs out of memory when there are too many blogs. But with the proposed changes (by avoiding switch_to_blog and restore_current_blog) you can list more blogs with same amount of memory.

Attachments (2)

class-wp-xmlrpc-server.php.diff (1011 bytes) - added by mohanjith 6 years ago.
20665.diff (914 bytes) - added by nacin 6 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to XML-RPC

#2 @SergeyBiryukov
6 years ago

  • Keywords has-patch added

#3 @nacin
6 years ago

Yeah, the switch_to_blog() really doesn't make any sense here.

#4 @nacin
6 years ago

  • Version changed from 3.4 to 3.0

Assuming this came in with MU in 3.0.

#5 @koke
6 years ago

  • Cc jbernal@… added

@nacin
6 years ago

#6 @nacin
6 years ago

  • Keywords needs-unit-tests commit added

20665.diff includes get_home_url() and some cleanup.

#7 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 3.5

#8 @nacin
6 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21194]:

Don't use switch_to_blog() in wp.getUsersBlogs to improve performance and memory footprint. props mohanjith for initial patch. fixes #20665.

Note: See TracTickets for help on using tickets.