Title: PHP Warning: Invalid argument
Last modified: July 20, 2020

---

# PHP Warning: Invalid argument

 *  Resolved [miracbureau](https://wordpress.org/support/users/mdwebbureau/)
 * (@mdwebbureau)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/)
 * Hi,
 * We used the most recent version of your plugin together with WooCommerce 4.3.0
   
   We get in our error-log: PHP Warning: Invalid argument supplied for foreach()
   in /wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php on line
   415
 * Every minute this error is visible.
    How can we fix this?

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Pit Bozionelos](https://wordpress.org/support/users/pitbozionelos/)
 * (@pitbozionelos)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13149833)
 * Hey [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/) ,
 * Thank you very much for reaching out to us! I’m sorry to hear that our plugin
   is causing you this issue, however, I’d be happy to help further investigate 
   this.
 * I took a look at the code of our plugin and it seems that this warning may appear
   when our plugin tries to sync variable products to your Facebook shop. In order
   to further investigate this, I’d like to know if you’re using variable products
   in your shop. If so, could you share me with more information regarding the type
   of products you’re syncing, including their attributes if they’re variable products?
 * Looking forward to your response.
 * Best regards,
    Pit
    -  This reply was modified 5 years, 9 months ago by [Pit Bozionelos](https://wordpress.org/support/users/pitbozionelos/).
 *  Thread Starter [miracbureau](https://wordpress.org/support/users/mdwebbureau/)
 * (@mdwebbureau)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13207937)
 * Yes, we use variable products.
    You can checkout the products here: [https://cityofglass.eu/en/shop/](https://cityofglass.eu/en/shop/)
 * Please let me know.
    -  This reply was modified 5 years, 9 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Short link expanded, do not use those here
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13207942)
 * [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/) Do not use short
   links in these forums, that has been abused in the past and is expanded when 
   found. I have expanded yours.
 *  [Pit Bozionelos](https://wordpress.org/support/users/pitbozionelos/)
 * (@pitbozionelos)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13217471)
 * Hey [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/) ,
 * Thank you very much for your sharing your link with me! A few days ago, our plugin
   was updated to the version 2.0.0. Could you let me know if you’d be interested
   in updating and letting me know if this helps with the PHP warning you’ve encountered?
 * Also, since this is a warning, you’ve mentioned that it’s visible all the time.
   I haven’t been able to encounter this error in your site, so could you provide
   me with more information on where this error is visible and if it has impacted
   the sync of your products in the time being?
 * Looking forward to your response to further investigate.
 * Best regards,
    Pit
 *  Thread Starter [miracbureau](https://wordpress.org/support/users/mdwebbureau/)
 * (@mdwebbureau)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13221129)
 * Hi Pit,
 * Yes, we still see the error:
    [07-Aug-2020 08:52:58 UTC] PHP Warning: Invalid
   argument supplied for foreach() in /public_html/wp-content/plugins/facebook-for-
   woocommerce/includes/fbproduct.php on line 438
 * It is like almost every minute in the error-log.
    It seems no impact on the sync
   of our products, but our error-log is already 8MB. It gets huge if i dont delete
   it on time. But the FB error make it huge everyday. So, we really need proper
   solution.
 * So right now we already updatet, but no solution.
    There is no specific place
   that the errors pop-up. It is just every minute visible in the error-log. No 
   impact on front-end.
 *  [Pit Bozionelos](https://wordpress.org/support/users/pitbozionelos/)
 * (@pitbozionelos)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13223243)
 * Hey [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/) ,
 * Thank you very much for letting me know. Unfortunately, I’m not aware what could
   be causing this issue, so I’ll go ahead and consult with one of our engineers
   and reach back to you as soon as further feedback is available.
 * I’m afraid that it’s possible that our team won’t be able to get back to me within
   the weekend, but one of my colleagues or I will make sure to reach back to you
   by Monday.
 * Thank you very much for your patience while working on this. Is there’s anything
   else I can do to help you in the meantime?
 * Best regards,
    Pit
 *  [Pit Bozionelos](https://wordpress.org/support/users/pitbozionelos/)
 * (@pitbozionelos)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13236951)
 * Hey [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/) ,
 * Thanks for your patience while further investigating this on our end.
 * My colleagues reached back to me and informed me that this warning is caused 
   by a part of the code used in our plugin not taking into consideration a specific
   condition. So, even though the plugin is working as expected and the sync process
   isn’t interrupted, we understand that it’s logging the warning continually on
   your site’s logs.
 * Our team has started tracking this issue to resolve it in a future update, however,
   in the meantime, you may need to continue deleting the logs manually or consider
   setting up an automatic way for them to be deleted. If you’d like to do this 
   automatically, you can setup a cron job that removes the logs generated by our
   plugin. In order to proceed with that, you’ll need access to the server and also
   make some technical changes.
 * It’s possible that [cPanel offers server cron jobs](https://docs.cpanel.net/cpanel/advanced/cron-jobs/)
   that could help you with that if you’d like to further investigate. Instead, 
   you can also reach out to your provider and request more information if this 
   would be feasible on their end. I’m sorry for not being able to provide you with
   better news on this one. Thank you for bringing this to our attention, though.
 * Would you please let me know if all of the above are helpful? Anything else I
   can help you with?
 * Best regards,
    Pit
 *  [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * (@tamarazuk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13299342)
 * Hey [@mdwebbureau](https://wordpress.org/support/users/mdwebbureau/),
 * It has been a long time since we heard from you, so I’m going to mark this topic
   as resolved.
 * If you’re still experiencing issues please [take a look at our documentation](https://docs.woocommerce.com/document/facebook-for-woocommerce/)
   for more information and [create a new thread](https://wordpress.org/support/plugin/facebook-for-woocommerce/#new-post)
   if you have further questions.
 * Thanks,
    Tamara 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘PHP Warning: Invalid argument’ is closed to new replies.

 * ![](https://ps.w.org/facebook-for-woocommerce/assets/icon.svg?rev=3469606)
 * [Meta for WooCommerce](https://wordpress.org/plugins/facebook-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-for-woocommerce/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [tamarazuk](https://wordpress.org/support/users/tamarazuk/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-invalid-argument-7/#post-13299342)
 * Status: resolved