=' ) && ! Schema::needsUpgrade() ) { return; } Schema::install(); Support\Migrations::run( $stored ); Manifest::rebuild(); update_option( 'rahkar_wp_version', RAHKAR_WP_VERSION, false ); } /** * The shared secret the queue worker endpoint authenticates with. * * Generated once and stored non-autoloaded. Rotating it means updating the * server cron line, which the health screen spells out. */ public static function workerKey(): string { $key = get_option( self::WORKER_KEY_OPTION ); if ( ! is_string( $key ) || '' === $key ) { $key = self::ensureWorkerKey(); } return $key; } /** * Generate the worker key when it is missing. */ public static function ensureWorkerKey(): string { $existing = get_option( self::WORKER_KEY_OPTION ); if ( is_string( $existing ) && '' !== $existing ) { return $existing; } $key = wp_generate_password( 40, false, false ); update_option( self::WORKER_KEY_OPTION, $key, false ); return $key; } /** * Attach the profiler output when profiling is switched on. * * @internal Hooked callback. */ public static function maybeProfile(): void { if ( Profiler::enabled() ) { add_action( 'shutdown', [ Profiler::class, 'emit' ], 999 ); } } }