Skip to content

Commit

Permalink
Updated instructions and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfoell committed Sep 29, 2017
1 parent 080b592 commit 78443d5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 37 deletions.
6 changes: 3 additions & 3 deletions lib/LatestMapWidget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public function __construct() {
parent::__construct(
false,
__( 'Strava Latest Map', 'wp-strava' ), // Name
array( 'description' => __( 'Strava latest ride using static google map image', 'wp-strava' ) ) // Args.
array( 'description' => __( 'Strava latest activity using static google map image', 'wp-strava' ) ) // Args.
);
}

public function form( $instance ) {
// outputs the options form on admin
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Latest Activity', 'wp-strava' );
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Latest Activity Map', 'wp-strava' );
$all_tokens = WPStrava::get_instance()->settings->get_all_tokens();
$athlete_token = isset( $instance['athlete_token'] ) ? esc_attr( $instance['athlete_token'] ) : WPStrava::get_instance()->settings->get_default_token();
$distance_min = isset( $instance['distance_min'] ) ? esc_attr( $instance['distance_min'] ) : '';
Expand Down Expand Up @@ -62,7 +62,7 @@ public function update( $new_instance, $old_instance ) {
public function widget( $args, $instance ) {
extract( $args );

$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Latest Activity', 'wp-strava' ) : $instance['title'] );
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Latest Activity Map', 'wp-strava' ) : $instance['title'] );
$athlete_token = isset( $instance['athlete_token'] ) ? $instance['athlete_token'] : WPStrava::get_instance()->settings->get_default_token();
$distance_min = $instance['distance_min'];
$strava_club_id = empty( $instance['strava_club_id'] ) ? null : $instance['strava_club_id'];
Expand Down
6 changes: 3 additions & 3 deletions lib/LatestRidesWidget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget {

public function __construct() {
$widget_ops = array( 'classname' => 'LatestRidesWidget', 'description' => __( 'Will publish your latest rides activity from strava.com.', 'wp-strava' ) );
parent::__construct( 'wp-strava', $name = __( 'Strava Latest Rides', 'wp-strava' ), $widget_ops );
parent::__construct( 'wp-strava', $name = __( 'Strava Latest Activity List', 'wp-strava' ), $widget_ops );
add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue' ) );
}

Expand All @@ -22,7 +22,7 @@ public function widget( $args, $instance ) {
extract( $args );

//$widget_id = $args['widget_id'];
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Rides', 'wp-strava' ) : $instance['title'] );
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Activity', 'wp-strava' ) : $instance['title'] );
$athlete_token = isset( $instance['athlete_token'] ) ? $instance['athlete_token'] : WPStrava::get_instance()->settings->get_default_token();
$strava_club_id = empty( $instance['strava_club_id'] ) ? '' : $instance['strava_club_id'];
$quantity = empty( $instance['quantity'] ) ? '5' : $instance['quantity'];
Expand All @@ -48,7 +48,7 @@ public function update( $new_instance, $old_instance ) {

/** @see WP_Widget::form */
public function form( $instance ) {
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Rides', 'wp-strava' );
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : __( 'Activity', 'wp-strava' );
$all_tokens = WPStrava::get_instance()->settings->get_all_tokens();
$athlete_token = isset( $instance['athlete_token'] ) ? esc_attr( $instance['athlete_token'] ) : WPStrava::get_instance()->settings->get_default_token();
$strava_club_id = isset( $instance['strava_club_id'] ) ? esc_attr( $instance['strava_club_id'] ) : '';
Expand Down
22 changes: 17 additions & 5 deletions lib/Settings.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function register_strava_settings() {
public function print_api_instructions() {
$signup_url = 'http://www.strava.com/developers';
$settings_url = 'https://www.strava.com/settings/api';
$icon_url = 'https://plugins.svn.wordpress.org/wp-strava/assets/icon-128x128.png';
$blog_name = get_bloginfo( 'name' );
$app_name = sprintf( esc_html( '%s Strava', 'wp-strava' ), $blog_name );
$site_url = site_url();
Expand All @@ -146,15 +147,26 @@ public function print_api_instructions() {
<ol>
<li>Create your free API Application/Connection here: <a href='%1\$s' target='_blank'>%2\$s</a> using the following information:</li>
<ul>
<li>Application Name: <strong>%3\$s</strong></li>
<li>Website: <strong>%4\$s</strong></li>
<li>Application Description: <strong>%5\$s</strong></li>
<li>Authorization Callback Domain: <strong>%6\$s</strong></li>
<li>App Icon: <strong>upload <a href='%3\$s' target='_blank'>this image</a></strong></li>
<li>Application Name: <strong>%4\$s</strong></li>
<li>Category: OK to leave at default 'other'</li>
<li>Club: OK to leave blank</li>
<li>Website: <strong>%5\$s</strong></li>
<li>Application Description: <strong>%6\$s</strong></li>
<li>Authorization Callback Domain: <strong>%7\$s</strong></li>
</ul>
<li>Once you've created your API Application at strava.com, enter the <strong>Client ID</strong> and <strong>Client Secret</strong> below, which can now be found on that same strava API Settings page.
<li>After saving your Client ID and Secret, you'll be redirected to strava to authorize your API Application. If successful, your Strava Token will display instead of Client ID and Client Secret.</li>
<li>If you need to re-authorize your API Application, erase your Strava Token here and click 'Save Changes' to start over.</li>
</ol>", 'wp-strava' ), $settings_url, $settings_url, $app_name, $site_url, $description, $site_url );
</ol>", 'wp-strava' ),
$settings_url,
$settings_url,
$icon_url,
$app_name,
$site_url,
$description,
wp_parse_url( $site_url, PHP_URL_HOST )
);
}

public function print_gmaps_instructions() {
Expand Down
55 changes: 29 additions & 26 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,55 @@ Show your Strava activity on your WordPress site.

== Description ==

This plugin uses the Strava V3 API to embed maps and activity for
athletes and clubs on your WordPress site. Included are several
widgets and shortcodes for showing maps and activity summaries.
This plugin uses the Strava API to embed maps and activity for athletes and clubs on your WordPress site. Included are several widgets and shortcodes for showing maps and activity summaries.

= Shortcodes =

[activity id=NUMBER] - add to any page or post. Also takes the following
optional parameters:
[activity id=NUMBER] - add to any page or post. Shows a summary of the activity plus a map if a google maps key has been added.

* som - english/metric (system of measure - override from default setting)
* map_width - width (width of image in pixels)
* map_height - height (height of image in pixels)
Also takes the following optional parameters:

* som - english/metric (system of measure - override from default setting).
* map_width - width (width of image in pixels).
* map_height - height (height of image in pixels).
* athlete_token - specify a different athlete (you can copy this value from https://www.strava.com/settings/api or the wp-strava settings page at /wp-admin/options-general.php?page=wp-strava-options).

[ride] is an alias for [activity] and will accept the same parameters (kept for backwards compatibility).

= Widgets =

Strava Latest Rides - shows a list of the last few activities
Strava Latest Activity List - shows a list of the last few activities.

Strava Latest Map - shows map of latest activity with option to limit
latest map to activities of a certain minimum distance
Strava Latest Map - shows map of latest activity with option to limit latest map to activities of a certain minimum distance.

== Changelog ==

= 1.2.0 =
Added multi-athlete configuration
Added multi-athlete configuration.
Additional transitions from Ride -> Activity.
Updated setup instructions to reflect latest Strava API set up process.

= 1.1.1 =
Changes to better support translations through https://translate.wordpress.org
Cleaned up formatting
Changes to better support translations through https://translate.wordpress.org.
Cleaned up formatting.

= 1.1 =
Added [activity] shortcode to deprecate [ride] in the future
Fixed static method call error in shortcode
Added title to Strava Latest Map Widget
Added Lance Willett to contributors
Added target="_blank" to widget hrefs
Added Google Maps Key to settings (required for map images)
Added cache clear option to remove transient & image data
Cleaned up formatting
Added [activity] shortcode to deprecate [ride] in the future.
Fixed static method call error in shortcode.
Added title to Strava Latest Map Widget.
Added Lance Willett to contributors.
Added target="_blank" to widget hrefs.
Added Google Maps Key to settings (required for map images).
Added cache clear option to remove transient & image data.
Cleaned up formatting.

= 1.0 =
Change to Strava API V3
Switch ride shortcode to use static map
Change to Strava API V3.
Switch ride shortcode to use static map.

= 0.70 =
Use WordPress HTTP API for all remote calls
Use WordPress Settings API for settings page
Use WordPress HTTP API for all remote calls.
Use WordPress Settings API for settings page.

= 0.62 =
Refactor some code.
Expand Down

0 comments on commit 78443d5

Please sign in to comment.