Hi Craig,
Wow, 5500+ are a lot of categories. What does the error message say?
Haha I know! I have to manage it :(.
Ok, so when I try to edit feed, it takes a LONG time.
Then it loads just the left side where I select the name and feed type.
The error log returns:
mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /home/weburl/public_html/wp-includes/class-wp-hook.php on line 277, referer: https://weburl/wp-admin/admin.php?page=wp-product-feed-manager
Craig,
I’m a bit confused about what is causing this error. The function I use to fill the categories list is a formal WooCommerce function (get_categories). This function contains a filter and it seems to be the filter that is causing the error message.
Do you by any chance use a plugin that alters or manages the categories? If so, what happens when you switch off this plugin?
Also, if possible could you try to temporary switch off as many plugins as you can and see if the issues disappears?
Hi Michel.
Thanks for your reply.
I will give it a go once I can get a good time to disable the plug ins.
I’ll report back here with my findings.
Thanks.
Craig
Hi Michel,
I’ve disabled most plugins now and tried again.
SImilar thing but this error in error file:
mod_fcgid: stderr: PHP Fatal error: Maximum execution time of 300 seconds exceeded in /home/weburl/public_html/wp-includes/taxonomy.php on line 1438, referer: https://weburl/wp-admin/admin.php?page=wp-product-feed-manager
Any suggestions?
Yes, the wierd thing is that I use the same code as WooCommerce is using to display its category list. The error message does seem to point to the fact that it takes to long to get the category list data. But then I would expect you would get the same message when you open the Product -> Categories list.
I will have to think a bit more about a solution for this one.
In my 5000+ categories, I have 10 or so that are top level, the rest are children.
What would work for me is if I could identify one or more of these top level categories by their ID, and then included in the product feed is all products belonging to this top level category, or any of the children within it.
This would mean a long list wouldn’t need to load maybe?
Might be, but as long as you only see an error message in the category mapping, it’s not possible to select any category. So I would not know (at the moment) how you could select any category number.
I wouldn’t necessarily need to select it. I could enter the ID. (Or IDs)…
Hi Michel,
Have you come up with any solution to my issue?
Many thanks,
Craig
Sorry Craig that I kept silent so long.
No, I’m still confused by what could cause this issue. Not helping is that I can’t replicate it on my server, and to be honest I don’t have the time to enter 5500+ categories manually on my test server :-(.
Do you by any chance use a local server program like DesktopServer or Local?
Best regards,
Michel
Craig,
Could you check your WooCommerce -> Status page and tell me what values your “WP Memory Limit” and “PHP post max size” are set to?
Best regards,
Michel
Hi Michel,
No problem!
I’ve got WP Memory Limit = 1GB and PHP Post Max Size = 10MB.
Is this sufficient?
Thanks,
Craig
Yes, that should be more than enough.
Craig,
I still don’t understand why it is not working, but I added three filters you could use to limit the list of categories.
wppfm_category_mapping_max_categories => here you can set a number that will limit the number of categories in the list.
wppfm_category_mapping_exclude => here you can enter an array or comma separated string with category ids that you would like to exclude from the list.
wppfm_category_mapping_exclude_tree => here you can enter an array or comma separated string with category ids that will be excluded, including the children categories belonging to that id, from the list. I think this would be the most suitable for your situation.
Could you please send me an email to michel@wpmarketingrobot.com so I can send you an patch file?
Also tell me if you know how to use filters or if you would like me to explain it to you in the mail.
Best regards,
Michel