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!
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 http://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.
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.
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!
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?
I’ll see what the hell I screwed up…. Damn it. You were working FINE IN TESTING. Bad code.
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.
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!
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.
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.
I’m very grateful that you have the skill to work that out! Thanks again.