In general it's not too ambitious at all, although I'd recommend just staying in and around Porto (Douro Valley? Braga?) with your four days at the end, as trying to see Porto and Lisbon plus travel in four days is a bit too rushed, IMO. There will be albergues in Porto and hostels in Lisbon and Madrid.
I also wouldn't book anything re: your Portugal side trip in case the Francés takes longer than you had planned (which can happen due to injury, or maybe you'll find that you prefer a slightly slower pace etc). My wife developed plantar fasciitis on the first day of the Francés and we took 39 days SJPdP-Santiago.
Regarding wifi, it depends on what you want/need to do. Some albergues don't offer it and at others, it doesn't really work. So if you're fine with being offline for a couple of days here and there, then it will be OK. But if you really need to do certain things on a daily basis, then get a Spanish SIM and buy some data for it.
Good luck with your planning and your camino!