Fix inversed logic for selecting highest version of plugin