Support » Plugin: Easy Instagram » Errors in admin area

  • Resolved Joshua

    (@joshuapalinggmailcom)


    I’m getting:

    Notice: Trying to get property of non-object in /var/www/vhosts/bbldigitaldev.com.au/flamingopink/wp-content/plugins/easy-instagram/include/Instagram-PHP-API/Instagram.php on line 158 Notice: Trying to get property of non-object in /var/www/vhosts/bbldigitaldev.com.au/flamingopink/wp-content/plugins/easy-instagram/include/Instagram-PHP-API/Instagram.php on line 176

    in the admin area. This is after clicking “instagram login” and giving permission to the app. The app comes up fine in my ‘Authorized Applications’ in my Instagram account.

    And (probably related…) I get no output from
    <?php echo do_shortcode( "[easy-instagram tag='puppy' limit=2]" ) ?>
    in the frontend.

    Any ideas? Thanks.

    http://wordpress.org/extend/plugins/easy-instagram/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Joshua

    (@joshuapalinggmailcom)

    By the way, it’s working on my localhost – just not on the staging server.

    Doing some debugging and print_r’s, it turns out the difference between the staging site and the local site is this:

    On the staging site, $this->_oauthToken contains:
    “HTTP/1.1 200 OK Content-Language: en Content-Type: application/json Date: Tue, 04 Dec 2012 04:14:39 GMT Server: nginx Vary: Accept-Language, Cookie, Accept-Encoding Content-Length: 367 Connection: keep-alive {“access_token”:”104849973.098c54f.73df46f417e643239e6e79b4ca5916b8″,”user”:{“username”:”flamingopinkau”,”bio”:”Welcome to our Instagram page. Put the kettle on, settle in and stay a while xox”,”website”:”http:\/\/flamingopink.com.au”,”profile_picture”:”http:\/\/images.instagram.com\/profiles\/profile_104849973_75sq_1339942957.jpg”,”full_name”:””,”id”:”104849973″}}”

    And on the local site, it contains pretty much the same thing – but only the json array. No “HTTP/1.1 200 OK Content-Language: en Content-Type: application/json Date: Tue, 04 Dec 2012 04:14:39 GMT Server: nginx Vary: Accept-Language, Cookie, Accept-Encoding Content-Length: 367 Connection: keep-alive” at the start of it. Now to figure out why the staging site is getting that additional stuff… any ideas?

    Joshua

    (@joshuapalinggmailcom)

    OK so it turns out the issue is in CurlHttpClient.php, inside Instagram-PHP-API. Because open_basedir is false, the ‘getResponse’ method calls “curl_redir_exec”, which sets CURLOPT_HEADER to true, so headers are included in the response.

    The ‘curl_redir_exec’ method has a line:
    list( $header, $data ) = explode( "\r\n", $data, 2 );
    which attempts to strip out the headers before finally returning $data, but it doesn’t always work. Sometimes there’s more than one “\r\n” within the header part of the response.

    Anyway, basically, it’s the same problem as what’s described here: http://stackoverflow.com/questions/11359276/php-curl-exec-returns-both-http-1-1-100-continue-and-http-1-1-200-ok-separated-b so that’s what I’m using as a solution. Hope that helps if someone else has the same issue.

    Joshua

    (@joshuapalinggmailcom)

    (just marking this topic as resolved)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Errors in admin area’ is closed to new replies.