Ultimate Facebook plugin not working with WP store Frontend

Hello there, I am at the final stages of a project I have been working on for some time, and the site itself is functioning all correctly, the only plugin which isn't playing nice is the 'Ultimate Facebook' plugin which I am very keen on coinciding with my other features as I had it running temporarily and it was awesome! Exactly what I wanted.

However this is my issue, I have a store to where products can be added via the frontend which is essential to what I need for my specific project. To do so I am using a plugin called WP Store Frontend. I had the developer take a look at it and he found that the ultimate facebook plugin was causing issues to which he was unsure and recommended I contact yourselves.

When one adds a product to the site they are directed to a page where they can see an outline of the backend features but in a more user friendly way. However when the 'Ultimate Facebook' Plugin is activated the page delivers this message "Fatal error: Cannot redeclare count_user_posts_by_type() (previously declared in /home1/********/public_html/wp-content/plugins/wp-store-frontend/lib/wp-store-functions.php:317) in /home1/********/public_html/wp-content/plugins/wp-store-frontend/lib/wp-store-functions.php on line 317"

I have been through all the settings of the ultimate facebook plugin and cant quite figure out what the issue could be.

I would greatly appreciate any help, you could offer, I am so close to finishing this and I have been working on it for quite some time.

Note, It is multisite and i have the ultimate facebook plugin network activated, however the store is based only on the primary site and there are currently no existing multisites added as that is something which i will be developing on later. (just in case thats relevant information)

Kind Regards

Gary

  • PC
    • WPMU DEV Initiate

    Hey there Gary,

    Thanks for posting on the forums.

    It generally happens when the same function is there in 2 separate plugins. I would like to have a closer look at the plugin code and troubleshoot this on my lab site if you can send me a copy of the plugin.

    Send it to [contact]@[wpmudev]dot[org]

    Subject : "Attn : PC"

    Please include a link to this thread in the body of that email so that we can track it down.

    Cheers, PC

  • Gary
    • Flash Drive

    Hi there PC, thanks for your help. I have posted an email to WPMU DEV as requested. I thought something like that may have been the issue, I'm quite new to code though so didn't really know what route to take. If you'd like any more details that you think I may have missed please feel free to let me know and I'll do my best to get them for you.

    Thanks again for your time.

    Gary

  • Gary
    • Flash Drive

    Hello there, I haven't heard anything for a few days. I was just wondering if there was any development into if there's any coding I should change or adjustments to get these two plugins to play nice?

    Maybe I'm being a bit persistent, sorry I'm sure there are many querys to deal with. I'm just keen to finally complete my project.

    Kind regards

    Gary

  • Ash
    • WordPress Hacker

    Hi @Gary

    I am really sorry for the delay in your thread.

    Please go to /plugins/wp-store-frontend/lib/wp-store-functions.php line no 317 and 335

    change

    function count_user_posts_by_type($userid, $post_type)

    to

    function wp_store_count_user_posts_by_type($userid, $post_type)

    and
    $user_post_count = count_user_posts_by_type($userid, $post_type);
    to
    $user_post_count = wp_store_count_user_posts_by_type($userid, $post_type);

    If it works, please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • PC
    • WPMU DEV Initiate

    Hey there Gary,

    I just finished testing this on my lab site and could not replicate the error while in the frontend posting mode.

    What version of the WP Store Frontend are you running ?

    Can you kindly test this with the default theme with all other plugins but Store Frontend, MarketPress and Ultimate Facebook disabled and see if you see the same error ?

    I would like to have a closer look if you can enable support access. You can enable support access via :

    WordPress Dashboard >> WPMU DEV Dashboard >> Support >> Staff Access >> Grant Access.

    If you have not installed WPMU DEV Dashboard plugin yet, kindly do that here : https://premium.wpmudev.org/project/wpmu-dev-dashboard/ and then allow access as per the above process.

    Cheers, PC

  • Gary
    • Flash Drive

    Hello there, and thank you for getting back to me, I really do appreciate it. I have updated the functions file and replaced the code as you mentioned but now the error has been replaced by "Cannot redeclare wp_store_count_user_posts_by_type()" . I have just noticed you posted an update of the plugin, should I delete my old one and replace with this? Sorry for my ignorance, I am rather new to this.

    Kind Regards

    Gary

  • Gary
    • Flash Drive

    Hello, so I removed the previous version of the plugin, replaced it with v2.3, then searched for the lines of code, they were on totally different lines although it still states on the error that they are on line 317 etc. However I replaced the code and there is still no change? I'm really stumped.

    Kind Regards

    Gary

  • Gary
    • Flash Drive

    Hi there PC, sorry I didnt see your response there, thank you for having a look for me. I have enabled support access for you. I have just confirmed that all works correctly, it is just when I enable Ultimate Facebook Plugin to when I receive this error.

    Note, I am not using Marketpress as the store plugin, as I did originally, but it wasn't compatible with the features of my theme.

    Thanks all, if you would like any further information, please just let me know.

    Kind Regards

    Gary

  • Gary
    • Flash Drive

    Also, a big thank you to you too
    Ash, I'm not sure what you mean by the plugin and more folders, but I have replaced the original to which I gave you with the updated plugin you provided if that's correct.

    Thanks once again, sorry for the multiple comments.

    Kind Regards

    Gary

  • Gary
    • Flash Drive

    Hi guys, I got it sorted. Although the error was appearing on the wp store front end page, the actual conflict seemed to be between the 'Ultimate Facebook' plugin and another 'WP-FB-Autoconnect' (a facebook login widget plugin) that I had installed. A bit slow of me to realise that this was a possibility. I'm just starting to make sense of functions though now so lesson earned I guess :stuck_out_tongue: Anyways this is resolved now, I have removed the WP-FB-Autoconnect plugin for now and everything seems to be working just fine.

    Thank you for your time and guidance. Also is it possible for you to remove the 'Attached File' from this forum being the 'WP-Store-Frontend v2.3zip' for the benefit and on behalf of the developer.

    Take Care

    Gary

  • PC
    • WPMU DEV Initiate

    Hey there Gary,

    Thanks for posting back and letting us know what was causing it :slight_smile:

    Glad to help and see this fixed !

    I have removed the attached plugin so that it can not be misused.

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.