There are two things to be considered when wall mounting speakers.
First, the wall will make an acoustic reflection of the speaker, so there will be some amount of phase difference between the direct and reflected sound causing cancellations at some frequencies; for example, a wall mounted speaker that is twelve inches deep will have an acoustical copy of itself twenty-four inches behind itself, this will result in a cancellation somewhere around 280Hz. Because twenty-four inches is half a wavelength of 282.5Hz, and a half wavelength offset will put the two signals 180 degrees out of phase.
The fact is that this is unavoidable, but the directivity of the speaker, the strength of the reflection and the distance of the reflective surface all play a role in what frequencies, and to what extent, this creates a problem.
Second, a wall mounted speaker no longer radiates into full space, but half space. This will result in an increase of SPL as the directivity of the speaker decreases, so at 100Hz where most speakers are omnidirectional, there will be a 6dB increase in SPL (relative to free space), but at 20kHz where most speakers are highly directional, there will be a minimum (if any) increase of SPL. This problem can be addressed if you have an EQ with a shelving filter and the right corner frequency.
And never put a speaker in a bookshelf, or other cubbyhole, as the resonances of the space will seriously mess up the speaker's frequency response.