Support » Plugin: Custom Content by Country (by One Dollar Plugin) » What are the country codes?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Paul

    (@paultgoodchild)

    Hi,

    Yes, you are right, it should be ‘SE’. But I checked the raw data and I think they’ve got an error in there.

    I’ve contacted the guys at ip2nation to see if they can build in a fix going forward for that. For now, if you want this to be fixed for you, my suggestion would be to:

    – open the current sql file found in the plugin directory under /inc/ip2nation/ip2nation.sql
    – go to line 62809 and change ‘SW’ to ‘SE’.
    – save the contents and replace the file on the server.
    – browse to your WordPress admin backend ie. http://yoursite.com/wp-admin/
    – then add this to the end of admin URL and load the URL: ?show_cbcdb_install=1
    e.g. http://yoursite.com/wp-admin/?show_cbcdb_install=1
    – then click the button to reinstall the database.

    Cheers,
    Paul.

    Plugin Author Paul

    (@paultgoodchild)

    I’ve released an updated version of the plugin with these country codes fixed so you can just update the database as normal.

    Cool. So I can trust that the other codes are also according to standard now?

    Hmm, I look through the raw data quickly and found this:
    …VALUES(‘ag’, ‘AT’, ‘ATG’, ‘Antigua and Barbuda’, ‘Antigua and Barbuda’, 17.03, -61.48);

    This means (?) that ‘AT’ will be ‘Antigua and Barbuda’. This is not correct. ‘AT’ is Austria.

    However, ‘ag’ is ‘Antigua and Barbuda’, which the first column says.

    So – where do they get the second column values from? They seem to be wrong in a lot of instances.

    OK, I get it. Sort of.

    The second column is just the two first characters of the third column.

    What you should use in your plugin is the first column. These values are what we expect. ‘se’ == Sweden, ‘at’ == Austria etc.

    Plugin Author Paul

    (@paultgoodchild)

    This data comes from a 3rd party, so it’s really down to what they’ve done here.

    But, with these corrections you’ve pointed out, I can correct them here and hopefully maintain these corrections easily through future updates.

    Frankly it’s a bit of a mess. It’s only in the last update that I started to use the Code2 instead of Code1 because GB was incorrectly identified with UK. But I hadn’t realised so many of the Code2 were wrong. Not good…

    Plugin Author Paul

    (@paultgoodchild)

    A bit of a pain, but I went through every entry in the database data and fixed their ISO 2-letter code.

    I’ve updated the plugin to a new release to reflect this.

    Hope it helps.

    Thanks. It’s better but still not 100%. For instance, Portugal is “PR” in the database, but it should be “PT”. I think there are more errors.

    Plugin Author Paul

    (@paultgoodchild)

    Yep, I just went over it there again and spotted a few more. I’ve released an update to reflect it. Hopefully I’ve picked up all of them – it’s oddly quite hard to see them 🙂

    Thanks,
    Paul.

    Thanks, it looks right 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘What are the country codes?’ is closed to new replies.