HEX
Server: Apache
System: Linux web15f74.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: lucendi (859622)
PHP: 7.4.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/lucendi/www/wp-content/plugins/wpforms-lite/src/Integrations/Square/Integrations/Loader.php
<?php

namespace WPForms\Integrations\Square\Integrations;

/**
 * Integrations loader.
 *
 * @since 1.9.5
 */
class Loader {

	/**
	 * Loaded integrations.
	 *
	 * @since 1.9.5
	 *
	 * @var array
	 */
	private $integrations = [];

	/**
	 * Classes to register.
	 *
	 * @since 1.9.5
	 */
	private const CLASSES = [
		'Divi',
		'Elementor',
		'BlockEditor',
	];

	/**
	 * Init.
	 *
	 * @since 1.9.5
	 */
	public function init() {

		foreach ( self::CLASSES as $class_name ) {
			$this->load_integration( $class_name );
		}
	}

	/**
	 * Load an integration.
	 *
	 * @since 1.9.5
	 *
	 * @param string $class_name Class name to register.
	 */
	private function load_integration( string $class_name ) {

		if ( isset( $this->integrations[ $class_name ] ) ) {
			return;
		}

		$full_class_name = 'WPForms\Integrations\Square\Integrations\\' . sanitize_text_field( $class_name );

		$integration = class_exists( $full_class_name ) ? new $full_class_name() : null;

		if ( $integration === null || ! $integration->allow_load() ) {
			return;
		}

		$integration->hooks();

		$this->integrations[ $class_name ] = $integration;
	}
}