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
  • Plugin uninstall support

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')) 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' );
    

You can see a working version of the plugin on this website, check the end of the sidebar and your location flag. Anyway, it’s cool to have visitors from

Warning: Please visit software77.net for their license, privacy policy and specially the periodic download limit for the database file.

World Flags Plugin @ WordPress Repository | Download (v1.1)

Come back here soon for updates, feature requests and information on future releases.