Is it possible for anyone to access your texts and WhatsApp messages?

I gave my iPhone 4 to my ex, now I'm wondering if there's anyway for them to access to any of the current messages that I sent out to other people. I know this is a dumb question but I'm
Trying to make sure since whatever you sent is within your own sim card.

Added (1). Yes I haven't deleted any of them. What am I supposed to do, why are they able to accessed to it honestly?

Added (2). I mean whatever I sent now they can receive as well? Not what was alrdy in it phone before I gave it to him

If you haven't deleted them before handing it over, then it is easily accessible by your ex. Because both messages as well as WhatsApp messages are stored in the phone memory. If you have deleted everything before giving it then there's no way to retrieve them.

Is there a reason why you didn't restore your phone back to factory first? I would never sell my phone without doing that first.