Optimize discovering of installed plugins and prevent duplicates