WordPress.org

Forums

Facebook Comments to WordPress
Warning: Invalid argument supplied for foreach() in /home/s (9 posts)

  1. benjiballin
    Member
    Posted 3 years ago #

    Been getting this error:
    Warning: Invalid argument supplied for foreach() in /home/safezone/dudelol.com/wp-content/plugins/facebook-import-comments/classes/FacebookCommentImporter.php on line 187

    The fix to make this error go away is to change:

    foreach ($comments as $num => $comment) {
                $this->importComment($comment, $parentCommentId);
            }

    to this:

    if(isset($comments))
    	{
    
            foreach ($comments as $num => $comment) {
                $this->importComment($comment, $parentCommentId);
            }
    
        }

    I am currently running this plugin on my funny pictures website and I am not sure if this plugin will continue getting comments into the database or not, this will at least make the error msg go away.

    http://wordpress.org/extend/plugins/facebook-import-comments/

  2. benjiballin
    Member
    Posted 3 years ago #

    actually no, this fix didn't work at ALL. In fact, I figured out that all of my comments have been getting DELETED from the wordpress database

  3. benjiballin
    Member
    Posted 3 years ago #

    ok I figured out the fix, the comments were getting deleted because facebook made a change to the API

    Disregard the first post changes and change:

    line 39
    if (is_array($locComments) && is_array($locComments['data']))

    TO:
    if (is_array($locComments) && is_array($locComments['comments']['data']))

    and line 43
    $helper->import($comments['data'], $this->importMode);

    TO:
    $helper->import($comments['comments']['data'], $this->importMode);

  4. benjiballin
    Member
    Posted 3 years ago #

    I fixed the plugin and re-uploaded it to the wordpress repository if anyone wants to use it.

    http://wordpress.org/extend/plugins/import-facebook-comments-to-wordpress/

  5. rhythmdoctor
    Member
    Posted 3 years ago #

    I tried to download your plugin but there were no files :(

  6. nvassos
    Member
    Posted 2 years ago #

    Hey buddy, your plugin doesnt have any files.... Are you going to fix it? Alot of people are eagerly wanting to use it. If it works its a major thing for big sites with facebook comments.

  7. nvassos
    Member
    Posted 2 years ago #

    I tried the other version and its working fine but the additional functionality of importing old comments is what i want as well adn I need to know whats the best way to attach more post-types to it.

  8. flauius
    Member
    Posted 2 years ago #

    Any insights?
    I will deactivate this plugin... and search for any other...

    There is no seo benefits in keeping the comments if every time I load a post I have a error message like this:

    Warning: Invalid argument supplied for foreach() in /home/directory/domain/wp-content/plugins/facebook-import-comments/classes/FacebookCommentImporter.php on line 185

  9. Chuck Reynolds
    Member
    Posted 2 years ago #

    Same bug in current 1.5 version. produces php error log. needs to be fixed for wp3.5

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Facebook Comments to WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic