diff --git a/lib/WPStrava/RouteShortcode.php b/lib/WPStrava/RouteShortcode.php index d30be37..a14ab49 100644 --- a/lib/WPStrava/RouteShortcode.php +++ b/lib/WPStrava/RouteShortcode.php @@ -63,7 +63,7 @@ class WPStrava_RouteShortcode { try { $route_details = $route->get_route( $atts['id'] ); - } catch( WPStrava_Exception $e ) { + } catch ( WPStrava_Exception $e ) { return $e->to_html(); } diff --git a/lib/WPStrava/SOM.php b/lib/WPStrava/SOM.php index 168a9bf..e47a605 100644 --- a/lib/WPStrava/SOM.php +++ b/lib/WPStrava/SOM.php @@ -28,8 +28,6 @@ abstract class WPStrava_SOM { abstract public function get_elevation_label(); abstract public function pace( $mps ); abstract public function get_pace_label(); - abstract public function swimpace( $mps ); - abstract public function get_swimpace_label(); public function time( $seconds ) { return date( 'H:i:s', mktime( 0, 0, $seconds ) ); @@ -38,4 +36,27 @@ abstract class WPStrava_SOM { public function get_time_label() { return __( 'hours', 'wp-strava' ); } + + /** + * Abbreviated label for this system of measure's pace - Minutes Per 100 Meters: min/100m. Same for English/metric. + * + * @return string 'min/100m' + */ + public function get_swimpace_label() { + return __( 'min/100m', 'wp-strava' ); + } + + /** + * Change meters per second to Minutes Per 100 Meters. Same for English/metric. + * + * @param float $mps Meters per second. + * @return float Minutes Per 100 Meters. + */ + public function swimpace( $mps ) { + + $kmh = $mps * 3.6; + $min100m = 60 / $kmh / 10; + + return number_format( $min100m, 2 ); + } } diff --git a/lib/WPStrava/SOMEnglish.php b/lib/WPStrava/SOMEnglish.php index 920ed93..abf6ca1 100644 --- a/lib/WPStrava/SOMEnglish.php +++ b/lib/WPStrava/SOMEnglish.php @@ -56,7 +56,7 @@ class WPStrava_SOMEnglish extends WPStrava_SOM { } /** - * Change meters per second to Minutes Per Mile. + * Change meters per second to minutes per mile. * * @param float $mps Meters per second. * @return float Minutes Per Mile. @@ -86,30 +86,6 @@ class WPStrava_SOMEnglish extends WPStrava_SOM { return __( 'min/mile', 'wp-strava' ); } - /** - * Change meters per second to Minutes Per 100 Meters. - * - * @param float $mps Meters per second. - * @return float Minutes Per 100 Meters. - */ - public function swimpace( $mps ) { - - $kmh = $mps * 3.6; - $min100m = 60 / $kmh / 10; - - return number_format( $min100m, 2 ); - - } - - /** - * Abbreviated label for this system of measure's pace - Minutes Per 100 Meters: min/100m - * - * @return string 'min/100m' - */ - public function get_swimpace_label() { - return __( 'min/100m', 'wp-strava' ); - } - /** * Change meters to feet. * diff --git a/lib/WPStrava/SOMMetric.php b/lib/WPStrava/SOMMetric.php index 559ee7d..7c969df 100644 --- a/lib/WPStrava/SOMMetric.php +++ b/lib/WPStrava/SOMMetric.php @@ -56,7 +56,7 @@ class WPStrava_SOMMetric extends WPStrava_SOM { } /** - * Change meters per second to kilometers per hour. + * Change meters per second to minutes per kilometer. * * @param float $mps Meters per second. * @return float Kilometers per hour. @@ -87,29 +87,6 @@ class WPStrava_SOMMetric extends WPStrava_SOM { return __( 'min/km', 'wp-strava' ); } - /** - * Change meters per second to Minutes Per 100 Meters. - * - * @param float $mps Meters per second. - * @return float Minutes Per 100 Meters. - */ - public function swimpace( $mps ) { - - $kmh = $mps * 3.6; - $min100m = 60 / $kmh / 10; - - return number_format( $min100m, 2 ); - } - - /** - * Abbreviated label for this system of measure's pace - Minutes Per 100 Meters: min/100m - * - * @return string 'min/100m' - */ - public function get_swimpace_label() { - return __( 'min/100m', 'wp-strava' ); - } - /** * Change meters to meters };^) * diff --git a/readme.txt b/readme.txt index 1a30e30..c8c0348 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === WP-Strava === -Contributors: cmanon, jrfoell, lancewillett, dlintott +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: 4.9 +Tested up to: 5.0 Stable tag: 1.6.0 Requires PHP: 5.2 License: GPLv2 or later @@ -80,7 +80,8 @@ WP-Strava caches activity for one hour so your site doesn't hit the Strava API o = NEXT = -Added Pace support (min/km) for Activity Shortcode +Added Sebastian Erb to contributors. +Added Pace support (min/km) and (min/mile) for Activity Shortcode Added Swimpace support (min/100m) for Activity Shortcode = 1.6.0 = @@ -126,7 +127,7 @@ Fix array indices on map widget = 1.4.0 = -Added dlintott to contributors. +Added Daniel Lintott to contributors. Fixed non-existent settings js from being enqueued. Changed all 'ride' styles and functions to 'activity'. Added inline documentation. diff --git a/wp-strava.php b/wp-strava.php index 2cae3e8..103a06c 100755 --- a/wp-strava.php +++ b/wp-strava.php @@ -4,7 +4,7 @@ * 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 - * Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott + * Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott, Sebastian Erb * License: GPL2 * Text Domain: wp-strava * Domain Path: /lang