• Resolved lkistenkas

    (@lkistenkas)


    Hi!

    My WP website uses a few plugins containing the PSR library, like your plugin is using as well. With switching to PHP 8.1 the PSR library version in my project was upgraded to version 3.0.0. But the PSR library which is included in mollie payments for woocommerce is conflicting with that.

    When I delete or upgrade the PSR version in mollie-payments-for-woocommerce I get other incompatible declaration fatal errors in the mollie-payments-for-commerce plugin itself.

    It only occurs when I use commands on the WP-CLI but it is a critical tool for us.

    Is it possible for you to upgrade the PSR library to version 3 and make the mollie-payments plugin compatible?

    Thanks in advance and kind regards Laurens

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter lkistenkas

    (@lkistenkas)

    An example error message when using PSR 3.0.0 with mollie-payments-for-woocommerce I get is:

    PHP Fatal error: Declaration of Mollie\WooCommerce\Log\WcPsrLoggerAdapter::log($level, $message, array $context = []) must be compatible with Psr\Log\AbstractLogger::log($level, Stringable|string $message, array $context = []): void in /var/www/project/web/app/plugins/mollie-payments-for-woocommerce/src/Log/WcPsrLoggerAdapter.php on line 75

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello,

    Thank you for reaching out to us, we are here to help.

    I will create a bug for this issue and send it to our team, so we can discuss it and resolve it when we can. This support thread will be linked to the bug, so when a fix is available/release, you will be made aware.

    Kind regards,
    Joost

    Thread Starter lkistenkas

    (@lkistenkas)

    Hi Joost,

    Thank you very much for your quick reply and action. Any idea of a timeframe when this issue could be resolved?

    With kind regard Laurens

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @lkistenkas

    This morning we discussed this situation in our backlog meeting. It seems we also encountered a similar situation for another plugin we support and tried to update this plugin as well. We found out that we could not update the version of the library and had to ask conflicting plugin authors to downgrade, to be compatible with this other plugin.

    When we would upgrade the PSR library for your plugin, we would most likely encounter the same issues with other plugins (as with the other plugin would occur as well). Our developer will still take a look at this, but at this moment no action is being taken. It could be that our developer will come back with the same outcome, and we could advise you to downgrade the PSR library for your plugin.

    I hope to have more information for you later.

    Kind regards,
    Joost

    Thread Starter lkistenkas

    (@lkistenkas)

    Hello Joost,

    Thanks for your reply and explanation. I understand the situation that you are in. I would like to suggest a possible solution, I’ve seen in other plugins that keep older versions of libraries that they make a fork of it and rename / prefix the classes / namespaces with their company/plugin name, or something like that. Is that a possibility for this plugin as well?

    That way I don’t need to keep my whole application on older libraries which will conflict updates of other plugins in the future when they are going to upgrade.

    With kind regards Laurens

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @lkistenkas

    I forwarded your message/proposal to our developer, pending a response.

    Kind regards,
    Joost

    To add to this: My plugin stopped working when my client installed this plugin due to a Psr\Container\ContainerInterface compatibility issue. My plugin used a newer version which want the has function to have a return type. Your plugin uses a version that does not require one so your implementation gives a fatal error.

    Please fix this problem. It’s as easy as giving line 103 in vendor/inpsyde/modularity/src/Container/ReadOnlyContainer.php a return type of bool.

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @bartkleinreesink

    Our developers are aware of the issue and know what is causing it, but the reason for not putting a fix in place straight away is that this fix would cause other plugins that also use the same library (like PayPal Payments) to cause the same conflict with our plugin. Our product owner and developers have chosen to wait with this change until other big plugins move forward on this.

    Kind regards,
    Joost

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    For the time being, there is not much we can do here, as we must prioritize the overall stability and compatibility with as many WordPress configurations as possible. Unfortunately, upgrading the PSR library could introduce wider compatibility issues, and we cannot take that risk at this time.

    As a workaround, you could potentially create a custom module as explained here with the changes mentioned above: https://github.com/mollie/WooCommerce/pull/621. This will allow your changes to persist through future Mollie updates.

    @niklasinpsyde could you show how that implementation should look like?

    PS. 7.3.9 broke compatibility for me since we are using newer psr/container (from external dependency :F)

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP 8.1 / PSR 3.0.0 compatibility’ is closed to new replies.