Moving plugins search to top

relevant code for #2510

Sorry if it's not flattened correctly, I've been doing git pulls as SO has suggested instead of git rebases...