Skip to content
wiki.fftac.org

Statuspage - Source Excerpt 01

Back to Statuspage

Summary

This source excerpt preserves a bounded section of Antichrist.net/wp-content/plugins/uaix-locale-router/src/Admin/StatusPage.php so readers can inspect the evidence without opening the full source file.

**Source path:** Antichrist.net/wp-content/plugins/uaix-locale-router/src/Admin/StatusPage.php

<?php

namespace UAIXLocaleRouter\Admin;

use UAIXLocaleRouter\Plugin;
use UAIXLocaleRouter\Support\Html;


if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

final class StatusPage {
	/**
	 * Render the plugin status page.
	 *
	 * @return void
	 */
	public static function render_page() {
		$status          = Plugin::system_status();
		$notice          = isset( $status['bootstrap_notice'] ) && is_array( $status['bootstrap_notice'] ) ? $status['bootstrap_notice'] : array();
		$localized_check = Plugin::localized_home_diagnostics( $status, true );
		$link_review     = Plugin::locale_link_review_diagnostics( true );
		$htaccess_status = isset( $status['htaccess'] ) && is_array( $status['htaccess'] ) ? $status['htaccess'] : Plugin::htaccess_diagnostics();
		?>
		<div class="wrap">
			<h1>UAIX Locale Router Status</h1>
			<p>Use this page to confirm runtime health, storage readiness, and diagnostics before going live.</p>

			<div class="uaixlr-grid">
				<div class="uaixlr-card">
					<h2>Runtime</h2>
					<div class="uaixlr-status-list">
						<div class="uaixlr-status-row">
							<span>Plugin version</span>
							<code><?php echo esc_html( $status['plugin_version'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Installed version</span>
							<code><?php echo esc_html( $status['install_version'] ? $status['install_version'] : 'not recorded' ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>NS12 migration</span>
							<?php echo wp_kses_post( Html::badge( empty( $status['migration_errors'] ) ? 'Ready' : 'Warnings', empty( $status['migration_errors'] ) ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>Migration checked</span>
							<code><?php echo esc_html( ! empty( $status['migration_ran_at'] ) ? gmdate( DATE_ATOM, absint( $status['migration_ran_at'] ) ) : 'not recorded' ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Runtime boot</span>
							<?php echo wp_kses_post( Html::badge( $status['runtime_booted'] ? 'Booted' : 'Pending', $status['runtime_booted'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>Bootstrap notice</span>
							<?php
							echo wp_kses_post(
								Html::badge(
									! empty( $notice['message'] ) ? 'Present' : 'Clear',
									! empty( $notice['message'] ) ? 'warning' : 'success'
								)
							);
							?>
						</div>
					</div>

					<?php if ( ! empty( $notice['message'] ) ) : ?>
						<div class="uaixlr-status-note">
							<strong>Latest bootstrap message:</strong>
							<p><?php echo esc_html( $notice['message'] ); ?></p>
						</div>
					<?php endif; ?>

					<?php if ( ! empty( $status['migration_errors'] ) ) : ?>
						<div class="uaixlr-status-note">
							<strong>Migration warnings:</strong>
							<ul class="uaixlr-guidance-list">
								<?php foreach ( $status['migration_errors'] as $migration_error ) : ?>
									<li><?php echo esc_html( $migration_error ); ?></li>
								<?php endforeach; ?>
							</ul>
						</div>
					<?php endif; ?>
				</div>

				<div class="uaixlr-card">
					<h2>Environment</h2>
					<div class="uaixlr-status-list">
						<div class="uaixlr-status-row">
							<span>WordPress</span>
							<code><?php echo esc_html( $status['wordpress_version'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>PHP</span>
							<code><?php echo esc_html( $status['php_version'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Site locale</span>
							<code><?php echo esc_html( $status['site_locale'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>WP_DEBUG</span>
							<?php echo wp_kses_post( Html::badge( $status['debug_enabled'] ? 'Enabled' : 'Disabled', $status['debug_enabled'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>WP_DEBUG_LOG</span>
							<?php echo wp_kses_post( Html::badge( $status['debug_log_enabled'] ? 'Enabled' : 'Disabled', $status['debug_log_enabled'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>debug.log</span>
							<?php echo wp_kses_post( Html::badge( $status['debug_log_exists'] ? 'Present' : 'Not found', $status['debug_log_exists'] ? 'success' : 'info' ) ); ?>
						</div>
					</div>
					<p class="description uaixlr-path-line"><code><?php echo esc_html( $status['debug_log_path'] ); ?></code></p>
				</div>
			</div>

			<div class="uaixlr-grid">
				<div class="uaixlr-card">
					<h2>Routing</h2>
					<div class="uaixlr-status-list">
						<div class="uaixlr-status-row">
							<span>Default locale</span>
							<code><?php echo esc_html( $status['default_locale'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Default URL tag</span>
							<code><?php echo esc_html( $status['default_url_tag'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Redirect bare URLs</span>
							<?php echo wp_kses_post( Html::badge( $status['redirect_bare_urls'] ? 'Enabled' : 'Disabled', $status['redirect_bare_urls'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>REST mode</span>
							<code><?php echo esc_html( $status['rest_localization_mode'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Enabled locales</span>
							<code><?php echo esc_html( (string) $status['enabled_locales_count'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Supported locales</span>
							<code><?php echo esc_html( (string) $status['supported_locales_count'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Pretty permalinks</span>
							<?php echo wp_kses_post( Html::badge( $status['pretty_permalinks_enabled'] ? 'Enabled' : 'Disabled', $status['pretty_permalinks_enabled'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>Home URL scheme</span>
							<code><?php echo esc_html( $status['home_scheme'] ? $status['home_scheme'] : 'unknown' ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Detected request scheme</span>
							<code><?php echo esc_html( $status['request_scheme'] ? $status['request_scheme'] : 'unknown' ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Localized home URL</span>
							<code><?php echo esc_html( $status['localized_home_url'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>Scheme alignment</span>
							<?php echo wp_kses_post( Html::badge( $status['home_scheme_mismatch'] ? 'Mismatch' : 'Aligned', $status['home_scheme_mismatch'] ? 'warning' : 'success' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>.htaccess server</span>
							<code><?php echo esc_html( $htaccess_status['server_label'] ); ?></code>
						</div>
						<div class="uaixlr-status-row">
							<span>UAIX .htaccess block</span>
							<?php echo wp_kses_post( Html::badge( $htaccess_status['marker_present'] ? 'Present' : 'Missing', $htaccess_status['marker_present'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>WordPress .htaccess block</span>
							<?php
							$wp_label = 'Not managed here';
							$wp_tone  = 'neutral';

							if ( ! empty( $htaccess_status['wordpress_marker_present'] ) ) {
								$wp_label = ! empty( $htaccess_status['wordpress_marker_current'] ) ? 'Current' : 'Needs refresh';
								$wp_tone  = ! empty( $htaccess_status['wordpress_marker_current'] ) ? 'success' : 'warning';
							}

							echo wp_kses_post( Html::badge( $wp_label, $wp_tone ) );
							?>
						</div>
						<div class="uaixlr-status-row">
							<span>.htaccess auto repair</span>
							<?php echo wp_kses_post( Html::badge( $htaccess_status['auto_repair_available'] ? 'Available' : 'Manual only', $htaccess_status['auto_repair_available'] ? 'success' : 'warning' ) ); ?>
						</div>
					</div>
					<p class="description uaixlr-path-line"><code><?php echo esc_html( $htaccess_status['path'] ); ?></code></p>
				</div>

				<div class="uaixlr-card">
					<h2>Storage</h2>
					<div class="uaixlr-status-list">
						<div class="uaixlr-status-row">
							<span>Dictionary folder</span>
							<?php echo wp_kses_post( Html::badge( $status['dictionary_dir_exists'] ? 'Present' : 'Missing', $status['dictionary_dir_exists'] ? 'success' : 'warning' ) ); ?>
						</div>
						<div class="uaixlr-status-row">
							<span>Dictionary folder writable</span>