isEnabled(); } /** * Check whether the global autopurge is enabled. */ function is_autopurge_enabled(): bool { if (defined('KINSTAMU_DISABLE_AUTOPURGE') && KINSTAMU_DISABLE_AUTOPURGE === true) { return false; } $status = get_option('kinsta-autopurge-status', null); return $status === 'enabled' || $status === null; } /** * Log debug messages in the PHP error log if KINSTAMU_DEBUG_LOG is enabled. * * @param array $context * * @internal This function is for internal use only. Other plugins should not use this function directly. */ function debug_log(string $message, array $context = []): void { /** * Note: KINSTAMU_DEBUG_LOG is currently experimental and may be renamed in the future. */ if (! defined('KINSTAMU_DEBUG_LOG') || KINSTAMU_DEBUG_LOG !== true) { return; } $timestamp = gmdate('Y-m-d H:i:s'); $message = sprintf('[%s] [kinsta-mu-plugins.DEBUG] %s', $timestamp, $message); if ($context !== []) { $message .= ' ' . json_encode($context); } file_put_contents(WP_CONTENT_DIR . '/kinsta-mu-plugins.log', $message . "\n", FILE_APPEND); }