HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/wpforms/src/Integrations/PayPalCommerce/Admin/SystemInfo.php
<?php

namespace WPForms\Integrations\PayPalCommerce\Admin;

use WPForms\Integrations\PayPalCommerce\Connection;
use WPForms\Integrations\PayPalCommerce\Helpers;

/**
 * PayPal Commerce System Information.
 *
 * @since 1.10.0
 */
class SystemInfo {

	/**
	 * Init class.
	 *
	 * @since 1.10.0
	 */
	public function init(): void {

		$this->hooks();
	}

	/**
	 * Register hooks.
	 *
	 * @since 1.10.0
	 */
	private function hooks(): void {

		add_filter( 'wpforms_admin_tools_views_system_wpforms_info', [ $this, 'add_paypal_commerce_info' ] );
	}

	/**
	 * Add PayPal Commerce connection information to system info.
	 *
	 * @since 1.10.0
	 *
	 * @param array $values Associative array of WPForms information key-value pairs.
	 *
	 * @return array
	 *
	 * @noinspection PhpMissingParamTypeInspection
	 */
	public function add_paypal_commerce_info( $values ): array {

		$values          = (array) $values;
		$connection_type = Helpers::is_legacy() ? 'first_party' : Connection::TYPE_THIRD_PARTY;

		$values['PayPal Commerce Connection'] = $connection_type;

		return $values;
	}
}