HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/dailygoldindex/public_html/wp-content/plugins/toolkit/utils/general.php
<?php

function epc_toggle_wp_cron($disable) {
    $wp_config_path = ABSPATH . 'wp-config.php';
    if (!file_exists($wp_config_path) || !is_writable($wp_config_path)) {
        return false;
    }
    $config_content = file_get_contents($wp_config_path);
    if ($disable) {
        if (strpos($config_content, "define('DISABLE_WP_CRON', true);") !== false) {
            return true;
        }
        $config_content = preg_replace("/define\('DISABLE_WP_CRON'.*?\);\n?/i", '', $config_content);
        $config_content = preg_replace('/<\?php/', "<?php\ndefine('DISABLE_WP_CRON', true);", $config_content, 1);
    } else {
        $config_content = preg_replace("/define\('DISABLE_WP_CRON'.*?\);\n?/i", '', $config_content);
    }
    return file_put_contents($wp_config_path, $config_content) !== false;
}