Unfortunately, my limited knowledge does not give me a chance to change your plugin. If I knew, I would do that.
I was successful in the original case, when I added that snippet of code to the end of functions.php file.
In case of your plugin, I do not know, where to add it to make it functional. I did multiple trials, but I always failed.