• Trying to update Safe SVG to 2.x.x or above results in the front end of the site never loading. There are no php errors being logged when this happens.

    We use the S3 Uploads plugin to keep all media assets in an Amazon S3 bucket.

    The specific place in Safe SVG where things hang up is in the svg_dimensions method, when it tries to use @simplexml_load_file on the remote file.

    If I short this out by instead defining $svg as false in svg_dimensions, things seem to work, but then the image dimensions are not added to the markup. Not sure if there are other implications to doing this that I’m not seeing yet, since this method is used by several other plugin hooks.

    Is there perhaps a different way I can get the image dimensions from a remote file?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darin Kotter

    (@dkotter)

    So simplexml_load_file should work for external URLs (keyword there being should). I guess also worth noting that this change was introduced in v1.8.0, so this isn’t specific to updating to v2.x.x.

    Note that there is an @ sign before this function, which will suppress any errors. I’d suggest removing that and if you have logging turned on, seeing if you then get any PHP errors logged.

    Thread Starter Sky Shabatura

    (@skyshab)

    Hi Darin!

    Thanks for your reply.

    Did some more digging on this.

    simplexml_load_file is actually working as expected. The issue in our case turned out to be that we have some code aggressively using wp_get_attachment_image_src to parse all possible image sizes in the background, which results in thousands of calls to the remote bucket with simplexml_load_file and it times out before it can finish.

    We may need to stay on an older version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conflict with S3 Uploads’ is closed to new replies.