We study the secular evolution of several exoplanetary systems by extending the Laplace-Lagrange theory to order two in the masses. Using an expansion of the Hamiltonian in the Poincaré canonical variables, we determine the fundamental frequencies of the motion and compute analytically the long-term evolution of the Keplerian elements. Our study clearly shows that, for systems close to a mean-motion resonance, the second order approximation describes their secular evolution more accurately than the usually adopted first order one. Moreover, this approach takes into account the influence of the mean anomalies on the secular dynamics. Finally, we set up a simple criterion that is useful to discriminate between three different categories of planetary systems: (i) secular systems (HD 11964, HD 74156, HD 134987, HD 163607, HD 12661 and HD 147018); (ii) systems near a mean-motion resonance (HD 11506, HD 177830, HD 9446, HD 169830 and υ Andromedae); (iii) systems really close to or in a mean-motion resonance (HD 108874, HD 128311 and HD 183263).