• [26-Feb-2026 14:09:29 UTC] PHP Warning: Attempt to read property “success” on null in

    \wp-content\plugins\simple-banner\simple-banner.php on line 552

    Version 3.2.1

    json_decode($result) is returning null, so $json is null — and you’re trying to read $json->success.

    In PHP 8+, accessing a property on null throws this warning.

    $json = json_decode($result);

    // 2026-02-27, gwb, fix php warning Attempt to read property "success" on null
    $success = (is_object($json) && property_exists($json, 'success'))
    ? $json->{'success'}
    : null;

    //$success = $json->{'success'};

    is_object($json)
    makes sure json_decode($result) didn’t return null or something invalid

    property_exists($json, 'success')
    makes sure the success property is present

    ? $json->{'success'} : null
    if both checks pass, use the value
    otherwise, set $success to null

    compatible with PHP 8.x (and also works in PHP 7.x).

    • This topic was modified 4 weeks, 1 day ago by capegreg.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rpetersen29

    (@rpetersen29)

    Hi @capegreg

    Are you connected to the internet when this error is occurring? And is it still occurring?

    • This reply was modified 3 weeks, 3 days ago by rpetersen29.
    Thread Starter capegreg

    (@capegreg)

    Sorry for late reply. Yes. This is our public-facing site. I have disabled the plugin to avoid logging the errors.

    Plugin Author rpetersen29

    (@rpetersen29)

    Thanks for the information. The plugin is hitting the subscription license verification API to check for status at that section, https://api.gumroad.com/v2/licenses/verify. Your backend is likely restricting APIs it can hit for security purposes, so you’ll need to allowlist that endpoint.

    I will also add a try/catch at that section of code to swallow the error, but the default return value on the license will be inactive, so if you have an active subscription you’ll still need to allowlist the API to get that to work. Will let you know when i’ve updated to remove the error state.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.