[ __( 'Not connected', 'aicom' ), '' ], 'pairing' => [ __( 'Waiting for confirmation', 'aicom' ), 'aicom-badge-warning' ], 'connected' => [ __( 'Connected', 'aicom' ), 'aicom-badge-success' ], 'offline' => [ __( 'Offline', 'aicom' ), 'aicom-badge-warning' ], 'attention' => [ __( 'Needs attention', 'aicom' ), 'aicom-badge-warning' ], 'paused' => [ __( 'Remote work paused', 'aicom' ), 'aicom-badge-warning' ], 'locked' => [ __( 'Locked', 'aicom' ), 'aicom-badge-danger' ], 'revoked' => [ __( 'Revoked', 'aicom' ), 'aicom-badge-danger' ], ]; [ $badge_label, $badge_class ] = $labels[ $ui ] ?? $labels['none']; $msgs = [ 'disconnected' => __( 'This site was disconnected from AICOMBase.', 'aicom' ), 'synced' => __( 'Synced with AICOMBase.', 'aicom' ), 'sync_failed' => __( 'Could not reach AICOMBase — see the connection log below. AICOM keeps working normally.', 'aicom' ), 'paused' => __( 'Remote work paused. AICOMBase will not send tasks to this site until you resume.', 'aicom' ), 'resumed' => __( 'Remote work resumed.', 'aicom' ), 'saved' => __( 'Settings saved.', 'aicom' ), ]; $flash = sanitize_key( wp_unslash( $_GET['base_msg'] ?? '' ) ); $url_error = get_transient( 'aicom_base_admin_error' ); if ( $url_error ) { delete_transient( 'aicom_base_admin_error' ); } $ago = static function ( int $ts ): string { return $ts ? sprintf( /* translators: %s: relative time */ __( '%s ago', 'aicom' ), human_time_diff( $ts, time() ) ) : __( 'never', 'aicom' ); }; $log = $wpdb->get_results( "SELECT created_at, tool_name, status, result_summary_json FROM {$wpdb->prefix}aicom_logs WHERE module = 'base' ORDER BY id DESC LIMIT 10", ARRAY_A ) ?: []; // phpcs:ignore WordPress.DB.DirectDatabaseQuery $allowed = AICOM_Base_Policy::allowed_scopes(); ?>

' . esc_html( $base ) . '' ); ?>

[ __( 'Sync now', 'aicom' ), 'button' ], AICOM_Base_State::is_paused() ? 'resume' : 'pause' => [ AICOM_Base_State::is_paused() ? __( 'Resume remote work', 'aicom' ) : __( 'Pause remote work', 'aicom' ), 'button' ], ]; foreach ( $forms as $act => [ $text, $cls ] ) : ?>

$scopes ) : ?>

$def ) : ?>