alexboia / WP-Trip-Summary

A WordPress trip summary plugin to help travel bloggers manage and display structured information about their train rides and biking or hiking trips
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link
geojson gis gps gpx gpx-track kml kml-parser kml-track maps openstreetmap osm php travel-documentation wordpress wordpress-plugin wordpress-travel-plugin

WP-Trip-Summary

An opinionated, multi-language, WordPress trip summary plugin to help travel bloggers manage and display structured information about their train rides and biking or hiking trips.

Status

WP compatibility PHP compatibility

Features

File formats accepted for import

WP-Trip-Summary supports the following file formats when importing GPS track data that should be attached to a post:

GPX

An uploaded file is processed as a GPX file (and validated as such) if it has any of the following mime types:

GPX documents are expected to comply with the GPX 1.1 schema and are parsed as follows:

For the more technically inclined, the parser can be consulted here.

GeoJSON

An uploaded file is processed as a GeoJSON file (and validated as such) if it has any of the following mime types:

GeoJson documents are assumed to comply with RFC 7946 and are parsed as follows:

For the more technically inclined, the parser can be consulted here.

KML

An uploaded file is processed as a KML file (and validated as such) if it has any of the following mime types:

The KML parse is based on Stepan Daleky's KML parser on GitLab, which I further built upon in two areas:

It might worth your while (to take a loot at it here)[https://github.com/alexboia/WP-Trip-Summary/tree/master/lib/3rdParty/kml-parser/KmlParser].

KML documents are parsed as follows:

For the more technically inclined, the parser can be consulted here.

Downloading the plug-in

You can get the plug-in:

Alternatives to WP Trip Summary

So I figured it would be nice to list here what other WordPress plugins can be used, if WP Trip Summary does not cover all your needs or its philosophy just isn't for you. These certainly are not the only ones, but these are the ones I consider the most relevant.

Waymark

Waymark allows you to create maps as you would create posts, add various shapes to them. These can then be embedded to any post using shortcodes. It also knows how to import data (markers and lines) from GPX/KML/GeoJSON files, to be displyed on a map.
It's still constantly updated and I recommend it if all you want to define and organize general purpose maps, possibly a lot of them, and use them in any post.
Find out more and get it here: https://wordpress.org/plugins/waymark/.

WP GPX Maps

WP GPX Maps allows you to upload a GPX track and display it on a map, along with a couple of graphs: altitude, speed, heart rate, temperature, cadence, grade. It also looks up the media gallery for picture files that would match the coordinates on the track and display those on the map as well. You get central management of these tracks and you can embed them anywhere using shortcodes.
It's a bit behind with the updates, but I recommed it for a similar reason I recommended Waymark - if you'd like to manage your stuff centrally and use it anywhere - as well as for the wealth of graphs it provides out of the box. Find out more and get it here: https://wordpress.org/plugins/wp-gpx-maps/.

Lf Hiker (no longer maintained)

Lf Hiker is somwehat closer to WP Trip Summary's philosophy: it's a plugin that allows you to quickly display your gpx tracks with their profile elevation on an interactive map. It's also linked to a post; not directly, but through the media gallery, through which you upload your GPX files. Ultimately, you can embed those anywhere using shortcodes and also provide some custom information for each post, to be displayed alongside the core track data.
It's a bit behind with the updates as well, but I recommend it for a simpler, more track-centered approach.
Find out more and get it here: https://wordpress.org/plugins/lf-hiker/.

Progress & Management

The milestones area usually paints a good outlook on the workload for the current release, as well as the past and planned releases.
You might also be interested in the issues area, for the gruesome details about what's currently on the table.

What it does

This plug-in provides three basic features:

Structured technical information

Structured technical information is supported for the following types of trips:

For bike trips

The following fields are available:

For hiking trips

The following fields are available:

For train rides

The following fields are available:

The track

I really wanted to host the GPS tracks myself for various reasons:

Thus, I developed a module to do just that: upload a GPS track (currently only GPX and GeoJSON files can be uploaded), parse it and display it.

Rider's log entries

For each post you can add unlimited log entries, each corresponding to someone travelling that route, specifying the following details:

JSON-LD front-end data

The plug-in, as of version 0.2.8 inserts structured JSON-LD data in the post and page details page, if there is track data attached to that post or page.

This behaviour is configurable and can be disabled or enabled in the plug-in's configuration page. By default, it is disabled.

Here is a sample JSON-LD data set inserted by this plug-in:

<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "Place",
    "geo": {
        "@type": "GeoShape",
        "box": "45.69152 23.72547 46.01246 25.27592"
    },
    "name": "Towards Eagle's lake"
}
</script>

