Plugin activation error due to unexpected output

Plugins are loaded before headers are sent. The reason is that you should be able to send your own headers per plugin.

And that’s why a main plugin file must not create direct output. Wrap your echo code into a function and register that function as a callback for an action that happens later, after the headers are sent.