Honestly it is very simple how to fix this issue. I have learned the hard way. Build buildings that are ready to be collected when you are online. Second if you can not do that, then aid them daily because usually once they realize that you are aiding them everyday they will stop plundering you...