Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#49291 new defect (bug)

Code issues with set_time_limit

Reported by: madpeter's profile madpeter Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.2
Component: Revisions Keywords:
Focuses: administration, performance Cc:

Description (last modified by SergeyBiryukov)

file: wp-admin\includes\ajax-actions.php
function: wp_ajax_get_revision_diffs
line: 3425
Issue: no time limit set
Suggestion: set value to 120

file: wp-includes\class-pop3.php
function: __construct
line: 63
Issue: timeout value is not tested and can be set to 9999999 or a negitive value that acts the same as 0
Suggestion: Force a range for the value (1 to 120)

Change History (3)

#1 @SergeyBiryukov
4 years ago

  • Component changed from Administration to Revisions
  • Description modified (diff)
  • Focuses administration added
  • Severity changed from major to normal

Hi there, welcome to WordPress Trac! Thanks for the report.

  • The set_time_limit( 0 ) instance in wp_ajax_get_revision_diffs() was introduced in [24707] / #24757. Could you clarify why the value should be changed to 120?
  • Please note that class-pop3.php is a part of the PHPMailer external library, any changes to its files should be submitted upstream: https://github.com/PHPMailer/PHPMailer.

#2 @madpeter
4 years ago

  • Keywords reporter-feedback added

The set_time_limit( 0 ) instance in wp_ajax_get_revision_diffs() was introduced in [24707] / #24757. Could you clarify why the value should be changed to 120?

if a badly coded plugin calls wp_ajax_get_revision_diffs but does not call set_time_limit itself and then it hangs due to a bug it can hold php active and not free up memory or worse use a while loop to hog cpu time.

but having a known limit for all set_time_limit calls it can help highlight issues with poorly coded plugins as it will create php time out warnings.

class-pop3.php
I will need to open a new ticket as wordpresses copy of phpmailer to far out of date.

#3 @madpeter
4 years ago

  • Keywords reporter-feedback removed
Note: See TracTickets for help on using tickets.