Should I replace my whirlpool dishwasher

Hi I have a dishwasher that does not drain well and leaves a foul odor once dishes are cleaned. I’ve been told that I can either replace the drain pump or get a new dishwasher. My repairman thinks the pump is bad because it rattles and doesn’t make a motioning noise. However, I don’t hear it and want to make sure it’s necessary to embark on such an expensive task. Also, the buttons on the front panel have lost the covering and he’s concerned by them being exposed will cause the buttons not to work.
Thoughts- new dishwasher or replace the pump??? It’s $400 vs $267. Thanks