WordPress.org

Ready to get started?Download WordPress

Forums

Srizon Facebook Album
[resolved] Albums don't load *most* of the time on *one* server (8 posts)

  1. Dustin Lammiman
    Member
    Posted 1 year ago #

    I am using your plugin with the same WordPress theme to load the same Facebook gallery on three different servers. On two of the servers it is working great but on my main server most of the time after a new sync it just shows a blank page. Once in a while it will load the albums and photos and then I am good until the next sync, but then they disappear again. Since this is only happening on one server I think it might be a server/php configuration issue. Unfortunately the plugin won't give me any useful information to debug with. Any ideas how I might track down what the problem is?

    http://wordpress.org/extend/plugins/srizon-facebook-album/

  2. afzal_du
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    you can add
    ?debugjfb=1 (or &debugjfb=1)
    also
    ?debugjfb=1&forcesync=1 (or &debugjfb=1&forcesync=1)
    to the url to see some debug info.
    probably it's a connectivity issue with your server and facebook.

  3. Dustin Lammiman
    Member
    Posted 1 year ago #

    Thanks, its good to be able to see the debug info. As we suspected it says
    getting remote data from:http://graph.facebook.com/mec/albums?fields=name,id,count,cover_photo file_get_contents failed...
    Farther down it says {"error":{"message":"(#4) Application request limit reached","type":"OAuthException","code":4}}. I assume that means that Facebook is rejecting the request due to some sort of request limit. Any idea what could be done about this?

  4. afzal_du
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, That happened with one or two other users before! But in that case the sync time was set to 600 minutes (which is only 2/3 request per day) and shouldn't reach any 'limit'.
    However, I suggest you try this.
    1. open srizon-fb-album-front.php (or srizon-fb-album-front-pro.php in case of pro version)
    2. locate the last function 'srz_fb_remote_to_data'
    3. replace that whole function with the following version (assuming you have curl library enabled on your server)

    function srz_fb_remote_to_data($url){
    if(isset($_GET['debugjfb'])){
    echo 'getting remote data from:'.$url;
    }

    require_once (dirname(__FILE__) . '/mycurl.php');

    $fbcurl = new SrzFBMycurl($url);
    $fbcurl->createCurl();
    $fbcurl->setUserAgent('');
    $fbcurl->setCookiFileLocation('');
    $fbcurl->setReferer('');
    $data = $fbcurl->tostring();
    if(isset($_GET['debugjfb'])){
    echo "\n".'wp_remote_get and curl failed to get the api response. either the pageid or albumid is wrong or your server is blocking all remote connection functions!';
    }

    return $data;
    }

  5. Dustin Lammiman
    Member
    Posted 1 year ago #

    After changing the function Facebook is still giving the response:

    {
       "error": {
          "message": "(#4) Application request limit reached",
          "type": "OAuthException",
          "code": 4
       }
    }
  6. afzal_du
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    Can't think of anything else!
    Since it's happening on just one server I don't think it's a general issue. Keep the sync interval higher and see if that works.
    I don't know if it's a shared server. In case it is, maybe some other user is using facebook api from the same IP and reached some limit.

  7. Dustin Lammiman
    Member
    Posted 1 year ago #

    Yeah, I'm thinking that it probably is a shared server and someone else is making calls from the same IP. Is there any easy way to sign the requests and possibly get around that limit? I'm guessing that would probably take a fair bit of work, so may not be worth it in this case. I guess I may have to find a different solution for how I display my galleries. Not your fault by any means - looks like it is a problem with my shared hosting. Thanks for the help and making a great plugin!

  8. afzal_du
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    For that you need to create a facebook app, use some kind of authentication, include that info(appid/auth) in api call.
    Since facebook page albums are publicly open and can be accessed without the auth process I didn't include that complex process in my plugin.
    Since only 2/3 servers including yours produced this problem I'm going to overlook this for now.
    Marking it as resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.