HEX
Server: Apache
System: Linux gains.linuxbigapps.com 4.18.0-553.74.1.lve.el8.x86_64 #1 SMP Tue Sep 9 14:25:24 UTC 2025 x86_64
User: mountains (1551)
PHP: 8.0.30
Disabled: allow_url_include, show_source, symlink, system, passthru, exec, popen, pclose, proc_open, proc_terminate,proc_get_status, proc_close, proc_nice, allow_url_fopen, shell-exec, shell_exec, fpassthru, base64_encodem, escapeshellcmd, escapeshellarg, crack_check,crack_closedict, crack_getlastmessage, crack_opendict, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, dl, escap, phpinfo
Upload Files
File: /home/mountains/public_html/wp-content/plugins/fluentform/app/Modules/Form/AkismetHandler.php
<?php

namespace FluentForm\App\Modules\Form;

use FluentForm\App\Helpers\Helper;
use FluentForm\App\Modules\Acl\Acl;
use FluentForm\Framework\Helpers\ArrayHelper;

class AkismetHandler
{
    public static function isEnabled()
    {
        if (!self::isPluginEnabled()) {
            return false;
        }

        $settings = get_option('_fluentform_global_form_settings');
        return $settings && ArrayHelper::get($settings, 'misc.akismet_status') == 'yes';
    }

    public static function isPluginEnabled()
    {
        $exists = method_exists('Akismet', 'http_post');
        if ($exists) {
            return !!\Akismet::get_api_key();
        }
        return false;
    }

    public static function isSpamSubmission($formData, $form)
    {
        global $akismet_api_host, $akismet_api_port;
        $fields = self::getAkismetFields($formData, $form);
        $response = \Akismet::http_post( $fields, 'comment-check' );

        return ArrayHelper::get($response, 1) == 'true';
    }

    protected static function getAkismetFields($data, $form)
    {
        $app = wpFluentForm();
        $ip = $app->request->getIp();

        $info = [
            'comment_type' => 'contact-form',
            'comment_author' => '',
            'comment_author_email' => '',
            'comment_content' => '',
            'contact_form_subject' => $form->title,
            'comment_author_IP' => $ip,
            'permalink' => urlencode($data['_wp_http_referer']),
            'user_ip' => preg_replace('/[^0-9., ]/', '', $ip),
            'user_agent' => $app->request->header('USER_AGENT'),
            'blog' => get_option('home')
        ];

        $maps = [
            'input_name' => 'comment_author',
            'input_email' => 'comment_author_email',
            'textarea' => 'comment_content'
        ];
        $inputs = FormFieldsParser::getInputs($form, ['attributes']);

        foreach ($inputs as $input) {
            $element = ArrayHelper::get($input, 'element');
            $key = ArrayHelper::get($input, 'attributes.name');
            if (isset($maps[$element]) && !$info[$maps[$element]]) {
                $value = ArrayHelper::get($data, $key);
                if ($value) {
                    if (is_array($value)) {
                        $value = implode(' ', $value);
                    }
                    $info[$maps[$element]] = $value;
                }
            }
        }

        $info = apply_filters('fluentform_akismet_fields', $info, $data, $form);

        return http_build_query($info);

    }

}