The WooCommerce Bookings 1.15 and later include a 3rd party library, called Monolog, that our plugins also use, but in a different version. Specifically:
All the Aelia plugins use version 1.25.x of the Monlog library, which is compatible with PHP 5.6 up until PHP 8. This library is part of the Aelia Foundation Classes framework.
The Bookings plugin 1.15 and newer uses version 2.1 of the Monolng library, compatible only with PHP 7.2 and newer.
The two versions of the Monolog libraries are not compatible with each other and can't be loaded at the same time. Our tests indicated that, in some cases, the Bookings plugin loads some files from its own version, and that can cause an error.
How to verify if your site is affected by the conflict
- Enable the WP_DEBUG and WP_DEBUG_DISPLAY options in your WordPress configuration (see https://codex.wordpress.org/WP_DEBUG).
- Activate the Currency Switcher.
- Load the page with the booking product. The page should show an error message, indicating what interrupted the loading. If the message refers to "monolog", then most likely the cause is the presence of two different versions of the library.
The best long-term solution to the conflict would be to ensure that the Bookings plugin should use a backward compatible version of the Monolog library. We already reported the possible conflict to the authors of the Bookings plugin, and recommended them to switch to a lower version for better compatibility (which, in our opinion, is the correct solution), but we don't know when that will be done.
In the meantime, if your site is affected by the Monolog versions, you can adopt two interim solutions:
- Replace the Monolog library included with the Bookings plugin with an earlier version. Downgrading the Monolog library to version 1.25.x will solve the issue, without requiring any changes in the rest of the plugin.
- Replace the Monolog library included with the Aelia Foundation Classes. Upgrading the Monolog library to version 2.1 should also solve the issue. The downgrade can be performed by changing the required version in file composer.json and running composer update against that file.
If you're not familiar with the process, and you don't have a developer who can do that for you, you can find a build of the AFC using the Monolog 2.x library here: wc-aelia-foundation-classes-184.108.40.206208-monolog2.x.zip. Please note that this is a development version, therefore we recommend to test it on a staging copy of your site first.
If you have any questions about the topic discussed in this article, please feel to contact us. We will be happy to assist you.