• Resolved svenms

    (@svenms)


    Dears,

    When I try a custom link, for example a Woocommerce product link, I get a message:
    Cannot connect to the requested page, the website returned the following HTTP error: 500 Internal Server Error

    Debug file says:
    PHP Fatal error: Cannot declare class Rest_Client_Abstract, because the name is already in use in /public_html/wp-content/plugins/woocommerce-mercadopago/includes/module/sdk/lib/rest-client/class-rest-client-abstract.php on line 21

    This is a plugin related to payment methods, created by MercadoLibre, a kind of Amazon from Latin America.

    PS: I would be great to have a button to enable the scan in the top Admin Bar.
    PS2: Service Agent and Profile Name setttings are not saved when updating the plugin page.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bruandet

    (@bruandet)

    I just installed and activated WooCommerce and woocommerce-mercadopago and saw the same error:

     PHP Fatal error:  Cannot declare class Rest_Client_Abstract, because the name is already in use in wp-content/plugins/woocommerce-mercadopago/includes/module/sdk/lib/rest-client/class-rest-client-abstract.php on line 21
    

    I edited that file and wrapped the whole Rest_Client_Abstract class into that code:

     if (! class_exists('Rest_Client_Abstract') ) {
    ...
    ...
    ...
    }
    

    Then I received another similar error:
    PHP Fatal error: Cannot declare class MP_Rest_Client, because the name is already in use in wp-content/plugins/woocommerce-mercadopago/includes/module/sdk/lib/rest-client/class-mp-rest-client.php on line 19

    I edited that file too and wrapped the MP_Rest_Client class into that code:

    if (! class_exists( 'MP_Rest_Client' ) ) {
    ...
    ...
    ...
    }
    

    Then, it worked.
    If you make those changes, test your plugin to make sure there’s no issues with it.
    I have no idea why it tries to load those classes twice.

    The profiler can’t work with just a button in the admin bar, because there are some AJAX requests to be processed in the background and so far they are only available from the main profiler page.

    The input fields on the profiler page are not saved. Maybe I will add a possibility to temporarily save them inside a cookie for the current session.

    Plugin Author bruandet

    (@bruandet)

    It seems that Mercado Pago fixed the problem in their plugin in version 5.7.x, which was released a couple of days ago.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error 500’ is closed to new replies.