• My site throws a divide by zero critical error. Here is the full log. I could fix it manually by changing the code, but if cache gets cleared this has to be redone 



    function mesmerize_woocommerce_cols_css($sel, $cols)

    {

        $size = (100 / intval($cols));

        return "" .

               "$sel {" .

               "-webkit-flex-basis: $size%;" .

               "-moz-flex-basis: $size%;" .

               "-ms-flex-preferred-size: $size%;" .

               "flex-basis: $size%;" .

               "max-width: $size%;" .

               "}";

    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Please replace:

    $size = (100 / intval($cols)); with: $int_cols = intval($cols); $size = !is_nan($int_cols) && $int_cols > 0 ? 100 / $int_cols : 50;

    A fix for this will be included in the next Mesmerize theme update. Thank you!

    Thread Starter mattw2711

    (@mattw2711)

    Thanks. This has fixed the site, but when I try customise the mesmerize theme with the customiser I still get a fatal error. Should the manual fix also have fixed that, or is there another known issue with it?

    Hi,

    Could you please let me know what error is currently appearing?

    It would also help a lot if you could:

    • Check the error log on your hosting server
    • Or enable WP_DEBUG in WordPress and share the exact error message that shows up

    This will allow to better understand what’s causing the issue and fix it faster.

    Thread Starter mattw2711

    (@mattw2711)

    Hey sorry for the late reply.

    I do not have server side access, only wordpress. I see the below when I navigate to the customiser and the following error in WooCommerce logs

    { “error”: { “type”: 1, “file”: “/home/jpflower/public_html/wp-includes/functions.php”, “line”: 655 }, “remote-logging”: true, “backtrace”: [ { “file”: “/home/jpflower/public_html/wp-content/plugins/woocommerce/includes/class-woocommerce.php”, “line”: 459, “function”: “critical”, “class”: “WC_Logger”, “type”: “->” }, { “function”: “log_errors”, “class”: “WooCommerce”, “type”: “->” } ] }

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.