Sunlight photocatalytic performance of Mg-doped nickel ferrite synthesized by a green sol-gel route