Support » Plugin: SVG Support » Illegal string offset warning for Height and Width

  • Resolved Craig

    (@digimouse)


    Hi,

    I used the plugin as I have before but this time with the WP Image widget and when I do the page gets a PHP warning for illegal string offset on both height and width. See below:

    Warning: Illegal string offset 'height' in C:\Users\Craig\Documents\Websites\hiringsauce.dev\wp-includes\media.php on line 989

    I am on PC running DesktopServer with Genesis Framework

    Thanks

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    Can you please try using the default twentysixteen theme and just SVG Support and WP Image widget active?

    If it still happens then, let me know and I’ll see if I can help out further.

    Hi,

    I have installed a fresh version of WP with Twenty Sixteen theme and the same issue is preset.

    Could this be something with the SVG code itself? NOTE: W3C Validated it as clean SVG 1.1 so this is a long shot.

    Craig

    • This reply was modified 6 months, 3 weeks ago by  Craig.
    Plugin Author Benbodhi

    (@benbodhi)

    That’s certainly a possibility.
    Try this one: https://live.mrbillstunes.com/wp-content/uploads/2017/04/mrbillstunes.com-mr.bill-logo_min.svg

    That definitely works on one of my sites.

    I have just tried this on the Twenty Sixteen install and same errors are there as before.

    Very confusing.

    WP Version 4.8.2?

    Plugin Author Benbodhi

    (@benbodhi)

    It might just be the combination of SVG Support and the WP Image Widget.
    Are you using the built in Image Widget or a plugin?

    I haven’t seen this issue with the built in widget, but will try to replicate now and see what happens.

    Yes, using built in Widget from 4.8 release.

    By the way, it throws these warning on width and height but still renders SVG on the page. Not sure if that makes much difference to the debugging.

    Plugin Author Benbodhi

    (@benbodhi)

    It is just a warning, so you can safely turn off warnings and it will be fine and will work as normal. You shouldn’t really have them dsiplayed on a live site anyway… though I’m not sure if it’s live or dev.

    But nonetheless, it’s nice to not see any warnings. I’m actively trying to reproduce and will see what I can find.

    Plugin Author Benbodhi

    (@benbodhi)

    I have managed to reproduce the issue now, but it might take me a little while to modify the code and update the plugin. I will work on it as soon as possible and push out an update to make it work with the image widget again… it used to.

    In the meantime, you can paste your SVG image tag in to the standard text widget like we had to before the image widget was integrated.

    Thank you for pointing this out, much appreciated. I don’t actually use the image widget anywhere so it takes users to let me know about some things like this.

    I can confirm this bug occurs on my environments, too. Of course, notices and warnings should be fixed as well, as these pollute the error log and slow down dev progress.

    Kind regards and big thanks for your plugin!

    Plugin Author Benbodhi

    (@benbodhi)

    Thanks for the confirmation @matthias-reuter,
    I’ll be working on it as soon as I get some solid time to put in.

    Thanks for your support!

    jramoscarmenates

    (@jramoscarmenates)

    I have the same problem using:

    WP version: 4.8.2
    PHP version: 7.0.11-1+deb.sury.org~xenial+1
    GD Library: 2.2.3
    Server Info: nginx/1.11.3
    Theme: Avada
    Theme version: 5.2.2

    The error is:

    Warning: Illegal string offset 'width' in /path/wp-includes/media.php on line 988
    Warning: Illegal string offset 'height' in /path/wp-includes/media.php on line 989
    Plugin Author Benbodhi

    (@benbodhi)

    Thank you @jramoscarmenates,

    I’m aware of this warning and will be fixing it as soon as I have some time.

    Thanks for your support.

    bluesix

    (@bluesix)

    Any update on this? I’m still seeing the error/warning.

    Plugin Author Benbodhi

    (@benbodhi)

    Sorry for the delay everyone!
    It’s been hard to dedicate time to this lately, especially since I don’t get paid 😛

    I’m actively working on it today, with any luck I’ll push out another update with this fixed.

Viewing 15 replies - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.