• Resolved jamieburchell

    (@jamieburchell)


    I’m seeing this in my PHP logs when testing against PHP 8.1

    PHP Deprecated: ?Automatic conversion of false to array is deprecated in /web/app/plugins/seo-by-rank-math/includes/helpers/class-wordpress.php on line 281

    The last item in the stack trace is:

    PHP ?24. RankMath\Helper::get_thumbnail_with_fallback($post_id = 1080, $size = 'full') /web/app/plugins/seo-by-rank-math/includes/modules/schema/snippets/class-primaryimage.php:31

    I actually tried to supply the full stacktrace in pastebin, but the not so SMART filter deemed it as offensive.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @jamieburchell,

    Thank you for contacting support.

    This is happening because the plugin is not able to fetch an image from the content automatically and in PHP8 this triggers this warning.

    The warning won’t cause any issues with the normal functionality of the plugin but if you want to disable the plugin from looking to set an image from the content automatically you can use the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#prevent-image-setting-og

    Hope this helps clarify the situation.

    Don’t hesitate to get in touch if you have any other questions.

    Thread Starter jamieburchell

    (@jamieburchell)

    Understood @rankmathteam but please can you fix the plugin to handle the variables you are getting so that the error logs don’t fill up with these warnings? Thanks!

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @jamieburchell,

    We have taken note of your suggestion. Our developers constantly improving our plugin and its code so let’s just hope that this will implemented in the feature to avoid filling your logs with warnings.

    With that said, applying the filter code we recently shared should improve the situation.

    Hope that helps. Thank you.

    Thread Starter jamieburchell

    (@jamieburchell)

    Thanks @rankmathteam I’m happy as long as the issue is acknowledged and there are plans to fix it.

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @jamieburchell,

    Thank you so much for your patience and understanding in the matter. You can keep an eye on our changelog to get notified about the latest features and updates: https://rankmath.com/changelog/

    Please do not hesitate to let us know if you need our assistance with anything else.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP 8.1 Automatic conversion of false to array is deprecated’ is closed to new replies.