Hello,
I’m experiencing a PHP warning in the Stock Locations for WooCommerce plugin.
The warning appears in:
wp-content/plugins/stock-locations-for-woocommerce/views/settings-api.php — line 41
The affected code is:
<tr title="<?php echo (isset($param_data['tooltip'])?$param_data['tooltip']:''); ?>" class="scope-<?php echo $param_data['scope']; ?>">
The warning is:
Warning: Undefined array key “scope”
It appears that $param_data['scope'] is not always defined for every parameter.
A possible fix would be to check whether the key exists before accessing it:
<tr title="<?php echo isset($param_data['tooltip']) ? esc_attr($param_data['tooltip']) : ''; ?>" class="scope-<?php echo isset($param_data['scope']) ? esc_attr($param_data['scope']) : ''; ?>">
Alternatively, a default value such as 'default' could be used if the plugin requires a specific scope.
Could you please review this and consider including a fix in a future update?
Thank you for your work on the plugin.