Enhancing flame retardant properties without losing other functions, such as mechanical properties, transparency, UV resistance and corrosion resistance, has become a research trend for the classic thermosetting epoxy resin (EP). In this work. a heterocyclic modified 'all-in-one' phenyl phosphonate, named PPS, has been designed and synthesized, which was characterized by FT-IR, NMR and X-ray crystal diffraction and its formation reason was investigated by density functional theory calculations. The imbalance between flame retardancy and mechanical properties has been broken through the construction of ionic-covalent crosslinked network structures with sacrificial bonds in EP materials by introduction of PPS. In comparison to pure EP, the tensile and flexural strengths of EP/PPS are improved by 47.6 % and 70.0 %, respectively. Interestingly, the impact strength of EP/ PPS can reach 33.88 kJ/m2 (64.5 % improvement). Upon addition of 2.5 wt % PPS, EP/2.5PPS can pass UL-94 V0 rating, and EP/5PPS can achieve LOI up to 36.4 %, and the total heat release (THR) and total smoke release (TSP) can be reduced by 43.4 % and 27.0 %, respectively, which shows excellent flame retardant performance. The biphasic fire-retardant effect of PPS was revealed by multi-scale analyses. Furthermore, EP/PPS exhibits good transparency, UV resistance, and acid and alkali resistance with protection efficiency much higher than pure EP. This work provides a new strategy for the development of high-performance epoxy composites.