A proper mount for the device would include a frame to hide the side port connector.
The outlet could be replaced with a small recessed LV enclosure with an outlet, and cover.
Easy to drill the stud from the recessed LV enclosure cut-out, and from a hole behind the frame mount.
It would be code compliant if the power cable was extended with in-wall rated cable.
TB A+ Partner Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense. -Buddha