Works well, except the origin of the separate png files that were exported seems to be off.
Steps to reproduce:
* 1 xfc or psd file with multiple layers that are smaller than the image size.
* export layers -> as png
* flatten images NO, only visible layers, yes or no
* result: all layers have the wrong origin in their respective sub-pngs.
* you can see this by reopening the output png files in gimp.

The plugin doesn't care about problematic characters for the file system given by the names of the layers. For example if you have a ":" character in the layer name the plugin creates only 1 empty file with a part of the layer name. I ran into this problem as i tested the standard globe animation plugin of Gimp, because it creates many layers with the ":" contained in the name.

The solution is to let the script remove / substitute all problematic characters. I did it by substituting this line: