• Resolved Desraj Kumawat

    (@desraj)


    Hi,

    After updating Image Regenerate & Select Crop from 8.1.2 to 8.1.3 (also tested 8.1.4), the site crashes with a fatal error in wp-admin

    • Plugin version:
      • 8.1.2 → Works fine
      • 8.1.3 → Fatal error
      • 8.1.4 → Fatal error

    It appears that the method:

    public function footer_text(string $original)

    does not handle null values. WordPress sometimes passes null to the admin_footer_text filter, which causes a TypeError in PHP 8+.

    Suggested fix:

    public function footer_text($original = ”) {
    $original = (string) $original;
    }

    or

    public function footer_text(?string $original = ”)

    This would restore PHP 8 compatibility.

    Please advise.
    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi Desraj,

    I made some change that type-hinted $original as ?string to gracefully handle third-party plugins that incorrectly return null or non-string values to admin_footer_text filter.

    According to the documentation, the filter should accept only strings (and that’s what my code was doing as well) https://developer.wordpress.org/reference/hooks/admin_footer_text/

    The change I did only hides the exisiting issue with other codes that are using the filter without returning something. Maybe you could look next to where the filter is used in other third-party from your setup.

    Please upgrade to 8.1.5

    Regards,
    Iulia

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.