oAuth conflict between Ultimate Facebook and Recent Tweets Widget


I've used wordpress for a few years, but mostly just basics for a personal blog. Now I'm setting up a bigger blog with bells and whistles type stuff and I have hit my first (of, I'm sure, many) snag.

I am using this plugin: https://wordpress.org/plugins/recent-tweets-widget/ Which worked fine until I installed Ultimate Facebook.

Now I get this error: Fatal error: Cannot redeclare class OAuthConsumer in /home/freejinger/freejinger.org/wp-content/themes/splash/functions/twitteroauth.php on line 4

I did some research on this and it seems to be a conflict because you can't call the OAuthConsumer class twice (I also use comments+ just for further information).

I did read the threads which suggested if you are using more than one plugin that uses calls to FB or Twitter you should use the check box rather than entering then ID numbers in both, so I have done that.

You can see that the facebook sign in is working fine here: http://www.freejinger.org/register/ and you can see the recent tweets widget being very unhappy here: http://www.freejinger.org/dictionary-category/individuals/ (I just have it showing on this one page right now since it's not working properly)

Any help fixing this matter would be greatly appreciated :slight_smile:

  • fjowner

    Wow you guys are quick. While I am waiting on pastebin to send me the email verification link, I forgot to add that I did upgrade the theme around the same time, so I thought that might have caused the problem. I had the original copy of the twitteroauth.php file so did reupload that and still had the same error.

    Edit to add link to pastebin: http://pastebin.com/vZP9BTsQ

    Edit to add further information: I just disabled Q&A and comments+ to stop them nagging me about things I didn't want to configure right this second and that fixed the conflict, so I guess it is actually a conflict with comments plus rather than Ultimate Facebook. Sorry for the confusion about that.

  • Michael Bissett

    Hey @fjowner, thanks for posting the code there, as well as sharing that additional information! :slight_smile:

    After looking through the code, I can see where the theme would be conflicting with Comments+. The class you mentioned (along with other ones), are already being defined inside of Comments+.

    The thing is though, if you were to look at the code inside /wp-content/plugins/comments-plus/lib/external/twitter/OAuth.php, you'd notice that there's statements like these:

    if (!class_exists('OAuthConsumer'))

    It's saying "if this class doesn't exist, then run this code" (which in this case, would cause this class to be defined). But, inside of the theme code you posted, no such checks are made.

    Could you please send in the following, so that we can dig into this deeper?

    - In the subject field add "Attn: Michael Bissett”
    - Link back to this thread
    - Include WordPress network admin access details
    - Include FTP log-in details
    - Include any relevant URLs for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.


    Please advise,

  • Michael Bissett

    Hey @fjowner,

    You're welcome, thanks for sending that information in! :slight_smile:

    Oddly enough, I just tried network activating both Comments+ & Q&A on your Multisite, and I didn't see this error come up anywhere on your site. Could you confirm that this is the case on your end as well?

    We may have run into a one time hiccup here, which got resolved after deactivating and reactivating these plugins.

    Please advise,

  • fjowner

    Well you seem to have the magic touch because I'm not seeing the error now either and I tried deactivating and reactivating things before asking for help.

    I do have one more question (or problem), which I am sure is likely user error, but it has me very confused.

    No matter what settings I use in the comments+ settings, it keeps giving me the "you need to configure the settings" nag.

    I just checked again and everything seems to be filled out, but I'm sure I'm missing something simple.


  • Michael Bissett

    Hey @fjowner,

    No matter what settings I use in the comments+ settings, it keeps giving me the "you need to configure the settings" nag.

    I just checked again and everything seems to be filled out, but I'm sure I'm missing something simple.

    Ah, that would be because the boxes for Facebook and Twitter weren't checked in the "Do not show "Comment with…" section inside Settings -> Comments Plus.

    As you had those boxes unchecked (enabling the ability to comment via Facebook & Twitter), yet you hadn't configured the settings for Facebook or Twitter (which would entail entering the app details for both), that's why it was saying that you needed to configure the settings.

    I just checked those for you, and am now seeing that the message has disappeared on my end. Could you confirm that this is so on your end as well? :slight_smile:

    Please advise,

  • fjowner

    Hi Michael,

    That has stopped the nag, thank you. I'm clearly confused about something and have just spent the last hour or so looking for the threads I read when trying to find a solution to the original problem I was having, but of course now I can't find those, to help explain my confusion.

    What I *thought* I understood from those threads was that if you already had an app that was using your (for example) consumer key and consumer secret, you did not want to enter those again because having them entered in both apps would effect your load, so you should just check the javascript box instead, because the app would go ahead and pull your keys from the other app that had them.

    I'm gathering from the fact that you had to click those 2 boxes that I misunderstood this and I do need to enter my keys in each app that uses them?

  • fjowner

    Hi Michael,

    Well this http://www.freejinger.org/blog/team_member/dawbs/ is .....interesting :slight_frown:

    I decided to try and work on the site a little tonight and put this page up. Not only is the twitter error back, but so are some other interesting problems, as you can see.

    Initially, I thought the page hadn't loaded correctly, but then I realized there was just a bunch of space between the top of the page and the start of the theme.

    I'm not sure why another add on is throwing an error, only on pages apparently, but not on the front page. The blg area of blank space also doesn't show up on the front page as you can see here: http://www.freejinger.org

    I haven't touched any settings that you did or changed anything else. All I did was finish a page I had in draft from a couple days ago.

    I'm sorry to be such a problem :slight_frown:

  • fjowner

    I wanted to add a little update. I changed themes tonight and it is also giving the same error with the recent tweets plug in. You can see the error here: http://www.freejinger.org/team_group/administrative/ (I have it hidden on the more popular pages, so that's why it's only showing sporadically).

    I went ahead and added my key information to comments+, but don't have any posts that are open for comments at the moment, so I'm not sure if that is working right. I should have a new post up in the next couple days so will know then.

    Thanks again for all your help :slight_smile:

  • Ash

    Hello @fjowner

    I hope you are well today.

    I am not seeing any error or blank space in any of your links. What I am seeing is some error comes from your caching plugin.

    When you test other plugins or just configure things, it's always better approach to test deactivating the caching plugin.

    Also, feel free to let us know when you will have another post that is open for comment. Do not forget to reset cache before checking :slight_smile:

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


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.