[wp-trac] [WordPress Trac] #47872: Try to create image sub-sizes again when uploading fails with a PHP fatal error

WordPress Trac noreply at wordpress.org
Thu Sep 5 21:15:34 UTC 2019


#47872: Try to create image sub-sizes again when uploading fails with a PHP fatal
error
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  high                                 |   Milestone:  5.3
Component:  Upload                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-dev-   |     Focuses:
  note has-screenshots                           |
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:11 afercia]:

 Thanks for testing! :)


 > had to set `max_execution_time` to `1` to make it timeout. Also, to
 upload images larger than 2 MB, set both `upload_max_filesize` and
 `post_max_size` to `20M` (WP takes the smaller of these two values).

 Right, both `upload_max_filesize` and `post_max_size` have to be bumped up
 to be able to upload larger files. Instead of setting `max_execution_time`
 to 1, could you try setting it to 3-4 seconds and uploading a larger image
 file? A "standard" cellphone photo will probably do. There seem to be in
 the 4-5MB range.

 > Both tests worked for me, see the requests in the screenshots below.
 However, on `media-new.php` I didn't get any error message (see second
 screenshot).

 Think this is due to setting `max_execution_time = 1`. On the last request
 it tries to do some cleanup of possibly left-over image sub-sizes, etc.
 and 1 second is just too short for "general" wp-admin tasks.

 > Any objections to expand `2500px` to `2500 pixels`?

 Sure. The text there can be improved. Hoping to get even more eyes on it
 :)

 > all the error `<div>`s would need a `role="alert"`: I guess that can be
 added in one of the many pending tickets to improve the media
 accessibility

 Haven't changed anything there in the last patch. You're right, better to
 fix it "globally" for all of the errors.

 > I see many links `href="#"` and `href='#'` that actually behave like
 buttons. They should be buttons. However, I ''think'' most of them are
 used in the old upload modal. Correct?

 Yeah, as far as I see all of these are the old, old upload UI. Not sure if
 it is used these days... Thinking this should be part of a "refresh" of
 the "uploader" UI and code. There's probably no need to use Plupload (as
 far as I see), its main purpose was to enable multi-file uploading and
 progress bars in old browsers. All new browsers support that natively.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47872#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list