Ok, got it. Yeh, as mentioned the most important factor is sheer surface area (bigger = cleaner, less compressed at higher SPLs), but various other factors are also important. A book could probably be written on this (although definitely not by me), but I can try to outline some of the basic considerations here.
The essential function of a port is to create a Holmholtz resonator, the tuning frequency of which is determined by the relationship between the port's length and surface area and the volume of the enclosure in which it is located.
For a given tuning frequency, a port may be any particular size, as long as the correct length/surface area relationship for the given enclosure volume is maintained. In other words, a small, short port may give the same tuning frequency in a given enclosure volume as a larger, longer port. As I mentioned earlier, the larger the port, the less likely it is to develop turbulence and therefore the better it is likely to perform in terms of distortion and compression.
However, ports also come with a host of issues. Apart from the intended system resonance at the tuning frequency, ports also develop pipe resonances as standing waves form across the length of the port. If excited, these pipe resonances manifest as sharp, high-pressure peaks at frequencies of wavelength twice the port's length, the port's length, half the port's length, etc. For example, for a port of length 17cm, the first pipe resonance will occur at around 1000Hz, the second at 2000Hz, the third at 3000Hz, etc.
This tends to be a problem in two-way ported systems in particular, where the woofer is crossed over high in frequency and is therefore producing a lot of output at frequencies at which these pipe resonances are likely to be excited. In subwoofers or 3-way systems, the (sub)woofer is crossed over lower in frequency and therefore is unlikely to be producing output at frequencies that will excite the port's pipe resonances (unless the port is very long indeed). Alternatively, damping the enclosure to absorb the woofer's backwave at higher frequencies is another way to reduce this issue. However, too much damping will begin to affect the functioning of the port (reducing its output at the tuning frequency), while in smaller enclosures it may not be possible to fit enough damping in to effectively absorb the woofer's backwave at the frequencies of concern.
Additionally, sound from the rear of the woofer(s) may "spill" out of the port. This tends to occur most at frequencies at which standing waves inside the enclosure form, and particularly if the port entrance is located at the antinode (i.e. peak) of such a standing wave inside the enclosure. So this is the first reason that the location of the port may be important. In particular, the port's entrance should not be located where an internal standing wave antinode occurs, and especially not where it coincides with a pipe resonance in the port. Absorption of these standing waves is another reason to damp the enclosure.
The second consideration regarding port location is distance of the port entrance from enclosure walls. If a port entrance is too close to an enclosure wall (or other internal obstruction), the small volume of air between the port entrance and the wall may act as part of the internal volume of the port, thereby lowering the port's tuning frequency. However, the port entrance needs to be quite close to an internal wall for this effect to occur, so it's not normally a real-world issue, except with slot ports (in which case it should be factored into the design in the first place).
A third consideration arises in enclosures that have a high aspect ratio, i.e. particularly tower speakers, and particularly where there are two or more woofers, each with a significantly different distance to the port(s). In such enclosures, the air "spring" provided by the internal volume of the enclosure will not be (as close to) uniform, and each port/woofer will tend to interact differently as a result. Therefore, it's usually best to build a separate internal enclosure with a separate port for each woofer, thereby ensuring more uniform operation of each woofer/port system.
Regarding port shape: In general, the shape of a port will affect the extent to which the air inside the port tends to remain laminar (i.e. not turbulent) as the particle velocity of the air passing through the port increases (i.e. as SPL increases). Turbulence inside the port is the enemy of effective port function and the primary cause of distortion/compression, so it's important to design the port so that the air inside it is as laminar as possible. As mentioned, size is by far the most important factor here. However, shape is also somewhat important. The ideal cross-sectional shape for a port is circular, as this is conducive to the most uniform flow of air through the port. The terminations of the port at the entrance and exit are also important: abrupt terminations are worse; flared terminations are better. Varying the internal surface area by tapering the port in the middle can also help reduce turbulence at
high lower velocities (although this is of no particular benefit at
low higher velocities).
No doubt I haven't covered a million other aspects of ported system design, but those are the main consideration IMO
EDIT: corrected my brain fart regarding tapering and velocity.