woocommerce-pagarme icon indicating copy to clipboard operation
woocommerce-pagarme copied to clipboard

Bug when using dotenv

Open jeffepn opened this issue 2 years ago • 0 comments

Hello, I would like to report a possible bug when using dotenv in our projects.

How to simulate

Install dotenv(composer require vlucas/phpdotenv) in the WordPress project root, and in the wp-config.php file add the following line :point_down:

// wp-config.php
<?php
    ...
    require_once(__DIR__ . '/../vendor/autoload.php');
    ...

image

How to fix

In the woo-pagarme-payments.php file the following change worked

// .../pagarme-payments-for-woocommerce/woo-pagarme-payments.php line 71

function _wcmp_load_instances()
{
     // before require_once 'vendor/autoload.php';
     require_once __DIR__ . '/vendor/autoload.php';

jeffepn avatar Jun 16 '22 15:06 jeffepn