Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 13.58.221.124
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/API/Endpoints/Logs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/API/Endpoints/Logs/GetLogs.php
<?php

namespace Give\API\Endpoints\Logs;

use Give\Log\LogRepository;
use Give\Log\ValueObjects\LogType;
use WP_REST_Request;
use WP_REST_Response;

/**
 * Class GetLogs
 * @package Give\API\Endpoints\Logs
 *
 * @since 2.10.0
 */
class GetLogs extends Endpoint
{

    /** @var string */
    protected $endpoint = 'logs/get-logs';

    /**
     * @var LogRepository
     */
    private $logRepository;

    /**
     * GetLogs constructor.
     *
     * @param LogRepository $repository
     */
    public function __construct(LogRepository $repository)
    {
        $this->logRepository = $repository;
    }

    /**
     * @inheritDoc
     */
    public function registerRoute()
    {
        register_rest_route(
            'give-api/v2',
            $this->endpoint,
            [
                [
                    'methods' => 'GET',
                    'callback' => [$this, 'handleRequest'],
                    'permission_callback' => [$this, 'permissionsCheck'],
                    'args' => [
                        'page' => [
                            'validate_callback' => function ($param) {
                                return filter_var($param, FILTER_VALIDATE_INT);
                            },
                            'default' => '1',
                        ],
                        'type' => [
                            'validate_callback' => function ($param) {
                                if (empty($param) || ('all' === $param)) {
                                    return true;
                                }

                                return LogType::isValid($param);
                            },
                            'default' => 'all',
                        ],
                        'category' => [
                            'validate_callback' => function ($param) {
                                return is_string($param);
                            },
                            'default' => '',
                        ],
                        'source' => [
                            'validate_callback' => function ($param) {
                                return is_string($param);
                            },
                            'default' => '',
                        ],
                        'sort' => [
                            'validate_callback' => function ($param) {
                                if (empty($param)) {
                                    return true;
                                }

                                return in_array($param, $this->logRepository->getSortableColumns(), true);
                            },
                            'default' => 'id',
                        ],
                        'direction' => [
                            'validate_callback' => function ($param) {
                                if (empty($param)) {
                                    return true;
                                }

                                return in_array(strtoupper($param), ['ASC', 'DESC'], true);
                            },
                            'default' => 'DESC',
                        ],
                    ],
                ],
                'schema' => [$this, 'getSchema'],
            ]
        );
    }

    /**
     * @return array
     */
    public function getSchema()
    {
        return [
            '$schema' => 'http://json-schema.org/draft-04/schema#',
            'title' => 'logs',
            'type' => 'object',
            'properties' => [
                'page' => [
                    'type' => 'integer',
                    'description' => esc_html__('Current page', 'give'),
                ],
                'type' => [
                    'type' => 'string',
                    'description' => esc_html__('Log type', 'give'),
                ],
                'category' => [
                    'type' => 'string',
                    'description' => esc_html__('Log category', 'give'),
                ],
                'source' => [
                    'type' => 'string',
                    'description' => esc_html__('Log source', 'give'),
                ],
                'direction' => [
                    'type' => 'string',
                    'description' => esc_html__('Sort direction', 'give'),
                ],
                'sort' => [
                    'type' => 'string',
                    'description' => esc_html__('Sort by column', 'give'),
                ],
            ],
        ];
    }

    /**
     * @since 3.12.1 Add 'givewp_log_source_view' filter
     *
     * @param WP_REST_Request $request
     *
     * @return WP_REST_Response
     */
    public function handleRequest(WP_REST_Request $request)
    {
        $data = [];
        $logs = $this->logRepository->getLogsForRequest($request);
        $total = $this->logRepository->getLogCountForRequest($request);

        foreach ($logs as $log) {
            $data[] = [
                'id' => $log->getId(),
                'log_type' => $log->getType(),
                'category' => $log->getCategory(),
                'source' => apply_filters('givewp_log_source_view', $log->getSource(), $log->getContext(),
                    $log->getId()),
                'message' => $log->getMessage(),
                'context' => $log->getContext(),
                'date' => $log->getDate(),
            ];
        }

        return new WP_REST_Response(
            [
                'status' => true,
                'data' => $data,
                'pages' => ceil($total / $this->logRepository->getLogsPerPageLimit()),
                'categories' => $this->logRepository->getCategories(),
                'sources' => $this->logRepository->getSources(),
                'statuses' => LogType::getTypesTranslated(),
            ]
        );
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit