WP Strava

This plugin will help you to display information from your Strava account, Strava is an excellent site for cyclist to track your performance, the plugin is divided in three pieces:

  • A widget to get the latest rides of any athlete or club.
  • A short code “ride” to allow you to display more information about a specific ride and a map with the trace of the ride. NOTE: The Strava API states that the tokens they provide do not expire, but they indeed expire so the shorcode functionality to display the map will stop working after your token expire, the only workaround is to login into your admin pages and enter your password again to generate a new token.
  • Last a small configuration page to obtain your Strava token to allow you to pull details of your rides.

Requirements

  • This plugin is written completely in objects, so it needs that you run your wordpress installation on PHP 5.3+.
  • I’ve tested this plugin with the latest wordpress 3.1+, please report any issue.
  • For this plugin to work, you need to have fun riding and use the excellent Strava service.

Installation

1. Download latest plugin version and unzipped it into your wordpress plugins folder.
2. Access to your Settings -> WP Strava page and put your Strava email and password (your password won’t be saved and will be sent to Strava using https) to get your token.
3. Configure your widget settings accessing Appearance -> Widgets (the widget name is Strava Latest Rides).
4. Use the “ride” shortcode on any post or page.

Changelog

wp-strava-0.61

  • Added configurations for metric/english system both on the widget and the shortcode options, for the shortcode use the option som=”english”.

wp-strava-0.6

  • Initial Release

Configuration

The “ride” shortcode accept four arguments:

  • id: required. It is the ride identifier.
  • map_width: optional. This is the with of the map that will be shown in the post or page, and basically is a css property so, it accept any css with value, default value is “100%”.
  • map_height: optional. This is the height of the map that will be shown in the post or page, and basically is a css property so, it accept any css height value, default value is “400px”.
  • threshold: optional. It’s a parameter to the Strava API to discard “uninteresting” points in the map in the “threshold” value in meters, default value is “0″.

If you would like to customize the way the html output work, you need to edit the css file included in the plugin main directory css/wp-strava.css.

Shortcode Examples

Simple:

[ride id=912928]

With all options:

[ride id=912928 map_width="500px" map_height="200px" threshold="15"]

Screenshots

The admin page.

The shortcode result.

The widget configuration.

The widget result.

To do

  • The plugin is prepared for multilingual support, just need to create and include the .po file to add more translations, now works just in english.

You can contact me for any issues with the plugin. Have fun riding!