GRAYBYTE WORDPRESS FILE MANAGER9612

Server IP : 68.65.123.43 / Your IP : 216.73.216.162
System : Linux server266.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/inteuuod/public_html/wp-content/plugins/cloudflare/src/API/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/inteuuod/public_html/wp-content/plugins/cloudflare/src/API//Client.php
<?php

namespace CF\API;

use CF\Integration\IntegrationInterface;
use CF\WordPress\Utils;

class Client extends AbstractAPIClient
{
    const CLIENT_API_NAME = 'CLIENT API';
    const ENDPOINT = 'https://api.cloudflare.com/client/v4/';
    const X_AUTH_KEY = 'X-Auth-Key';
    const X_AUTH_EMAIL = 'X-Auth-Email';
    const AUTHORIZATION = 'Authorization';
    const AUTH_KEY_LEN = 37;
    const USER_AGENT = 'User-Agent';

    /**
     * @param Request $request
     *
     * @return Request
     */
    public function beforeSend(Request $request)
    {
        $key = $this->data_store->getClientV4APIKey();
        $headers = array(
            self::CONTENT_TYPE_KEY => self::APPLICATION_JSON_KEY,
        );

        $composer = Utils::getComposerJson();
        $version = $composer['version'] ?? 'unknown';
        $wp_version = $GLOBALS['wp_version'] ?? 'unknown';
        $headers[self::USER_AGENT] =  'wordpress/' . $wp_version . '; cloudflare-wordpress-plugin/' . $version;

        // Determine authentication method from key format. Global API keys are
        // always returned in hexadecimal format, while API Tokens are encoded
        // using a wider range of characters.
        if (strlen($key) === self::AUTH_KEY_LEN && preg_match('/^[0-9a-f]+$/', $key)) {
            $headers[self::X_AUTH_EMAIL] = $this->data_store->getCloudFlareEmail();
            $headers[self::X_AUTH_KEY] = $key;
        } else {
            $headers[self::AUTHORIZATION] = "Bearer {$key}";
        }

        $request->setHeaders($headers);

        // Remove cfCSRFToken (a custom header) to save bandwidth
        $body = $request->getBody();
        unset($body['cfCSRFToken']);
        $request->setBody($body);

        return $request;
    }

    /**
     * @param $message
     *
     * @return array
     */
    public function createAPIError($message)
    {
        $this->logger->error($message);

        return array(
            'result' => null,
            'success' => false,
            'errors' => array(
                array(
                    'code' => '',
                    'message' => $message,
                ),
            ),
            'messages' => array(),
        );
    }

    /**
     * @param error
     *
     * @return string
     */
    public function getErrorMessage($error)
    {
        $jsonResponse = json_decode($error->getResponse()->getBody(), true);
        $errorMessage = $error->getMessage();

        if (count($jsonResponse['errors']) > 0) {
            $errorMessage = $jsonResponse['errors'][0]['message'];
        }

        return $errorMessage;
    }

    /**
     * @param $response
     *
     * @return bool
     */
    public function responseOk($response)
    {
        return isset($response['success']) ? $response['success'] : false;
    }

    /**
     * @return string
     */
    public function getEndpoint()
    {
        return self::ENDPOINT;
    }

    /**
     * @return string
     */
    public function getAPIClientName()
    {
        return self::CLIENT_API_NAME;
    }

    /**
     * GET /zones/:id.
     *
     * @param $zone_tag
     *
     * @return string
     */
    public function zoneGetDetails($zone_tag)
    {
        $request = new Request('GET', 'zones/'.$zone_tag, array(), array());

        return $this->callAPI($request);
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:45:36
inteuuod / inteuuod
0755
Exception
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
inteuuod / inteuuod
0644
APIInterface.php
0.219 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
AbstractAPIClient.php
5.68 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
AbstractPluginActions.php
5.375 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Client.php
3.255 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
DefaultHttpClient.php
1.754 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Host.php
2.494 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
HttpClientInterface.php
0.181 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Plugin.php
2.743 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
PluginRoutes.php
1.083 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Request.php
1.651 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF