Periodic solutions for periodic second-order differential equations with variable potentials