Phase transitions in the Ising square lattice with next-nearest-neighbor interactions