For elastic-perfectly plastic materials with constant properties, the well-known Melan's theorem gives a sufficient condition for shakedown to occur, independently on the initial state. It has been conjectured that Melan's theorem could be extended to temperature-dependent (or time-dependent) elastic moduli, but no theoretical result is available. This paper aims at providing results in that direction, with a special emphasis on time-periodic variations. If Melan's condition is satisfied, we show that shakedown indeed occurs provided the time fluctuations of the elastic moduli satisfy a certain condition (which in particular is fulfilled if the time fluctuations are not too large). We provide a counterexample which shows that setting such a constraint on the elastic moduli is necessary to reach path-independent theorems as proposed. A simple mechanical system is studied as an illustrative example.