• Resolved jstnrs

    (@jstnrs)


    On installing and activating the plugin, the plugin causes PHP warnings on deprecated functions:

    Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /project/wordpress/wp-includes/functions.php on line 7288
    Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /project/wordpress/wp-includes/functions.php on line 2187

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author LuckyWP

    (@theluckywp)

    Can you show full stack trace?
    Are you sure that this warnings appear after LuckyWP ACF Menu Field activation?

    Yes, the plugin is definitely at fault here. (It’s not the first one to be fair, but most others have patched the issue in the meantime.)

    The error stems from passing null as the first parameter to the add_submenu_page function. WordPress has always expected a string there, and always used the argument as a string, e.g. by passing it to the strpos function. This hadn’t been a problem until PHP 8.1, where passing null to such functions causes a deprecation warning.

    The issue is easily fixable by just using an empty string instead of null.

    • This reply was modified 1 year, 6 months ago by loilo.
    Plugin Author LuckyWP

    (@theluckywp)

    @loilo Thank you for explanation. We are fixed it in new version 1.0.2.

    Very nice, thanks a lot. 🙂

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

The topic ‘Deprecated functions in plugin’ is closed to new replies.