• Resolved Beee

    (@beee)


    I saw this notice in my logs

    PHP Deprecated:  TinyWP_Mobile_Detect::__construct(): Implicitly marking parameter $headers as nullable is deprecated, the explicit nullable type must be used instead in /home/httpd/html/domain.com/public_html/app/plugins/tinywp-mobile-detect/inc/TinyWP_Mobile_Detect.php on line 889
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pothi Kalimuthu

    (@pothi)

    Thanks for bringing it to attention. I am not actively developing (the plugin). I tried to update the upstream library years ago, only to break the live installation of other users. I couldn’t replicate it, though.

    If anyone wants to co-author the plugin, please let me know. Thanks.

    Thread Starter Beee

    (@beee)

    I asked Gemini. The fix is quite easy as it turns out.

    This is the reply I got.

    The error you are seeing is a PHP 8.1+ deprecation warning. It occurs because the __construct method in the TinyWP_Mobile_Detect.php file defines parameters with a default value of null without explicitly marking the type as nullable using a ?

    public function __construct(
    ?array $headers = null,
    $userAgent = null
    )

    That should fix it, I think. I haven’t tested this yet on a live server.

    Plugin Author Pothi Kalimuthu

    (@pothi)

    It was indeed the solution. Fixed it with version 3.1.1. Thanks again for the heads-up.

    Thread Starter Beee

    (@beee)

    You’re welcome. Happy to help.

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

You must be logged in to reply to this topic.