get_site_options();
$err = is_wp_error($opts) ? $opts->get_error_message() : null;
$server_host = self::extract_server_host($opts);
$tier = $err ? null : (string) ($opts->_meta->pricingTier ?? $opts->tier ?? 'free');
$match = self::compare_hosts($wp_url, $server_host);
AllAccessible_Debug::console('ConnectionStatusCard', array(
'wp_url' => $wp_url,
'account_id' => $account_id,
'subdomain_id' => $subdomain_id,
'opts_is_error' => is_wp_error($opts),
'opts_error' => $err,
'server_host' => $server_host,
'tier' => $tier,
'host_match' => $match,
'opts_type' => is_object($opts) ? get_class($opts) : gettype($opts),
));
?>
0 ? '#' . $subdomain_id : '—');
if ($tier !== null) {
self::row(__('Plan tier', 'allaccessible'), self::tier_label($tier));
}
?>
✓
⚠
' . esc_html(self::host_of($wp_url)) . '',
'' . esc_html($server_host ?: '?') . ''
);
?>
subdomainHost)) return self::host_of((string) $o->subdomainHost);
if (!empty($o->siteUrl)) return self::host_of((string) $o->siteUrl);
if (!empty($o->canonicalSiteUrl))return self::host_of((string) $o->canonicalSiteUrl);
if (!empty($o->host)) return strtolower((string) $o->host);
// Legacy
if (!empty($o->subdomain) && !empty($o->domain)) {
return strtolower($o->subdomain . '.' . $o->domain);
}
if (!empty($o->domain)) return strtolower((string) $o->domain);
return null;
}
private static function tier_label($tier) {
$map = array(
'free' => __('Free', 'allaccessible'),
'starter' => __('Starter', 'allaccessible'),
'enterprise' => __('Enterprise', 'allaccessible'),
'legacy' => __('Legacy', 'allaccessible'),
'trial' => __('Trial', 'allaccessible'),
);
return isset($map[$tier]) ? $map[$tier] : esc_html($tier);
}
private static function render_inline_js() {
static $printed = false;
if ($printed) return;
$printed = true;
?>