Error Log fixes
-
Just wanted to let you know, your plugin has 3 errors that get added to the “error_log”:
PHP Warning: A non-numeric value encountered in /home/public_html/wp-content/plugins/canada-post-shipping-for-woocommerce/canada-post-shipping-for-woocommerce-canada-post.php on line 13
PHP Warning: A non-numeric value encountered in /home/public_html/wp-content/plugins/canada-post-shipping-for-woocommerce/canada-post-shipping-for-woocommerce-canada-post.php on line 32
PHP Notice: Undefined index: enabled in /home/public_html/wp-content/plugins/canada-post-shipping-for-woocommerce/canada-post-shipping-for-woocommerce-canada-post.php on line 68These are in the functions “get_normalized_weight“, “get_normalized_dimension“, and “make_request_to_canada_post“.
And can be fixed by adding a few fail-safe checks like these:
get_normalized_weightif ($woo_weight_unit != 'kg') { $weight = intval( $weight ); switch ($woo_weight_unit) {
get_normalized_dimension
if ($woo_dimension_unit != 'cm') { $dimension = intval( $dimension ); switch ($woo_dimension_unit) {
make_request_to_canada_post
if ( isset( $option['enabled'] ) && $option['enabled'] == 'on'){
I hope this can help you! I made the changes on my own plugin, and figured you might also want them. There may be more errors, but these were the ones on my server.
- The topic ‘Error Log fixes’ is closed to new replies.