cloudflare / Cloudflare-WordPress

A Cloudflare plugin for WordPress
https://www.cloudflare.com/wordpress/
BSD 3-Clause "New" or "Revised" License
215 stars 84 forks source link

PHP 8.2 Compatibility #528

Open fliespl opened 9 months ago

fliespl commented 9 months ago

Confirmation

WordPress version

6.4.2

Cloudflare-WordPress version

4.12.2

PHP version

8.2.8

Expected result

Successful plugin activation

Actual result

$ wp plugin activate cloudflare PHP Fatal error: Declaration of CF\Integration\DefaultLogger::debug($message, array $context = []) must be compatible with Psr\Log\AbstractLogger::debug(Stringable|string $message, array $context = []): void in /x/wp-content/plugins/cloudflare/src/Integration/DefaultLogger.php on line 42 Fatal error: Declaration of CF\Integration\DefaultLogger::debug($message, array $context = []) must be compatible with Psr\Log\AbstractLogger::debug(Stringable|string $message, array $context = []): void in /x/wp-content/plugins/cloudflare/src/Integration/DefaultLogger.php on line 42

Steps to reproduce

Trying to use plugin with php 8.2.8.

Additional factoids

No response

References

No response

fliespl commented 9 months ago

It's a collision with rollbar plugin.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

xanghyr commented 3 months ago

Hello ! Any news about when this will be fixed ? I'm actualy running into the same issue and can't enable the plugin.

edit : I don't have the "rollbar plugin" on my side.

tomkyser commented 2 weeks ago

Hello ! Any news about when this will be fixed ? I'm actualy running into the same issue and can't enable the plugin.

edit : I don't have the "rollbar plugin" on my side.

So we fixed this by forcing certain composer dependencies namely psr/log to use different versions that are compatible with the cloudflare plugin's requirements.

IF you are using composer for your project try: "psr/log": "^1.0.0",

If that doesn't fix it then you'll need to keep digging: composer why {insert a desperate guess dependency name} -t

There is already a PR that would fix this, not sure why they haven't done it yet. https://github.com/cloudflare/Cloudflare-WordPress/pull/541