Plugin content is shown on every page

It’s a common mistake about the difference of WordPress’ Actions and Filters.

  1. Action is when you want something to happens besides the default.
  2. Filter is when you want something to happens instead the default.

Knowing that, when you use an action, your output will be inserted in that action content. But when you use a filter, your output will replace that filter content.

In the filter the_content you are replacing all the content from a post with your plugin content. So, the right way to fix it would be appending your content to the output, like $content .= "<div>...</div>";