Problems with compiling more then one sketch in the Arduino IDE
That sketch is written for the ESP8266, not the ESP32. The two are very different chips, and the libraries used are very different.
You will have to learn how the sketch works, and how the ESP32 libraries work, and port the sketch to the ESP32 once you have learned how.