You can prevent the plundering by:
1) Having your buildings already motivated by friends or yourself, therefore not able to be plundered, OR
2} Collect the production from your buildings on time, so the attacker gets nothing when he tries to plunder.
Your defending troops automatically heal without you lifting a finger. The attacker has to spend resources to heal/retrain his.