PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / plugins-cross-sell-page / core / class-loader.php
wordpress-popup / lib / plugins-cross-sell-page / core Last commit date
class-container.php 1 year ago class-loader.php 1 year ago class-rest-api.php 1 year ago class-utilities.php 5 months ago plugins-list.php 5 months ago
class-loader.php
117 lines
1 <?php
2 /**
3 * Class to boot up module.
4 *
5 * @link https://wpmudev.com/
6 * @since 1.0.0
7 *
8 * @author WPMUDEV (https://wpmudev.com)
9 * @package WPMUDEV/Plugin_Cross_Sell
10 *
11 * @copyright (c) 2025, Incsub (http://incsub.com)
12 */
13
14 namespace WPMUDEV\Modules\Plugin_Cross_Sell;
15
16 // If this file is called directly, abort.
17 defined( 'WPINC' ) || die;
18
19 /**
20 * The Loader class is responsible for initializing the module.
21 */
22 final class Loader {
23 /**
24 * Settings helper class instance.
25 *
26 * @since 1.0.0
27 * @var object
28 */
29 public $settings;
30
31 /**
32 * Minimum supported php version.
33 *
34 * @since 1.0.0
35 * @var float
36 */
37 public $php_version = '7.4';
38
39 /**
40 * Minimum WordPress version.
41 *
42 * @since 1.0.0
43 * @var float
44 */
45 public $wp_version = '6.3';
46
47 /**
48 * The dependency container.
49 *
50 * @since 1.0.0
51 * @var Container
52 */
53 private $container;
54
55 /**
56 * Initialize the loader.
57 *
58 * @since 1.0.0
59 * @param Container $container The dependency container.
60 * @return void
61 */
62 public function __construct( Container $container ) {
63 $this->container = $container;
64 }
65
66 /**
67 * Initialize functionality if requirements are met.
68 *
69 * @return void
70 */
71 public function init(): void {
72 if ( ! $this->can_boot() ) {
73 return;
74 }
75
76 $this->setup_components();
77 }
78
79 /**
80 * Main condition that checks if plugin parts should continue loading.
81 *
82 * @return bool
83 */
84 private function can_boot() {
85 /**
86 * Checks
87 * - PHP version
88 * - WP Version
89 * If not then return.
90 */
91 global $wp_version;
92
93 return (
94 version_compare( PHP_VERSION, $this->php_version, '>=' ) &&
95 version_compare( $wp_version, $this->wp_version, '>=' )
96 );
97 }
98
99 /**
100 * Register all the actions and filters.
101 *
102 * @since 1.0.0
103 * @access private
104 * @return void
105 */
106 private function setup_components(): void {
107 $submenus = new App\Submenus\CrossSell();
108 $submenus->init( $this->container );
109
110 $install_endpoint = new App\Rest_Endpoints\Install_Plugin();
111 $install_endpoint->init( $this->container );
112
113 $activation_endpoint = new App\Rest_Endpoints\Activate_Plugin();
114 $activation_endpoint->init( $this->container );
115 }
116 }
117