A uniform is only active if the GLSL compiler and/or linker determine that it is used in the shader, or cannot conclusively determine that it is not used in the shader. As an example, in the following shader pair foo, rex, and gl_LightModel.ambient are the only active uniforms.
Even though v_color, f_color, and rex are all used in the code as written they do not have any affect on the final vertex position or fragment color. As such, a good GLSL compiler/linker will determine that they are unused.
Vertex attributes have similar rules. In order to be considered active they must in some way affect the final vertex position or fragment color.
This differentiation between active and inactive can be important, especially if you are dealing with procedurally generated shaders. Only active uniforms and attributes count towards implementation defined limits. That is, if your implementation has a limit of 16 vertex attributes you can still declare more than 16 as long as 16 or fewer actually affect the final vertex position or fragment color.