tinuzz / wp-plugin-trackserver

A WordPress plugin for GPS tracking and publishing
https://wordpress.org/plugins/trackserver/
36 stars 12 forks source link

Connection lost every hour (livetrack) #36

Closed SPalette closed 1 year ago

SPalette commented 1 year ago

Hallo Mr. Grendelman,

i tried do bring location data via curl to trackservers osmand-interface. Now livetracking works fine but every track recording ends on the last waypoint in a hour. For example, a track recording works up to 15:59:02 assigned to track #1, then the next waypoint 16:00:02 will be assigned to track #2. While livetracking an alertbox appears (Track missing from server response. Please reload the page). Unfortunately, only the waypoints of on (#2) track are displayed after page reloading....

All other trackserver-functions are working fine...

best regards Stephan

tinuzz commented 1 year ago

Hi Stephan,

Please look at the "OsmAnd trackname format" in the options page. It likely contains '%H' or something similar, which means that Trackserver generates a new track every hour.

Regards, Martijn.

SPalette commented 1 year ago

Yeah, I got it yesterday in the evening while a extensively code review. :-) In this context I gleaned, that strftotime() now is deprecated (PHP 8.1). Anyway, it works... What not really works is to save a new password. The request crashes. (PHP 8.2, Apache 5, Win) I solved this problem by deleting the whole "action" - parameter include the inline-php-statement in class-trackserver-profile.php on line 307 (var $url is not set in that context).

Thank you for your work, and best regards Stephan

tinuzz commented 1 year ago

Hi Stephan,

Thank you for the report, that is indeed a bug that I didn't catch. I think it depends on the version of PHP and/or the settings, because an undefined variable is not normally a fatal error, AFAIK.

Anyhow, I fixed it by adding this statement at the top of the yourprofile_html() function in class-trackserver-profile.php:

$url = menu_page_url( 'trackserver-yourprofile', false );

The fix will be in the next point release.

Best regards, Martijn

P.S. I missed the strftime() deprecation too; I'll work on replacing it for the next release. Thanks.