##SortLayers Sorts Layers in QGIS Layers Panel
To use: copy directory "SortLayers" into your ".qgis2/python/plugins" directory;
switch to ".qgis2/python/plugins/SortLayers";
from linux terminal run "make clean; make".
(if you don't run make, it won't load into QGIS - this step is required)
Enable plugin in QGIS.
There are two buttons: one will sort layers alphabetically from A to Z.
Another will sort from Z to A.
This should work with QGIS 3.0 and up.