Support » Plugins » Genki Youtube Comments plugin error

  • Resolved eliotc


    Has anyone had luck with the Genki Youtube Comments plugin on WP 2.3?

    After following the instructions, when I try the Manual Update, i get the following error:

    Warning: Invalid argument supplied for foreach() in /home/cultural/public_html/wp-content/plugins/youtubecomments/genki_youtube_comments.php on line 158

    I’ve taken a look at the php and at the youtube API but still can’t tell what’s wrong. Can anyone help me out?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I think this may have to do with Youtube changing its API.
    Comments are no longer showing up in the XML generated by the API, so the foreach array is non-existent (therefore giving the error).

    If anyone has any ideas about a fix, please let me know. Thanks.

    I have made some progress on fixing this issue, but its not working yet. I’m not a developer, so hopefully someone more knowledgeable can help get it working again. YouTube has published a helpful ‘Migration Guide’ here:

    Based on this, I changed genki_youtube_comments.php line 147 from

    $source = file_get_contents(“$youtube_dev_id&video_id=$videopost->meta_value”);


    $source = file_get_contents(“$videopost->meta_value/comments”);

    Now the plugin successfully prints the WP permalink, but then throws the error “Error retrieving data from YouTube”. There must be some other syntax change required, but I’m not a developer so I’m shooting in the dark here. Can anyone else help?

    Ok i’ve taken a look at the XML from the new Youtube API and it’s completely different than the legacy API. This means that a major rewrite is probably going to be necessary.

    For example, you’re getting the “Error retrieving data from YouTube” because the plugin is checking that the status of UT_RESPONSE[0] is set to OK. But UT_RESPONSE doesn’t exist in that way in the new API.

    So this part (line 156):
    ($x->data->UT_RESPONSE[0]->_attr->STATUS == ‘ok’)
    is gonna have to go.

    Whereas this part:
    ($x->data->UT_RESPONSE[0]->VIDEO_DETAILS[0]->COMMENT_COUNT[0]->_text != 0)
    is going to have to be rewritten.

    Maybe something like
    ($x->data->FEED[0]->OPENSEARCH:TOTALRESULTS[0]->_text != 0)

    i’m going to mark this as resolved since the plugin author has indicated that no further development will occur on this project (unless someone wants to take it on).

    Please, can someone look into fixing this extremely cool plugin? It was really, really handy.

    And I’m sure the new YouTube API would allow for some nice new features as well.

    hey guys, you can give the new version a download @

    hopefully it doesn’t break anything 😉

    hey thanks! I’ve tested it out and it looks like it’s working.

    i’ve set it to update daily, so hopefully that works too.

    thanks again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Genki Youtube Comments plugin error’ is closed to new replies.