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/options/js/purge-cache.js
function openDeleteConvertedFilesPopup() {
    var html = '';
    html += '<p>To delete all converted files, click this button:<br>';
    html += '<button onclick="purgeCache(false)" class="button button-secondary" type="button">Delete all converted files</button>';
    html += '</p>';
    html += '<p>Or perhaps, you only want to delete the converted <i>PNGs</i>? Then this button is for you:<br>';
    html += '<button onclick="purgeCache(true)" class="button button-secondary" type="button">Delete converted PNGs</button>';
    html += '</p>';

    document.getElementById('purgecachecontent').innerHTML = html;
    tb_show('Purge cache', '#TB_inline?inlineId=purgecachepopup');
//    purgeCache();
}

function purgeCache(onlyPng) {
    var data = {
        'action': 'webpexpress_purge_cache',
        'nonce' : window.webpExpress['ajax-nonces']['purge-cache'],
        'only-png': onlyPng
    };
    jQuery.post(ajaxurl, data, function(response) {
        if ((typeof response == 'object') && (response['success'] == false)) {
            if (response['data'] && ((typeof response['data']) == 'string')) {
                alert(response['data']);
            } else {
                alert('Something failed');
            }
            return;
        }

        var result = JSON.parse(response);
        //console.log(result);

        if (result['fail-count'] == 0) {
            if (result['delete-count'] == 0) {
                alert('No webp files were found, so none was deleted.');
            } else {
                alert('Successfully deleted ' + result['delete-count'] + ' webp files');
            }
        } else {
            if (result['delete-count'] == 0) {
                alert('Failed deleting ' + result['fail-count'] + ' webp files. None was deleted, in fact.');
            } else {
                alert('Deleted ' + result['delete-count'] + ' webp files. However, failed deleting ' + result['fail-count'] + ' webp files.');
            }
        }

    });
}