• Resolved peter8nss

    (@peter8nss)


    Following upgrade to version 2.5.8 I am getting the following PHP warning:

    Undefined array key "css_target" in /home/sites/1a/4/44afcb079c/staging_html/wp-content/plugins/svg-support/admin/admin-init.php on line 54
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Thanks for letting me know. That is odd, I didn’t get this warning, I was flicking between all major versions of php and didn’t catch it.

    what version of php are you using?

    • This reply was modified 7 months, 2 weeks ago by Benbodhi. Reason: spelling mistake

    same here, php 8.2.17?

    Plugin Author Benbodhi

    (@benbodhi)

    thanks for sharing the php version ??

    Thread Starter peter8nss

    (@peter8nss)

    I don’t think it is to do with the PHP version. And I can’t seem to cause it again.

    Is “css_target” a recently added setting stored in (array) option “bodhi_svgs_settings”. If so, I suspect the first time you read it you get the PHP warning, but the following code then adds it so that you don’t see the warning again.

    Plugin Author Benbodhi

    (@benbodhi)

    it was an existing setting, but I did a lot of refactoring.
    so you see the warning when first loading the plugin, but then it disappears because of the order of the settings being added?

    thanks for this info, helpful for me to be able to track it down.

    Just more info – I’ve had the plugin enabled for at least a month, and today was the first time I have the error in my error_log. So it doesn’t occur on activation:

    PHP Warning: Undefined array key “css_target”

    I have just encountered the same PHP warning after updating the plugin from 2.5.6 to 2.5.8.

    gsc89

    (@gsc89)

    Same issue locked it to 2.5.7 on sites we used it on till this is resolved.

    cataras

    (@cataras)

    Same problem with version 2.5.8 under PHP 8.3. It works when you switch back to version 2.5.7.

    • This reply was modified 7 months ago by cataras.

    Same error here 2.5.8 under PHP 8.2.22

    Same issue here with version 2.5.8 on PHP 8.3.9

    Undefined array key "css_target" in /plugins/svg-support/admin/admin-init.php?(line 54)

    Same issue with PHP 8.2 & SVG Support 2.5.8
    Disable then enable the plugin resolve the issue (with wp-cli, or by deleting the plugin)

    • This reply was modified 5 months, 2 weeks ago by striffly.
    twobyte

    (@twobyte)

    Also had this issue with 2.5.8

    Downgrading wpackagist-plugin/svg-support (2.5.8 => 2.5.7)

    Bruno

    (@andrea_brunato)

    @benbodhi got same error on PHP 7.4.
    The error is caused by line 54 in admin-init.php because of the undefined target css_target

    ?$value[‘css_target’]?=?esc_attr(?sanitize_text_field(?$value[‘css_target’]?)?);

    You just need to check if the value exist before calling it.

    Plugin Author Benbodhi

    (@benbodhi)

    apologies for the delay on this!
    I have added the fix in the upcoming version 2.5.9 which will be pushed to the WP repo soon.
    It’s still in development as I address a backlog of things here. Latest dev version is at https://github.com/benbodhi/svg-support if you want to test it early.

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