$44 GRAYBYTE WORDPRESS FILE MANAGER $86

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-wappspector/src/Matchers/

HOME
Current File : /opt/cpanel/ea-wappspector/src/Matchers//WebPresenceBuilder.php
<?php

declare(strict_types=1);

namespace Plesk\Wappspector\Matchers;

use DOMDocument;
use DOMXPath;
use League\Flysystem\Filesystem;
use Plesk\Wappspector\Helper\InspectorHelper;
use Plesk\Wappspector\MatchResult\EmptyMatchResult;
use Plesk\Wappspector\MatchResult\MatchResultInterface;
use Plesk\Wappspector\MatchResult\WebPresenceBuilder as MatchResult;
use Throwable;

class WebPresenceBuilder implements MatcherInterface
{
    public function match(Filesystem $fs, string $path): MatchResultInterface
    {
        $indexHtmlPath = rtrim($path, '/') . '/index.html';
        if (!$fs->fileExists($indexHtmlPath)) {
            return new EmptyMatchResult();
        }

        $fileContent = $fs->read($indexHtmlPath);

        $inspectorHelper = new InspectorHelper();

        return $inspectorHelper->fileContentMatchesString(
            $fileContent,
            '/<meta name="generator" content="Web Presence Builder.*">/'
        ) || $this->fileContainsDOMStructure($fileContent)
            ? new MatchResult($path)
            : new EmptyMatchResult();
    }

    private function fileContainsDOMStructure(string $fileContent): bool
    {
        $dom = new DOMDocument();
        try {
            libxml_use_internal_errors(true);
            $domIsLoaded = $dom->loadHTML($fileContent);
            libxml_clear_errors();
        } catch (Throwable) {
            return false;
        }

        if ($domIsLoaded === false) {
            return false;
        }

        $xpath = new DOMXPath($dom);

        // Find the <div> with id="page"
        $pageDiv = $xpath->query("//div[@id='page']");

        if ($pageDiv->length === 0) {
            return false;
        }

        $pageNode = $pageDiv->item(0);

        // Check for direct children with the required IDs
        $watermarkDiv = $xpath->query("./div[@id='watermark']", $pageNode);
        $layoutDiv = $xpath->query("./div[@id='layout']", $pageNode);

        return $watermarkDiv->length > 0 && $layoutDiv->length > 0;
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
15 May 2026 8.30 AM
root / root
0755
CakePHP.php
1.021 KB
14 May 2026 3.20 PM
root / root
0644
CodeIgniter.php
1.136 KB
14 May 2026 3.20 PM
root / root
0644
Composer.php
1.089 KB
14 May 2026 3.20 PM
root / root
0644
DotNet.php
1.054 KB
14 May 2026 3.20 PM
root / root
0644
Drupal.php
1.626 KB
14 May 2026 3.20 PM
root / root
0644
Duda.php
1.72 KB
14 May 2026 3.20 PM
root / root
0644
Joomla.php
3.788 KB
14 May 2026 3.20 PM
root / root
0644
Laravel.php
1.9 KB
14 May 2026 3.20 PM
root / root
0644
MatcherInterface.php
0.335 KB
14 May 2026 3.20 PM
root / root
0644
NodeJs.php
0.846 KB
14 May 2026 3.20 PM
root / root
0644
Php.php
1.07 KB
14 May 2026 3.20 PM
root / root
0644
Prestashop.php
1.409 KB
14 May 2026 3.20 PM
root / root
0644
Python.php
0.725 KB
14 May 2026 3.20 PM
root / root
0644
Ruby.php
0.696 KB
14 May 2026 3.20 PM
root / root
0644
Sitejet.php
0.953 KB
14 May 2026 3.20 PM
root / root
0644
Siteplus.php
1.791 KB
14 May 2026 3.20 PM
root / root
0644
Sitepro.php
0.957 KB
14 May 2026 3.20 PM
root / root
0644
Symfony.php
0.884 KB
14 May 2026 3.20 PM
root / root
0644
Typo3.php
1.768 KB
14 May 2026 3.20 PM
root / root
0644
UpLevelMatcherTrait.php
0.959 KB
14 May 2026 3.20 PM
root / root
0644
WebPresenceBuilder.php
1.969 KB
14 May 2026 3.20 PM
root / root
0644
Wordpress.php
1.477 KB
14 May 2026 3.20 PM
root / root
0644
Yii.php
1.641 KB
14 May 2026 3.20 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF