• Resolved ChrisCG

    (@chriscg)


    I noticed I have many instances of these two warnings in my error log:

    PHP Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /{my server}/wp-content/plugins/edd-prevent-eu-checkout/edd-prevent-checkout.php on line 226
    PHP Warning: file_get_contents(https://api.hostip.info/country.php?ip=207.46.13.119): failed to open stream: no suitable wrapper could be found in /{my server}/wp-content/plugins/edd-prevent-eu-checkout/edd-prevent-checkout.php

    Should I ignore it or fix it? I understand that I can change the setting in my php.ini to allow_url_fopen=1. Is this a good thing to do or does it involve lower security?

    https://www.ads-software.com/plugins/edd-prevent-eu-checkout/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It can lower your security.

    I’ll see if I can get a wrapper around that to work via curl first and then file_get_contents if all else fails. It’s not horrible in this case, but it’s not great, you’re right.

    Good call!

    Thread Starter ChrisCG

    (@chriscg)

    Hi,

    I’m running v1.0.8 and the above error seems to have disappeared, but –

    After 5 months, I’ve come back to looking at this plugin and find I’m now getting hundreds of instances of this error message:

    20151115T130902: abwoon.org/index.php
    PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /hermes/bosnaweb05a/b2613/ipw.abwoonco/public_html/abwoon/wp-content/plugins/edd-prevent-eu-checkout/edd-prevent-checkout.php on line 292

    Does this mean anything to you? It seems to me that as this line is part of a 4-part conditional test, if it can’t establish if the user’s country is on the country list it won’t block any sales – is that what it means?

    When I check customers’ location using the IP and https://www.iplocation.net, I find we have sold to several EU countries, so it looks like it’s not blocking very well, if at all.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    if it can’t establish if the user’s country is on the country list it won’t block any sales – is that what it means?

    Correct.

    Where are you getting their IPs from? EDD logs or …?

    What other EDD plugins are you running?

    FYI, I’m JUST pushing 1.1 today (meant to 3 days ago, screwed my back up) and I don’t see any errors on a test site with debug on.

    Thread Starter ChrisCG

    (@chriscg)

    Yes, I get them from the EDD logs. I’m also running
    Easy Digital Downloads – Amazon S3 and Easy Digital Downloads – Email Templates

    I’ve just updated to v1.1 and the error log is staying empty at the moment ( it was giving an error every minute or so) so it’s looking good. I’ll see if any EU sales go through in the future.

    Thanks, Mika!

    Thread Starter ChrisCG

    (@chriscg)

    Erm, I spoke too soon.

    I now find that the Prevent EU Checkout plugin had deactivated on update and now refuses to be activated. It thinks EDD isn’t installed (which it is). I get the message:

    “EDD – Prevent EU Checkout requires that Easy Digital Downloads be installed; the plug-in has been deactivated.”

    What next?

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I’ll see what the hell I screwed up…. Damn it. You were working FINE IN TESTING. Bad code.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay, I see why that activation error would happen in some cases. I’ll push 1.1.1 to fix that.

    I don;t know why array_key_exists… OH. yes I do. I’m using a fallback of ’00’ which is not an integer. Stupid PHP. Okay. Fixing that. Just have to sort out which codes will ‘never’ be used. Expect a new version in an hour.

    What’s happening is that those IPs are, for some reason, failing every check and EDD S2BEU gives up and assigns it a country of 00, my fallback. It’s probably timing out. But since 00 is not an integer in some versions of PHP (THANKS, PHP) it’s crapping out.

    Thread Starter ChrisCG

    (@chriscg)

    If it helps, I can say that the site I’m experiencing this problem with is still using php 5.3.29. Why the host hasn’t insisted on upgrading to 5.5 I don’t know.

    Thanks for this extra work you’re doing!

    Thread Starter ChrisCG

    (@chriscg)

    I’ve updated to v1.1.1 and it activates now – and the error has not reappeared.

    Thanks again – let’s see what happens over time with future orders.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    There was a bad logic chain in activation and if you had them in a specific order, the check ran before the plugin had access to a command. *sigh* race conditions. Hate.

    Thread Starter ChrisCG

    (@chriscg)

    I’m very grateful that you have the skill to work that out! Thanks again.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘php warning keeps appearing: wrapper is disabled’ is closed to new replies.