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(); }, );