In this paper, we develop a comprehensive theoretical framework for analyzing the performance of reconfigurable intelligent surfaces (RISs)-assisted communication systems over generalized fading channels and in the presence of phase noise. To this end, we propose the Fox's H model as a unified fading distribution for a large number of widely used generalized fading channels. In particular, we derive a unified analytical framework for computing the outage probability and for estimating the achievable diversity order of RIS-aided systems in the presence of phase shifts that either are optimally configured or are impaired by phase noise. The resulting expressions are general, as they hold for an arbitrary number of reflecting elements, and various channel fading and phase noise distributions. As far as the diversity order is concerned, notably, we introduce an asymptotic analytical framework for determining the diversity order in the absence of phase noise, as well as sufficient conditions based on upper bounds and lower bounds for ensuring that RIS-assisted systems achieve the full diversity order in the presence of phase noise. More specifically, if the absolute difference between pairs of phase errors is less than $\pi/2$, RIS-assisted communications achieve the full diversity order over independent fading channels, even in the presence of phase noise. The theoretical frameworks and findings are validated with the aid of Monte Carlo simulations.