Conversation
supportI 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
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.
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.
It was indeed the solution. Fixed it with version 3.1.1. Thanks again for the heads-up.
You’re welcome. Happy to help.
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.
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.
It was indeed the solution. Fixed it with version 3.1.1. Thanks again for the heads-up.
You’re welcome. Happy to help.