HEX
Server: Apache/2
System: Linux sm.stlbg.net 3.10.0-962.3.2.lve1.5.87.el7.x86_64 #1 SMP Tue Jan 28 09:38:56 UTC 2025 x86_64
User: todorterziev (1053)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/todorterziev/public_html/wp-content/plugins/element-helper/autoload.php
<?php 

spl_autoload_register(function ($class_name) {

    //prefix for plugin namespace 
    $prefix = 'ElementHelper\\';
    $widget_prefix = 'ElementHelper\Widget\\';
    $filepath = '';

    //get length from namespace
    $len = strlen($prefix);

    //compare namespace exists in class name
    if (strncmp($prefix, $class_name, $len) !== 0) {
        // exist from next registered autoloader
        return;
    }

    //get the relative class name
    $relative_class = substr($class_name, $len);
    $widget_class = explode("\\", $relative_class);


    //replace the namespace prefix with the base directory, replace namespace
    //separators with directory separators in the relative class name
    if( 'Helper' === $relative_class ) {
        $file     = strtolower($relative_class);
        $path     = ELH_DIR_PATH . 'inc/';
        $filepath = $path . $file . '.php';
    }
    elseif ( 'Element_El' === substr( end($widget_class), 0, 10 ) ) {
        $class_name = end( $widget_class );
        $file     = str_replace( '_', '-', strtolower( $class_name ) );
        $path     = ELH_DIR_PATH . 'classes/';
        $filepath = $path . $file . '.php';
    }
    elseif( in_array( 'Widget', $widget_class ) ) {
        $class_name = end( $widget_class );
        $file     = str_replace( '_', '-', strtolower( $class_name ) );
        $path     = ELH_DIR_PATH . 'widgets/';
        $filepath = $path . $file .'/'. $file .'-widget.php';
    }

    // if the file exists, require it
    if (file_exists($filepath)) {
        require_once $filepath;
    }

});