WC_Tracker::get_wordpress_info()private staticWC 1.0

Get WordPress related data.

Метод класса: WC_Tracker{}

Хуков нет.

Возвращает

Массив.

Использование

$result = WC_Tracker::get_wordpress_info();

Код WC_Tracker::get_wordpress_info() WC 9.3.3

private static function get_wordpress_info() {
	$wp_data = array();

	$memory = wc_let_to_num( WP_MEMORY_LIMIT );

	if ( function_exists( 'memory_get_usage' ) ) {
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- False positive.
		$system_memory = wc_let_to_num( @ini_get( 'memory_limit' ) );
		$memory        = max( $memory, $system_memory );
	}

	// WordPress 5.5+ environment type specification.
	// 'production' is the default in WP, thus using it as a default here, too.
	$environment_type = 'production';
	if ( function_exists( 'wp_get_environment_type' ) ) {
		$environment_type = wp_get_environment_type();
	}

	$wp_data['memory_limit'] = size_format( $memory );
	$wp_data['debug_mode']   = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No';
	$wp_data['locale']       = get_locale();
	$wp_data['version']      = get_bloginfo( 'version' );
	$wp_data['multisite']    = is_multisite() ? 'Yes' : 'No';
	$wp_data['env_type']     = $environment_type;
	$wp_data['dropins']      = array_keys( get_dropins() );

	return $wp_data;
}