HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
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/delta/wp-content/plugins/sg-cachepress/core/Cli/Cli_Heartbeat.php
<?php
namespace SiteGround_Optimizer\Cli;

use SiteGround_Optimizer\Options\Options;
/**
 * WP-CLI: wp sg heartbeat {setting} value.
 *
 * Run the `wp sg heartbeat {setting} {option} {frequency}` command to change the settgins of specific plugin functionality.
 *
 * @since 5.6.1
 * @package Cli
 * @subpackage Cli/Heartbeat
 */

/**
 * Define the {@link Cli_Heartbeat} class.
 *
 * @since 5.6.1
 */
class Cli_Heartbeat {
	/**
	 * Enable specific setting for Speed Optimizer by SiteGround plugin.
	 *
	 * ## OPTIONS
	 *
	 * <location>
	 * : Setting name.
	 * ---
	 * options:
	 *  - frontend
	 *  - dashboard
	 *  - post
	 * ---
	 * <frequency>
	 * : Frequency for the Heartbeat.
	 * ---
	 * options:
	 *  - 0
	 *  - 15
	 *  - 30
	 *  - 60
	 *  - 90
	 *  - 120
	 */
	public function __invoke( $args ) {
		// Set location based on cli command.
		$interval_option = 'siteground_optimizer_heartbeat_' . $args[0] . '_interval';

		// Set the interval frequency.
		update_option( $interval_option, $args[1] );

		\WP_CLI::success( 'Heartbeat optimization interval for ' . $args[0] . ' was set successfully.' );
	}
}