Skip to content

PHP-Warnings regarding logo #58

@threadi

Description

@threadi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions