HEX
Server: Apache
System: Linux digivps 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: root (0)
PHP: 8.3.15
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/biographybirthday.com/wp-content/plugins/webp-express/lib/migrate/migrate2.php
<?php

namespace WebPExpress;

use \WebPExpress\Messenger;
use \WebPExpress\Option;
use \WebPExpress\Paths;
use \WebPExpress\TestRun;

/* helper. Remove dir recursively. No warnings - fails silently
   Set $removeTheDirItself to false if you want to empty the dir
*/
function webpexpress_migrate2_rrmdir($dir, $removeTheDirItself = true) {
    if (@is_dir($dir)) {
        $objects = @scandir($dir);
        foreach ($objects as $object) {
            if ($object != "." && $object != "..") {
                $file = $dir . "/" . $object;
                if (@is_dir($file)) {
                    webpexpress_migrate2_rrmdir($file);
                } else {
                    @unlink($file);
                }
            }
        }
        if ($removeTheDirItself) {
            @rmdir($dir);
        }
    }
}

$testResult = TestRun::getConverterStatus();
if ($testResult) {
    $workingConverters = $testResult['workingConverters'];
    if (in_array('imagick', $workingConverters)) {
       webpexpress_migrate2_rrmdir(Paths::getCacheDirAbs(), false);
       Messenger::addMessage(
           'info',
           'WebP Express has emptied the image cache. In previous versions, the imagick converter ' .
              'was generating images in poor quality. This has been fixed. As your system meets the ' .
              'requirements of the imagick converter, it might be that you have been using that. So ' .
              'to be absolutely sure you do not have inferior conversions in the cache dir, it has been emptied.'
       );
    }
    if (in_array('gmagick', $workingConverters)) {
        Messenger::addMessage(
            'info',
            'Good news! WebP Express is now able to use the gmagick extension for conversion - ' .
               'and your server meets the requirements!'
        );
    }
    if (in_array('cwebp', $workingConverters)) {
        Messenger::addMessage(
            'info',
            'WebP Express added several options for the cwebp conversion method. ' .
                '<a href="' . Paths::getSettingsUrl() . '">Go to the settings page to check it out</a>.'
        );
    }
}
Messenger::addMessage(
    'info',
    'WebP Express can now be configured to cache the webp images. You might want to ' .
        '<a href="' . Paths::getSettingsUrl() . '">do that</a>.'
);


Option::updateOption('webp-express-migration-version', '2');