What is the ruling of wearing wigs and hair extensions?

there is no problem to wear it.
but is is better to put off it during the namaz.