Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin failed to load properly. E_COMPILE_ERROR was caused in line 58 #2206

Closed
HossamVegetaMoghrabi opened this issue May 6, 2024 · 2 comments
Labels
support Support case

Comments

@HossamVegetaMoghrabi
Copy link

Describe the Bug

i didn't do anything to my website, but suddenly it stopped working and showed me this on the plugin:

An error of type E_COMPILE_ERROR was caused in line 58 of the file /home1/----/public_html/wp-content/plugins/woocommerce-paypal-payments/modules/woocommerce-logging/src/Logger/WooCommerceLogger.php. Error message: Declaration of WooCommerce\WooCommerce\Logging\Logger\WooCommerceLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerTrait::log($level, Stringable|string $message, array $context = []): void

I didn't do anything to the website and all was working fine, but today I suddenly opened it to see this.

To Reproduce

1- go to website wordpress admin, it cannot be opened.
2- go to recovery mode and it works but disabled the paypal plugin.
3- enabling it does not work.

Expected Behavior

I expect the plugin and site to work fine, site loads and so on.

Actual Behavior

wordpress site does not load at all, except if in recovery mode. bluehost says it is a plugin issue not their issue.

Environment

  • WordPress Version 6.5.2
  • WooCommerce Version 8.8.3
  • Plugin Version 2.7.0
  • Browser : firefox, as usual.
@InpsydeNiklas InpsydeNiklas added the support Support case label May 7, 2024
@HossamVegetaMoghrabi
Copy link
Author

I upgraded to alpha version and it seems to work.

@SydeKrystian
Copy link
Collaborator

Hello @HossamVegetaMoghrabi

The fatal error is triggered because our plugin uses a previous version of psr/log , as defined in woocommerce-paypal-payments/blob/trunk/composer.json with "psr/log": "^1.1" . The more recent version that would be compatible with PHP 8.2 is this one: https://packagist.org/packages/psr/log#3.0.0. The Psr/log version 3.0.0 requires PHP version 8.0.0 or higher and uses Union types in its arguments, which PayPal Payments doesn’t support yet.

Most likely, some other plugin on your site implements the library psr/log in version 3.0.0 which is not compatible with the version used in PayPal Payments.

The first step would be to isolate the cause of the conflict, so you may want to perform a full conflict test to understand which other plugin may be involved. We recommend temporarily activating the default theme Storefront and disabling all other plugins except for WooCommerce and PayPal Payments, and then enabling other plugins one by one to see when the error occurs. Once you know which other plugin implements this version of the dependency, you could potentially ask the other plugin developer to consider downgrading the dependency version.

Alternatively, a potential workaround would be downgrading to PHP 7.4. For a complete fix, we are in the process of merging a crucial update that will address this compatibility issue permanently. You can follow the progress of this update through our GitHub repository:

Issue tracking: GitHub issue #1518
Pending resolution Pull Request: PR #1944

We anticipate integrating these changes by Q3 with the release of PayPal Payments version 3.0+. This update will ensure that all dependency conflicts are resolved.

Let us know if the problem arise once again, but this time we kindly ask that you reach out directly to our support team.

Kind regards,
Krystian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support case
Projects
None yet
Development

No branches or pull requests

3 participants