The 24-year-old Wales international has signed a four-and-a-half-year contract to keep him at Selhurst Park.