For #27328 - Fix for subclassing hooks

- Previously, sub-classing hooks would only work if the name of the derived class was alphabetically after the name of the base class.
- Derived hook classes tend to be named the same as the base class which meant that the behaviour was indeterminate.
Could be wrong here, but it looks like we are iterating over all valid_base_classes in the loop above, so the message should be `"Error .... again." % ( plugin_file, " ".join([x.__name__ for x in valid_base_classes])` ?
If so, do we still need the valid_base_class local variable ?