• Resolved Jeff Starr

    (@specialk)


    Hello,

    Thanks for EDD, it’s a great plugin.

    Recently getting LOTS of these PHP Notices filling up the error logs:

    PHP Notice: A non well formed numeric value encountered in /wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php on line 1889', referer: https://www.paypal.com/
    
    PHP Notice: A non well formed numeric value encountered in /wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php on line 1889
    
    PHP Notice: A non well formed numeric value encountered in /wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php on line 1889', referer: /checkout/
    .
    .

    Let me know if I can provide any further infos.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Pippin Williamson

    (@mordauk)

    @specialk can we get a copy of your system info please from Downloads > Tools > System Info?

    Thread Starter Jeff Starr

    (@specialk)

    I’d rather not divulge private site infos if that’s okay. Hopefully you can look at line 1889 and add some check for “non well formed numeric value”. It’s a pretty common notice that should be straightforward to resolve. Either way, just letting you know FYI.

    Plugin Contributor Pippin Williamson

    (@mordauk)

    That’s understandable. The main piece I need is your PHP version. What version is your site running?

    Thread Starter Jeff Starr

    (@specialk)

    PHP Version: 7.4.11

    Ashley

    (@nosegraze)

    Hi @specialk ,

    I’m looking into this for you. Can you just clarify if you’re using any EDD add-ons or running any custom code?

    Also, have you been able to reproduce this with specific steps or are you just noticing these from the error logs? We want to try to reproduce this error so we can fix it, and exact steps or settings to cause it would help!

    Do you use discount codes on your site? If so, what settings do you use for the discount(s)? (Specifically amount and whether it’s a flat rate or a percentage.)

    Thread Starter Jeff Starr

    (@specialk)

    Hi @nosegraze,

    For EDD addons, using only Invoices and Manual Purchases. Not running any custom code.

    Have not tried reproducing the issue locally, just many entries in the error logs. Did try searching for “non well formed numeric value” (without the quotes) and saw lots of results. It looks like a pretty common issue with PHP 7.4+ that is resolved easily. For example this post.

    It may be related to discount codes. There was an active percentage-rate discount when I noticed the errors. As a test, I deleted all of the EDD discounts on site and will report back if the PHP notices stop.

    Also while I’m here, there are lots of these notices as well:

    PHP Notice: Undefined index: download_id in /plugins/easy-digital-downloads/includes/cart/actions.php on line 67

    Just FYI

    Ashley

    (@nosegraze)

    In order to make sure it’s resolved, we want to make sure we can reproduce it. That way we can confirm the issue, then also confirm the fix. Additionally, if there is an invalid numeric value that’s indicative of another issue somewhere down the line because that shouldn’t be happening. So reproducing is key to make sure it’s fully fixed and not causing any other issues.

    If you could give me the following then I can try to reproduce this:

    1. Amount your product is priced at.
    2. Currency you are using.
    3. Exact discount percentage you are using.

    With just a simple 50% discount code I’m not seeing the problem so the actual numbers themselves might be important.

    Regarding the other notice, we will apply a patch to prevent that error. But the core issue there is that the download_id wasn’t passed through. This could happen if you manually generate an “add to cart” link but forget the &download_id= argument. For example:

    https://yoursite.com/checkout/?edd_action=add_to_cart

    But we can definitely account for that on our end.

    Thread Starter Jeff Starr

    (@specialk)

    Sure here you go:

    1) $50
    2) USD
    3) Was using 15% discount (currently no discounts on site)

    For the other notice, all links on site are of the format:

    /checkout/?edd_action=add_to_cart&download_id=123

    Let me know if I can provide any further infos.

    Ashley

    (@nosegraze)

    Thank you @specialk ! I was able to reproduce the problem so I think I can take it from here. It looks like it’s possible to save non-numeric discount amounts, which is what causes the issue. We’ll work up a fix and get that in a future release.

    As for the undefined index, we’ve got a fix for that in place and it will be in our 2.10 release.

    Thread Starter Jeff Starr

    (@specialk)

    Thanks for resolving, seems to be fixed in EDD 2.10. Marking thread as resolved.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Lots of PHP Notices’ is closed to new replies.