Hi @rgwpladapa
I am happy to check but at this point in time I believe that WordPress support for PHP 8.1 is not yet stable.
See PHP Compatibility and WordPress versions) for details.
I hope this helps!
-Marco
Hi Marco! (@wpo365)
You are right, WordPress only “beta-supports” PHP 8.1. Still, supporting that version in your plugin would be helpful, since it’s technically already possible to run WordPress on 8.1 And people do it.
A fix could be quite easy: Just return ''
when $path
is null
.
Also, couldn’t that function simply be replaced with trailingslashit()
?
Cheers,
Philipp
And isn’t PHP 7.4 about to EOL soon?
@tyrannous But that uses untrailingslashit and that uses rtrim and wouldn’t get rid of the issue.
@rgwpladapa 8.0 is supported. I don’t think that is the issue right now.
In general: When I run WordPress 6.0.2 on a local WAMP stack with PHP 8.1.6 I still receive lots of deprecation notices that generate from WordPress core e.g.
PHP Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in ..\wp-includes\formatting.php on line 2772
PHP Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..\wp-includes\Requests\Cookie\Jar.php on line 63
PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 40
PHP Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in ..\wp-includes\Requests\Transport\cURL.php on line 345
And that is when I have no plugins whatsoever enabled. So I am not sure whether this is meant with “technically supported”.
@tyrannous and @rgwpladapa
Version 20.0 of the WPO365 | LOGIN plugin has been modified and many of the string handling methods now check whether the input is empty. It would be great to learn from your experience with PHP 8.1 and whether the plugin now runs error-free on PHP 8.1.
Thanks!
-Marco