From 238ebc094920271217798560ffaaf126b4e75294 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Fri, 4 Jul 2025 20:18:23 +0400 Subject: [PATCH] Fix the plugin main file path --- bootstrap.php | 2 +- src/services.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 673f34473..588f0b01d 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -32,7 +32,7 @@ return function ( $modules = apply_filters( 'woocommerce_paypal_payments_modules', $modules ); // Initialize plugin. - $properties = PluginProperties::new( __FILE__ ); + $properties = PluginProperties::new( "$root_dir/woocommerce-paypal-payments.php" ); $bootstrap = Package::new( $properties ); foreach ( $modules as $module ) { diff --git a/src/services.php b/src/services.php index 03a0c699d..562d448be 100644 --- a/src/services.php +++ b/src/services.php @@ -39,6 +39,9 @@ return array( return $properties->basePath(); }, 'ppcp.path-to-plugin-main-file' => function( ContainerInterface $container ) : string { - return $container->get( 'ppcp.path-to-plugin-folder' ) . '/woocommerce-paypal-payments.php'; + /** @var Properties $properties */ + $properties = $container->get( Package::PROPERTIES ); + + return $properties->pluginMainFile(); }, );