I am rebuilding a leaky shower, and now that I have the wall taken out, I’m noticing that the shower valve is right next to two outlet boxes. That just looks like it’s too close. Is that okay, or is that a disaster waiting to happen?
While as others suggested that there 'should' be no free-standing water in that area and therefore you 'should' be fine, mixing valve gaskets leak and cold water pipes can get surrounded with condensation.
If your wall is still open, and you're handy enough to replace a shower, I'd move those electrical outlets or in the least put in a GFCI breaker.