Yes it is legal. The GPL states you must maintain the GPL/copyright notice in the source code. On Q2A it's the comment at the top of every PHP file. The GPL says nothing about visible attribution on the front end.
Also, this stuff doesn't apply to using the software anyway, it only applies when you want to redistribute it.
For themes, you might want to have a look at the Creative Commons licenses, which you can require attribution for. Note: CC covers the "creative" side i.e. the actual graphics/theme look. It's supposedly not suited for code.