• Hi there,

    Orders cant be processed because of this error. When we deactivate the plugin, everything works fine. What to do?

    Thanks in advance!

    2021-09-09 09:24:06.888882 [NOTICE] [771256] [T0] [31.201.34.254:50394:HTTP2-229#APVH_www.xxx:443] [STDERR] PHP Fatal error: Cannot declare class AC_Connector, because the name is already in use in /home/xxx/public_html/wp-content/plugins/wc-ac-hook/activecampaign-api-php/includes/Connector.class.php on line 8

    • This topic was modified 3 years, 2 months ago by lauralisa.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author mtreherne

    (@mtreherne)

    Ok – most likely there is a conflict with another plugin (they are both trying to declare ‘AC_Connector’.

    Let’s check the most obvious thing first. Do you have any ActiveCampaign plugins in use? e.g. the ActiveCampaign WordPress plugin or the ActiveCampaign for WooCommerce WordPress plugin? If so can you let me know the exact name and version.

    If you don’t then another plugin must be declaring ‘AC_Connector’ and we will need to track it down, to work out how best to fix.

    Thread Starter lauralisa

    (@lauralisa)

    I found out its the WP Fusion Lite plugin that uses the same connector. What to do? We need both.

    Thread Starter lauralisa

    (@lauralisa)

    Fusion is for adding users to AC after registration.

    Plugin Author mtreherne

    (@mtreherne)

    Thanks for tracking down which plugin clashes. As you have done the only immediate solution is to disable one of the plugins.

    I will take a look at the WP Fusion plugin and work out the best fix. But it might take a couple of days to find time to do this. You could contact WP Fusion (as they could do a similar fix), but you’ll probably get a quicker response from me.

    Apologies for the problem. It is not the fault of either plugin. It is just something that happens sometimes in the WP framework. PHP now has namespaces to avoid these issues, but it is not simply a case of using them. This plugin has been around a while and I will have a handful (like 0.5%!) of installations on PHP 5.2 (which does not support namespaces). So I can’t just do that or I’ll create problems for others.

    I’ll get back to you with options, either a hot fix for you to apply, or a new release of the plugin. How proficient are you with editing PHP, FTPing files to your WP install? If you are that might speed things up. I quite understand if you don’t have these skills (and talk of PHP and namespaces is all meaningless to you!).

    Thread Starter lauralisa

    (@lauralisa)

    Great, thank you!!
    I have downgraded the fusion lite plugin for now. So we will have time to wait for the fix, I totally get it.
    Thanks again.

    Plugin Author mtreherne

    (@mtreherne)

    I don’t have solution yet. But I wanted to give you a quick update. I was hoping for a one line simple fix that I could give you as a hot fix (and subsequently release an update) but that is looking unlikely.

    I suspect the problem started about 3 weeks ago when version 3.38.2 of WP Fusion Lite was released.

    WP Fusion Lite make use of an Active Campaign API:

    https://github.com/ActiveCampaign/activecampaign-api-php

    This code is pretty much used by any plugin that needs to access AC. The wp-fusion-lite developer had customised the API to rename all the classes (to avoid clashes) but with 3.38.2 they removed the custom names, on all but one class (the top level class – which they have renamed from ActiveCampaign to ActiveCampaign_API). If they had customized every class name (as prior to 3.38.2) or left the API class names unchanged it would all be fine. But because they are in both camps, the solution for me is not trivial (without using namespaces – which as I explained is a problem due to old versions of PHP still in use).

    Sorry to give you a running commentary. I would rather not customize the ActiveCampaign API code to get things to work because then I cannot easily take version updates for this code (which is created by ActiveCampaign) from GitHub.

    Another solution is to have wc-ac-hook use the ActiveCampaign_API class (if it is declared), and I think it should work, but it is an older version of the API, and as so it might not. wp-fusion-lite uses a slightly older version of the ActiveCampaign API compared to wc-ac-hook which uses the latest 2.0.3. So that muddies the waters.

    I will sleep on it and will get back to you but it may be a couple of days.

    Thread Starter lauralisa

    (@lauralisa)

    I get what your saying, thank you for the update and we’ll wait patienly ??

    Plugin Author mtreherne

    (@mtreherne)

    I have released a new version that uses PHP namespace. Hopefully it will fix the problem for you (and not create new problems for others). It is the best way to resolve the issue and if there are any users left on PHP 5.2 or earlier then they will have to upgrade PHP before taking this version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal error: Cannot declare class AC_Connector’ is closed to new replies.