# give/4.16.9/src/DonationSpam/Akismet/DataTransferObjects/CommentCheckArgs.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 63 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/DonationSpam/Akismet/DataTransferObjects/CommentCheckArgs.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/DonationSpam/Akismet/DataTransferObjects/CommentCheckArgs.php
- Modified: 2026-06-24T16:23:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/DonationSpam/Akismet/DataTransferObjects/CommentCheckArgs.php#L10-L20`.

```php
<?php

namespace Give\DonationSpam\Akismet\DataTransferObjects;

/**
 * @since 4.9.0 add #[AllowDynamicProperties]
 * @since 3.15.0
 */
#[\AllowDynamicProperties]
class CommentCheckArgs
{
    public $blog;
    public $blog_lang;
    public $blog_charset;
    public $user_ip;
    public $user_agent;
    public $referrer;
    public $comment_type;
    public $comment_content;
    public $comment_author;
    public $comment_author_email;

    /**
     * @since 4.16.0 handle undefined server variables gracefully
     * @since 3.22.0 updated params to receive
     * @since 3.15.0
     */
    public static function make(string $comment, string $email, string $firstName): CommentCheckArgs
    {
        $self = new self();

        $self->comment_type = 'contact-form';
        $self->comment_content = $comment;
        $self->comment_author = $firstName;
        $self->comment_author_email = $email;

        $self->blog = get_option('home');
        $self->blog_lang = get_locale();
        $self->blog_charset = get_option('blog_charset');

        $self->user_ip = $_SERVER['REMOTE_ADDR'] ?? '';
        $self->user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
        $self->referrer = $_SERVER['HTTP_REFERER'] ?? '';

        // Append additional server variables.
        foreach ( $_SERVER as $key => $value ) {
            if ( ! in_array( $key, [ 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ], true ) ) {
                $self->$key = $value;
            }
        }

        return $self;
    }

    /**
     * @since 3.15.0
     */
    public function toHttpQuery(): string
    {
        return http_build_query(get_object_vars($this));
    }
}

```
