WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[Plugin: AddThis] PHP Warnings about array arguments in foreach() and array_shift() (11 posts)

  1. msenate
    Member
    Posted 2 years ago #

    I've got a sub-domain multisite installation and am getting a few PHP warnings in my error log. The following error warns for lines 627, 633, 642, 647, and 666:

    PHP Warning: Invalid argument supplied for foreach() in wp-content/plugins/addthis/addthis_social_widget.php on line 666, referer: http://sub.site.com/blogname/wp-admin/

    Also, there's an error around array_shift()'s parameters on line 658:

    PHP Warning: array_shift() expects parameter 1 to be array, null given in wp-content/plugins/addthis/addthis_social_widget.php on line 658, referer: http://sub.site.com/blogname/wp-admin/

    http://wordpress.org/extend/plugins/addthis/

  2. _mjk_
    AddThis Samurai
    Plugin Author

    Posted 2 years ago #

    Hm, what version of PHP are you running?

    Best,
    Matt

  3. msenate
    Member
    Posted 2 years ago #

    I'd rather not share the version number here, do you have any particular php bugs in mind?

    You can also contact me directly at msenate at plos {dot} org

  4. addthis_paul
    AddThis Samurai
    Plugin Author

    Posted 2 years ago #

    Are you using this as an admin user or some other permission level? We know of a bug that causes an error when you're using the AddThis plugin and aren't an admin user.

  5. msenate
    Member
    Posted 2 years ago #

    Hmm, I believe only admins and super admins are configuring the plugin. Might there be a configuration issue with super admins?

  6. addthis_paul
    AddThis Samurai
    Plugin Author

    Posted 2 years ago #

    No, it was only with users without admin rights having the problem.

    Have you tried disabling other plugins to see if there's a conflict?

  7. msenate
    Member
    Posted 2 years ago #

    I will test this, but it's a rather odd error response for a plugin conflict. Thanks for your help thus far.

  8. msenate
    Member
    Posted 2 years ago #

    okay, I've debugged this further to the admin dashboard.

    I believe it's an issue with displaying the AddThis dashboard widget. I've disabled dashboard display in the advanced settings of AddThis and have not received any error messages.

  9. _mjk_
    AddThis Samurai
    Plugin Author

    Posted 2 years ago #

    It seems that the problem arises when a date range is selected (or defaulted) missing either share or clickback data. I've checked in a possible fix to the development version (http://downloads.wordpress.org/plugin/addthis.zip). Could you try that out and re-enable the dashboard widget to see if it works it works for you?

    Thanks!

  10. msenate
    Member
    Posted 2 years ago #

    thanks for the patch, it did not fix my problem, I continue to receive the same warning messages...

  11. _mjk_
    AddThis Samurai
    Plugin Author

    Posted 2 years ago #

    Man. There's definitely something deeper going on that to fix properly will require adding some more powerful remote diagnostic capability to the tool.

    However, I've updated the dev version with even more failsafes around missing data. Let me know if it resolves the problem at your leisure.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic