In this research, a theoretical investigation of the one-dimensional defective photonic crystals is considered for the detection of gamma-ray radiation. Each unit cell of the considered one-dimensional photonic crystals (1D PhCs) is composed of two layers designed from porous silicon infiltrated by poly-vinyl alcohol polymer doped with crystal violet (CV) and carbol fuchsine (CF) dyes (doped-polymer) with different porosity. In addition, a single layer of doped-polymer is included in the middle of the designed 1D PhCs to stimulate the localization of a distinct resonant wavelength through the photonic band gap. In particular, the appearance of this resonant mode represents the backbone of our study towards the detection of γ-ray radiation with doses from 0 to 70 Gy. The Bruggeman's effective medium equation, the fitted experimental data to the refractive index of the doped-polymer, and the Transfers Matrix Method (TMM) serve as the mainstay of our theoretical treatment. The numerical findings provide significant contributions to some of the governing parameters such as the thicknesses of the considered materials on the performance of the presented sensor, the effect of incidence angle and the porosity of the considered materials on the resonance wavelength. In this regard, at optimum values of these parameters the sensitivity, quality factor, signal-to-noise ratio, detection limit, sensor resolution, and figure of merit that are obtained are 205.7906 nm RIU-1, 9380.483, 49.315, 2.05 × 10-5 RIU, 3.27 × 10-5, and 2429.31 RIU-1, respectively. Therefore, we believe that the suggested design could be of significant interest in many industrial, medical, and scientific applications.