In regards to food, I'd like to put in my plug for Natural Balance Limited Ingredient Diet Potato & Duck Small Breed Bites. Rylie is doing really well on it and it is lower protein content if you find your dog has a problem with any of the higher protein foods (like Blue Buffalo or Acana, which are high quality too!). NB LID is grain free and high quality, but has lower protein content. However, it really is whatever food your dog personally does well on!
Note: If you switch over to a new food be sure to do it gradually by mixing and don't just give an entire bowl of the new food one day. There are plenty of threads on YT on how to do it properly!
I'd try to apple bitter spray the gate. Unfortunately, Rylie loved the stuff for some reason and literally LICKED IT OFF any of the furniture we put it on so it didn't work for us

It works for A LOT of people though, so I'd try that.