The fuel injectors make a ticking noise as they open and close that sound very much like lifters. If it is a more solid knocking sound, it could be the cam phasers and that is a problem. The bad idle could be several things. Needs plugs, or the throttle body or the MAF could need cleaning. Could even need a fuel filter, that will cause it too.