WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 7 weeks ago

#22041 new enhancement

Importer dies silently when multisite upload limit is reached

Reported by: danielbachhuber Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: Import Keywords: needs-patch
Focuses: multisite Cc:

Description

The scenario: You're importing a WXR file into a site on a multisite network and the WXR includes a number of large attachments. For whatever reason, the upload capacity for each site is set at 100MB.

If the upload capacity is reached during the import process, the import will look like it's hanging forever. Instead, it would be nice to show an alert that the upload capacity was reached or similar.

Change History (4)

comment:1 SergeyBiryukov19 months ago

  • Milestone changed from Awaiting Review to WordPress.org

comment:2 jeremyfelt8 weeks ago

  • Focuses multisite added
  • Keywords needs-patch added
  • Milestone changed from WordPress.org to Future Release

I haven't verified yet, but fixing this makes sense if it's still a present issue.

Would this be the import plugin's job or is there something we can do to throw the notice in core?

comment:3 danielbachhuber7 weeks ago

I tried to reproduce this morning and couldn't. As far as I can tell, the import process gets no where near is_upload_space_available().

The rundown is this:

  • In WP_Importer::process_attachment(), the importer calls WP_Importer::fetch_remote_file() to pull down the remote file. ::process_attachment() also calls wp_insert_attachment(), but that just performs the database interaction.
  • WP_Importer::fetch_remote_file() uses wp_upload_bits() to create an empty file, and then wp_get_http() to write the contents of the remote file to the local file.
  • WP_Importer::fetch_remote_file()also checks against WP_Importer::max_attachment_size(), which is filterable and defaults to 0. I wish I had reported which environment I experienced this in, because this may have been the cause of the bug I saw.

Based on my debugging today, this ticket could become that the importer should respect the blog's max storage limit value.

comment:4 SergeyBiryukov7 weeks ago

  • Milestone changed from Future Release to WordPress.org
Note: See TracTickets for help on using tickets.