Title: Quick Flag
Author: Marko-M
Published: <strong>06 Marz 2012</strong>
Last modified: 02 Avost 2019

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/quick-flag.svg)

# Quick Flag

 By [Marko-M](https://profiles.wordpress.org/marko-m/)

[Download](https://downloads.wordpress.org/plugin/quick-flag.zip)

 * [Details](https://lmo.wordpress.org/plugins/quick-flag/#description)
 * [Reviews](https://lmo.wordpress.org/plugins/quick-flag/#reviews)
 *  [Installation](https://lmo.wordpress.org/plugins/quick-flag/#installation)
 * [Development](https://lmo.wordpress.org/plugins/quick-flag/#developers)

 [Support](https://wordpress.org/support/plugin/quick-flag/)

## Description

Quick Flag resolves IP address to [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
two-letter country code and name using [ip-countryside](http://code.google.com/p/ip-countryside/)
generated database and displays country flag if required. In contrast to other IP
to country solutions this one allows you to create and update database your self
using 5 Regional Internet Registrars (RIR) databases: AFRINIC, APNIC, ARIN, LACNIC
and RIPE and ip-countryside open source application that does the work of generating
database for you. You can also update IP to country database automatically with 
single click or schedule weekly automatic updates.

**Big thanks to [Markus Goldstein](http://madm.dfki.de/goldstein/) for ip-countryside
project, weekly database updates and automatic update server used in the past. To
offload Markus server, database updates are currently generated by me and stored
inside [GitHub repository](https://github.com/Marko-M/ip-countryside-db).**

#### Quick Flag feature highlights

 * **New in v2.10**: Country names can be translated using Poedit
 * Quick Flag database can be updated using single click without updating Quick 
   Flag plugin.
 * Quick Flag database can be auto updated weekly without updating Quick Flag plugin.
 * Because of the way Quick Flag database is created it has probably the most accurate
   IP to country database you can find.
 * Database updates are generated using open source [ip-countryside](http://code.google.com/p/ip-countryside/)
   application.
 * Quick Flag provides PHP function to retrieve country code and country name for
   given IP address (see FAQ for more)
 * Quick Flag provides PHP function to retrieve country flag image for given country,
   248 flag images provided by [Mark James](http://www.famfamfam.com)

#### Other WordPress plugins supporting Quick Flag

 * Voting polls plugin [Quick Poll](http://www.techytalk.info/wordpress-plugins/quick-poll/)
 * Who is online plugin [Quick Count](http://www.techytalk.info/wordpress-plugins/quick-count/)
 * Chat plugin [Quick Chat](http://www.techytalk.info/wordpress-plugins/quick-chat/)

For more information and demo please visit [Quick Flag demo](http://www.techytalk.info/wordpress-plugins/quick-flag/)
page at [TechyTalk.info](http://www.techytalk.info/).

## Screenshots

 * [[
 * Quick Flag inside who is online plugin [Quick Count](http://www.techytalk.info/wordpress-plugins/quick-count/)

## Installation

Quick Flag can be installed using integrated WordPress plugin installer or manually.

#### Integrated WordPress plugin installer method:

 1. Go to Plugins > Add New.
 2. Under Search, type in ’Quick Flag’.
 3. Click Install Now to install the WordPress Plugin.
 4. A popup window will ask you to confirm your wish to install the Plugin.
 5. If this is the first time you’ve installed a WordPress Plugin, enter the FTP login
    credential information. If you’ve installed a Plugin before, it will still have
    the login information.
 6. Click Proceed to continue with the installation. The resulting installation screen
    will list the installation as successful or note any problems during the install.
 7. If successful, click Activate Plugin to activate it, or Return to Plugin Installer
    for further actions.
 8. Have fun using geolocation trough your own plugin.

#### Manual method:

 1. Upload ’quick-flag’ folder from quick-flag.zip file downloaded from [Quick Flag WordPress plugin directory page](https://wordpress.org/extend/plugins/quick-flag/)
    to the ’/wp-content/plugins/’ directory.
 2. Activate ’Quick Flag’ plugin through the ’Plugins’ menu in WordPress.
 3. Have fun using geolocation trough your own plugin code.

## FAQ

  How do I test is Quick Flag installed properly?

You can place `[quick-flag]` shortcode to add current IP address country name and
flag image to your page or post. To display country name and flag image of IP address
other than current you can use this shortcode like `[quick-flag ip="some_ip_address"]`.

  Can you provide example for fetching country info and flag for imaginary `123.123.123.123`
IP address from country Croatia?

You can use something like this:

    ```
    // Query database with following IP address
    $ip_address = '123.123.123.123';

    global $quick_flag;
    if(isset($quick_flag) && is_object($quick_flag)){
        if(($info = $quick_flag->get_info($ip_address)) != false){
            $version = $info->version;      // Quick Flag version (float): 2.00
            $ip = $info->ip;                // IP address (string): 123.123.123.123
            $code = $info->code;            // Country code (string): HR
            $name = $info->name;            // Country name (string): Croatia
            $latitude = $info->latitude;    // Country latitude (float): 45.1667
            $longitude = $info->longitude;  // Country longitude (float): 15.5
            $flag = $quick_flag->get_flag($info, 'my-own-css-class'); // CSS class is optional, 'quick-flag' by default
        }
    }
    ```

$flag variable will contain following string:

    ```
    <img
        class="my-own-css-class"
        title="Croatia"
        src="http://www.yoursite.com/wp-content/plugins/quick-flag/img/flags/HR.gif"
    />
    ```

  How do I translate country names to my own language?

Like most WordPress plugins Quick Flag can be translated using gettext. You can 
use Poedit application to open translation template from ‘languages’ directory or
you can use [Quick Flag online translation interface](http://www.techytalk.info/wordpress-plugins/quick-flag/#translations).
Please keep in mind that after you change your blog language or update language 
files you must trigger database update to update country names inside database. 
Currently the easiest way to do this is to delete ip2country.db and ip2country.version
files from ‘database’ directory and click ‘Update’ button in Quick Flag settings.

## Reviews

![](https://secure.gravatar.com/avatar/d8a3a7bdeaab19b55d4755b1ac878c7b342fb321f4e50b76d5d1b7402339a2d3?
s=60&d=retro&r=g)

### 󠀁[Quick Flag](https://wordpress.org/support/topic/quick-flag/)󠁿

 [KathleenH](https://profiles.wordpress.org/kathleenh/) 27 Otover 2016

We installed this ages ago and it is still working well as we have updated our WP.
Thanks!

![](https://secure.gravatar.com/avatar/12c3894e87084de2a5b01d14a337695336739ce5900a9c415114ee60e8533f5e?
s=60&d=retro&r=g)

### 󠀁[Good job!](https://wordpress.org/support/topic/good-job-593/)󠁿

 [WaKeMaTTa](https://profiles.wordpress.org/wakematta/) 07 Fevrer 2017

good job

 [ Read all 3 reviews ](https://wordpress.org/support/plugin/quick-flag/reviews/)

## Contributors & Developers

“Quick Flag” is open source software. The following people have contributed to this
plugin.

Contributors

 *   [ Marko-M ](https://profiles.wordpress.org/marko-m/)

[Translate “Quick Flag” into your language.](https://translate.wordpress.org/projects/wp-plugins/quick-flag)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/quick-flag/), check
out the [SVN repository](https://plugins.svn.wordpress.org/quick-flag/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/quick-flag/) by 
[RSS](https://plugins.trac.wordpress.org/log/quick-flag/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.12 (02.08.2019.)

 * Switch ip2country database source to one kindly provided by Markus Goldstein

#### 2.11 (25.11.2012.)

 * Fix for ip2long returning signed integer on 32-bit systems

#### 2.10 (12.09.2012.)

 * Add ability to translate country names using Poedit
 * Update ISO 3166-2 country names and codes
 * Change database update URLs to GitHub repository
 * Database updated to 11.09.2012. version

#### 2.02 (23.07.2012.)

 * Code refactoring and minor cleanup
 * Fix another bug where Quick Flag fails to operate on PHP versions older than 
   5.3.0

#### 2.01 (22.07.2012.)

 * Fix bug where Quick Flag fails to operate on PHP versions older than 5.3.0

#### 2.00 (22.07.2012.)

 * Add admin settings page
 * Add single click database update feature and admin settings button
 * Add auto database update feature and admin settings toggle checkbox
 * quick_flag_get_info() deprecated. Use $quick_flag->get_info() instead.
 * quick_flag_get_flag() deprecated. Use $quick_flag->get_flag() instead.
 * Database updated to 17.07.2012. version

#### 1.14 (07.07.2012.)

 * Database updated to 03.07.2012. version

#### 1.13 (23.04.2012.)

 * Database updated to 17.04.2012. version

#### 1.12 (27.03.2012.)

 * Database updated to 27.03.2012. version

#### 1.11 (17.03.2012.)

 * Fix bug where all users were resolved to country Croatia

#### 1.10 (16.03.2012.)

 * Database updated to 13.03.2012. version
 * Place latitude and longitude data inside
 * Add new global variable $quick_flag_version
 * Place Quick Flag version inside data returned by `quick_flag_get_info()`. If 
   you are using cookies to store users geolocation data you can easily check cookie
   for Quick Flag version that created this data. If data is not up to date you 
   can fetch new data and update cookie.
 * Split country and ip ranges data into separate tables, join them when necessary.
   This gives us around 40% database size reduction.

#### 1.00 (06.03.2012.)

 * Initial release
 * Database updated to 06.03.2012. version

## Meta

 *  Version **2.12**
 *  Last updated **7 years ago**
 *  Active installations **100+**
 *  WordPress version ** 3.0 or higher **
 *  Tested up to **3.4.2**
 *  Language
 * [English (US)](https://wordpress.org/plugins/quick-flag/)
 * Tags
 * [geolocation](https://lmo.wordpress.org/plugins/tags/geolocation/)[ip to country](https://lmo.wordpress.org/plugins/tags/ip-to-country/)
   [ip2country](https://lmo.wordpress.org/plugins/tags/ip2country/)
 *  [Advanced View](https://lmo.wordpress.org/plugins/quick-flag/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  3 5-star reviews     ](https://wordpress.org/support/plugin/quick-flag/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/quick-flag/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/quick-flag/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/quick-flag/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/quick-flag/reviews/?filter=1)

[Add my review](https://wordpress.org/support/plugin/quick-flag/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/quick-flag/reviews/)

## Contributors

 *   [ Marko-M ](https://profiles.wordpress.org/marko-m/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/quick-flag/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CZQW2VZNHMGGN)