• Hi there!

    Yesterday I was informed by a client who uses the POS, that she gets a fatals server error when trying to checkout in the POS. The POS has been working for around 2 years and this never happened.

    When I was searching the error logs, ive stumbled on the following error:

    PHP Fatal error: Cannot declare class Perfect_Woocommerce_Brands\\PWB_API_Support, because the name is already in use in /www/wp-content/plugins/perfect-woocommerce-brands/classes/class-pwb-api-support.php on line 0, referer: https://stijl-iconendoesburg.nl/pos/

    For how far my knowledge go’s, it seems there are two plugins struggling with each other. Ive tried a couple of things, but wasn’t able to find solution. Ive tried te deactivate the “perfect brand” plugin and the POS was checking out normally. The only thing is that we need the brand to keep working on the site.

    P.S. Ive also updated all plugins, WordPress and the theme already

    Does anyone here have a solution for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author kilbot

    (@kilbot)

    Hi @maxdv02!

    It seems that the woocommerce_init action is being called twice for some reason.

    For immediate support we could hot patch the Perfect WooCommerce Brands plugin with a class_exists check, eg:

    add_action(
      'woocommerce_init',
      function () {
        if(! class_exists( '\Perfect_Woocommerce_Brands\PWB_API_Support' )) {
          require 'classes/class-pwb-api-support.php';
          new PWB_API_Support();
        }
      }
    );

    I will install Perfect WooCommerce Brands on my dev machine later today, but it could be any plugin or theme file calling the woocommerce_init hook, so I might not be able to reproduce it without knowing the exact setup for that particular site.

    • This reply was modified 2 years, 2 months ago by kilbot.
    Thread Starter maxdv02

    (@maxdv02)

    Hey@kilbot ,

    Its amazing how much knowledge you have of this stuff. This totally solved my issue! I will test it a few times today to make sure, but for now thank you man!

    Hope you have wonderfull holidays!

    Thread Starter maxdv02

    (@maxdv02)

    Hi @kilbot,

    Hope you’ve had great holidays.

    I wanted to contact you, since the error popped up again. The solution worked for a couple of days and today my client informed me about it popping up again.

    Ive deactivated the perfect brand plugin again, so the POS works for know. I was wondering if there is an other way to fix this issue.

    Kind regards, Max

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal server error between plugins’ is closed to new replies.