mirror of
https://github.com/10h30/wp-strava.git
synced 2026-06-05 15:10:01 +09:00
Added extended timeout to all API requests
Bumped version Fixed spelling errors
This commit is contained in:
@@ -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<br/><code>define( \'WP_STRAVA_DEBUG\', true );</code><br/>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<br/><code>define( \'WPSTRAVA_DEBUG\', true );</code><br/>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<br/><code>define( \'WP_STRAVA_DEBUG\', true );</code><br/>to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ),
|
||||
sprintf( __( 'ERROR %1$s %2$s - See full error by adding<br/><code>define( \'WPSTRAVA_DEBUG\', true );</code><br/>to wp-config.php', 'wp-strava' ), $response['response']['code'], $response['response']['message'] ),
|
||||
$error
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -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 =
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user