403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/test20.chuangfenglink.xyz/wp-content/plugins/fluentform/app/Api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/test20.chuangfenglink.xyz/wp-content/plugins/fluentform/app/Api/FormProperties.php
<?php

namespace FluentForm\App\Api;

use FluentForm\App\Helpers\Helper;
use FluentForm\App\Modules\Form\FormFieldsParser;

class FormProperties
{
    private $form;

    public function __construct($form)
    {
        $this->form = $form;
    }

    /**
     * Get Form formatted inputs
     *
     * @param string[] $with
     *
     * @return array
     */
    public function inputs($with = ['admin_label', 'raw'])
    {
        return FormFieldsParser::getEntryInputs($this->form, $with);
    }

    /**
     * Get Form Input labels
     *
     * @return array
     */
    public function labels()
    {
        $inputs = $this->inputs();
        return FormFieldsParser::getAdminLabels($this->form, $inputs);
    }

    /**
     * Get Form Fields
     *
     * @return array
     */
    public function fields()
    {
        return json_decode($this->form->form_fields, true);
    }

    /**
     * Get Form Settings
     *
     * @return array
     */
    public function settings()
    {
        return (array) Helper::getFormMeta($this->form->id, 'formSettings', []);
    }

    /**
     * Get Email Notifications as an array
     *
     * @return array
     */
    public function emailNotifications()
    {
        $emailNotifications = wpFluent()
            ->table('fluentform_form_meta')
            ->where('form_id', $this->form->id)
            ->where('meta_key', 'notifications')
            ->get();

        $formattedNotifications = [];

        foreach ($emailNotifications as $notification) {
            $value = \json_decode($notification->value, true);
            $formattedNotifications[] = [
                'id'       => $notification->id,
                'settings' => $value,
            ];
        }

        return $formattedNotifications;
    }

    /**
     * Get Form metas
     *
     * @param $metaName
     * @param false $default
     *
     * @return mixed|string
     */
    public function meta($metaName, $default = false)
    {
        return Helper::getFormMeta($this->form->id, $metaName, $default);
    }

    /**
     * Get form renerable pass settings as an array
     *
     * @return array
     */
    public function renderable()
    {
        $isRenderable = [
            'status'  => true,
            'message' => '',
        ];
        /* This filter is deprecated and will be removed soon */
        $isRenderable = apply_filters('fluentform_is_form_renderable', $isRenderable, $this->form);
        
        return apply_filters('fluentform/is_form_renderable', $isRenderable, $this->form);
    }

    public function conversionRate()
    {
        if (!$this->form->total_Submissions) {
            return 0;
        }

        if (!$this->form->total_views) {
            return 0;
        }

        return ceil(($this->form->total_Submissions / $this->form->total_views) * 100);
    }

    public function submissionCount()
    {
        return wpFluent()
            ->table('fluentform_submissions')
            ->where('form_id', $this->form->id)
            ->where('status', '!=', 'trashed')
            ->count();
    }

    public function viewCount()
    {
        $hasCount = wpFluent()
            ->table('fluentform_form_meta')
            ->where('meta_key', '_total_views')
            ->where('form_id', $this->form->id)
            ->first();

        if ($hasCount) {
            return intval($hasCount->value);
        }

        return 0;
    }

    public function unreadCount()
    {
        return wpFluent()->table('fluentform_submissions')
            ->where('status', 'unread')
            ->where('form_id', $this->form->id)
            ->count();
    }

    public function __get($name)
    {
        return $this->form->{$name} ?? null;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit