This happens to me every moment of everyday. It's like as soon as someone logs out, boom they're on the top of the list to get attacked. It's almost as if the system is based on who just logged out rather than by medal count.
Put your Town Center outside to get peace treaty. The more loot you have, the higher chance of being attacked. The more difficult your base design for people to star, the more frequent you get attacked.
I just wrote about the same thing. Something changed after the last updated. As soon as I am done attacking and log out within seconds I am being attacked. It use to minutes or even hours before without being attacked.
it is so simple, when we are online, other players can not attack us! maybe the be attacked rate need to change lower for the new player can easy to play