rewritten to a class and wrapper + removed wp < 3.5 fallback