Battlefield 2 Stats


This plugin creates a function which outputs your Battlefield 2 profile statistics. The data is fetched via a XML feed from It’s intended for your sidebar, but can also be used on a WordPress page.

It’s fully configurable via an options page in the WordPress admin area and only requires that you add the plugin’s output function to your theme’s sidebar to get it working.

To see it in action, look to your right in my sidebar, just below the weather.


This plugin has been moved!

You can now find it at the plugin database.

Support / Feature Request Forum:


If you enjoy this plugin, please consider sending a few bucks my way. I’ve spent a lotta time on this plugin and all donated money will be put towards paying off my college loans and such. 🙂

Configuration Page Screenshot

Click for a larger version.

Battlefield 2 Stats Configuration Page [Thumbnail]

Change Log:

  • v1.14: Complete recode of the ranks code due to stupidity on my part when it was first coded. Also various bug fixes and improved error handling. Please make sure to upload the new image file as well.
  • v1.13: no longer allows the use of playernames, so this plugin now reflects that change. You can only use PIDs now. Also new are some minor improvements and bug fixes.
  • v1.12: WordPress Widgets support and long term logging added. Now if an error occurs, you’ll actually be able to see it later on rather than just at the time it occured. Also some various bug fixes I believe (hard to remember what I changed, lol).
  • v1.11: Localization support added. Now all of you non-English bloggers can display your stats in whatever language you wish. Also added are thousands seperators in the numbers (for easier reading) and unit abbreviations to the playtime (example: Playtime: 236h:06m:04s). You can toggle the use of that though.
  • v1.10: Ranks introduced in the BF2 v1.2 patch added as well as many new features / improvements including an optional update checker that connects to my website every once in a while to look for a new version.
  • v1.02: More improvements in the rank percentages (you can now choose from two percent types) as well as a widget for WP-Dash. You can also now use your player name to fetch your stats rather than only your PID.
  • v1.01: Major “percentage to next rank” improvements. Basically, I wasn’t correctly calculating the percenteage in v1.00.

61 thoughts on “Battlefield 2 Stats

  1. Pingback: WordPress Station » Blog Archive » Battlefield 2 Stats

  2. Nice work. A little gem of a plugin for those of us who are seriously addicted to BF2:)

    If you update this with any new features – let me know. I’d be keen to see it progress.


  3. Thanks. 🙂

    And I think it’s pretty much done. I can’t really think of anything else to add to it, else I woulda done so already. :/ Although others may have more ideas…

  4. Updated again.

    v1.02: More improvements in the rank percentages (you can now choose from two percent types) as well as a widget for WP-Dash. You can also now use your player name to fetch your stats rather than only your PID.

  5. I’m currently using the code that Chuy posted to list the scores for all of our clan members at my site. I was going to write a WP plugin to wrap that functionality, but perhaps it would be better if you could add the functionality to your plugin. It would be nice to have an option to add multiple PIDs and allow a listing of users (like on the site above). Just a thought. I use your plugin on my personal blog (much appreciated). By the way, I wrapped a Teamspeak server status script to make it a plugin as well (in case someone needs that let me know).


  6. Problem with that is it’d require a whole recode. Besides only allowing the entering of one PID/playname (well, it doesn’t really only allow, but it’s only designed for one), it’s setup only to grab and store one set of data. Not to mention it’d have to have a whole other setup page on how to display multiple users and such.

    Plus, I think 99.9% of WordPress blogs that’d be interested in this plugin are single user and have no need to display the stats for more than one person. This plugin only has 25 downloads at the time of this comment as it is, the other version would only get 1, maybe 2 downloads. To be frank, not worth my time.

    So, I think for the select few who need to display multiple people, they’re better off just doing what you did and wrapping the official API into their WordPress theme. As you probably found out, it was very easy to do. 😉

  7. Pingback: Living in the Whine Country » BF2 Stats Plugin for WordPress

  8. I am having problems getting the rank icons to display. Where exactly should the rank images be added to? Currently I have them located in two locations and it still does not work:
    \wp-content\themes\default\images &

  9. The plugin file, readme, and the images folder should all be in a folder called “wp_bf2s” in your plugins folder. That results in the rank images being located here:


    Just keep the ZIP’s file structure intact and you should be good. 🙂

  10. Thanks!! I figured it out. I guess I should learn to read more carefully. BTW great Plugin!! See you on the field….

  11. A new version of this plugin should be out in a couple days. It’ll have support for the new ranks introduced in today’s version 1.2 patch as well as a couple new features. 🙂

  12. Alright, the update is done I think. However, before I publicly release it to a ton of people, I need to triple check that it actually works. I’ve tested it on my local blog as well as here on my real blog, but I still would like a couple people to try it out first.

    So, if you use this plugin and would like to beta test the next version for me, contact me and I’ll send you a download link. 🙂

  13. Pingback: Hjelmengen’s Blog » Blog Archive » Battlefield2 Statistics Plugin to WordPress

  14. Pingback: Double Life » Blog Archive » Battlefield 2 Wordpress Plugin

  15. Hi, I am curious, seeing that I am pretty new at wordpress and plugins. I understand the concept of putting it in the sidebar, but how do you put it on a page?
    I want to display it on a page, what is the code for it?
    Thank you.

  16. [Comment ID #744 Will Be Quoted Here]
    Please accept my apologies for using the wrong venue for my support questions, will be posting it in the right area…

  17. No worries. I just like to keep support to the forums to make these comments less messy and to better get help to those that need it.

    Anyway, check out your thread. I’ve left a response. 😉

  18. Pingback: NanoBlog » Blog Archive » Out of the Dark

  19. Pingback: Rene - Just another Blog » Blog Archive » Battlefield 2 Stats Translation

  20. Pingback: » Battlefield 2 stats, tips and info

  21. Hi Viper,Herez a short question for ya. Im playing Bf2 now for a few months or so, but i’m not getting my stats to go up. My stats-counters stay down @ zero. That’s pretty crappy because everyone thinks there just playing against a fucking nooby. I think I even kicked your ass severall times.
    How can i get my stats to work properly??

  22. Pingback: What is on my Mind » Blog Archive » BF2 Stats Plugin

  23. Pingback: What is on my Mind » Blog Archive » Pimped out my Blog

  24. Pingback: BREWTALITY.NET » BF2 Stats for WordPress

  25. Pingback: Living in the Whine Country » What tweaks & plugins for Wordpress do I suggest?

  26. for the past 24 hours I have earned over 100 points for kills, flags, etc. but its not showing up in my stats. why am i not getting my points?

  27. Pingback: » Blog Archive » Added a BF2 Stats plug-in

  28. Pingback: 10 Web Widgets to Share Interests on Your Site at

  29. Oliver on March 28th, 2007 at 9:35 AM wrote:

    Please add an option that grabs the “Last Battle on …”-date.

    All information that’s available in the feed I use is currently available for display in the plugin. has just released a new, separate feed that contains nearly ALL data in your profile, however due to the age of this game and other priorities I have, this plugin is probably at it’s final release and will never be updated again.

  30. Pingback: 7 plugins curiosos para Wordpress » BlogMundi

Comments are closed.