GRAYBYTE WORDPRESS FILE MANAGER5184

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/WordPress/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


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

namespace CF\WordPress;

use CF\API\APIInterface;
use CF\API\Request;
use CF\Integration\DefaultIntegration;
use Symfony\Polyfill\Tests\Intl\Idn;

class ClientActions
{
    private $api;
    private $config;
    private $wordpressAPI;
    private $dataStore;
    private $logger;
    private $request;

    /**
     * @param DefaultIntegration $defaultIntegration
     * @param APIInterface       $api
     * @param Request            $request
     */
    public function __construct(DefaultIntegration $defaultIntegration, APIInterface $api, Request $request)
    {
        $this->api = $api;
        $this->config = $defaultIntegration->getConfig();
        $this->wordpressAPI = $defaultIntegration->getIntegrationAPI();
        $this->dataStore = $defaultIntegration->getDataStore();
        $this->logger = $defaultIntegration->getLogger();
        $this->request = $request;
    }

    /**
     * GET /zones.
     *
     * @return mixed
     */
    public function returnWordPressDomain()
    {
        // Call GET /zones
        $response = $this->api->callAPI($this->request);

        // We tried to fetch a zone but it's possible we're using an API token,
        // So try again with a zone name filtered API call
        if (!$this->api->responseOk($response)) {
            $zoneRequest = new Request(
                'GET',
                'zones/',
                array(
                    'name' => idn_to_ascii($this->wordpressAPI->getOriginalDomain(), IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46),
                    'status' => 'active',
                ),
                null
            );
            $zoneResponse = $this->api->callAPI($zoneRequest);

            return $zoneResponse;
        }

        // Cache the domain for subdomains
        $this->cacheDomainName($response);

        // Get zone information
        $cfZonesList = $this->filterZones($response);

        return $cfZonesList;
    }

    private function filterZones($response)
    {
        $cfZonesList = $response;
        $wpDomainList = $this->wordpressAPI->getDomainList();
        $wpDomain = $wpDomainList[0];

        $domainList = array();
        if ($this->api->responseOk($cfZonesList)) {
            $found = false;
            foreach ($cfZonesList['result'] as $zone) {
                if (idn_to_ascii($zone['name'], IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46) === idn_to_ascii($wpDomain, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46)) {
                    $found = true;
                    array_push($domainList, $zone);
                }
            }

            if ($found === false) {
                array_push($domainList, array(
                    'name' => $wpDomain,
                    'plan' => array('name' => ''),
                    'type' => '',
                    'status' => 'inactive',
                ));
            }
        }
        $cfZonesList['result'] = $domainList;

        return $cfZonesList;
    }

    public function cacheDomainName($response)
    {
        // Check if domain name needs to be cached
        $wpDomain = $this->wordpressAPI->getOriginalDomain();
        $cachedDomainList = $this->wordpressAPI->getDomainList();
        $cachedDomain = isset($cachedDomainList[0]) ? $cachedDomainList[0] : '';

        if (Utils::getRegistrableDomain($wpDomain) !== $cachedDomain) {
            // If it's not a subdomain cache the current domain
            $domainName = $wpDomain;

            // Get cloudflare zones to find if the current domain is a
            // subdomain of any cloudflare zones registered
            $validDomainName = $this->wordpressAPI->checkIfValidCloudflareSubdomain($response, $wpDomain);

            // Check if it's a subdomain, if it is cache the zone instead of the
            // subdomain
            if ($this->api->responseOK($response) && $validDomainName) {
                $domainName = Utils::getRegistrableDomain($wpDomain);
            }

            $this->wordpressAPI->setDomainNameCache($domainName);

            // Log for debugging
            $this->logger->debug("Current domain -> $wpDomain");
            $this->logger->debug("Valid domain -> $validDomainName");
            $this->logger->debug("Cached domain -> $domainName");

            return $domainName;
        }

        return $cachedDomain;
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:45:36
inteuuod / inteuuod
0755
Constants
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
inteuuod / inteuuod
0644
ClientActions.php
4.217 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
ClientRoutes.php
0.336 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
DataStore.php
4.284 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
HTTP2ServerPush.php
5.436 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
PluginActions.php
7.37 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
PluginRoutes.php
0.403 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Proxy.php
4.202 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
Utils.php
1.606 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
WordPressAPI.php
3.35 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
WordPressClientAPI.php
7.375 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644
WordPressWrapper.php
0.925 KB
August 23 2024 03:21:02
inteuuod / inteuuod
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF