WordPress.org

Ready to get started?Download WordPress

Forums

Google+ Crossposting
Invalid argument supplied for foreach (6 posts)

  1. michapixel
    Member
    Posted 2 years ago #

    While manually importing items of my timeline i get the error:

    "Warning: Invalid argument supplied for foreach() in [...]/wp-content/plugins/g-crossposting/gplus-crosspost.php on line 197"

    http://wordpress.org/extend/plugins/g-crossposting/

  2. michapixel
    Member
    Posted 2 years ago #

    Well ... turns out you have to actually activate the G+ API in it's interface, which i didn't :-) anyways:

    foreach ((array) $activities->items as $activity)

    should prevent the error, although before traversing this object you should check if it has an 'error' item and instead display this.

  3. Sebastian
    Member
    Plugin Author

    Posted 2 years ago #

    Good point, will check it.

  4. Sebastian
    Member
    Plugin Author

    Posted 2 years ago #

    I just released version 1.0.1 of the plugin fixing the problem you reported above. The validation of the settings entered is now more careful. If the settings are wrong, the are reset to empty strings.

    At a later point, I will try to figure out how to do correct error reporting to the admin user. I was not able to find a good description how to keep error messages between page views. I would be happy for any pointers.

  5. michapixel
    Member
    Posted 2 years ago #

    Just write your own in "wp_options"?

  6. michapixel
    Member
    Posted 2 years ago #

    What you got here is not exactly an error, it's a misconfiguration by us users, so in my mind you should write a decent doc and put it somewhere under the help panel on your plugins option page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic