Rewrite of https://github.com/thomasgriffin/TGM-Plugin-Activation