diff --git a/README.md b/README.md index 8db9a13..e1a1256 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@
@@ -37,7 +36,7 @@ ### Using standard WordPress structure -1. Download plugin from WordPress store +1. Download latest plugin from our [Releases](https://github.com/Attributes-PHP/wp-fastendpoints-depends/releases) page 2. Install plugin as a [MU-plugin](https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/) 3. Run the following WP CLI command `wp fastendpoints depends` or activate any plugin on the website 4. Enjoy 😊 diff --git a/fastendpoints-depends.php b/fastendpoints-depends.php index 8e9dab6..a637574 100644 --- a/fastendpoints-depends.php +++ b/fastendpoints-depends.php @@ -14,6 +14,10 @@ use Attributes\Wp\FastEndpoints\Depends\DependenciesGenerator; use Attributes\Wp\FastEndpoints\Depends\DependsAutoloader; +if (! defined('ABSPATH')) { + exit; +} + $composer = __DIR__.'/vendor/autoload.php'; if (! file_exists($composer)) { wp_die( diff --git a/src/DependenciesGenerator.php b/src/DependenciesGenerator.php index f58a67e..012aab2 100644 --- a/src/DependenciesGenerator.php +++ b/src/DependenciesGenerator.php @@ -4,6 +4,10 @@ use WP_CLI; +if (! defined('ABSPATH')) { + exit; +} + /** * Holds logic to update the FastEndpoint dependencies * diff --git a/src/DependsAutoloader.php b/src/DependsAutoloader.php index a25686f..40efa84 100644 --- a/src/DependsAutoloader.php +++ b/src/DependsAutoloader.php @@ -4,6 +4,10 @@ use WP_Rewrite; +if (! defined('ABSPATH')) { + exit; +} + /** * Holds logic to load plugins as dependencies for REST endpoints * diff --git a/src/DependsCommand.php b/src/DependsCommand.php index 4c23058..d335d27 100644 --- a/src/DependsCommand.php +++ b/src/DependsCommand.php @@ -4,6 +4,10 @@ use WP_CLI; +if (! defined('ABSPATH')) { + exit; +} + /** * Manages REST endpoint dependencies * diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3b77cf9..01a494c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -12,6 +12,8 @@ * integration tests. */ if (! Helpers::isIntegrationTest()) { + define('ABSPATH', __FILE__.'/fastendpoints-depends/wp/src/'); + return; }