  Exploring the concept of a massive photon has been an important area in
astronomy and physics. If photons have mass, their propagation in nonvacuum
space would be affected by both the nonzero mass $m_{\gamma}$ and the presence
of a plasma medium. This would lead to a delay time proportional to
$m_{\gamma}^2\nu^{-4}$, which deviates from the classical dispersion relation
(proportional to $\nu^{-2}$). For the first time, we have derived the
dispersion relation of a photon with a nonzero mass propagating in plasma. To
reduce the impact of variations in the dispersion measure (DM), we employed the
high-precision timing data to constrain the upper bound of the photon mass.
Specifically, the DM/time of arrival (TOA) uncertainties derived from ultrawide
bandwidth (UWB) observations conducted by the Parkes Pulsar Timing Array (PPTA)
are used. The dedispersed pulses from fast radio bursts (FRBs) with minimal
scattering effects are also used to constrain the upper bound of photon mass.
The stringent limit on the photon mass is determined by uncertainties of the
TOA of pulsars, with an optimum value of $9.52\times 10^{-46} \, \rm kg
\,\,(5.34 \times 10^{-10}\, \rm eV/c^2$). In the future, it is essential to
investigate the photon mass, as pulsar timing data are collected by PTA and UWB
receivers, or FRBs with wideband spectra are detected by UWB receivers.
