| Server IP : 149.50.156.242 / Your IP : 216.73.216.238 Web Server : Apache System : Linux vps-6212575-x.dattaweb.com 4.18.0-553.148.1.el8_10.x86_64 #1 SMP Tue Jul 28 01:08:52 EDT 2026 x86_64 User : c1751829 ( 1001) PHP Version : 8.4.23 Disable Function : system, shell, exec, system_exec, shell_exec, mysql_pconnect, passthru, popen, proc_open, proc_close, proc_nice, proc_terminate, proc_get_status, escapeshellarg, escapeshellcmd, eval, dl, imap_mail, libvirt_connect, gnupg_init, unsetenv, apache_setenv, pcntl_exec, 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_getpriority, pcntl_setpriority, pcntl_async_signals, opcache_get_status, opcache_reset, opcache_get_configuration MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/c1751829/public_html/wp-content/plugins/jetpack/ |
Upload File : |
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* Jetpack Heartbeat.
*
* @package automattic/jetpack
*/
use Automattic\Jetpack\Heartbeat;
/**
* Jetpack Heartbeat.
*/
class Jetpack_Heartbeat {
/**
* Holds the singleton instance of this class
*
* @since 2.3.3
* @var Jetpack_Heartbeat
*/
private static $instance = false;
/**
* Holds the singleton instance of the proxied class
*
* @since 8.9.0
* @var Automattic\Jetpack\Heartbeat
*/
private static $proxied_instance = false;
/**
* Singleton
*
* @since 2.3.3
* @static
* @return Jetpack_Heartbeat
*/
public static function init() {
if ( ! self::$instance ) {
self::$instance = new Jetpack_Heartbeat();
self::$proxied_instance = Heartbeat::init();
}
return self::$instance;
}
/**
* Constructor for singleton
*
* @since 2.3.3
*/
private function __construct() {
add_filter( 'jetpack_heartbeat_stats_array', array( $this, 'add_stats_to_heartbeat' ) );
}
/**
* Generates heartbeat stats data.
*
* @param string $prefix Prefix to add before stats identifier.
*
* @return array The stats array.
*/
public static function generate_stats_array( $prefix = '' ) {
$return = array();
$return[ "{$prefix}version" ] = JETPACK__VERSION;
$return[ "{$prefix}wp-version" ] = get_bloginfo( 'version' );
$return[ "{$prefix}php-version" ] = PHP_VERSION;
$return[ "{$prefix}branch" ] = (float) JETPACK__VERSION;
$return[ "{$prefix}wp-branch" ] = (float) get_bloginfo( 'version' );
$return[ "{$prefix}php-branch" ] = (float) PHP_VERSION;
$return[ "{$prefix}public" ] = Jetpack_Options::get_option( 'public' );
$return[ "{$prefix}ssl" ] = Jetpack::permit_ssl();
$return[ "{$prefix}is-https" ] = is_ssl() ? 'https' : 'http';
$return[ "{$prefix}language" ] = get_bloginfo( 'language' );
$return[ "{$prefix}charset" ] = get_bloginfo( 'charset' );
$return[ "{$prefix}is-multisite" ] = is_multisite() ? 'multisite' : 'singlesite';
$return[ "{$prefix}plugins" ] = implode( ',', Jetpack::get_active_plugins() );
if ( function_exists( 'get_mu_plugins' ) ) {
$return[ "{$prefix}mu-plugins" ] = implode( ',', array_keys( get_mu_plugins() ) );
}
$return[ "{$prefix}manage-enabled" ] = true;
if ( function_exists( 'get_space_used' ) ) { // Only available in multisite.
$space_used = get_space_used();
} else {
// This is the same as `get_space_used`, except it does not apply the short-circuit filter.
$upload_dir = wp_upload_dir();
$space_used = get_dirsize( $upload_dir['basedir'] ) / MB_IN_BYTES;
}
$return[ "{$prefix}space-used" ] = $space_used;
// is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`.
$return[ "{$prefix}is-multi-network" ] = 'single-site';
if ( is_multisite() ) {
$return[ "{$prefix}is-multi-network" ] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
}
if ( ! empty( $_SERVER['SERVER_ADDR'] ) || ! empty( $_SERVER['LOCAL_ADDR'] ) ) {
$ip = ! empty( $_SERVER['SERVER_ADDR'] ) ? wp_unslash( $_SERVER['SERVER_ADDR'] ) : wp_unslash( $_SERVER['LOCAL_ADDR'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized just below.
$ip_arr = array_map( 'intval', explode( '.', $ip ) );
if ( 4 === count( $ip_arr ) ) {
$return[ "{$prefix}ip-2-octets" ] = implode( '.', array_slice( $ip_arr, 0, 2 ) );
}
}
foreach ( Jetpack::get_available_modules() as $slug ) {
$return[ "{$prefix}module-{$slug}" ] = Jetpack::is_module_active( $slug ) ? 'on' : 'off';
}
return $return;
}
/**
* Add Jetpack Stats array to Heartbeat if Jetpack is connected
*
* @since 8.9.0
*
* @param array $stats Jetpack Heartbeat stats.
* @return array $stats
*/
public function add_stats_to_heartbeat( $stats ) {
if ( ! Jetpack::is_connection_ready() ) {
return $stats;
}
$jetpack_stats = self::generate_stats_array();
return array_merge( $stats, $jetpack_stats );
}
}