Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9043 closed defect (bug) (invalid)

set_time_limit in import/wordpress.php causing issues.

Reported by: joostdevalk Owned by: joostdevalk
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patchdev-feedback 2nd-opinion
Focuses: Cc:


On line 366 of /wp-admin/wordpress/import.php, there's a "set_time_limit( 60 );" without any checks, and the set time limit is never set back to its original state. This causes issues when the entire import process takes longer.

Setting a 60 second time limit for the import of a single post makes sense though, so I'm attaching a patch that will store the original time limit, set the time limit to 60 seconds, and restore it to it's original value after the import has been done.

Attachments (1)

import-patch.txt (657 bytes) - added by joostdevalk 9 years ago.

Download all attachments as: .zip

Change History (4)

9 years ago


#1 @tellyworth
9 years ago

I don't think this works as you expect.

set_time_limit(123) doesn't set the time limit to 123 seconds since script execution started. It adds 123 new seconds from the current point. So if the original time limit is 30 seconds, when you call set_time_limit($orig_timelimit) you're adding a further 30 seconds of execution time, not winding back the total limit to 30 seconds.

This is covered in the set_time_limit() docs:


Can you elaborate on what the bug is?

#2 @ryan
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Indeed, it adds to the time. Closing as invalid for now. Reopen with more details.

#3 @ryan
9 years ago

  • Milestone 2.8 deleted
Note: See TracTickets for help on using tickets.