Like your plugin!
I have a use case where I, during a travel, upload and overwrite a GPX-file with FTP. Currently the plugin does not catch that but loads the cached file. I don’t want to disable cache, my file will be large and the reducing functionality is a great feature! I know I can hit “clear cache” but I don’t want to add that rather inconvenient step when just updating the gpx-file.
I suggest adding the file modification time to the $cacheFileName to be able to catch . I did a quick fix as the code show below. I’d like to be able to update the plugin so if you think it’s a good idea I’d please implement it :good:
function handle_WP_GPX_Maps_Shortcodes($attr, $content=”)
{
[…]
// Add file modification time to cache filename to catch new uploads with same file name
$mtime = sitePath() . str_replace(array(‘/’, ‘\\’), DIRECTORY_SEPARATOR, trim($gpx));
if(file_exists($mtime)) {
$mtime = filemtime($mtime);
} else {
$mtime = 0;
}
$cacheFileName = “$gpx,$mtime,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showAtemp,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,$distanceType,v1.3.5”;
Thank you for at least considering!
Best regards,
David