| Server IP : 193.146.211.90 / Your IP : 10.85.6.55 Web Server : Apache System : Linux wordpress-gti-69dcdb54f7-n4wdq 6.11.8-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 15 Nov 2024 15:35:07 +0000 x86_64 User : 1001 ( 1001) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/image-optimization/modules/connect-manager/ |
Upload File : |
<?php
namespace ImageOptimization\Modules\ConnectManager;
use ImageOptimization;
use ImageOptimization\Classes\{
Module_Base,
};
use ImageOptimization\Modules\ConnectManager\Classes\Connect_Runner;
use ImageOptimization\Modules\ConnectManager\Components\Legacy_Connect;
use ImageOptimization\Modules\ConnectManager\Components\Connect;
use ImageOptimization\Plugin;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Class Module
*/
class Module extends Module_Base {
/**
* Connect instance
*
* @var connect_instance
*/
public $connect_instance;
/**
* Get module name.
* Retrieve the module name.
* @access public
* @return string Module name.
*/
public function get_name() {
return 'connect-manager';
}
/**
* component_list
* @return string[]
*/
public static function component_list() : array {
return [
'Legacy_Connect',
'Connect',
];
}
public function __construct() {
// Register components.
$this->register_components();
// Load Connect Manager.
add_action( 'plugins_loaded', [ $this, 'load_connect_manager' ] );
}
/**
* Load Connect Manager
*
* Load the correct version of Connect Manager based on whether
* the user is already connected using legacy version or not.
*
* @return void
*/
public function load_connect_manager() {
if ( ImageOptimization\Modules\Connect\Module::is_active() ) {
$this->connect_instance = new Connect_Runner( new Connect() );
} else {
$this->connect_instance = new Connect_Runner( new Legacy_Connect() );
}
}
}