How to repair this plastered wall with brickwork in bad condition?
Personally, I'd be looking for some old bricks and mix up some mortar and try to fix that wall. Get rid of the expanding foam and straighten out that right edge. Remove those old pieces of timber. These brick repairs can be time consuming but if you like puzzles, you'll like this. 
Once the wall is repaired and solid, then plaster away. You could then add a layer of cement board if you felt the one inch of plaster was too thick. Good luck and stay safe out there.