• Resolved crystalfyre

    (@crystalfyre)


    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 68

    These 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_weight

    		if ($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.

    • This topic was modified 4 years, 8 months ago by crystalfyre. Reason: Code doesn't like HTML tags, duh
    • This topic was modified 4 years, 8 months ago by crystalfyre.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author smallfishes

    (@smallfishes)

    Hey, thanks for the report on the warnings and notice and solution! I’ll get a fix out for these later today!

    Thread Starter crystalfyre

    (@crystalfyre)

    Sweet! ?? Thank you!

    Plugin Author smallfishes

    (@smallfishes)

    Looks like only one of those exists in the free version. I’m releasing a fix for that, and will work on a fix for the pro version shortly. Might take a bit more than today to get the pro version ready though. Thanks again for the bug report.

    Thread Starter crystalfyre

    (@crystalfyre)

    Much appreciated for the prompt reply. ??

    Have a great day!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error Log fixes’ is closed to new replies.