I make a beer with vanilla about once a year... not always a porter... but I use at least 4 beans split lenghtwise in secondary for at least 2 weeks. Keep in mind the vanilla flavor with fade with time. If you decide to use extract, find a good, high quality one and start mixing it in about a teaspoon at a time and stir gently and taste as you go. For the coffee, I cold steep a strong brew and add it at bottling/kegging too. and you could 'dry bean' too. Add some coarsely cracked beans when you add the vanilla if you do it in secondary.