Plugin code with test cases