Outdoor plugs and WIFI proximity

My plug has connected to my 2.4 wifi and the app works well. I use it to turn water pumps on/off. My question is: I know the plug has to be within range of my WIFI - can I turn the plug on/off from 10 miles away or must the phone also be within range of the same WIFI.

Just like cameras, you can control your outdoor outlets from anywhere that you have an internet connection.