Skip to content

Commit

Permalink
Merge branch 'master' into feature/refresh-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfoell committed Sep 22, 2019
2 parents 7621c5c + cabbd83 commit 8fc6de5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
39 changes: 38 additions & 1 deletion includes/WPStrava/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ public function __construct() {
* @since 0.62
*/
public function hook() {
add_action( 'admin_init', array( $this, 'register_strava_settings' ), 20 );
add_action( 'admin_init', array( $this, 'register_strava_settings' ) );
add_action( 'admin_menu', array( $this, 'add_strava_menu' ) );
add_filter( 'plugin_action_links_' . WPSTRAVA_PLUGIN_NAME, array( $this, 'settings_link' ) );
add_action( 'in_plugin_update_message-wp-strava/wp-strava.php', array( $this, 'plugin_update_message' ), 10, 2 );
add_action( 'after_plugin_row_wp-strava/wp-strava.php', array( $this, 'ms_plugin_update_message' ), 10, 2 );
}

/**
Expand Down Expand Up @@ -699,4 +701,39 @@ public function settings_link( $links ) {
$links[] = $settings_link;
return $links;
}

/**
* Plugin Upgrade Notice.
*
* @param array $data Plugin data with readme additions.
* @param array $response Response from wp.org.
* @author Justin Foell <[email protected]>
* @since 1.7.3
*/
public function plugin_update_message( $data, $response ) {
if ( isset( $data['upgrade_notice'] ) ) {
echo wp_kses_post( $data['upgrade_notice'] );
}
}

/**
* Plugin Upgrade Notice (multisite).
*
* @param string $file Relative path to plugin, i.e. wp-strava/wp-strava.php.
* @param array $plugin Plugin data with readme additions.
* @author Justin Foell <[email protected]>
* @since 1.7.3
*/
public function ms_plugin_update_message( $file, $plugin ) {
if ( is_multisite() && ! is_network_admin() && version_compare( $plugin['Version'], $plugin['new_version'], '<' ) ) {
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
printf(
'<tr class="plugin-update-tr"><td colspan="%s" class="plugin-update update-message notice inline notice-warning notice-alt"><div class="update-message"><h4 style="margin: 0; font-size: 14px;">%s</h4>%s</div></td></tr>',
$wp_list_table->get_column_count(),
$plugin['Name'],
wp_kses_post( $plugin['upgrade_notice'] )
);
}
}

}
19 changes: 16 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== WP-Strava ===

Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb
Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, gps, shortcode, widget, plugin
Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin
Requires at least: 4.6
Tested up to: 5.1
Stable tag: 1.7.2
Stable tag: 1.7.3
Requires PHP: 5.2
License: GPLv2 or later

Expand All @@ -17,7 +17,7 @@ This plugin uses the Strava API to embed maps and activity for athletes and club

= Cron =

Using WP-Strava after September 2019 requires a working WordPress cron configuration. By default, WordPress has a built-in cron system to run scheduled events, but it relies on your website getting frequent visitors. The Strava authentication token system expires after 6 hours if not refreshed. If you think your site will not get any visitors over the span on 6 hours, you might want to set up a _real_ cron: https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/. Setting up this sort of cron is beyond the scope of support for this free plugin, so you should seek assistance through your host.
Using WP-Strava 2.0+ requires a working WordPress cron configuration. By default, WordPress has a built-in cron system to run scheduled events, but it relies on your website getting frequent visitors. The Strava authentication token system expires after 6 hours if not refreshed. If you think your site will not get any visitors over the span on 6 hours, you might want to set up a _real_ cron: https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/. Setting up this sort of cron is beyond the scope of support for this free plugin, so you should seek assistance through your host. Force-running the WordPress cron once an hour is good enough for WP-Strava.


= Shortcodes =
Expand Down Expand Up @@ -97,6 +97,11 @@ WP-Strava caches activity for one hour so your site doesn't hit the Strava API o
Added new Strava "refresh tokens" ala https://developers.strava.com/docs/oauth-updates/#migration-instructions


= 1.7.3 =

Added update notice.


= 1.7.2 =

Added setting to hide elevation.
Expand All @@ -111,6 +116,7 @@ Fixed swimpace calculation.
Fixed seconds display on pace.
Added Hide Activity Time option to hide time display from Latest Activities List.


= 1.7.0 =

Added Sebastian Erb to contributors.
Expand Down Expand Up @@ -236,3 +242,10 @@ Added option to select unit of measurements on the widget. https://wordpress.org
= 0.6 =

Initial version.


== Upgrade Notice ==

= 1.7.3 =

Version 2.0 will be mandatory after October 15th, 2019. Try the 2.0 beta: <a href="https://github.com/cmanon/wp-strava/releases">https://github.com/cmanon/wp-strava/releases</a>. 2.0 settings upgrade instructions: <a href="https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade">https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade</a>.
2 changes: 1 addition & 1 deletion wp-strava.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.2
* Version: 1.7.3
* Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott, Sebastian Erb
* License: GPL2
* Text Domain: wp-strava
Expand Down

0 comments on commit 8fc6de5

Please sign in to comment.