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 / inc / provider / class-hustle-provider-autoload.php
wordpress-popup / inc / provider Last commit date
class-hustle-provider-abstract.php 5 months ago class-hustle-provider-admin-ajax.php 1 month ago class-hustle-provider-autoload.php 5 months ago class-hustle-provider-container.php 3 years ago class-hustle-provider-form-hooks-abstract.php 5 months ago class-hustle-provider-form-settings-abstract.php 1 month ago class-hustle-provider-interface.php 5 months ago class-hustle-provider-utils.php 1 month ago
class-hustle-provider-autoload.php
122 lines
1 <?php
2 /**
3 * Hustle_Provider_Autoload class.
4 *
5 * @package Hustle
6 * @since 4.0.0
7 */
8
9 /**
10 * Class Hustle_Provider_Autoload
11 * Handling Autoloader
12 */
13 class Hustle_Provider_Autoload {
14
15 /**
16 * Flag for the providers being initiated.
17 *
18 * @since 4.2.0
19 * @var boolean
20 */
21 private static $is_initiated = false;
22
23 /**
24 * Class constructor.
25 *
26 * @since 3.0.5
27 */
28 public function __construct() {
29 }
30
31 /**
32 * Loads the provicers.
33 *
34 * @since 3.0.5
35 */
36 public function load() {
37 $pro_providers_dir = Opt_In::$plugin_path . 'inc/providers/';
38
39 // List of providers that should be launch in block editor.
40 $block_editor_providers = apply_filters( 'hustle_providers_block_editor', array( 'gutenberg' ) );
41
42 // Load Available Pro Providers.
43 $directory = new DirectoryIterator( $pro_providers_dir );
44 foreach ( $directory as $d ) {
45 if ( $d->isDot() || $d->isFile() || in_array( $d->getBasename(), $block_editor_providers, true ) ) {
46 continue;
47 }
48 // Take directory name as provider name.
49 $provider_name = $d->getBasename();
50 /**
51 * Add the new Provider.
52 * A valid provider should have `provider_name.php` inside its main directory
53 */
54 $provider_initiator = $d->getPathname() . DIRECTORY_SEPARATOR . $provider_name . '.php';
55 include_once $provider_initiator;
56 }
57 }
58
59 /**
60 * Loads the providers only for block editor.
61 *
62 * @since 4.2.0
63 */
64 public static function load_block_editor() {
65 $pro_providers_dir = Opt_In::$plugin_path . 'inc/providers/';
66
67 /**
68 * Hook to filter list of providers loaded only on block editor.
69 *
70 * @since 4.2.0
71 * @param array
72 */
73 $block_editor_providers = apply_filters( 'hustle_providers_block_editor', array( 'gutenberg' ) );
74
75 if ( $block_editor_providers ) {
76 foreach ( $block_editor_providers as $provider ) {
77 $provider_initiator = $pro_providers_dir . $provider . DIRECTORY_SEPARATOR . $provider . '.php';
78
79 if ( file_exists( $provider_initiator ) ) {
80 include_once $provider_initiator;
81 }
82 }
83 }
84 }
85
86 /**
87 * Initiate providers.
88 *
89 * @since 3.0.5
90 * @since 4.2.0 Moved from Opt_In to this class.
91 */
92 public static function initiate_providers() {
93
94 // We just need this once.
95 if ( self::$is_initiated ) {
96 return;
97 }
98
99 /**
100 * Triggered before registering internal providers
101 *
102 * @since 3.0.5
103 */
104 do_action( 'hustle_before_load_providers' );
105
106 $hustle_provider_loader = Hustle_Providers::get_instance();
107
108 // Load packaged providers.
109 $autoloader = new Hustle_Provider_Autoload();
110 $autoloader->load();
111
112 /**
113 * Triggered after hustle packaged providers were loaded
114 *
115 * @since 3.0.5
116 */
117 do_action( 'hustle_providers_loaded' );
118
119 self::$is_initiated = true;
120 }
121 }
122