where $I_{enc}$ is the algebraic sum of all currents passing through the loop. Let us choose a loop where one side of length $l$ lies above the plane, and the other lies symmetrically below it. Since the current is distributed uniformly over the plane, the magnetic field on both sides of the plane will be equal in magnitude but opposite in direction. The direction of traversing the loop is shown in the figure. Thus, the circulation of the magnetic field for such a loop is:
$$Bl+Bl=\mu_{0}il$$
The contributions of the dot product of the vector $\overrightarrow{B}$ and the displacement vector along the vertical sides are 0, since $\cos \frac{\pi}{2}=0$.