diff --git a/lib/WPStrava/API.php b/lib/WPStrava/API.php index cd912cb..793204f 100755 --- a/lib/WPStrava/API.php +++ b/lib/WPStrava/API.php @@ -44,8 +44,8 @@ class WPStrava_API { return new WP_Error( 'wp-strava_post', - // Translators: message shown when there's a problem with ab HTTP POST to the Strava API. - sprintf( __( 'ERROR %1$s %2$s - See full error by adding
define( \'WP_STRAVA_DEBUG\', true );
to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ), + // Translators: message shown when there's a problem with an HTTP POST to the Strava API. + sprintf( __( 'ERROR %1$s %2$s - See full error by adding
define( \'WPSTRAVA_DEBUG\', true );
to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ), $error ); } @@ -63,8 +63,11 @@ class WPStrava_API { } $get_args = array( - 'headers' => array(), + 'headers' => array(), + 'sslverify' => false, + 'timeout' => 30, ); + if ( $this->access_token ) { $get_args['headers']['Authorization'] = 'Bearer ' . $this->access_token; } @@ -91,7 +94,7 @@ class WPStrava_API { return new WP_Error( 'wp-strava_get', // Translators: message shown when there's a problem with an HTTP GET to the Strava API. - sprintf( __( 'ERROR %1$s %2$s - See full error by adding
define( \'WP_STRAVA_DEBUG\', true );
to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ), + sprintf( __( 'ERROR %1$s %2$s - See full error by adding
define( \'WPSTRAVA_DEBUG\', true );
to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ), $error ); } diff --git a/lib/WPStrava/LatestMapWidget.php b/lib/WPStrava/LatestMapWidget.php index 794d269..5299a51 100644 --- a/lib/WPStrava/LatestMapWidget.php +++ b/lib/WPStrava/LatestMapWidget.php @@ -91,7 +91,7 @@ class WPStrava_LatestMapWidget extends WP_Widget { if ( is_wp_error( $activities ) ) { echo $args['before_widget']; if ( $title ) { - echo $args['$before_title'] . $title . $args['$after_title']; + echo $args['before_title'] . $title . $args['after_title']; } if ( WPSTRAVA_DEBUG ) { @@ -101,7 +101,7 @@ class WPStrava_LatestMapWidget extends WP_Widget { } else { echo $activities->get_error_message(); } - echo $args['$after_widget']; + echo $args['after_widget']; return; } diff --git a/readme.txt b/readme.txt index 468615e..ef77f74 100755 --- a/readme.txt +++ b/readme.txt @@ -52,7 +52,7 @@ Strava Latest Map - shows map of latest activity with option to limit latest map = Why am I getting "ERROR 401 Unauthorized"? = -When you have multiple athletes saved, the first is considered to be the default athlete. If you use a shortcode to display activity from anyone other than the default athlete, you must add the athlete token (found on the wp-strava settings page) to the shortcode, such as athlete_token=c764a2b199cff281e39f24671760c1b9c9fe005e +When you have multiple athletes saved, the first is considered to be the default athlete. If you use a shortcode to display activity from anyone other than the default athlete, you must add the athlete token (found on the wp-strava settings page) to the shortcode, such as athlete_token=c764a2b199cff281e39f24671760c1b9c9fe005e. If you've recently had to re-authorize with Strava, your athlete token may have changed and will need to be updated in your shortcodes and widgets. For widgets, re-select the athlete you'd like to display and click Save. = Why is my Google Map not showing up? = @@ -62,7 +62,6 @@ If your API key works with other Google Maps plugins but not WP Strava, you may WP-Strava caches activity for one hour so your site doesn't hit the Strava API on every page load. If you recently uploaded activity and want to see it right away, go to the Settings -> Strava in the wp-admin dashboard, check the checkbox labeled "Clear cache (images & transient data)" and then click Save Changes. - == Screenshots == 1. WP Strava settings - this walks you through connecting the WP Strava plugin to your strava account. You can connect multiple accounts by authenticating each one here. Add your Google Maps key for map display here. You can also set the system of measurement (miles/kilometers) and clear any saved data. @@ -84,8 +83,8 @@ WP-Strava caches activity for one hour so your site doesn't hit the Strava API o rawurlencode() redirect_uri so authentication works more consistently. Added FAQ about caching. Changed to new-style phpcs ignores and ignored some additional lines. -Added debug option to Authentication Failed path for https://wordpress.org/support/topic/problem-authenticating-with-strava/ -Increased API Post timeout to 30 seconds. +Simplified auth token logic to troubleshoot https://wordpress.org/support/topic/problem-authenticating-with-strava/ +Increased API request timeout to 30 seconds. = 1.5.0 = diff --git a/wp-strava.php b/wp-strava.php index 4872253..6ddb6b7 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.5.1-rc3 + * Version: 1.5.1 * Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott * License: GPL2 * Text Domain: wp-strava