self::STATUS_SHOW, 'triggered_at' => time(), ] ); } /** * Get the current notice state. * * @since 1.3.0 * * @return string One of STATUS_PENDING|STATUS_SHOW|STATUS_DISMISSED. */ public static function get_status(): string { $state = get_option( self::OPTION_KEY ); if ( ! is_array( $state ) || ! isset( $state['status'] ) ) { return self::STATUS_PENDING; } $known = [ self::STATUS_PENDING, self::STATUS_SHOW, self::STATUS_DISMISSED ]; $value = (string) $state['status']; return in_array( $value, $known, true ) ? $value : self::STATUS_PENDING; } /** * Render the review request notice on admin screens. * * @since 1.3.0 * @since 1.8.0 Suppress review requests during an observed current interruption. */ public static function render(): void { if ( ! current_user_can( 'manage_activelayer' ) || self::get_status() !== self::STATUS_SHOW || AdminStatus::active() ) { return; } if ( ! current_user_can( 'manage_activelayer' ) ) { return; } ?>

 •   • 

esc_html__( 'Permission denied.', 'activelayer-anti-spam-spam-protection-for-forms-comments' ) ], 403 ); } self::dismiss(); wp_send_json_success(); } /** * Mark the notice dismissed, preserving the trigger timestamp. * * @since 1.3.0 */ public static function dismiss(): void { $state = get_option( self::OPTION_KEY ); $triggered_at = is_array( $state ) ? ( $state['triggered_at'] ?? null ) : null; update_option( self::OPTION_KEY, [ 'status' => self::STATUS_DISMISSED, 'triggered_at' => $triggered_at, ] ); } }