A Substance Designer plugin is a Python file or a Python module that defines an initializeSDPlugin() function.
The initializeSDPlugin() function is called when the plugin is loaded.
In this function, you can create user interface elements, register callbacks and any other piece of functionality you might need.
Optionally, the plugin can define an uninitializeSDPlugin() function that will be called when the plugin is unloaded.
You can use this function to free resources, close network connections and similar things.