diff --git a/CHANGELOG.md b/CHANGELOG.md index c93d332..8d9b227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Prefix the change with one of these keywords: -- _Added_: for new features. -- _Breaking_: for higher visibility of breaking changes -- _Changed_: for changes in existing functionality. -- _Deprecated_: for soon-to-be removed features. -- _Removed_: for now removed features. -- _Fixed_: for any bug fixes. -- _Security_: in case of vulnerabilities. +- _Added_: for new features. +- _Breaking_: for higher visibility of breaking changes +- _Changed_: for changes in existing functionality. +- _Deprecated_: for soon-to-be removed features. +- _Removed_: for now removed features. +- _Fixed_: for any bug fixes. +- _Security_: in case of vulnerabilities. ## [Unreleased] -- _Fixed_: Missing wp-env script and some documentation changes. +- _Fixed_: Check for autoload.php before requiring it. +- _Fixed_: Missing wp-env script and some documentation changes. diff --git a/plugin.php b/plugin.php index 60906ea..2804e8d 100644 --- a/plugin.php +++ b/plugin.php @@ -22,8 +22,12 @@ define( 'MULTI_BLOCK_STARTER_URL', plugin_dir_url( __FILE__ ) ); // Include Composer's autoload file. -require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; - +if ( file_exists( plugin_dir_path( __FILE__ ) . 'vendor/autoload.php' ) ) { + require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; +} else { + wp_trigger_error( ' Multi Block Starter Plugin: Composer autoload file not found. Please run `composer install` to install the dependencies.', E_USER_ERROR ); + return; +} // Instantiate the classes. $multi_block_starter_classes = array( \Multi_Block_Starter\Enqueues::class,