CITOLUME_TIMEOUT, 'headers' => array( 'X-License-Key' => $key, 'Accept' => 'application/json', ), ) ) ); if ( is_wp_error( $probe ) ) { add_settings_error( 'citolume', 'citolume_key', $probe->get_error_message() ); } else { update_option( 'citolume_license_key', $key, false ); citolume_clear_status_cache(); add_settings_error( 'citolume', 'citolume_key', __( 'Connected.', 'citolume' ), 'success' ); } } if ( 'features' === $action ) { update_option( 'citolume_llms_enabled', empty( $_POST['citolume_llms_enabled'] ) ? 0 : 1 ); $days = isset( $_POST['citolume_retention_days'] ) ? absint( $_POST['citolume_retention_days'] ) : 90; update_option( 'citolume_retention_days', in_array( $days, array( 30, 90, 365 ), true ) ? $days : 90 ); add_settings_error( 'citolume', 'citolume_features', __( 'Saved.', 'citolume' ), 'success' ); } if ( 'claim_code' === $action ) { $minted = citolume_api_send( '/v1/claim-code', 'POST' ); if ( is_wp_error( $minted ) || empty( $minted['code'] ) ) { add_settings_error( 'citolume', 'citolume_claim_code', is_wp_error( $minted ) ? $minted->get_error_message() : __( 'The service sent a reply we could not read.', 'citolume' ) ); } else { set_transient( 'citolume_claim_code', sanitize_text_field( (string) $minted['code'] ), 15 * MINUTE_IN_SECONDS ); } } if ( 'portal' === $action ) { // Fetched at click time, never earlier — the signed URL dies within a // day, and a stored one is a support ticket waiting to happen. $url = citolume_portal_url(); if ( is_wp_error( $url ) ) { add_settings_error( 'citolume', 'citolume_portal', $url->get_error_message() ); return; } wp_redirect( $url ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- external billing portal by design. exit; } } /** * Renders Settings. * * @return void */ function citolume_render_settings_screen() { if ( ! current_user_can( 'manage_options' ) ) { return; } $connected = '' !== citolume_license_key(); $status = $connected ? citolume_site_status() : null; ?>
|WP_Error|null $status The service's report. * @return void */ function citolume_render_connection_card( $connected, $status ) { ?>

'$9.99', 'growth' => '$24.99', ); $engine_names = array_map( 'citolume_engine_label', (array) ( $status['engines'] ?? array() ) ); $funnel = citolume_funnel(); $next = ( is_array( $funnel ) && ! empty( $funnel['next_scheduled_at'] ) ) ? (int) strtotime( (string) $funnel['next_scheduled_at'] . ' UTC' ) : 0; ?>
✓
0 ) { echo ' '; printf( /* translators: %d: number of paused questions. */ esc_html( _n( '%d question paused after the downgrade — upgrade to resume it. Nothing was deleted.', '%d questions paused after the downgrade — upgrade to resume them. Nothing was deleted.', $paused, 'citolume' ) ), (int) $paused ); echo ''; } ?>

—

✓ —

↗ —

' . esc_html( $claim_code ) . '', '' . esc_html( preg_replace( '#^https?://#', '', citolume_site_url() ) . '/account/claim' ) . '' ); ?>

—