• Resolved onetrev

    (@onetrev)


    When I activate the plugin with my local setup running PHP 8.1, then I get a whole bunch of these deprecation warnings:

    
    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 /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 63
    

    Not a major issue, just thought I should report it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Andy Fragen

    (@afragen)

    Cookies aren’t used in this plugin. Is there a stack trace?

    Thread Starter onetrev

    (@onetrev)

    Sadly no stack trace. Ya I didn’t think there would be cookies, so it is odd it chucks these warnings right? The only plugin active is this one. I triple checked. ?? If I switch back to PHP 8.0, all is good.

    The entire warning message, which appears on the /wp-admin/plugins.php page and on the plugin settings page (/wp-admin/tools.php?page=wp-beta-tester) is:

    
    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 /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 63 Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 73 Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 89 Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 102 Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Cookie/Jar.php on line 111 Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /app/wordpress/wp-includes/Requests/Transport/cURL.php on line 345 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 /app/wordpress/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40 Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51 Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68 Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82 Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/wordpress/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
    
    Plugin Author Andy Fragen

    (@afragen)

    I’ve tracked this down to an error in wp-includes/option.php::wp_user_settings() line 1089 which returns empty. This is later passed to setCookie() where the error triggers.

    Plugin Author Andy Fragen

    (@afragen)

    This seems to have been fixed for WP 6.1, https://core.trac.www.ads-software.com/changeset/53490

    Thread Starter onetrev

    (@onetrev)

    Nice find! I tried to track down the PHP 8.1 fixes in WP 6.1 core, but didn’t come across this one. The odd thing is I’ve been running WP 6.1-beta2, so perhaps it’s not merged yet? I can’t tell. It’s not obvious to me like it is with git. ??

    Plugin Author Andy Fragen

    (@afragen)

    However the deprecated notices persist until core figures them out. Can set WP_DEBUG to false and the notices won’t appear. Sorry, that’s the best I’ve got.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Deprecation warnings PHP 8.1’ is closed to new replies.