This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

World Flags

Description

Add country flags anywhere in your WordPress blog using simple shortcodes and/or widgets, or show visitor country flag and info based on their IP address.

This is the first version of World Flags. This version uses the software77.net ip2country database and only wraps the IPV4 version. The plugin imports the csv file into a mysql table for fast queries. Fetching of the csv IP database can be scheduled weekly using the WP cron jobs, or manually via the plugin options page.

Features

  • Supports shortcodes anywhere and widgets
  • Template functions and comments author flags (NEW!)
  • Uses software77 IP database with more than 3 billion addresses included
  • Multilingual interface
  • Scheduled downloads of the IP database file
  • MD5 checks to validate database before populating tables
  • Uses MySQL for super fast queries
  • 4 image sizes for country flags – 16, 24, 32 and 48
  • Different ways to insert HTML – simple, JavaScript and jQuery (with Ajax)
  • Plugin uninstall support

Multilingual Support

World Flags supports multilingual interface and currently has:

  • Persian (fa_IR)

You can also translate the data/country-codes.txt file for country names in your language.

All translation submissions are appreciated. Thank you.

Warning: Please be aware that software77.net may ban your IP if you send many download requrests. Visit software77.net for their license, privacy policy and specially the periodic download limit for the database file.

Visit BSurprised Home Page for updates, feature requests and information on future releases.

Screenshots

  • World Flags settings page

Installation

Installation is the same routine as most WP plugins:

  1. Upload ‘word-flags’ folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the Plugins menu in WordPress
  3. Find the World Flags submenu under Options menu in your WordPress to change some settings or manually update the IP database.

Notice: You need to manually fetch the IP database the first time as the plugin does not include the files.

Using World Flags

  • Place [flag code="your-country-code/auto" size="16/24/32/48" text="yes/no"] in your posts.
    Example: [flag code="auto" size="48" text="yes"]
  • Drag the plugin widget in your Widgets menu and customize its options to show what you want.
  • If you want to show the country flag for your visitor comments, you can add the flag before or after the comment text along with your custom text or use <?php if (function_exists('world_flags_comment_flag')) echo world_flags_comment_flag($comment); ?> inside your comments loop in your template. $comment is the variable that holds the comment inside your loop.
  • You can add <?php if (function_exists('world_flags_insert_flag')) world_flags_insert_flag(); ?> inside your template to add flags anywhere. Optional argument $code can be provided to override auto mode. Example: world_flags_insert_flag( 'US' )

FAQ

What are the options for the World Flags shortcode?

The shortcode supports these attributes:

  • code: Can be an ISO_3166-1_alpha-2 two-letter country code, or the keyword auto for the automatic display of the flags based on the visitor IP address.
  • size: Currently supports 16, 24, 32 and 48 pixel image sizes.
  • text: yes or no, whether to show the country name text beside the flag image.
What are the requirements for the plugin?
  • You need at least 15 megabytes of space on your hosting as the ip2country database file, when extracted, takes some space.
  • Plugin needs to have write permissions on its /data directory.
The plugin auto mode does not show visitor flags correctly. Why?

You probably have some sort of caching enabled like wp-supercache. You need to set the mode to jQuery for the flags to load by ajax calls.

Contributors & Developers

“World Flags” is open source software. The following people have contributed to this plugin.

Contributors

Translate “World Flags” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.1

2010-08-23
* Comment flags based on comment author IP address
* function to include flags anywhere inside template
* Many new customizable options

1.0.1-beta

2010-08-21
* Fixed the cache problem by implementing ajax calls in jQuery

1.0-beta

2010-08-17
* First released version
* Supports shortcodes and widgets
* Uses software77 IP database
* Only IPV4
* Plugin uninstall support