In GIMP 3, plug-ins are mandatorily under a subdirectory. Though on GIMP 2.10.x, both cases are still possible. So only the previous commit should be backported to gimp-2-10 branch. See discussion in !392. Thanks also to Christopher Nielsen for helping.