Code feedback. Added a cache for the plugin-category counting helper function.