• Query Monitor caught these PHP warnings on frontend :

    Constant HDOM_TYPE_ELEMENT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:26

    Constant HDOM_TYPE_COMMENT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:27

    Constant HDOM_TYPE_TEXT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:28

    Constant HDOM_TYPE_ENDTAG already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:29

    Constant HDOM_TYPE_ROOT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:30

    Constant HDOM_TYPE_UNKNOWN already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:31

    Constant HDOM_QUOTE_DOUBLE already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:32

    Constant HDOM_QUOTE_SINGLE already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:33

    Constant HDOM_QUOTE_NO already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:34

    Constant HDOM_INFO_BEGIN already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:35

    Constant HDOM_INFO_END already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:36

    Constant HDOM_INFO_QUOTE already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:37

    Constant HDOM_INFO_SPACE already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:38

    Constant HDOM_INFO_TEXT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:39

    Constant HDOM_INFO_INNER already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:40

    Constant HDOM_INFO_OUTER already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:41

    Constant HDOM_INFO_ENDSPACE already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:42

    Constant HDOM_SMARTY_AS_TEXT already defined at wp-content/plugins/webp-express/vendor/kub-at/php-simple-html-dom-parser/src/KubAT/PhpSimple/lib/simple_html_dom.php:48

    —-

    filesize(): stat failed for /home/u893662792/domains/site/public_html/site/wp-content/webp-express/webp-images/doc-root/site/wp-content/uploads/2022/07/preview-300x248.jpg.webp at wp-content/plugins/webp-express/lib/classes/BiggerThanSource.php:23

    —-

    Web server: LiteSpeed
    PHP version: 8.2.5
    DB: 10.5.19-MariaDB
    WordPress: 6.2.2
    Redis Object Cache enabled.

Viewing 4 replies - 1 through 4 (of 4 total)
  • In order to fix the error of the filesize(): stat failed for you can alter the file BiggerThanSource.php with the following code until an official fix is released

    <?php
    
    /*
    
    This class is made to not be dependent on WordPress functions and must be kept like that.
    
    It is used by webp-on-demand.php. It is also used for bulk conversion.
    
    */
    
    namespace WebPExpress;
    
    class BiggerThanSource
    
    {
    
    ? ? /**
    
    ? ? ?* Check if webp is bigger than original.
    
    ? ? ?*
    
    ? ? ?* @return boolean|null ? True if it is bigger than original, false if not. NULL if it cannot be determined
    
    ? ? ?*/
    
    ? ? public static function bigger($source, $destination)
    
    ? ? {
    
    ? ? ? ? if (!file_exists($source) || !file_exists($destination)) {
    
    ? ? ? ? ? ? return null;
    
    ? ? ? ? }
    
    ? ? ? ? $filesizeDestination = @filesize($destination);
    
    ? ? ? ? $filesizeSource = @filesize($source);
    
    ? ? ? ? // sizes are FALSE on failure (ie if file does not exists)
    
    ? ? ? ? if (($filesizeDestination === false) || ($filesizeSource === false)) {
    
    ? ? ? ? ? ? return null;
    
    ? ? ? ? }
    
    ? ? ? ? return ($filesizeDestination > $filesizeSource);
    
    ? ? }
    
    }

    also if you are getting a warning on the file PictureTags.php change the line 142 from

    @$dom->loadHTML($html);

    to

    @$dom->loadHTML($html, LIBXML_NOWARNING | LIBXML_NOERROR);

    hope that helps a bit.

    Thread Starter iontulburedev

    (@iontulburedev)

    @ifrountas On plugin update this code will get overwritten. Maybe the developer will implement a fix …

    This is just a hotfix, of course developer should fix this officially.

    Thread Starter iontulburedev

    (@iontulburedev)

    @ifrountas Ok, thank you very much !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP 8.2 warnings Constant HDOM_ & filesize(): stat failed’ is closed to new replies.