WOW Darko, super-fast! 
First, thanks for your kind collaboration and availability: I'm on CEST (+02:00), working on Moodle contributions mostly in my spare/night time.
I'll test your branch, and try to add the version constraint check too guessing that the way I've done via "your hack" is wrong - again, TNX a ton for your reply there, https://moodle.org/mod/forum/discuss.php?d=353727#p1487324 , will look at it
.
At first glance, here I missed the include in https://github.com/kiklop74/moodle-local_fooplug/blob/17d5d111c74f21dffbd14be4bf1563e3add6500d/environmentchecks.php#L27.
On reading your code I still have the need of some potential Moodle enhancements in this "hidden" area (let us call it enhs and not bugs
):
I'll post here my feedback (not sure when) about your branch - we should update the Wiki at least with a pointer to this thread - and refined thoughts about the enhs above.
HTH,
Matteo