PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.2.0
Forumax – AI Powered Advanced Community Forum Plugin v2.2.0
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
← All changes | autoloader.php +2 -34 2.4.22.2.0 View file →
@@ -1,46 +1,14 @@
1 1 <?php
2 2 spl_autoload_register( 'forumax_autoloader' );
3 3
4 4 /**
5 - * Autoload files for the Forumax plugin.
5 + * Autoload files for the plugin
6 6 *
7 - * SCOPED: Only handles classes that belong to Forumax.
8 - * This prevents conflicts with other plugins' autoloaders and namespaces.
9 - *
10 - * @param string $class The fully-qualified class name.
7 + * @param string $class
11 8 * @return void
12 9 */
13 10 function forumax_autoloader( $class ) {
14 - // Define the namespace/class prefixes that belong to Forumax.
15 - $forumax_prefixes = array(
16 - 'admin\\', // admin\Menu, admin\Elementor\*, admin\Blocks\*, admin\menu\*
17 - 'Admin\\', // Admin\Admin_Assets
18 - 'Frontend\\', // Frontend\Frontend_Assets
19 - 'features\\', // features\bbp_voting, features\bbp_attachments, etc.
20 - );
21 -
22 - // Check if this class belongs to Forumax.
23 - $is_forumax_class = false;
24 -
25 - // Check for exact global class name (no namespace).
26 - if ( 'Admin' === $class ) {
27 - $is_forumax_class = true;
28 - } else {
29 - // Check for namespace prefixes.
30 - foreach ( $forumax_prefixes as $prefix ) {
31 - if ( strpos( $class, $prefix ) === 0 ) {
32 - $is_forumax_class = true;
33 - break;
34 - }
35 - }
36 - }
37 -
38 - // Bail early if this class doesn't belong to Forumax.
39 - if ( ! $is_forumax_class ) {
40 - return;
41 - }
42 -
43 11 $path = __DIR__ . '/includes/' . str_replace( '\\', '/', $class ) . '.php';
44 12
45 13 if ( file_exists( $path ) ) {
46 14 include_once $path;