HEX
Server: nginx/1.18.0
System: Linux hqnl0246134.online-vm.com 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: phpinfo,disk_free_space,disk_total_space,diskfreespace,dl,exec,opcache_get_configuration,opcache_get_status,passthru,pclose,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_waitpid,pcntl_wait,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,popen,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,show_source,system,exec,passthru,shell_exec,system,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/www/sites/reo.ua/wp-content/autoptimize_404_handler.php
<?php
/**
 * Autoptimize's magic 404 handler.
 *
 * Configure your webserver to have requests for files that are no longer in
 * /wp-content/cache/autoptimize/ to redirect to this file. AO's .htaccess file
 * will have a "Errordocument:" directive to automatically do this.
 *
 * This file has simple logic to redirect to the "fallback" files that are
 * created automatically by AO to avoid visitors seeing broken pages or
 * Googlebot getting utterly confused.
 *
 * Error logging is off by default (don't want to flood your php errorlog, but
 * can be enabled by this code snippet:
 *
 * add_filter( 'autoptimize_filter_cache_fallback_log_errors', '__return_true' );
 *
 * Warning: the fallback files might not apply to all pages, so this is a just
 * a temporary solution, you really should clear any page cache to avoid requests
 * to files that don't exist in AO's cache.
 */

$original_request = strtok( $_SERVER['REQUEST_URI'], '?' );

if ( strpos( $original_request, 'uucss/uucss-' ) !== false ) {
    $original_request = preg_replace( '/uucss\/uucss-[a-z0-9]{32}-/', 'css/', $original_request  );
}

$fallback_target  = preg_replace( '/(.*)_(?:[a-z0-9]{32})\.(js|css)$/', '${1}_fallback.${2}', $original_request );
$ao_cache_dir     = '/var/www/sites/reo.ua/wp-content/cache/autoptimize/';
$js_or_css        = pathinfo( $original_request, PATHINFO_EXTENSION );

// add multisite logic.
$multisite = false;
if ( true === $multisite ) {
    preg_match( '#\/([0-9]{1,5})\/(?:js|css)\/[a-z0-9]*_fallback\.(?:js|css)$#', $fallback_target, $child_site_id );
    $ao_root_cache_dir = preg_replace( '#[0-9]*\/$#', '', $ao_cache_dir );
    $ao_cache_dir      = $ao_root_cache_dir . $child_site_id[1] . '/';
}

$fallback_path = $ao_cache_dir . $js_or_css . '/autoptimize_fallback.' . $js_or_css;

if ( $original_request !== $fallback_target && file_exists( $fallback_path ) ) {
    // error_log( 'Autoptimize file ' . $original_request . ' not found, using fallback instead.' );
    header( 'HTTP/1.1 301 Moved Permanently' );
    header( 'Location: ' . $fallback_target );
} else {
    // error_log( 'Autoptimize file ' . $original_request . ' not found, sending 410 gone response.' );
    header( 'HTTP/1.1 410 Gone' );
}

exit();