Hiding Empty Categories From Main Menu

I am the admin of a store that runs 4.3.3 version of CS-Cart.

I am updating the shop through csv files that are created by my companies erp system.

I update almost everything from these csv files, products, categories, customers.

What I need to do in the shop is to find which categories are completely empty OR have ONLY disabled products.

And if I find such a category, I will disable it so as to not being showed in the main menu.

Has anyone done anything similar in the past?

I have searched and found an addon that is only for v2 but nothing more so I feel completely stuck.

Thank a lot in advance!

If you do not find ready-to-use solution, feel free to contact us to get a free quote