Error message: exit status 1 'printWifiStatus' was not declared in this scope

void loop()
void printWiFiStatus() {

You can NOT define the printWiFiStatus() function here. Put it AFTER the body of loop().