After activating the plugin and reloading the page, I receive the following message:
Fatal error: Uncaught Error: Class 'OSDXP_Dashboard\OsdxpModuleUpdateChecker' not found in includes/utils.php:31
#0 /var/www/html/wp-includes/class-wp-hook.php(286): OSDXP_Dashboard\hook_update_check('')
#1 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /var/www/html/wp-settings.php(450): do_action('init')
#4 /var/www/html/wp-config.php(88): require_once('/var/www/html/w...')
#5 /var/www/html/wp-load.php(37): require_once('/var/www/html/w...')
#6 /var/www/html/wp-admin/admin.php(31): require_once('/var/www/html/w...')
#7 /var/www/html/wp-admin/network/admin.php(13): require_once('/var/www/html/w...')
#8 /var/www/html/wp-admin/network/plugins.php(11): require_once('/var/www/html/w...')
#9 {main}
thrown in includes/utils.php on line 31
Possible Cause
The class files are not being loaded. The includes folder is listed as a PSR-4 root, but none of the classes in this project follow PSR-4.
Suggested Solution
Switch to PSR-4. It is a much better and more widely used convention. Any convention, including PSR-4, would allow easier loading of classes without the need to generate autoload maps.
Another option is to add includes as a classmap root instead of PSR-4. This will generate a map of all classes contained in all files in that folder, recursively, to their filename. It would require re-generation every time a new class is added, or a class file path is changed.
Remarks
This problem does not seem to manifest when installing the plugin from dist manually, or from source via cloning. It manifests when this package is a dependency of another package. While this is issue is indeed an issue in its own right, it currently manifests due to #16.
The Symptom
After activating the plugin and reloading the page, I receive the following message:
Possible Cause
The class files are not being loaded. The
includes
folder is listed as a PSR-4 root, but none of the classes in this project follow PSR-4.Suggested Solution
includes
as a classmap root instead of PSR-4. This will generate a map of all classes contained in all files in that folder, recursively, to their filename. It would require re-generation every time a new class is added, or a class file path is changed.Remarks
This problem does not seem to manifest when installing the plugin from dist manually, or from source via cloning. It manifests when this package is a dependency of another package. While this is issue is indeed an issue in its own right, it currently manifests due to #16.