Maintenance

As of version 0.2.8, there is a new Maintenance section, which allows you to carry out various maintenance tasks:

The box is described by the south-west and north-east points, in lat-lng format: Lat1 Lng1 Lat2 Lng2.

Menu: Trip Summary -> Maintenance.

System logs

As of version 0.3.2, there is a new System logs section, which allows you to manage the log files to which WP Trip Summary writes its debug and error messages.

There are two sections for each of the log types (debug and error, respectively, as mentioned), BUT debug logs are only produced if:

Menu: Trip Summary -> System logs.

Supported languages

The following languages are supported:

Language Code Notes
English en_US Also serves as default language
French fr_FR -
Romanian ro_RO -
German de_DE Partly contribured by Nico, partly translated using Google Translate.

Changelog

Version 0.3.2

See the entire changelog here

Roadmap

Road to Version 0.4

Moving forward to 0.4, the focus is on extensibility, a slightly improved UI and, as a nice to have, a broader language support:

Also, use the Issues area to submit your idea.

Requirements

For running the plug-in itself

  1. PHP version 8.0.0 or greater;
  2. MySQL version 5.7 or greater (with spatial support);
  3. WordPress 6.0.0 or greater;
  4. libxml extension;
  5. SimpleXml extension;
  6. mysqli extension;
  7. mbstring - not strictly required, but recommended;
  8. zlib - not strictly required, but recommended.

For development

All of the above, with the following amendments:

  1. xdebug extension is recommended;
  2. phpunit version 5.x installed and available in your $PATH, for running the tests;
  3. wp (wp-cli) version 2.x installed and available in your $PATH, for initializing the test environment, if needed
  4. phpcompatinfo version 5.x installed and available in your $PATH, for generating the compatibility information files
  5. cygwin, for Windows users (or Windows Linux Subsystem, in which case it pretty much works out of the box), such as myself, for setting up the development environment, running unit tests and the build scripts, with the following requirements itself:
    • wget command;
    • curl command;
    • gettext libraries;
    • php core engine and the above-mentioned php extensions;
    • mysql command line client;
    • subversion command line client;
    • zip command.

Limitations

  1. Currently it only works with the classic WordPress Editor. An update is planned for 0.3. (Available as of 0.2.4).
  2. Not designed for (and not tested with) multi-site installations. No update is currently planned.
  3. Currently only supports GPX and GeoJSON files as a way to upload GPS tracks. KML will be supported round about 0.3, maybe earlier (Available as of 0.3.2).

Screenshots

Editor - Info

Editor - Info

Editor - Map

Editor - Map

Viewer - Info

Viewer - Info

Viewer - Map

Viewer - Map

Viewer - Map with altitude profile

Viewer - Map with altitude profile

Viewer - Log entries

Viewer - Info

How can you help

Despite my best intentions, it would be really hard to come up with a stellar product without any help from those who would either be really interested in using it or would like to work on such a product.
See here how one can contribute.

Credits

  1. PHP-MySQLi-Database-Class - small mysqli wrapper for PHP. I used it instead of the builtin wpdb class
  2. MimeReader - PHP mime sniffer written by Shane Thompson
  3. jQuery EasyTabs
  4. Select2 - A jQuery Single/Multi Select plugin
  5. Leaflet - open source JavaScript library for interactive maps
  6. Machina - JavaScript state machine
  7. NProgress - slim JavaScript progress bars
  8. Toastr - Javascript library for non-blocking notifications
  9. URI.js - JavaScript URI builder and parser.
  10. Visible - jQuery plugin which allows us to quickly check if an element is within the browsers visual viewport regardless of the window scroll position
  11. blockUI - jQuery modal view plug-in
  12. kite - super small and simple JavaScript template engine
  13. Leaflet.MagnifyingGlass - Leaflet plug-in that adds the magnifying glass feature: enlarging a discrete area on the map
  14. Leaflet.fullscreen - Leaflet plug-in that allows the map to be displayed in full-screen mode
  15. Tipped JS - A Complete Javascript Tooltip Solution
  16. PHPUnit - The PHP Unit Testing framework
  17. Parsedown - Better Markdown Parser in PHP. http://parsedown.org
  18. Faker - Faker is a PHP library that generates fake data for you
  19. Mockery - A simple yet flexible PHP mock object framework for use in unit testing with PHPUnit
  20. Parsedown Extra - Markdown Extra Extension for Parsedown

License

The source code is published under the terms of the BSD New License licence.

Donate

I put some of my free time into developing and maintaining this plugin. If helped you in your projects and you are happy with it, you can...

ko-fi