Fix PHP error so plugin works correctly