Title: Version 2.5.3 PHP warnings
Last modified: May 28, 2024

---

# Version 2.5.3 PHP warnings

 *  [Paul](https://wordpress.org/support/users/headwall/)
 * (@headwall)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/)
 * Hi
 * Version **2.5.3** of the plugin is putting loads of warnings into our PHP error
   logs.
 * File: includes/**class-wc-sumup-block-gateway.php**
   Line: **161** & **162**
 * The array settings array might not always contain the “enable_pix” or “open_payment_modal”
   keys. Can you please put some checking to see if those array keys exist (or populate
   them with sensible defaults)?
 * Thanks
 * Paul

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

 *  [dlevain2800](https://wordpress.org/support/users/dlevain2800/)
 * (@dlevain2800)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17787585)
 * Same problem here … lin 161 – **class-wc-sumup-block-gateway.php** : 
   **Warning**:
   Undefined array key “enable_pix”
 *  [cariboulette](https://wordpress.org/support/users/cariboulette/)
 * (@cariboulette)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17788978)
 * Same problem for me… 10 error messages on my shop :/
 *  Thread Starter [Paul](https://wordpress.org/support/users/headwall/)
 * (@headwall)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17788996)
 * If you edit **includes/class-wc-sumup-block-gateway.php** and add the following
   snippet before the call to **wp_localize_script()**, it will get rid of the warnings
   safely:
 *     ```wp-block-code
       if (!array_key_exists('enable_pix', $this->settings)) {
           $this->settings['enable_pix'] = false;
       }
   
       if (!array_key_exists('open_payment_modal', $this->settings)) {
           $this->settings['open_payment_modal'] = false;
       }
       ```
   
 * I’ve run this patch on three sites now and the logs are clean again. It will 
   do for now, until the author releases an update.
 *  [cariboulette](https://wordpress.org/support/users/cariboulette/)
 * (@cariboulette)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17789028)
 * Thanks for your reply… I tried this and it’s worse!
 * Parse error: syntax error, unexpected token “}” in /homepages/45/d901075961/htdocs/
   wp-content/plugins/sumup-payment-gateway-for-woocommerce/includes/class-wc-sumup-
   block-gateway.php on line 143
 * Notice: La fonction is_embed a été appelée de façon incorrecte. Les balises de
   requête conditionnelle ne fonctionnent pas avant le lancement de la requête. 
   Avant cela, elles renvoient toujours le booléen false. Veuillez lire Débogage
   dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version
   3.1.0.) in /homepages/45/d901075961/htdocs/wp-includes/functions.php on line 
   5865
 * Notice: La fonction is_search a été appelée de façon incorrecte. Les balises 
   de requête conditionnelle ne fonctionnent pas avant le lancement de la requête.
   Avant cela, elles renvoient toujours le booléen false. Veuillez lire Débogage
   dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version
   3.1.0.) in /homepages/45/d901075961/htdocs/wp-includes/functions.php on line 
   5865
   Il y a eu une erreur critique sur ce site.
 *  Thread Starter [Paul](https://wordpress.org/support/users/headwall/)
 * (@headwall)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17789031)
 * [@cariboulette](https://wordpress.org/support/users/cariboulette/) Check that
   you have pasted the code correctly. Here is the code snippet with a bit more 
   context (between START and END)
 *     ```wp-block-code
       /**
        * Translators: the following error messages are shown to the end user
        */
       $error_general = __('Transaction was unsuccessful. Please check the minimum amount or use another valid card.', 'sumup-payment-gateway-for-woocommerce');
       $error_invalid_form = __('Fill in all required details.', 'sumup-payment-gateway-for-woocommerce');
   
       // START fix log warnings --------------------------------
       if (!array_key_exists('enable_pix', $this->settings)) {
           $this->settings['enable_pix'] = false;
       }
   
       if (!array_key_exists('open_payment_modal', $this->settings)) {
           $this->settings['open_payment_modal'] = false;
       }
       // END fix log warnings ----------------------------------
   
       wp_localize_script('wc-sumup-blocks-integration', 'sumup_gateway_params', [
           'showInstallments' => "$show_installments",
           'sumup_handler_url' => add_query_arg(
               [
                   'wc-api' => 'sumup_api_handler',
                   'action' => 'create_checkout'
               ],
               home_url() . '/'
           ),
           'showZipCode' => "$show_zipcode",
           'maxInstallments' => $number_of_installments,
           'locale' => "$card_locale",
           'country' => '',
           'status' => '',
           'errors' => [
               'general_error' => "$error_general",
               'invalid_form' => "$error_invalid_form",
               'payment_error' => ''
           ],
           'enablePix' => $this->settings['enable_pix'],
           'openPaymentInModal' => $this->settings['open_payment_modal'],
           'redirectUrl' => ''
       ]);
       ```
   
 * I hope this helps
    -  This reply was modified 2 years ago by [Paul](https://wordpress.org/support/users/headwall/).
    -  This reply was modified 2 years ago by [Paul](https://wordpress.org/support/users/headwall/).
 *  [cariboulette](https://wordpress.org/support/users/cariboulette/)
 * (@cariboulette)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17789049)
 * Thank you so much!!! the 10 messages have disappeared!
 *  [fsda](https://wordpress.org/support/users/fsda/)
 * (@fsda)
 * [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17791803)
 * I also have this problem for no reason, since the update that to bug the itnernet
   sites using Sumup I have an error Credentials are not valid. Please check and
   try again. I have redone the API Auth but nothing changes impossible to make 
   it work, if the osuci is not solved knowing that I have not touched anything 
   I leave Sumup and I take another solution for collections…….. =(

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

The topic ‘Version 2.5.3 PHP warnings’ is closed to new replies.

 * ![](https://ps.w.org/sumup-payment-gateway-for-woocommerce/assets/icon.svg?rev
   =3531852)
 * [SumUp Payment Gateway For WooCommerce](https://wordpress.org/plugins/sumup-payment-gateway-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sumup-payment-gateway-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sumup-payment-gateway-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/sumup-payment-gateway-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sumup-payment-gateway-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sumup-payment-gateway-for-woocommerce/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [fsda](https://wordpress.org/support/users/fsda/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/version-2-5-3-php-warnings/#post-17791803)
 * Status: not resolved