Testing the children().size() < 3 seems a bit irrelevant, what is important is that we don't allow any names besides "name, value, enabled".  John says that this would require testing that the plug being created does not already exist, otherwise it could add a "name2" plug.  Also, you missed a newline on this line.