2006 Ford Five-hundred

battery went dead, took to parts house verified it was bad. Installed new battery, car started no problem but I did not drive it. Next day went to start car, it had a little trouble starting but did and ran smooth but in neutral would not throttle above 2k. drove car down road and would not accelerate much. Parked it, came back next day car almost didn’t start (not due to low or poor battery either) when got started ran rough and would not bring rpm’s above 1k. Put car in drive and no matter if peddle is on floor or not car will not throttle up. Now that it’s running bad the check engine and wrench light or displayed on console??? what the heck happened, car was tuned up (new plugs, fuel filter and belt less than a thousand miles before problem???