Built a second plugin but it overwrote the first one

OK, so…

It doesn’t matter if the functions are the same or if the __construct methods are almost identical – all of these functions are not global – they are class methods – so they can be the same.

Problem lies somewhere else…

In both plugins you declare a class with identical name in the same namespace… So these classes conflict with each other.

The class name should be unique – so using BaseController as a class name is rather bad idea.

Notice
After you change names of these classes, remember also to change the name in initialization part.

Somewhere in your plugin you have something like this:

new BaseController();

You have to change that, so the proper class gets initialized.