ear-fung.us I'm a programmer. I'm also pro-grammar.

Nike+WordPress Plugin

The Nike+ iPod Stats plugin for WordPress is a great way to display to the world how you're doing at your workouts. It uses Nike's public API (the same one used for the official Nike widgets) to retrieve your personal data and formats it to display correctly on your WordPress blog.

NOTE TO EVERYONE UPGRADING FROM 1.4.2:

Because WordPress is now hosting the plugin, you may need to change your permissions again and change your cache path to the new directory in the plugin's options. The plugin directory has changed from nikePlus to nike-ipod. This will result in a change of the caching path from something like: "/home/username/public_html/wp-content/plugins/nikePlus/cache/" to "/home/username/public_html/wp-content/plugins/nike-ipod/cache/"

Sorry for the trouble.

Info:

  • Version: 1.4.3
  • Description: Allows you to display Nike+ iPod running data on your wordpress blog.
  • Download: Nike+ iPod Stats WordPress Plugin
  • Release Date: June 25, 2009

If you like my plugin and use it, please consider making a donation through Paypal to support its further development.

In the past month, I have received $0.00 for my coding efforts.

Requirements:

  • A wordpress blog running on a server with PHP ? 4.3.0 compiled with curl support.
  • A Nike+ login ID (used to access http://www.nike.com/nikeplus/)

What it does:

  • Gets your personal running data from Nike.com in XML format
  • Caches the data locally so your site load time is not dependent on the speed of the Nike website.
  • Displays your data in an easy to read way.
  • Easy to use configuration in your WordPress administration panel
  • Ability to enable or disable the display of your "Power Song"
  • Ability to display all your goals under the general run data.
  • Ability to link your power song to the artist on the iTunes Music Store
  • Ability to show your most recent runs
  • Graphs your runs

Note: The functionality of this plug in is SOLELY dependent on the open Nike+ API. At any time Nike decides to change or close access to their API, this plug in will most likely cease to operate correctly. The likelihood of this happening, however, is very slim since the plugin uses the exact same calls as the flash animations on the official NikePlus website.

This plugin has been tested with WordPress 2.8 and is not guaranteed to work for you. Support questions? Leave them in the comments below.

Comments (174) Trackbacks (14)
  1. @ChrisC

    In your options in the wordpress admin panel, put this in the “web proxy” option and everything should be OK:

    http://proxy.shr.secureserver.net:3128

    good luck,
    -Mark

  2. I have tried and tried to make a directory writable for this plugin to work, still no dice…. please help!!

  3. @michelle
    please tell me the exact problem you are having and what the page is doing with the plugin enabled. Otherwise i can’t help you.
    Does the admin panel say the directory isn’t writeable?
    what hosting service are you using?

  4. Mark,

    Thanks for the reply. I’ve added the proxy server – The line you gave me is what I was trying earlier on my own as well. Now that I got the writable issue resolved, I’m getting what appears to be a timeout issue. My blog will try to load the nike+ data for a minute or so then just stop, with no error message. I’ve verified the account information is correct, what else could it be?

  5. Hi Mark
    Thanks for a great plugin.
    However, I just upgraded to version 2.2 of WordPress and now it says “Can not retrieve data from Nike.com. Error:”. I don’t know if this is a coincindece, if I forgot to do something when upgrading of if it actually is the plugin that don’t work with this new WordPress version.

    Thanks
    Jonas

  6. @ChirsC
    I’m not sure what else it could be if you’ve entered the proxy correctly. Perhaps email me the errors that you’re receiving in your logfile for PHP (at the system level)

    @Jonas
    I have not tested yet with 2.2, but rest assured, as soon as i do, i’ll probably have to do another release to correct a few bugs.

  7. Has Nike changed something? It wont work any longer for me, it seems. And it looks broken on your site, too, Mark?!

  8. @Manu
    Looks like you’re right. I’m going to try and figure out what’s going on, but i’m at work right now so i don’t know how much time i’ll be able to devote to it.

  9. What I’ve noticed so far: I used to go to http://www.nike.com/nikeplus/ for viewing the original Nike-Site. When entering that URL it now redirects me to http://nikeplus.nike.com/nikeplus/

    I tried to change the URL accordingly in the PHP-Code, but it doesn’t seem to work.

  10. If you actually visit the URLs in a browser, they have setup server redirects to working files. I found most of the URLs and posted them on my blog, it doesn’t look like they have changed the XML format or anything…
    http://blog.asktherelic.com/2007/05/17/nike-site-update/

  11. AskedRelic: Good work!
    When I replaced http://www.nike.com with secure-nikeplus.nike.com in the API URL definitions it started working again, meaning the problems had absolutely nothing to do with WordPress 2.2.

  12. @AskedRelic
    Thanks for the tip. I’ve got my version working and I’m going to have a new version of the plugin ready to download hopefully by tomorrow.

  13. I’ve already got a workaround and i’ll post if here for everyone wanting to do it themselves. Nike simply changed the URL of their scripts.

    If you haven’t modified the nikePlus.php file at all, all you should need to change is in lines 68-75. Simply replace all occorance os “https://www.nike.com” or “http://www.nike.com” with “https://secure-nikeplus.nike.com”

    so:

    $nikeplus_api['auth'] = https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['data'] = "http://www.nike.com/nikeplus/v1/...
    $nikeplus_api['goals'] = "https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['runs'] = "https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['run_detail'] = "https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['challenges'] = "https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['challenge_detail'] = "https://www.nike.com/nikeplus/v1/...
    $nikeplus_api['records'] = "https://www.nike.com/nikeplus/v1/...

    BECOMES

    $nikeplus_api['auth'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['data'] = "http://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['goals'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['runs'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['run_detail'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['challenges'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['challenge_detail'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...
    $nikeplus_api['records'] = "https://secure-nikeplus.nike.com/nikeplus/v1/...

    Good luck, and I’ll try to have an official release over the weekend.

  14. Hey Mark (and Jonas), thanks for the workaround and update!

  15. Is it possible to have the weekly and monthly averages?

  16. Help.

    I am just losing my time here. Anyone can help me with my website?

    he seems to get into nikeplus, but something is wrong with my installation….

    http://brooklynroadrunners.org/wordpress/

  17. Hello Mark,

    First of all great plugin.
    I am having a problem however with displaying graphs and I was hoping you might have some advice. I am using WordPress 2.1 with sidebar widgets on a server running PHP v5.1.6
    Everything works fine unless I check the option to ‘show run graphs’. Then the sidebar stops rendering immediately after ‘My Recent Runs’. It looks as if something is breaking in the function _create_run_chart since no *.png files are being written to the cache.

    Thanks in advance,
    Edward

  18. @Edward
    Is the GD Image Library included in your installation of PHP?

    That is the only thing i can think of that would prevent the output of the png files since they are generated on the fly by the GD image library.

    you can do a simple test by creating a dummy php file and running the command:
    < ?php
    phpinfo();
    ?>

    search for “GD” to see if it is installed and active.

  19. Hi again,

    I enabled GD on my server by adding “extension = gd.so” to my php.ini file.
    Now when I do call phpinfo() I get this under GD:

    GD Support enabled
    GD Version bundled (2.0.28 compatible)
    FreeType Support enabled
    FreeType Linkage with freetype
    FreeType Version 2.2.1
    GIF Read Support enabled
    GIF Create Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled

    However, the function _create_run_chart still fails on the line $gd = gd_info();
    Is GD still not enabled properly? I can do simple examples using GD like the button example at http://www.php.net/gd

  20. ^ never mind. i didn’t read the instructions carefully enough. the php.ini file has to be in the same subdirectory as nikePlus.php :)

  21. @Edward
    Glad you got it working… i saw your comment and approved it but was going to look into the situation when i got home from work.

    I hope you enjoy the plugin. (now you just need to figure out how to change the backgrounf of the PNGs it generates to blend into your wordpress theme better :) )

  22. Hi Mark! Thanks for creating this great plugin!

    I keep on getting the “WARNING! Your current directory is not writable. This plugin will not function properly til you change this value!” warning even though I made not only the cache writable, but the nikePLUS folder too.
    Am I suppose to upload the whole nikePLUS folder in the wordpress plugin directory or JUST the php file?

    Thanks in advance for your help! :)

  23. @Anthony,
    you need to upload the entire nikePlus directory to the plugins directory, traverse into that directory and then make the cache folder writeable.

    hope this helps.
    -Mark

  24. Hmmm, that’s exactly what I did. I used chmod 777 for the cache directory. I think it might be that my server local path is incorrect. How do I know if it’s correct or not?

    Thanks again!

  25. @Anthony,
    if you believe your path is incorrect, put a php file in the cache directory with this in it:

    < ?php
    phpinfo();
    ?>

    then look for the variable (near the bottom) “_SERVER["SCRIPT_NAME"]”

    that is your path, minus the page.php at the end.

  26. Thanks for your effor on making this plugin, but for me it keeps saying: “Can not retrieve data from Nike.com.Error: session authentication failed”

  27. Hi:
    Maybe you find what the new xml that contain the leaderboard in the Team’s Challenges ?
    I found a groupID with a number but i dont know what xml call with tha number to return the leaderboard.

    Thanks,
    CubanRunner

  28. Hello Mark,

    I am very excited for your plugin, and have been wrestling for 3 days now with installation and configuration. I believe that I have it installed properly now, but when I load my wordpress site all of the content loads up to the Nike+ information…. at that point it just hangs, displays nothing, andstops… i.e. the rest of the sidebar content is not displayed.

    I am on godaddy for hosting, and I tried the proxy string posted above… but I suspect that the above posted proxy string may be no good.

    Do you have any suggestion as to what I may be doing wrong? I am truly too stubborn to give up on this plug-in. :)

  29. Nike now allows you to name your runs. Is it possible to pull that data from the site and post it with the run output?

  30. I am having trouble getting the stats to display in a separate page. The php code is not running and is just getting displayed as text. The site is here. Any help would be greatly appreciated.

    thanks

  31. I have the plugin running in the sidebar now, and is working great. Thanks for making this!!!

  32. I love this plugin! are there any updates coming down the road?

  33. I get

    “Can not retrieve data from Nike.com.
    Error: ”

    The error part is just blank. This was working fine last year for a while. Any idea what I could do to fix it?

  34. I can confirm that I’m having the same issue as John – a blank error, unable to retrieve the data from Nike. Have they changed the API again?

  35. Is anyone else having issues with loading data? I haven’t been able to get updated run information since last week.

  36. I am trying to get the plugin working on my site, but when I add it to the sidebar, it doesn’t seem to load (no data and no errors). I have double checked my user name and password, I have added the proxy http://proxy.shr.secureserver.net:3128, I have a writeable directory, I’m just confused on what it could be.

    I am using WordPress 2.3.3 on godaddy. Is this plugin broken now? Do I need any other plugins to use this plugin?

  37. Hi There-

    Any ideas what this error means? Is it related to Curl? I’m running WP 2.1.3 hosted by TotalChoiceHosting (and enabled your Nike+ plugin via Sidebar Widgets – but get same error when I manually add the code, too).

    Fatal error: Cannot use string offset as an array in /home/gabeand/public_html/wp-content/plugins/nikePlus/nikePlus.php on line 660

    Thanks for what sounds like a great plugin.. looking forward to having it work! :)

  38. P.S. TotalChoiceHosting support says this:

    “As far as I can tell from a quick look at the error / code, it looks due to incorrect coding for PHP5, rather than a curl issue.

    “I’d suggest contacting the developer, and checking with them for php 5.2.4.”

    Thoughts on that?

    Thanks!

  39. @Gabe:
    My server (this one) is running 5.2.5 so a newer version of PHP shouldn’t be the culprit.

    Are you sure of 2 things:

    1. Your host doesn’t require a curl proxy host?
    2. CHMOD the entire nikePlus cache directory to 777

    Other than that, there’s not a whole lot more I can do.
    Let me know if that helps.

  40. Thanks, Mark. #2 is definitely set, so it must be #1. I’ve followed up with my Web host.

  41. Thank you for this great plugin!
    My donation is on the way..

  42. Hallo zusammen! Ich habe das komplette Plugin einmal auf Deutsch übersetzt, den Download gibt es hier: http://www.fabianschulz.net/blog/2008/03/18/nike-statistiken-fur-wordpress/

    Hello! I’ve translate the plugin in german, the download is here: http://www.fabianschulz.net/blog/2008/03/18/nike-statistiken-fur-wordpress/

  43. hi Mark
    Can u tell why my nike doesn’t work? Is works fine when i install it, but day after there was a time out every time:

    * About to connect() to secure-nikeplus.nike.com port 443
    * Connected to e1063.c.akamaiedge.net (88.221.48.119) port 443
    * SSL connection using AES256-SHA
    * Server certificate:
    * subject: /C=US/L=Beaverton/O=Nike, Inc/OU=Internet Domain Administrator/ST=Oregon/CN=secure-nikeplus.nike.com
    * start date: 2008-03-10 14:27:16 GMT
    * expire date: 2009-03-10 14:27:16 GMT
    * issuer: /C=US/O=Akamai Technologies Inc/CN=Akamai Subordinate CA 3
    * SSL certificate verify result: 20, continuing anyway.
    > GET /nikeplus/v1/services/widget/generate_pin.jhtml?login=email@email.com&password=xx HTTP/1.1
    Host: secure-nikeplus.nike.com
    Pragma: no-cache
    Accept: */*

    * Operation timed out with 0 out of -1 bytes received
    * Closing connection #0
    * About to connect() to secure-nikeplus.nike.com port 443
    * Connected to e1063.c.akamaiedge.net (88.221.48.119) port 443
    * SSL connection using AES256-SHA
    * Server certificate:
    * subject: /C=US/L=Beaverton/O=Nike, Inc/OU=Internet Domain Administrator/ST=Oregon/CN=secure-nikeplus.nike.com
    * start date: 2008-03-10 14:27:16 GMT
    * expire date: 2009-03-10 14:27:16 GMT
    * issuer: /C=US/O=Akamai Technologies Inc/CN=Akamai Subordinate CA 3
    * SSL certificate verify result: 20, continuing anyway.
    > GET /nikeplus/v1/services/widget/generate_pin.jhtml?login=email@email.com&password=xx HTTP/1.1
    Host: secure-nikeplus.nike.com
    Pragma: no-cache
    Accept: */*

    Natascha xx

  44. Mark–I love this idea but can’t get it to work. I did everything as instructed, but in my options panel it keeps telling me “WARNING! Your current directory is not writable. This plugin will not function properly til you change this value!”

    Well, I properly CHMODed the cache file to 777. There is no question I did this properly. What gives? Any ideas?

    thanks!

  45. This looks to be exactly what I wanted, but I can’t get it to work. Using PHP5 and WordPress 2.6
    I get:
    Can not retrieve data from Nike.com.
    Error: there is no user information in the request

    Can not retrieve data from Nike.com.
    Error:
    I have filled in my username and password, and even tried my email address instead.

    Anyone any ideas?

    Cheers.

  46. Two comments:

    1. Great plugin.

    2. It’d be nice to be able to enable/disable and reorder the “Running” section that lists the “Total Runs:” and other totals. I’d like to either remove that section or move it below the “My Recent Runs” section.

    Thanks again for writing the Nike +iPod Stats WordPress Plugin!

  47. Sorry I’m feeling retarded. I don’t see the Options tab in which I put my nike plus login information. CAn you be more specific? Thanks.

  48. Jennie,
    After you’ve installed and activated the plugin, there will be a tab under the settings page that says “Nike+”. All the options are in that tab.

  49. I am so bummed. I was totally thrilled to install this plugin, then my Web Hosts connacted me stating the plugin was causing server error logs and sending my username and password for the geek world to see?!?!?! EEPS! Did I install it wrong?

  50. Chelle,
    The login procedure that the plugin uses is exactly the same as the official Nike+ widget for Mac and Yahoo Widget Engine. It sends your username and password via a GET request on an https connection using CURL.

    I’d be more worried that there was a “man in the middle” attack going on at my home computer than from my webhost to Nike’s servers. I’d venture to say that hunderds of thousands, if not millions of passwords are transmitted in the clear every day. Things like FTP are completely unencrypted and those passwords are out ther for anyone to see, yet huge corporations still use the protocol.

    As far as errors, what are they? Perhaps i can help. Are the permissions on your directories writeable for the cache directory?


Leave a comment

(required)