I would suggest the following:
Your solenoid will for sure burn down the LDO when engaged. Consider that when using Wifi, the ESP32 can momentarily have 400mA spikes, and the coil probably consumes some 5V power also, this would require you to have good heat dissipation for the 5V LDO, which is a pain in the ass, to design.
I have 2 suggestions:
Plan A)
Intead of the LDO, use a DC-DC buck converter
like this one.
This is actually adjustable. The underside of the PCB is flat, so you can just solder it onto your PCB as a module, and adjust the output as needed.
I have these modules, and use them. The size of this is smaller than the size of the WROVER module, so very tiny, but can output 2A-s easily.
So you would do this: 12VDC -> 5V Switching PSU ->3.3V LDO, use the 5V for the solenoid coil only, and for 3.3V LDO.
This way you will have a much better circuit, with big power headroom, and will allow the solenoid coil to firmly close and stay closed. (Imagine you pull the solenoid coil, it is a coil, so it will have a peak current when you pull it, which will settle down. This peak will surge the LDO, resulting in big heat, and a huge voltage drop, which will destabilize the 3.3V LDO, resulting in POR reset of your ESP.... non of the above is good. The 5V buck converter can easily supply all of the loads, without harming anything else.
Plan B)
As Sprite suggested, use a simple 5V power supply you can buy anywhere, but
use a boost converter for the 12V. A boost converter is essentially a switching supply, converting a lower DC voltage (like 5V) to a higher DC voltage (like 12V). This will eliminate the need for a big transformer. The boost converter will only operate when the 12V output signal is needed (when the solenoid is on). This is the simplest and sexiest approach, which the least amount of parts, and this version is the cheapest, hence you don't need a big clumsy expensive transformer for the 12V.
Vader[BEN]