Hornby joined from Chester City in the summer of 2019 but only made his debut in December, the first of 18 league appearances.
He got his chance because of an injury to O'Donnell, but the latter was made to watch from the bench 13 times after regaining fitness.
It gives Hornby confidence that he can be part of an "exciting time" at Valley Parade under new manager Derek Adams
“I have a lot of momentum to take into next season and beyond after the 2021 I have had so far," he said. "When I signed a couple of years ago, I said I wanted to come here and play, so I want to kick on even more over the next couple of years.
“There is a lot of change - on and off the field - at the moment, and it is a very exciting time. There are fresh faces and ideas in all areas of the club, which it is great to be involved in."
Adams said of the 26-year-old: “He has shown his ability to both take and keep hold of the No 1 jersey, and competition in all areas of the field is going to be hugely important over the course of the coming campaign."
Support The Yorkshire Post and become a subscriber today. Your subscription will help us to continue to bring quality news to the people of Yorkshire. In return, you'll see fewer ads on site, get free access to our app and receive exclusive members-only offers. Click HERE to subscribe.