This paper considers the propagation of shallow-water solitary and nonlinear periodic waves over a gradual slope with bottom friction in the framework of a variable-coefficient Korteweg-de Vries equation. We use the Whitham averaging method, using a recent development of this theory for perturbed integrable equations. This general approach enables us not only to improve known results on the adiabatic evolution of isolated solitary waves and periodic wave trains in the presence of variable topography and bottom friction, modelled by the Chezy law, but also, importantly, to study the effects of these factors on the propagation of undular bores, which are essentially unsteady in the system under consideration. In particular, it is shown that the combined action of variable topography and bottom friction generally imposes certain global restrictions on the undular bore propagation so that the evolution of the leading solitary wave can be substantially different from that of an isolated solitary wave with the same initial amplitude. This non-local effect is due to nonlinear wave interactions within the undular bore and can lead to an additional solitary wave amplitude growth, which cannot be predicted in the framework of the traditional adiabatic approach to the propagation of solitary waves in slowly varying media.