• Resolved Michele

    (@mathrim87)


    Hi,
    I’ve recently discovered that the PRO version of the plugin generates a lot of “PHP warnings” in the php_errorlog file. The error is always the same:

    [date] PHP Warning: A non-numeric value encountered in /home/customer/www/xxxx/public_html/wp-content/plugins/upsell-order-bump-offer-for-woocommerce-pro/includes/class-upsell-order-bump-offer-for-woocommerce-pro.php on line 284

    The errors are persistent, one every 3-15 seconds. Hope there is a way to fix this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Swings

    (@wpswings)

    Hi @mathrim87
    Thanks for giving a try to our plugin.We have checked the same on our local environment but we are not getting any such persistent error in our plugin.Please make sure you are on our latest pro version.
    If you still experienced such an error please visit the same line no 284 and replace the code with below code
    $day_count = ( (int) $thirty_days – (int) $current_time ) / ( 24 60 60 );
    This error generally happens when a non-numeric value has been encountered in a place where a number is expected, so to tackle that we need to place the data type i.e., int in above code to make sure the variable we get is of int data type.

    Hope this will help .
    Regards
    WP Swings

    Thread Starter Michele

    (@mathrim87)

    Hi,
    Thank you for your assistance, I have the last version, so I replaced the code and it solved the problem!
    I’ve added “(int)” before the two variables as you suggest and keep the asterisks as before. This is the correct code in case someone needs it:

    $day_count = ( (int) $thirty_days – (int) $current_time ) / ( 24 * 60 * 60 );
    Plugin Author WP Swings

    (@wpswings)

    Hey @mathrim87

    We are happy that your issue got resolved, will be waiting for your kind words also as review

    Thank you so much!

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

The topic ‘Pro plugin creates lot of warnings’ is closed to new replies.