Hi threadi,
Thank you very much for your feedback. We’ll review your comments carefully and address any issues that may be occurring.
In the meantime, could you please provide more details about the error you’re experiencing, along with the steps to reproduce it? Knowing the exact actions you’re taking, and what you expect to happen versus what actually occurs, will greatly help us identify and resolve the problem efficiently.
Thank you!
Reproducing the error is somewhat difficult. The cache in question is only refreshed by WooCommerce when the category structure is updated. I have now recreated the following rather manual scenario for you. First some preparations:
- fresh WordPress 6.8.1.
- reinstalled and activated WooCommerce in it.
- in WooCommerce I have only imported the sample products. This also creates categories.
- now a direct look into the database: in the options table there is an option_name “product_cat_children” with the following value:
a:1:{i:352;a:4:{i:0;i:353;i:1;i:354;i:2;i:355;i:3;i:356;}} – looks ok so far. If I look under Products > Categories, I can also see them including their structure.
- now I install and activate “Hide Category by User Role for WooCommerce”.
- for further testing I have provided a test plugin here: https://github.com/threadi/hide-category-by-user-role-for-woocommerce-test – download the ZIP there and upload and activate it in WordPress.
Now the test:
- Delete the options record with the option_name “product_cat_children” in the database.
- Execute this command via WP CLI:
wp mytest reset_term_hierarchy
- Look at the data record with option_name “product_cat_children” in the database table options. It will contain an empty array:
a:0:{}
- deactivate the plugin “Hide Category by User Role for WooCommerce”.
- delete the data record for “product_cat_children” in the database again.
- execute the WP CLI command again:
wp mytest reset_term_hierarchy
- now there is a complete entry for “product_cat_children” in the database again.
Yes, the way is rather manual, but it shows that when using your plugin this essential data set is saved incorrectly. I hope this helps 🙂
Unfortunately, we haven’t been able to replicate the issue you reported, so far. The steps you’ve outlined are quite specific and rely on a very controlled environment, including a fresh WordPress installation and manual database edits. It’s possible that the behavior you’re seeing is unique to your setup and may not occur in other environments.
That said, we are aware that caching—especially WooCommerce’s internal category cache—can sometimes interfere with category visibility. However, this typically doesn’t affect newly created categories on fresh installations.
Also, as noted on the plugin’s settings page, we recommend clearing any relevant caches after saving changes to ensure they take effect. As we haven’t received similar reports from other users this leads us to believe that this is not a widespread issue.
We’ll continue to monitor the situation closely. In parallel, we’re reviewing the code to make it as robust as possible, aiming to cover a wide range of potential scenarios—even those that may be edge cases like this one.
We’ve just released version 2.3 of the plugin. This update includes improved compatibility with WooCommerce’s caching system and we believe these changes should address the issues you reported.
Please update the plugin and confirm whether the caching problems have been resolved.
Yes, that looks good. Thank you 🙂