From 4f66886832f6b20ef0fc5feca3588dac1f649e51 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 1 Feb 2019 11:59:00 -0600 Subject: [PATCH 1/5] Added image_only flag to [activity] shortcode --- css/wp-strava.css | 3 -- lib/WPStrava/ActivityShortcode.php | 85 +++++++++++++++++------------- lib/WPStrava/RouteShortcode.php | 7 ++- readme.txt | 8 ++- wp-strava.php | 2 +- 5 files changed, 62 insertions(+), 43 deletions(-) diff --git a/css/wp-strava.css b/css/wp-strava.css index 4331325..03574ac 100755 --- a/css/wp-strava.css +++ b/css/wp-strava.css @@ -32,6 +32,3 @@ .activity-details-table-units { font-size: 0.8em; } -.wp-strava-activity-container img { - max-width: none; -} diff --git a/lib/WPStrava/ActivityShortcode.php b/lib/WPStrava/ActivityShortcode.php index 7044b15..3b694de 100644 --- a/lib/WPStrava/ActivityShortcode.php +++ b/lib/WPStrava/ActivityShortcode.php @@ -53,9 +53,16 @@ class WPStrava_ActivityShortcode { 'map_height' => '320', 'athlete_token' => WPStrava::get_instance()->settings->get_default_token(), 'markers' => false, + 'image_only' => false, ); - $atts = shortcode_atts( $defaults, $atts ); + $atts = shortcode_atts( $defaults, $atts, 'activity' ); + + /* Make sure boolean values are actually boolean + * @see https://wordpress.stackexchange.com/a/119299 + */ + $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN ); + $atts['image_only'] = filter_var( $atts['image_only'], FILTER_VALIDATE_BOOLEAN ); $strava_som = WPStrava_SOM::get_som( $atts['som'] ); $activity = WPStrava::get_instance()->activity; @@ -74,42 +81,46 @@ class WPStrava_ActivityShortcode { $map_height = str_replace( 'px', '', $map_height ); if ( $activity_details ) { - return ' -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' . __( 'Elapsed Time', 'wp-strava' ) . '' . __( 'Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Average Speed', 'wp-strava' ) . '' . __( 'Max Speed', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $activity_details->elapsed_time ) . '' . $strava_som->time( $activity_details->moving_time ) . '' . $strava_som->distance( $activity_details->distance ) . '' . $strava_som->speed( $activity_details->average_speed ) . '' . $strava_som->speed( $activity_details->max_speed ) . '' . $strava_som->elevation( $activity_details->total_elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_speed_label() . '' . $strava_som->get_speed_label() . '' . $strava_som->get_elevation_label() . '
- ' . - WPStrava_StaticMap::get_image_tag( $activity_details, $map_height, $map_width, $atts['markers'] ) . - ' -
'; + $activity_output = '
'; + if ( ! $atts['image_only'] ) { + $activity_output .= ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
' . __( 'Elapsed Time', 'wp-strava' ) . '' . __( 'Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Average Speed', 'wp-strava' ) . '' . __( 'Max Speed', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $activity_details->elapsed_time ) . '' . $strava_som->time( $activity_details->moving_time ) . '' . $strava_som->distance( $activity_details->distance ) . '' . $strava_som->speed( $activity_details->average_speed ) . '' . $strava_som->speed( $activity_details->max_speed ) . '' . $strava_som->elevation( $activity_details->total_elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_speed_label() . '' . $strava_som->get_speed_label() . '' . $strava_som->get_elevation_label() . '
+ '; + } + $activity_output .= '' . + WPStrava_StaticMap::get_image_tag( $activity_details, $map_height, $map_width, $atts['markers'] ) . + ' +
'; + return $activity_output; } // End if( $activity_details ). } diff --git a/lib/WPStrava/RouteShortcode.php b/lib/WPStrava/RouteShortcode.php index d30be37..99a7981 100644 --- a/lib/WPStrava/RouteShortcode.php +++ b/lib/WPStrava/RouteShortcode.php @@ -55,7 +55,12 @@ class WPStrava_RouteShortcode { 'markers' => false, ); - $atts = shortcode_atts( $defaults, $atts ); + $atts = shortcode_atts( $defaults, $atts, 'route' ); + + /* Make sure boolean values are actually boolean + * @see https://wordpress.stackexchange.com/a/119299 + */ + $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN ); $strava_som = WPStrava_SOM::get_som( $atts['som'] ); $route = WPStrava::get_instance()->routes; diff --git a/readme.txt b/readme.txt index 8297f50..6567157 100755 --- a/readme.txt +++ b/readme.txt @@ -72,12 +72,18 @@ WP-Strava caches activity for one hour so your site doesn't hit the Strava API o 6. Activity Shortcode - Shows a map of activity with some statistics. 7. Activity Shortcode Settings - An example activity shortcode. The athlete_token parameter is only needed if your site is connected to multiple athlete accounts. 8. Route Shortcode - Shows a map of a route. -9. Route Shortcode Settings - An example route shortcode. Add markers=true to show green/red start stop points. +9. Route Shortcode Settings - An example route shortcode. Add markers=true to show green/red start/stop points. 10. Activities Shortcode - Shows latest athlete activity in a page or post. 11. Activities Shortcode Settings - An example activities shortcode. The athlete_token parameter is only needed if your site is connected to multiple athlete accounts. == Changelog == += 1.6.1 = + +Added 'image_only' attribute to [activity] shortcode to optionally remove data table. +Added boolean filtering to shortcodes to prevent false-positive "truthiness" to a shortcode attribute like markers="false". +Removed 'max-width: none' from activity image to make it responsive. + = 1.6.0 = Added class autoloader (removed composer autoloader). diff --git a/wp-strava.php b/wp-strava.php index 2cae3e8..e2e4aed 100755 --- a/wp-strava.php +++ b/wp-strava.php @@ -3,7 +3,7 @@ * Plugin Name: WP Strava * Plugin URI: https://wordpress.org/plugins/wp-strava/ * Description: Show your strava.com activity on your WordPress site. Some Icons are Copyright © Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 license. - * Version: 1.6.0 + * Version: 1.6.1 * Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott * License: GPL2 * Text Domain: wp-strava From 7298a73671a0b392f67736b51c5709f3031c39c9 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 1 Feb 2019 13:19:47 -0600 Subject: [PATCH 2/5] Moved activity table into separate method --- lib/WPStrava/ActivityShortcode.php | 139 ++++++++++++++++------------- 1 file changed, 76 insertions(+), 63 deletions(-) diff --git a/lib/WPStrava/ActivityShortcode.php b/lib/WPStrava/ActivityShortcode.php index 0c09a26..8e450e4 100644 --- a/lib/WPStrava/ActivityShortcode.php +++ b/lib/WPStrava/ActivityShortcode.php @@ -64,7 +64,6 @@ class WPStrava_ActivityShortcode { $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN ); $atts['image_only'] = filter_var( $atts['image_only'], FILTER_VALIDATE_BOOLEAN ); - $strava_som = WPStrava_SOM::get_som( $atts['som'] ); $activity = WPStrava::get_instance()->activity; $activity_details = null; @@ -83,68 +82,7 @@ class WPStrava_ActivityShortcode { if ( $activity_details ) { $activity_output = '
'; if ( ! $atts['image_only'] ) { - - $strava_activitytype = WPStrava_ActivityType::get_type_group( $activity_details->type ); - $avg_speed = ''; - $max_speed = ''; - $speed_label = ''; - $avg_title = '' . __( 'Average Speed', 'wp-strava' ) . ''; - $max_title = '' . __( 'Max Speed', 'wp-strava' ) . ''; - - switch ( $strava_activitytype ) { - case WPStrava_ActivityType::TYPE_GROUP_PACE: - $avg_speed = '' . $strava_som->pace( $activity_details->average_speed ) . ''; - $max_speed = '' . $strava_som->pace( $activity_details->max_speed ) . ''; - $speed_label = '' . $strava_som->get_pace_label() . ''; - break; - case WPStrava_ActivityType::TYPE_GROUP_SPEED: - $avg_speed = '' . $strava_som->speed( $activity_details->average_speed ) . ''; - $max_speed = '' . $strava_som->speed( $activity_details->max_speed ) . ''; - $speed_label = '' . $strava_som->get_speed_label() . ''; - break; - case WPStrava_ActivityType::TYPE_GROUP_PACE: - $avg_speed = '' . $strava_som->swimpace( $activity_details->average_speed ) . ''; - $max_speed = '' . $strava_som->swimpace( $activity_details->max_speed ) . ''; - $speed_label = '' . $strava_som->get_swimpace_label() . ''; - break; - default: - $avg_title = ''; - $max_title = ''; - break; - } - - $activity_output .= ' - - - - - - - ' . $avg_title . ' - ' . $max_title . ' - - - - - - - - - ' . $avg_speed . ' - ' . $max_speed . ' - - - - - - - ' . $speed_label . ' - ' . $speed_label . ' - - - -
' . __( 'Elapsed Time', 'wp-strava' ) . '' . __( 'Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $activity_details->elapsed_time ) . '' . $strava_som->time( $activity_details->moving_time ) . '' . $strava_som->distance( $activity_details->distance ) . '' . $strava_som->elevation( $activity_details->total_elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_elevation_label() . '
- '; + $activity_output .= $this->get_table( $activity_details, $atts['som'] ); } $activity_output .= '' . WPStrava_StaticMap::get_image_tag( $activity_details, $map_height, $map_width, $atts['markers'] ) . @@ -154,6 +92,81 @@ class WPStrava_ActivityShortcode { } // End if( $activity_details ). } + /** + * The the activity details in in HTML table. + * + * @param string $activity_details Activity details from the activity class. + * @param string $som System of measure (english/metric). + * @return string HTML Table of activity details. + * @author Justin Foell + * @author Sebastian Erb + * @since NEXT + */ + private function get_table( $activity_details, $som ) { + $strava_som = WPStrava_SOM::get_som( $som ); + $strava_activitytype = WPStrava_ActivityType::get_type_group( $activity_details->type ); + $avg_speed = ''; + $max_speed = ''; + $speed_label = ''; + $avg_title = '' . __( 'Average Speed', 'wp-strava' ) . ''; + $max_title = '' . __( 'Max Speed', 'wp-strava' ) . ''; + + switch ( $strava_activitytype ) { + case WPStrava_ActivityType::TYPE_GROUP_PACE: + $avg_speed = '' . $strava_som->pace( $activity_details->average_speed ) . ''; + $max_speed = '' . $strava_som->pace( $activity_details->max_speed ) . ''; + $speed_label = '' . $strava_som->get_pace_label() . ''; + break; + case WPStrava_ActivityType::TYPE_GROUP_SPEED: + $avg_speed = '' . $strava_som->speed( $activity_details->average_speed ) . ''; + $max_speed = '' . $strava_som->speed( $activity_details->max_speed ) . ''; + $speed_label = '' . $strava_som->get_speed_label() . ''; + break; + case WPStrava_ActivityType::TYPE_GROUP_PACE: + $avg_speed = '' . $strava_som->swimpace( $activity_details->average_speed ) . ''; + $max_speed = '' . $strava_som->swimpace( $activity_details->max_speed ) . ''; + $speed_label = '' . $strava_som->get_swimpace_label() . ''; + break; + default: + $avg_title = ''; + $max_title = ''; + break; + } + + return ' + + + + + + + ' . $avg_title . ' + ' . $max_title . ' + + + + + + + + + ' . $avg_speed . ' + ' . $max_speed . ' + + + + + + + ' . $speed_label . ' + ' . $speed_label . ' + + + +
' . __( 'Elapsed Time', 'wp-strava' ) . '' . __( 'Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $activity_details->elapsed_time ) . '' . $strava_som->time( $activity_details->moving_time ) . '' . $strava_som->distance( $activity_details->distance ) . '' . $strava_som->elevation( $activity_details->total_elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_elevation_label() . '
+ '; + } + /** * Enqueue style if shortcode is being used. * From 629d8c3c59dc6f4c5b71ef2c8771ead786a8321d Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 1 Feb 2019 14:16:28 -0600 Subject: [PATCH 3/5] Add image_only flag to [route] shortcode; Refine table addition --- lib/WPStrava/ActivityShortcode.php | 18 ++++--- lib/WPStrava/RouteShortcode.php | 85 +++++++++++++++++++----------- 2 files changed, 63 insertions(+), 40 deletions(-) diff --git a/lib/WPStrava/ActivityShortcode.php b/lib/WPStrava/ActivityShortcode.php index 8e450e4..bb29188 100644 --- a/lib/WPStrava/ActivityShortcode.php +++ b/lib/WPStrava/ActivityShortcode.php @@ -73,23 +73,25 @@ class WPStrava_ActivityShortcode { return $e->to_html(); } - //sanitize width & height - $map_width = str_replace( '%', '', $atts['map_width'] ); - $map_height = str_replace( '%', '', $atts['map_height'] ); - $map_width = str_replace( 'px', '', $map_width ); - $map_height = str_replace( 'px', '', $map_height ); - + $activity_output = ''; if ( $activity_details ) { - $activity_output = '
'; + $activity_output .= ''; - return $activity_output; } // End if( $activity_details ). + return $activity_output; } /** diff --git a/lib/WPStrava/RouteShortcode.php b/lib/WPStrava/RouteShortcode.php index 3230699..68e3423 100644 --- a/lib/WPStrava/RouteShortcode.php +++ b/lib/WPStrava/RouteShortcode.php @@ -53,6 +53,7 @@ class WPStrava_RouteShortcode { 'map_height' => '320', 'athlete_token' => WPStrava::get_instance()->settings->get_default_token(), 'markers' => false, + 'image_only' => false, ); $atts = shortcode_atts( $defaults, $atts, 'route' ); @@ -60,9 +61,9 @@ class WPStrava_RouteShortcode { /* Make sure boolean values are actually boolean * @see https://wordpress.stackexchange.com/a/119299 */ - $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN ); + $atts['markers'] = filter_var( $atts['markers'], FILTER_VALIDATE_BOOLEAN ); + $atts['image_only'] = filter_var( $atts['image_only'], FILTER_VALIDATE_BOOLEAN ); - $strava_som = WPStrava_SOM::get_som( $atts['som'] ); $route = WPStrava::get_instance()->routes; $route_details = null; @@ -72,41 +73,61 @@ class WPStrava_RouteShortcode { return $e->to_html(); } - // Sanitize width & height. - $map_width = str_replace( '%', '', $atts['map_width'] ); - $map_height = str_replace( '%', '', $atts['map_height'] ); - $map_width = str_replace( 'px', '', $map_width ); - $map_height = str_replace( 'px', '', $map_height ); - + $route_output = ''; if ( $route_details ) { - return ' -
- - - - - - - - - - - - - - - - - - - - -
' . __( 'Est. Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $route_details->estimated_moving_time ) . '' . $strava_som->distance( $route_details->distance ) . '' . $strava_som->elevation( $route_details->elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_elevation_label() . '
- ' . + $route_output = ''; } // End if( $route_details ). + return $route_output; + } + + /** + * The the route details in in HTML table. + * + * @param string $route_details route details from the route class. + * @param string $som System of measure (english/metric). + * @return string HTML Table of route details. + * @author Justin Foell + * @since NEXT + */ + private function get_table( $route_details, $som ) { + $strava_som = WPStrava_SOM::get_som( $som ); + return ' + + + + + + + + + + + + + + + + + + + + +
' . __( 'Est. Moving Time', 'wp-strava' ) . '' . __( 'Distance', 'wp-strava' ) . '' . __( 'Elevation Gain', 'wp-strava' ) . '
' . $strava_som->time( $route_details->estimated_moving_time ) . '' . $strava_som->distance( $route_details->distance ) . '' . $strava_som->elevation( $route_details->elevation_gain ) . '
' . $strava_som->get_time_label() . '' . $strava_som->get_distance_label() . '' . $strava_som->get_elevation_label() . '
+ '; } /** From 9813dc2aec5424ea6d6f42a466b98850f67da628 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 1 Feb 2019 14:17:22 -0600 Subject: [PATCH 4/5] Add missing documentation --- lib/WPStrava/Activity.php | 9 ++++----- lib/WPStrava/ActivityType.php | 2 +- lib/WPStrava/Exception.php | 26 ++++++++++++++++++++++++-- lib/WPStrava/LatestMapWidget.php | 14 +++++--------- lib/WPStrava/SOM.php | 2 +- lib/WPStrava/Settings.php | 12 ++++++------ 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/lib/WPStrava/Activity.php b/lib/WPStrava/Activity.php index 68769e0..9572dc3 100755 --- a/lib/WPStrava/Activity.php +++ b/lib/WPStrava/Activity.php @@ -13,7 +13,7 @@ class WPStrava_Activity { * @param string $athlete_token Token of athlete to retrieve for * @param int $activity_id ID of activity to retrieve. * @return object stdClass representing this activity. - * @author Justin Foell + * @author Justin Foell */ public function get_activity( $athlete_token, $activity_id ) { return WPStrava::get_instance()->get_api( $athlete_token )->get( "activities/{$activity_id}" ); @@ -22,8 +22,7 @@ class WPStrava_Activity { /** * Get activity list from Strava API. * - * @author Justin Foell - * + * @author Justin Foell * @param string $athlete_token Token of athlete to retrieve for * @param int $club_id Club ID of all club riders (optional). * @param int|null $quantity Number of records to retrieve (optional). @@ -52,12 +51,12 @@ class WPStrava_Activity { } /** - * Undocumented function + * Get activities with a distance longer than specified length. * * @param array $activities * @param float $dist Distance in default system of measure (km/mi). * @return void - * @author Justin Foell + * @author Justin Foell */ public function get_activities_longer_than( $activities, $dist ) { $som = WPStrava_SOM::get_som(); diff --git a/lib/WPStrava/ActivityType.php b/lib/WPStrava/ActivityType.php index c404b15..40ead7d 100644 --- a/lib/WPStrava/ActivityType.php +++ b/lib/WPStrava/ActivityType.php @@ -61,7 +61,7 @@ class WPStrava_ActivityType { * * @param string $type Type provided by Strava. * @return string Type group (water/pace/speed/other). - * @author @author Sebastian Erb + * @author Sebastian Erb * @since NEXT */ public static function get_type_group( $type ) { diff --git a/lib/WPStrava/Exception.php b/lib/WPStrava/Exception.php index b7e9afa..325c4e4 100644 --- a/lib/WPStrava/Exception.php +++ b/lib/WPStrava/Exception.php @@ -38,18 +38,32 @@ class WPStrava_Exception extends WPStrava_Abstract_Exception { * * @param WP_Error $error * @return WPStrava_Exception - * @author Justin Foell - * @since + * @author Justin Foell + * @since 1.6.0 */ public static function from_wp_error( WP_Error $error ) { $class = __CLASS__; return new $class( $error->get_error_message( $error->get_error_code() ) ); } + /** + * HTML version of this exception. + * + * @return string The exception string wrapped in
 tags.
+	 * @author Justin Foell 
+	 * @since  1.6.0
+	 */
 	public function to_html() {
 		return '
' . $this . '
'; } + /** + * Magic method to convert this exception to a string. + * + * @return string + * @author Justin Foell + * @since 1.6.0 + */ public function __toString() { if ( WPSTRAVA_DEBUG && $this->getPrevious() ) { return $this->get_formatted_message( $this->getPrevious() ); @@ -58,6 +72,14 @@ class WPStrava_Exception extends WPStrava_Abstract_Exception { return $this->get_formatted_message( $this ); } + /** + * Exception message with extra formatting. + * + * @param Exception $exception + * @return string Formatted exception message. + * @author Justin Foell + * @since 1.6.0 + */ public function get_formatted_message( $exception ) { $code = $exception->getCode(); diff --git a/lib/WPStrava/LatestMapWidget.php b/lib/WPStrava/LatestMapWidget.php index 0ca26f7..1eef15d 100644 --- a/lib/WPStrava/LatestMapWidget.php +++ b/lib/WPStrava/LatestMapWidget.php @@ -96,7 +96,7 @@ class WPStrava_LatestMapWidget extends WP_Widget { try { $activities = $strava_activity->get_activities( $athlete_token, $strava_club_id ); - } catch( WPStrava_Exception $e ) { + } catch ( WPStrava_Exception $e ) { echo $e->to_html(); } @@ -136,8 +136,7 @@ class WPStrava_LatestMapWidget extends WP_Widget { /** * Get image for specific activity using Static Maps class. * - * @author Justin Foell - * + * @author Justin Foell * @param string $id Athlete Token or Club ID. * @param object $activity Activity to get image for. * @param boolean $build_new Whether to refresh the image from cache. @@ -157,9 +156,8 @@ class WPStrava_LatestMapWidget extends WP_Widget { /** * Update map in option to cache. * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 - * * @param string $id Athlete Token or Club ID. * @param string $img Image tag. */ @@ -170,9 +168,8 @@ class WPStrava_LatestMapWidget extends WP_Widget { /** * Update activity in option to cache. * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 - * * @param string $id Athlete Token or Club ID. * @param object $activity stdClass Strava activity object. */ @@ -183,9 +180,8 @@ class WPStrava_LatestMapWidget extends WP_Widget { /** * Update activity in transient to cache. * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 - * * @param string $id Athlete Token or Club ID. * @param object $activity stdClass Strava activity object. */ diff --git a/lib/WPStrava/SOM.php b/lib/WPStrava/SOM.php index e47a605..7730606 100644 --- a/lib/WPStrava/SOM.php +++ b/lib/WPStrava/SOM.php @@ -8,7 +8,7 @@ abstract class WPStrava_SOM { * * @param string $som 'english' or 'metric' * @return WPStrava_SOM Instance of SOM - * @author Justin Foell + * @author Justin Foell */ public static function get_som( $som = null ) { $som = $som ? $som : WPStrava::get_instance()->settings->som; diff --git a/lib/WPStrava/Settings.php b/lib/WPStrava/Settings.php index 38c2c76..e6acd32 100644 --- a/lib/WPStrava/Settings.php +++ b/lib/WPStrava/Settings.php @@ -357,7 +357,7 @@ class WPStrava_Settings { * Gets all saved strava tokens as an array. * * @return array - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 */ public function get_tokens() { @@ -379,7 +379,7 @@ class WPStrava_Settings { * Returns first (default) token saved. * * @return string|null - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 */ public function get_default_token() { @@ -391,7 +391,7 @@ class WPStrava_Settings { * Get all tokens and their nicknames in one array. * * @return void - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 */ public function get_all_tokens() { @@ -413,7 +413,7 @@ class WPStrava_Settings { /** * Returns default nickname 'Default' / 'Athlete n'. * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 * * @param integer $number Athlete number (default 1). @@ -427,7 +427,7 @@ class WPStrava_Settings { /** * Checks for valid tokens. * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 * * @param string|array Single token or array of tokens. @@ -454,7 +454,7 @@ class WPStrava_Settings { * * @param string $token * - * @author Justin Foell + * @author Justin Foell * @since 1.2.0 */ public function add_token( $token ) { From 38e15027026fe5e1658e3fee9893c860226f3873 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 1 Feb 2019 14:22:25 -0600 Subject: [PATCH 5/5] Update 1.7.0 functions and readme.txt --- lib/WPStrava/ActivityShortcode.php | 2 +- lib/WPStrava/ActivityType.php | 4 ++-- lib/WPStrava/RouteShortcode.php | 2 +- readme.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/WPStrava/ActivityShortcode.php b/lib/WPStrava/ActivityShortcode.php index bb29188..8b5a459 100644 --- a/lib/WPStrava/ActivityShortcode.php +++ b/lib/WPStrava/ActivityShortcode.php @@ -102,7 +102,7 @@ class WPStrava_ActivityShortcode { * @return string HTML Table of activity details. * @author Justin Foell * @author Sebastian Erb - * @since NEXT + * @since 1.7.0 */ private function get_table( $activity_details, $som ) { $strava_som = WPStrava_SOM::get_som( $som ); diff --git a/lib/WPStrava/ActivityType.php b/lib/WPStrava/ActivityType.php index 40ead7d..7ef74e3 100644 --- a/lib/WPStrava/ActivityType.php +++ b/lib/WPStrava/ActivityType.php @@ -8,7 +8,7 @@ * ActivityType class. * * @author Sebastian Erb - * @since NEXT + * @since 1.7.0 */ class WPStrava_ActivityType { @@ -62,7 +62,7 @@ class WPStrava_ActivityType { * @param string $type Type provided by Strava. * @return string Type group (water/pace/speed/other). * @author Sebastian Erb - * @since NEXT + * @since 1.7.0 */ public static function get_type_group( $type ) { diff --git a/lib/WPStrava/RouteShortcode.php b/lib/WPStrava/RouteShortcode.php index 68e3423..a0a9a51 100644 --- a/lib/WPStrava/RouteShortcode.php +++ b/lib/WPStrava/RouteShortcode.php @@ -101,7 +101,7 @@ class WPStrava_RouteShortcode { * @param string $som System of measure (english/metric). * @return string HTML Table of route details. * @author Justin Foell - * @since NEXT + * @since 1.7.0 */ private function get_table( $route_details, $som ) { $strava_som = WPStrava_SOM::get_som( $som ); diff --git a/readme.txt b/readme.txt index ee26bd1..e5fe38e 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, gps, shortcode, widget, plugin Requires at least: 4.6 Tested up to: 5.0 -Stable tag: 1.6.0 +Stable tag: 1.7.0 Requires PHP: 5.2 License: GPLv2 or later