Ported speakers have a hole (port), usually on the back, but sometimes on the front. It's normally an inch or two in diameter, and is used to "tune" the bass output.
A rear-firing port, pointing into an enclosed cavity, can sound nasty. If your speakers have rear ports, filling the space behind them with insulating material (Rockwool) will reduce the problem. Even if the speakers aren't ported, you might find that some Rockwool will improve the sound.
It might be a good idea to isolate the speakers from the studwork/shelf with some blobs of Blutak, to prevent the fram from resonating.
Make sure that you use proper speaker grille material, and that the hole in the frame is bigger than the speaker - you need to avoid the sound from the speaker bouncing back from the edges of the frame.