Title: Fatal errors when running WP-CLI commands
Last modified: January 10, 2026

---

# Fatal errors when running WP-CLI commands

 *  Resolved [dimsal](https://wordpress.org/support/users/dimsal/)
 * (@dimsal)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/)
 * **Problem.**
 * When running WP-CLI commands with the gutenverse-form plugin enabled, two fatal
   errors occurred:
    1. **Error 1**: `Class "Gutenverse\Framework\Style_Generator" not found`
    2. **Error 2**: `Undefined constant "Gutenverse\Framework\GUTENVERSE_FRAMEWORK_URL_PATH"`
 * **Root Cause**
 * The gutenverse-form plugin bundles its own copy of the Gutenverse Framework but
   was not properly initializing it before trying to use framework classes. The 
   plugin’s main loader only registered the autoloader for `Gutenverse_Form\` namespaced
   classes, leaving the `Gutenverse\Framework\` classes inaccessible.
 * **Solution**
 * **File 1: autoload.php**
 * Added framework bootstrap initialization at the beginning of the autoloader:
 *     ```wp-block-code
       <?php// Load framework bootstrap to ensure framework classes are availablerequire_once dirname( FILE ) . '/framework/bootstrap.php';
       ```
   
 * **File 2: bootstrap.php**
 * Added the missing `GUTENVERSE_FRAMEWORK_URL_PATH` constant definition to the 
   constants section:
 *     ```wp-block-code
       <?phpdefined( 'GUTENVERSE_FRAMEWORK_URL_PATH' ) || define( 'GUTENVERSE_FRAMEWORK_URL_PATH', plugins_url( 'gutenverse-form' ) . '/lib/framework' );
       ```
   
 * This constant was being used throughout the framework’s Asset class (and other
   classes) to build paths to CSS, JavaScript, and image assets.
 * Why This Works
    1. By requiring the framework’s bootstrap file early, we ensure the framework’s
       autoloader is registered before any code tries to instantiate framework classes
    2. By defining `GUTENVERSE_FRAMEWORK_URL_PATH`, all framework classes that reference
       this constant will have a valid value, allowing assets to be properly located
       and loaded
 * These changes ensure the framework is fully initialized and all necessary constants
   are available before the gutenverse-form plugin’s initialization classes try 
   to use them.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [putra1arya](https://wordpress.org/support/users/putra1arya/)
 * (@putra1arya)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/#post-18781791)
 * Hi,
   Thank you for providing the solution.
 * We’ll review it and proceed with implementing it in our plugin. If we have any
   questions during the process, we’ll let you know.
 *  [tresnasaputra](https://wordpress.org/support/users/tresnasaputra/)
 * (@tresnasaputra)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/#post-18782399)
 * Hi,
 * Thank you very much for your response and for sharing the solution. We truly 
   appreciate it.
 * To proceed with the implementation and ensure we apply the most appropriate solution,
   we may need to replicate the issue on our end. This will help us gain a clearer
   and more comprehensive understanding of the situation.
 * To assist us further, could you please share the following details?
    - The list of plugins that are currently active
    - The WordPress version you are using
    - The PHP version you are using
    - An example of the WP-CLI command you are attempting to run
 * Thank you for your cooperation. We look forward to your response so we can assist
   you further.
 *  Thread Starter [dimsal](https://wordpress.org/support/users/dimsal/)
 * (@dimsal)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/#post-18782507)
 * List plugins:
 *     ```wp-block-code
       +----------------------------------------------+----------+--------+----------+----------------+-------------+| name | status | update | version | update_version | auto_update |+----------------------------------------------+----------+--------+----------+----------------+-------------+| accessibility-onetap | inactive | none | 2.8.0 | | off || admin-site-enhancements | active | none | 8.2.2 | | off || compressx | active | none | 0.9.33 | | off || depicter | inactive | none | 4.7.0 | | off || duplicate-menu | active | none | 0.2.3 | | off || envato-market | active | none | 2.0.12 | | off || greenshift-animation-and-page-builder-blocks | active | none | 12.5.7 | | off || gutenverse | active | none | 3.4.3 | | off || gutenverse-companion | active | none | 2.0.2 | | off || gutenverse-form | active | none | 2.4.3 | | off || gutenverse-news | active | none | 3.1.0 | | off || capability-manager-enhanced | active | none | 2.23.0 | | off || seo-by-rank-math | active | none | 1.0.261 | | off || simple-cloudflare-turnstile | active | none | 1.36.1 | | off || revslider | inactive | none | 6.7.40 | | off || smart-slider-3 | inactive | none | 3.5.1.31 | | off || splide-carousel | active | none | 1.7.0 | | off || suremails | active | none | 1.9.1 | | off || svg-support | active | none | 2.5.14 | | off || user-role-editor | inactive | none | 4.64.6 | | off || view-transitions | active | none | 1.1.2 | | off |+----------------------------------------------+----------+--------+----------+----------------+-------------+
       ```
   
 * WordPress version 6.9
 * PHP version 8.2
 * WP-CLI command example: wp plugin list –allow-root
 *  [tresnasaputra](https://wordpress.org/support/users/tresnasaputra/)
 * (@tresnasaputra)
 * [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/#post-18782656)
 * Thank you very much for your response and for providing the details. We’re sorry
   that we haven’t been able to reproduce the issue on our side.
 * However, we have implemented a special fix for cases when the plugin is loaded
   via the CLI, which should ensure that the framework loads correctly in all situations.
   This fix will be included in the upcoming update.
   Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-errors-when-running-wp-cli-commands%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/gutenverse-form/assets/icon-128x128.png?rev=3135966)
 * [Gutenverse Form - Contact Form Builder, Block Form & Booking Form](https://wordpress.org/plugins/gutenverse-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenverse-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenverse-form/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenverse-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenverse-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenverse-form/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 4 replies
 * 3 participants
 * Last reply from: [tresnasaputra](https://wordpress.org/support/users/tresnasaputra/)
 * Last activity: [4 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-errors-when-running-wp-cli-commands/#post-18782656)
 * Status: resolved