qenta-cee / woocommerce-qcp

QENTA Checkout Page plugin for WooCommerce
https://www.qenta.com
GNU General Public License v2.0
9 stars 7 forks source link

PHP-Warnings regarding logo #58

Open threadi opened 7 months ago

threadi commented 7 months ago

Questionaire

Versions

WooCommerce version: 8.7.0 PHP version: 8.0 Plugin version 2.1.5

Issue

Problem description:

3 warnings are thrown during each loading process in backend:

Warning: Trying to access array offset on value of type bool in /var/www/clients/client0/web3/web/wp-content/plugins/woocommerce-qenta-checkout-page/includes/settings-qcp.php on line 9

Warning: Trying to access array offset on value of type bool in /var/www/clients/client0/web3/web/wp-content/plugins/woocommerce-qenta-checkout-page/includes/settings-qcp.php on line 10

Warning: Trying to access array offset on value of type bool in /var/www/clients/client0/web3/web/wp-content/plugins/woocommerce-qenta-checkout-page/includes/settings-qcp.php on line 11

Reason: The logo is read out in the aforementioned file using get_theme_mod( 'custom_logo' ). However, it is not taken into account that a WordPress project may not have a logo stored in this way.

The solution would be to check the presence of a logo before image information is loaded.

Steps to reproduce:

  1. install WordPress.
  2. install and activate WooCommerce.
  3. install and activate a theme that does not use custom_logo (e.g. Avada).
  4. Install and activate woocommerce-qcp.

Note: the messages can be seen, for example, when debug mode is activated (in my case in my own development environment) or in the error log.