From 78443d5ea9c1c0da82a07df39865bacba0c56da9 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 29 Sep 2017 11:25:22 -0500 Subject: [PATCH] Updated instructions and changelog --- lib/LatestMapWidget.class.php | 6 ++-- lib/LatestRidesWidget.class.php | 6 ++-- lib/Settings.class.php | 22 ++++++++++--- readme.txt | 55 +++++++++++++++++---------------- 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/lib/LatestMapWidget.class.php b/lib/LatestMapWidget.class.php index 2ccb33b..bb4234f 100644 --- a/lib/LatestMapWidget.class.php +++ b/lib/LatestMapWidget.class.php @@ -10,13 +10,13 @@ class WPStrava_LatestMapWidget extends WP_Widget { 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'] ) : ''; @@ -62,7 +62,7 @@ class WPStrava_LatestMapWidget extends WP_Widget { 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']; diff --git a/lib/LatestRidesWidget.class.php b/lib/LatestRidesWidget.class.php index 32f95e0..2a3174f 100644 --- a/lib/LatestRidesWidget.class.php +++ b/lib/LatestRidesWidget.class.php @@ -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' ) ); } @@ -22,7 +22,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget { 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']; @@ -48,7 +48,7 @@ class WPStrava_LatestRidesWidget extends WP_Widget { /** @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'] ) : ''; diff --git a/lib/Settings.class.php b/lib/Settings.class.php index c311c89..71e9a2e 100644 --- a/lib/Settings.class.php +++ b/lib/Settings.class.php @@ -138,6 +138,7 @@ class WPStrava_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(); @@ -146,15 +147,26 @@ class WPStrava_Settings {
  1. Create your free API Application/Connection here: %2\$s using the following information:
  2. Once you've created your API Application at strava.com, enter the Client ID and Client Secret below, which can now be found on that same strava API Settings page.
  3. 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.
  4. If you need to re-authorize your API Application, erase your Strava Token here and click 'Save Changes' to start over.
  5. -
", 'wp-strava' ), $settings_url, $settings_url, $app_name, $site_url, $description, $site_url ); + ", '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() { diff --git a/readme.txt b/readme.txt index 1e330ed..724c062 100755 --- a/readme.txt +++ b/readme.txt @@ -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.