[resolved] Fatal error: Access to undeclared static property: Facebook::$CURL_OPTS (22 posts)

  1. frankog
    Posted 5 years ago #

    First off, love this plugin. Thank you for it.

    Everything was working fine until i upgraded yesterday to wpbook 2.1.3

    When i published to wordpress on 3/19/11 entitled "Photos . . . March 19, 2011" i got a page which loaded in my browser that read:

    Fatal error: Access to undeclared static property: Facebook::$CURL_OPTS in/home/~/public_html/queerliberationfront.us/wp-content/plugins/wpbook/includes/publish_to_facebook.php on line 30

    Line 30/31 read:

    My wordpress post on wordpress is fine.

    The post didn't post on my facebook wall:

    or facebook blog page:
    (which contains a list of errors.)

    Please help.
    Thank you in advance.

  2. John Eckman
    Plugin Author

    Posted 5 years ago #

    @frankog can you try commenting out lines 30/31 of publish_to_facebook.php?

    I had to add those to support users whose ssl certificates were self-signed - but maybe that's conflicting with some other plugin you have also using the Facebook api?

    Do you have the plugin enabled now? Looking at the app canvas page: http://apps.facebook.com/queerliberation/

    This seems off - it should be showing in the WPBook theme.

    Loading either http://queerliberationfront.us/?fb_sig_in_iframe=1 or http://queerliberationfront.us/?signed_request=true

    should try to invoke WPBook but isn't.

  3. John Eckman
    Plugin Author

    Posted 5 years ago #

    I also wonder if the error doesn't suggest some kind of problem with the install, since it should be finding the Facebook client in the right place - maybe try uninstalling and reinstalling?

  4. analogixx
    Posted 5 years ago #

    Hi John.
    I get the same error. It came after the last wordpress update.
    Also deinstall/install did not fix this.
    What can I in addition try ?
    thanks in advance

  5. John Eckman
    Plugin Author

    Posted 5 years ago #

    @analogixx are you running other Facebook related plugins?

    You can try the same fix I suggested above which is to comment out (or delete) lines 30 and 31 in:


    But that potentially only shifts the problem, as the real issue is why your copy of the Facebook api doesn't allow this - suggests you have an older FB SDK hanging around somewhere.

    One other thing to check is at line 9 of that same file, does it say:
    if(!class_exists('Facebook')) {

    or does it say:
    if(!class_exists('FacebookRestClient')) {

    You WANT it to be checking for Facebook class, not FacebookRestClient class.

  6. ds123
    Posted 5 years ago #

    i have same problem ..am using andy peatlings facebook connect plugin maybe that is why?

    i commented out those 2 lines you mentioned which got rid of the error when publishing a post ..but no post made it the facebook wall or that apps.facebook.com page

    anything else i can try? really would love to use this to import my facebook comments into wordpress!

  7. John Eckman
    Plugin Author

    Posted 5 years ago #

    @ds123 The issue of no post making it to the wall is likely completely unrelated to this error.

    What does your check permissions page say? (WordPress->Settings->WPBook, stream/wall options, click on "check permissions" link)

  8. ds123
    Posted 5 years ago #

    @johneckman thanks for the reply ... when i click on check permissions it brings up facebook and a totally blank page (other than facebook stuff on the right side)

    i recreated the app following your instructions to make sure i didn't miss anything

  9. ds123
    Posted 5 years ago #

    on another note i've had all sorts of issues with iframe and facebook lately ..even using their like box generator the iframe didn't work but the xbml did .... another weird thing yesterday i created some simple apps for wordpress to connect to other than yours and if i used one of my old apps meaning an app on facebook i created long time ago and modified it it worked...creating new app then plugin didn't work

    IFrame tab issues

    Mar 24, 2011 2:16pm
    Most iframe tab issues have been resolved since Thursday afternoon, including on app profile pages.

    IFrame tab issues

    Mar 22, 2011 5:21pm
    We're seeing issues with some iFrame tabs failing to load. We're investigating and will follow up further in bug 16102.

    Missing bookmarks for some users

    Mar 18, 2011 2:19pm
    We are seeing reports of missing bookmarks and users having to reauthorize apps. This appears to be happening only for a subset of users. We are currently investigating.

  10. marste
    Posted 5 years ago #

    Hey *,
    I think I've got the same error, but I am not a hundred percent sure.
    I have new most recent WP-Version and WPBook 2.1.4.
    1. After updating WP I de- and reinstalled WPBook.
    2. Checked the Facebook-App-Settings as described somewhere in the docu for updating from 2.0.x to 2.1
    3. got the from the first post here
    4. commented line 30 & 31 out in wp-content/plugins/wpbook/includes/publish_to_facebook.php
    5. change Facebook class from 'FacebookRestClient' to 'Facebook' in line 9 - same file.

    now I get the following error when I publish I post and nothing appears on my wall:

    Fatal error: Call to undefined method Facebook::api() in /var/www/web1077/html/blog/wp-content/plugins/wpbook/includes/publish_to_facebook.php on line 208

    I have also another Facebook plugIn which enables single-login named "Facebook Connect"

    kind regards and thx in advanced

  11. marste
    Posted 5 years ago #

    I just had I look on the other plugin. The Facebook client is completely different. I am wondering if it is possible to just name the Facebook classed used for WPBook different, so that two different can exists next to each other.

  12. BandonRandon
    Plugin Contributor

    Posted 5 years ago #

    @marste I think the problem is that FB Connect using an older version of the Facebook Class. I also don't think renaming the class will work because then you'll get a cannot redefine function error.

    Hopefully when FB Connect upgrades to the new API the problem will go away. For now your SOL on using both at the same time.

  13. analogixx
    Posted 5 years ago #

    After the last posts I checked my environment. I also have FB connect running. But when I deactivate i get the "invalid oAuth .. access error" when I post something only with WPbook activated.
    I tried to grant permission again over the WPbook function but get the message in Facebook "error..please try again later"

  14. John Eckman
    Plugin Author

    Posted 5 years ago #


    The invalid oAuth error you refer to is because WP does not have the correct access token stored. In general this is due to a misconfiguration of WPBook.

    The error you are getting when you try to grant permissions is the problem - is there a corresponding error in your PHP logs when that happens?

    What version of WordPress are you running? Have you updated to WPBook 2.2?

    What's the URL of your blog outside Facebook, and what is the url of your Facebook application?

  15. analogixx
    Posted 5 years ago #

    I found now why I can't grant authority again. Between the message there's another on, which disappears in half a second:

    Your Facebook Profile ID must match the ID which you are logged in...

    But it is exactly the ID I'm logged in.

    But this text is interesting:
    "The Facebook profile ID you are currently logged in to Facebook as is . You have defined xxx as your Facebook user id in WPBook Settings."

    ... to Facebook as is .
    looks like WPBook does not know what I'm logged in

  16. John Eckman
    Plugin Author

    Posted 5 years ago #

    Hmm. WPBook should know that you are logged in.

    Have you visited your canvas page? (apps.facebook.com/appname/)

    Are you logged in to Facebook in some unusual way, as other than a regular user?

    Farther down the page, does it say:

    FB Profile XXX has granted the following permissions:

    WPBook is getting that value directly from the OAuth payload from Facebook. No idea why that would be blank, but it certainly will cause trouble if it is.

    Have you set your Facebook application to use OAuth 2.0 based authentication?
    ("OAuth 2.0 for Canvas" in Advanced, Migrations)

  17. analogixx
    Posted 5 years ago #

    I changed OAuth in advanced. You're right..this was not set.
    Now I get these messages:

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/virtual/xx.de/xx_de/htdocs/wp-content/plugins/wpbook/includes/publish_to_facebook.php on line 67
    The same on 79,97,132,139,144 and 150
    Additional to it this one:

    Fatal error: Call to undefined method Facebook::api() in /var/www/virtual/xx..de/xx_de/htdocs/wp-content/plugins/wpbook/includes/publish_to_facebook.php on line 220

    After granting permission new I got this:
    FB profile 100001067665305 has granted these permissions:

    Caught exception in getting permissions for user: Invalid API keyError code: 101

  18. John Eckman
    Plugin Author

    Posted 5 years ago #

    @analogixx - a few notes.

    1. The fwrite() errors should go away if your turn off debugging (WordPress settings->WPBook->Stream/Wall Options, uncheck "enable WPBook to create a debug file").

    I tried to clean up how we're doing debugging in 2.2 and may have been overzealous. Will fix this in a next release. (The $fp file handle apparently needs to be re-opened each time in the file - I thought it would persist).

    2. The Facebook::api() undefined one is a problem. This means you are running some other Facebook plugin that uses the old version of the Facebook client. You cannot have two Facebook plugins running at the same time using different versions of the Facebook SDK

    3. The permissions error may be related to the other errors, but it also suggests that maybe you haven't updated your WPBook settings to refer to app_id rather than API-key? (WordPress->Settings->WPBook, required section, the first box is your app's ID, not api key).

  19. analogixx
    Posted 5 years ago #


    Now I got everything away :-) thank you...
    nearly all. The only thing which stayed now is:
    Caught exception in publish to page Invalid OAuth access token. Error code: 0

  20. analogixx
    Posted 5 years ago #

    @john.....everything works now :-) :-) thanks a lot for your support.
    You were right...the app's ID ......there was the api key in !!

  21. NoobError
    Posted 5 years ago #

    i have been following along here and have fixed the settings to alow it to pass lines 37 220 and now there is an errro on 348.

    Fatal error: Call to undefined method Facebook::api() in /publish_to_facebook.php on line 348

  22. John Eckman
    Plugin Author

    Posted 5 years ago #


    This typically means you have some other Facebook-oriented plugin that is including an out-of-date version of the Facebook PHP client.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WPBook
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic