What happens in this method is an `array_search()` to check if the `$name` exists in the `loadedPlugins`. If that is false (i.e., the plugin is not loaded before, I assume) you create a string. If not (i.e., the plugin is in `loadedPlugins`) you return an empty string.

However, you never put the `$name` in the `loadedPlugins`, so if you require a `$name` twice, it is also loaded twice This despite the false indication it does ;)

If you add `$this->loadedPlugins[] = $name` somewhere in the if statement, it will be added and thus skipped next time you add a plugin :)