• Resolved appleandpear

    (@appleandpear)


    I have set up minimum distance to 45km on the last activity map widget but on my page I can see any activity independent on distance. Few weeks ago it was working well. I wasn’t change this settings since the first configuration and now I have noticed that it is not working as expected. So I suppose that some update may mess up.

    I found similar topic here: https://www.ads-software.com/support/topic/map-minimum-distance/ – so I have cleared cache but it not solve my problem.

    Also, I have changed widget setting even to 500 km distance, cleared cache and again I see my latest activity with 21 km. Reinstallation of plugin didn’t help too.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author jrfoell

    (@jrfoell)

    I’ll take a look @appleandpear

    Plugin Author jrfoell

    (@jrfoell)

    @appleandpear – I tried to reproduce this on my account but I was unable to. I thought maybe switching to metric would trigger it. Can you set up a test page for me to look at on your site with the problem?

    Thread Starter appleandpear

    (@appleandpear)

    @jrfoell I have created a copy of my website under URL: beta.dlugidystansrowerem.pl

    I can create a user to give You access into backend, but please provide me Your e-mail address first.

    Thread Starter appleandpear

    (@appleandpear)

    Hi @jrfoell again,
    I’ve take a deep look into the code and found where is the problem located.
    In the file wp-strava/lib/WPStrava/Activity.php row 63:
    $meters = $som->distance_inverse( $dist );
    You converts $dist into string, in my case the var_dump returned string(9) "45,000.00"

    But few lines later inside foreach ( $activities as $activity_info ) loop, the var_dump($activity_info->distance) returns values as floats, i.e.: `float(4528.5)
    float(20960.6)
    float(134480)
    float(111905)`

    So the statement if ( $activity_info->distance > $meters ) doesn’t work.
    When I typed in the code my meters value as 45000, the plugin works well.

    Conclusion: the $som->distance_inverse() method messed up.

    Waiting for fix ??

    Plugin Author jrfoell

    (@jrfoell)

    Ahhh, good sleuthing! I’m going to be working on this on Friday this week. Can you help test the 2.0 beta? https://github.com/cmanon/wp-strava/releases/tag/v2.0b1

    I’ll try to get this fix included in the 2.0 release.

    Plugin Author jrfoell

    (@jrfoell)

    Thanks for your report @appleandpear – I got to write a unit test and solve the issue yesterday and today I released version 2.0.

    You should see the update available in wp-admin. Please read the upgrade instructions after you’ve updated: https://github.com/cmanon/wp-strava/wiki/2.0-Upgrade

    Let me know here if have any issues and thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Minimum distance on last activity map widget not working’ is closed to new replies.