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

To determine if the same error could be occurring on your site we would recommend the following steps:
  1. Enable the WP_DEBUG and WP_DEBUG_DISPLAY options in your WordPress configuration (see https://codex.wordpress.org/WP_DEBUG).
  2. Activate the Currency Switcher.
  3. 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.

How to address the conflict in Monolog versions

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:

  1. 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. 
  2. 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-2.1.1.201208-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.
Important
Both of the above are temporary solutions. If you modify either of the plugins as described, the changes will be lost the next time you update them. Our Aelia Foundation Classes will keep including version 1.2x of the Monolog library for the time being, because both WordPress and WooCommerce still support PHP versions older than 7.2 and we must support them too. On the other hand, if you downgrade the Monolog library in the the Bookings plugin, a future update might restore the newer version of the library at the next update. 


Any questions?

If you have any questions about the topic discussed in this article, please feel to contact us. We will be happy to assist you.


You can purchase the Currency Switcher from our online shop.