IMO this function should eventually be passed the plugin_path. all_plugins is already searching all the directories and finding the path to them. It can pass them to this function and we won't need to find the path from name...