5, )); if (!is_wp_error($response)) { $ip_address = trim(wp_remote_retrieve_body($response)); continue; } // end if; } // end foreach; set_site_transient('wu_public_network_ip', $ip_address, 10 * DAY_IN_SECONDS); $_ip_address = $ip_address; } // end if; /** * Allow developers to change the public IP address of the network. * * This is displayed to the customer/users when new domains are mapped * and need DNS records configured. * * This is useful in cases where a load balancer might be present and IP might vary. * * @see https://wpultimo.feedbear.com/boards/bug-reports/posts/network-ip-filter-required * * @param string $_ip_address The public IP address. * @param bool $local True if this is a local network (localhost, .dev, etc.), false otherwise. * @return string The new IP address. */ return apply_filters('wu_get_network_public_ip', $_ip_address, false); } // end get_network_public_ip; /** * Checks if a given domain name has a valid associated SSL certificate. * * @since 2.0.0 * * @param string $domain Domain name, e.g. google.com. * @return boolean */ public static function has_valid_ssl_certificate($domain = '') { $is_valid = false; try { $certificate = SslCertificate::createForHostName($domain); $is_valid = $certificate->isValid($domain); // returns bool; } catch (\Exception $e) { // translators: %s is the error message returned by the checker. wu_log_add('domain-ssl-checks', sprintf(__('Certificate Invalid: %s', 'wp-ultimo'), $e->getMessage()), LogLevel::ERROR); } // end try; return $is_valid; } // end has_valid_ssl_certificate; } // end class Helper;