Giter VIP home page Giter VIP logo

alexboia / wp-trip-summary Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 4.0 17.12 MB

A WordPress trip summary plugin to help travel bloggers manage and display structured information about their train rides and biking or hiking trips

License: BSD 3-Clause "New" or "Revised" License

PHP 92.86% CSS 4.49% JavaScript 2.46% Shell 0.13% HTML 0.06% Less 0.01%
wordpress-plugin travel-documentation gpx-track wordpress-travel-plugin php wordpress geojson gps gpx openstreetmap osm gis maps kml kml-parser kml-track

wp-trip-summary's Introduction

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

  • attach technical information to a post (ex. how long was your trip, how much did you totally climb, where from and where to, how hard do you think it has been, what kind of roads or trails did you encounter etc.);
  • attach some GPS data to a post (see below for a detailed discussion on accepted file formats) and display that track on a map;
  • maintain rider's log entries, while optionally specifying some of them as public;
  • allows management of the look-up data used to populate the fields presented as single or multi-selection options list (ex. Difficulty Level, Open During Seasons etc.);
  • allows customization of the map layer:
    • map tile source (comes by default configured with OpenStreetMap);
    • enabling/disabling of available map controls;
    • customizing the visual representation of the track).
  • allows customization of the measurement unit system used to represent various values (ex. Total distance, Total climb etc.);
  • multi-language.

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:

  • application/gpx;
  • application/x-gpx+xml;
  • application/xml-gpx;
  • application/xml;
  • application/gpx+xml;
  • text/xml.

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

  • Only document name, description and keywords metadata elements are read;
  • The following information is read for a point (<wpt> or <trkpt>), besides latitude and longitude:
    • altitude/elevation (<ele> element);
    • name (<name> element).
  • The following information is read for a track part (<trk> element), besides the list of track segments;
    • name (<name> element).
  • For a track segment (<trkseg> elements), only its points are read.

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:

  • application/json;
  • application/geo+json;
  • application/vnd.geo+json.

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

  • Document metadata is only searched for is the root object is a FeatureCollection and the first Feature of that collection:

    • has a properties property;
    • its geometry property is null.
  • A LineString is read as a track part with a single track segment;

  • If a LineString geometry is contained within a Feature object, then the resulting track part's name is searched for in the feature object's properties property.

  • A MultiLineString is read as a track part, and each comprising line string is added to the track part as a track segment;

  • If a MultiLineString geometry is contained within a Feature object, then the resulting track part's name is searched for in the feature object's properties property.

  • A Point is read as a document-level waypoint, regardless of where it is found in the geoJSON file;

  • If a Point geometry is contained within a Feature object, then the waypoint's name is searched for in the feature object's properties property.

  • All the points in a MultiPoint are each added as a document-level waypoint, regardless of where it is found in the geoJSON file;

  • If a MultiPoint geometry is contained within a Feature object, then a name is searched for in the feature object's properties property and assigned to each of the resulting waypoints;

  • A Polygon is read as a track part with a track segment for each of the polygon's contour lines;

  • If a Polygon geometry is contained within a Feature object, then the resulting track part's name is searched for in the feature object's properties property.

  • A MultiPolygon is read as multiple track parts, one for each comprising polygon; each track part is then comprised of the corresponding polygon's contour lines;

  • If a MultiPolygon geometry is contained within a Feature object, then a name is searched for in the feature object's properties property and assigned to each of the resulting track parts.

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:

  • application/vnd.google-earth.kml+xml.

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

  • support for additional KML objects;
  • a basic processing infrastructure.

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:

  • Either root KML folder or root KML document is considered, not both (first it checks for a root folder and, if not found for a root document);

  • A KML container is searched, in this order, for: folders, documents and placemarks;

  • For a placemark, Point, Linestring, LinearRing, Polygon and MultiGeometry geometries are supported;

  • Neither folder, nor document metadata is stored;

  • A Point geometry is read as a document-level waypoint, regardless of where it is found in the KML file;

  • For a Point geometry, the name and description metadata are stored;

  • A LineString is read as a track part with a single track segment;

  • For a LineString geometry, only the name metadata is stored;

  • A LinearRing is read as a track part with a single track segment;

  • For a LinearRing geometry, only the name metadata is stored;

  • A Polygon is read as two track parts: one for the outer boundary LinearRing, the other for the inner boundary LinearRing;

  • For a Polygon geometry, only the name metadata is stored, for each of the resulting track parts;

  • A MultiGeometry is processed by reading its individual parts, not as a whole, obeying the above-mentioned rules.

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:

  • allow some structured information to be filled in, according to a selected trip type;
  • allow some GPS track to be uploaded and then rendered on a map;
  • maintain rider's log entries, while optionally specifying some of them as public.

Structured technical information

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

  • Bike trips;
  • Hiking trips;
  • Train rides.

For bike trips

The following fields are available:

  • Total distance;
  • Total climb;
  • Difficulty level;
  • Access information (how to get to the start point and return from the end point);
  • Open during seasons;
  • Path surface type (eg: dirt, asphalt, grass etc.);
  • Recommended bike type (eg: MTB, road bike etc.).

For hiking trips

The following fields are available:

  • Total distance;
  • Total climb;
  • Difficulty level;
  • Access information;
  • Open during seasons;
  • Path surface type;
  • Route markers.

For train rides

The following fields are available:

  • Total distance;
  • How many trains were exchanged;
  • Line gauge (mm);
  • Railroad operators used;
  • Line status (closed, operational etc.);
  • Whether the line is electrified or not;
  • Line type.

The track

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

  • Didn't want to depend on any third party provider;
  • It was good fun writing this feature;
  • I want to use the resulting data in the near future to do some other stuff on my website.

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:

  • Who (the rider's name);
  • When (date);
  • Time (how many hours spent);
  • Vehicle used (e.g. bike make and model);
  • Gear (notes about what equipment was used - backpack configuration and the like);
  • Other (random) notes;
  • Whether or not the entry should be displayed publicly (if so, then the entry will be shown in the frontend viewer in a separate tab dedicated to log entries).

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:

  • Clear all cached track data information;
  • Clear all plug-in related information (all post trip summary, all cached data and all stored track files);
  • Detect which posts that should have track data information are actually missing track files.

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:

  • ABP01_ENABLE_DEBUG_LOGGING is defined (in wp-config.php) and set to true (if defined, it will supersede WP_DEBUG) or;
  • WP_DEBUG is defined and set to true.

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

  • Added German translation (issue #90);
  • Added support for KML files (issue #91);
  • Bring help contents (mostly) up-to-date with the new features, for ro_RO and en_US (issue #89);
  • Add route type filter in admin area post listing (issue #92);
  • Some embarrassing bug fixes;
  • Add proper error and debug logging infrastructure, including dedicated log management page (go to Trip Summary -> System logs);
  • Other stuff which I may not remember.

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:

  • support custom route types:
    • also add some more pre-defined types, such as: roadtrips, water-stuff etc.;
  • allow customization of settings section;
  • allow viewer color-scheme customization, both programatically and from the settings page.
  • add some nice to have features, which can be quickly implemented and provide some value, such as:
    • display GPX waypoints;
  • an API for plugin developers;
  • refactoring (on-going);

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

wp-trip-summary's People

Contributors

alexandruboia avatar alexboia avatar philipflohr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wp-trip-summary's Issues

Redo fit to bounds when full screen status is changed

The map zoom has to be adjusted to the maximum available zoom that can fit the route.
I am not 100% sure about this, but it seems like a good idea, especially when you go full screen, since this means that you would want to see a greater level of detail.
Thus, adjusting the zoom to this extent ca possibly spare the user a few actions.

Teaser translation is broken

The teaser is not correctly translated: the text appears in the default language (english), regardless of the current blog language.

When attempting to download a GPX track using the map button from the front-end viewer, the operation fails if the user is not authenticated

Describe the bug
When attempting to download a GPX track using the map button from the front-end viewer, the operation fails if the user is not authenticated

To Reproduce
Steps to reproduce the behavior:
0. Make sure to enable GPX track download (go to WordPress back-end panel, Trip Summary -> Settings menu and tick the Allow track download? checkbox. Save and then sign out;

  1. Go to a post which has a GPX track attached and select the Map tab;
  2. Click on the download button (the down facing arrow);
  3. See an empty screen which only displays a 0.

Expected behavior
The browser should pop a window asking to download the file (or automatically start the download, depending on the browser settings).

Desktop (please complete the following information):

  • Regardless of desktop configuration.

Smartphone (please complete the following information):

  • Regardless of smartphone configuration.

Add track download capability

Users should be able to download tracks, if they have been uploaded to a post.

Required changes

  • add a UI button that allows the user to download the track;
  • add back-end handler that will process the download action;
  • add a setting that allows the blog owner to enable/disable track downloading - defaults to enabled.

Add settings management capability

This issue tracks the work required to implement settings management capability to WP-Trip-Summary.

Available settings

  1. Tile layer option - allows the use to change the provider for the tile layer. Right now OSM is used by default. This will remain the default option;
  2. Configure teaser: whether to display it or not and what text should be displayed. Default is to display it and the default text is the one being displayed right now.
  3. Enable magnifying glass capability in frontend map;
  4. Enable full screen capability in frontend map;
  5. What units of measure to display (this will not to any actual conversions, it will only attach meaning to the numbers entered). Options are metric and imperial. Default is metric.
  6. Enable map scale in both frontend and backend maps. Default is to enable.

Required changes

1. Back-end administration panel

  • add settings management page;
  • add settings management menu option;
  • inject settings into trip summary editor (e.g. the tile layer URL setting);

2. Frontend viewer

  • inject settings into trip summary viewer;
  • adjust teaser to respect the new teaser settings.

Support look-up data management

Look-up data is comprised of the pre-defined data sets used as a basis for selection for various fields:

  • recommended seasons (ex: spring, summer, autumn, winter);
  • road surface (ex: asphalt, grass etc.);
  • recommended bike type;
  • difficulty level;
  • railroad line status;
  • railroad electrification status;
  • railroad line type (single / double);
  • railroad operators.

Right now these cannot be managed (added/edited/deleted), unless you are editing the XML file from which these are read at install time. Which sucks.

What we need is a page where all these data sets can be managed consistently.
This, in turn, raises a secondary issue: the trip summary editor needs to be updated with a new way of rendering and selecting the options for fields that use these sets of look-up data so as to not have their size be dependent on how many options they have.

Rules that should govern this process

  1. If a look-up data item is in use, it's deletion must not be allowed.
  2. If, for some field there are no options, we should display a message with a link towards the management page.

Main tasks

  1. Core look-up data management classes.
  2. Look-up data management interface.
  3. Update trip-summary editor UI.
  4. Update existing unit tests if required.
  5. Create new unit tests if required.

Plug-in fails to activate when WP_DEBUG is set to true and not in development environment

Describe the bug
Plug-in fails to activate when WP_DEBUG is set to true and not in development environment.

To Reproduce
Steps to reproduce the behavior:

  1. Set WP_DEBUG to true in wp-config.php.
  2. Install the plug-in.
  3. Attempt to activate it.
  4. See error 'Could not activate plug-in'.

Expected behavior
The plug-in has been successfully activated.

Screenshots
None applicable.

Desktop (please complete the following information):

  • Not dependent on user's environment.

Smartphone (please complete the following information):

  • Not dependent on user's environment.

Additional context
Set WP_DEBUG to true in wp-config.php.

Launch the trip summary editor from a side metabox, instead of the current WP editor button and also add relevant trip summary status information to that metabox

Is your feature request related to a problem? Please describe.
The problem with the current way of opening the trip summary editor is two-fold:

  • one, that you cannot see whether or not there is some trip summary data for the post we are currently editing;
  • two, that the current button that is being used is only being displayed for the classic editor (since it is bound to the media_buttons hook).

Describe the solution you'd like
The proposed solution is to manage the trip summary data using a metabox on the side that would include:

  • status information (whether or not trip summary information and/or track data exists);
  • quick action buttons: clear track data, clear trip summary information;
  • a button to launch the editor.

Create help page

The final piece of the puzzle will be a help page that should describe anything and everything about what this plug-in is and does.
Without going into content specifics just yet, I can underline some of the technical details:

  • this will be a separate page in the plug-in administration menu;
  • we'll have to have links in other places as well, such as in the trip summary editor;
  • content editing will be done in markdown which will be converted to HTML to produce the user-readable output.

Typo in project summary, should be "hiking"

Hello,

The summary reads:

A WordPress trip summary plugin to help travel bloggers manage and display structured information about their train rides and biking or hinking trips

Add automated testing for the GPX document parser component

Add automated testing for the GPX document parser component, this means the Abp01_Route_Track_GpxDocumentParser class.

Only basic checks for now:

  • Can correctly check whether GPX document parsing is supported or not;
  • Try parse invalid files;
  • Try parse partially valid files;
  • Parse hand crafted GPX file to precisely assess the result;
  • Parse a few real-world files for various sources, incl. GPS devices.

The "wait" message and progressbar are not shown on the plug-in settings page under certain conditions

Describe the bug
The "wait" message and progressbar are not shown (or partially shown) on the plug-in settings page when the resolution does not allow the entire settings form to be displayed and the user has to scroll to the "save" button.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the plug-in settings page using a device such as a laptop computer or another device with a vertical resolution of 768px or less (or resize the browser window to fit this setup).
  2. Scroll down to the "save" button and attempt to save the settings.
  3. The screen is blocked by a translucent overlay, but no "wait" message or progress bar is shown.

Expected behavior
The "wait" message and progress bar must be shown.

Desktop (please complete the following information):

  • Vertical resolution (or browser window size) of 768px or less.

Smartphone (please complete the following information):

  • Vertical resolution (or browser window size) of 768px or less.

Add map scale

The map needs to have a scale - the ratio of a distance on the map to the corresponding distance on the ground.
It should probably be shown in the lower-left corner of the map.

The "Edit trip summary" button must only be displayed for users that can edit a post's trip summary

Describe the bug
The "Edit trip summary" button must only be displayed for users that can edit a post's trip summary, as currently, even if the user does not have the proper capability, can see it.
However, the corresponding editor assets are not loaded if the user is not allowed to edit it and saving does would not work either.
Hence, this situation results in a broken button.

To Reproduce
Steps to reproduce the behavior:
0. Log-in as a user which is neither administrator, nor editor

  1. Open the post editor for any post
  2. See the "Edit trip summary" button being displayed.

Expected behavior
The trip summary button must not be displayed in this situation.

Desktop (please complete the following information):
Regardless of desktop/browser configuration.

Smartphone (please complete the following information):
Regardless of smartphone/browser configuration.

Select the color being used to plot the route on the map

Is your feature request related to a problem? Please describe.
It would be nice if one would be able to select a custom color for the line being used to plot the route track on the map.

Describe the solution you'd like
This could be accomplished using a color chooser in the WP Trip Summary settings page.

Add automated testing for the unit system component

Add automated testing for the unit system component. This means for each of the following classes:

  • Abp01_UnitSystem_Imperial;
  • Abp01_UnitSystem;
  • Abp01_UnitSystem_Metric.

Check the following:

  • That the correct unit symbols are being returned;
  • That unit system instances are correctly being created;
  • That supported unit systems are correctly being checked for;
  • That conversion to plain stdClass objects is correctly carried out.

The trip summary editor does not automatically reposition on window resize

Describe the bug
The trip summary editor does not automatically reposition (re-center vertically and horizontally) on window resize

To Reproduce
Steps to reproduce the behavior:

  1. Go to a wordpress article post
  2. Click on 'Edit trip summary' button and wait for the editor to appear
  3. Resize the browser window
  4. The trip summary overlay window that contains the editor does not re-center.

Expected behavior
The trip summary overlay window should re-center vertically and horizontally.

Screenshots
None applicable.

Desktop (please complete the following information):

  • Regardless of user environment.

Smartphone (please complete the following information):

  • Regardless of user environment.

Move plug-in track & cache storage to wp-content/uploads

Describe the bug
Move plug-in track & cache storage to a sub-directory of wp-content/uploads, as, currently, the plug-in stores its track & cache files to its own directory, which causes this data to be lost upon upgrade, since WordPress, when upgrading a plug-in, removes all the files that belong to the previous plug-in version.

To Reproduce

  1. Upgrade the plug-in to a new version;
  2. See error that says that the track cannot be loaded due an internal server error.

Expected behavior
After upgrade, all track & cache files should still exist.

In the post listing we need to see which post/page has a trip summary attached to it and which kind of information is available (map/meta-stuff)

Is your feature request related to a problem? Please describe.
In the WordPress post and page listing one cannot tell which post or page has trip summary information attached to it and which does not.

Describe the solution you'd like
It would be nice to have an additional column in the post and page listing which shows the following:

  • whether or not there is any trip summary information attached to the post or page;
  • if there is, which kind of information is available: generic information, track data or both.

Install trip summary editing capabilities for other roles as well

Currently, WP Trip Summary only installs trip summary editing capabilities for the following roles:

  • administrator
  • editor.

However, there are other roles as well which are allowed to edit posts, so they need to have these capabilities as well:

See more information here: https://wordpress.org/support/article/roles-and-capabilities/.

Nice to have: edit the capability-to-role assignment from the WP Trip Summary settings page (possible target milestone: 0.2.3).

GPX track files encoded as UTF-8 with BOM are not processed and issue an error when uploaded

Describe the bug
Issue started on the plug-in's WP directory support page: https://wordpress.org/support/topic/donload-gpx-file/.
The issue is that GPX files that are encoded with a byte order mark (BOM) are not correctly validated by the plug-in and, thus, rejected with an error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Edit trip summary' -> 'Map'
  2. Click on the upload button
  3. Select a GPX track file that is encoded as UTF-8 with BOM
  4. See error

Expected behavior
The GPX track file is correctly uploaded and processed.

Desktop (please complete the following information):
Regardless of client desktop/browser configuration.

Create French translation of the plug-in

Create French translation of the plug-in. The following types of content need to be translated:

  • UI strings (labels, messages, buttons etc.);
  • The default lookup data that is installed with the plug-in;
  • help content.

Possibly also publish a guide of sorts about how could one contribute with other translations.

TypeError: element is null nprogress.js:463:5 occurs in back-end editor when first loading existing map

Describe the bug
When the back-end editor is opened for the first time and the Map tab is selected, if there is a GPX track already uploaded, after loading the map, the following error occurs in the browser console:

TypeError: element is null nprogress.js:463:5 classList http://alexboia.net.local:8080/wp-content/plugins/abp01-travel-tech-box/media/js/3rdParty/nprogress/nprogress.js?ver=0.2.0:463 removeClass http://alexboia.net.local:8080/wp-content/plugins/abp01-travel-tech-box/media/js/3rdParty/nprogress/nprogress.js?ver=0.2.0:444 remove http://alexboia.net.local:8080/wp-content/plugins/abp01-travel-tech-box/media/js/3rdParty/nprogress/nprogress.js?ver=0.2.0:257 set http://alexboia.net.local:8080/wp-content/plugins/abp01-travel-tech-box/media/js/3rdParty/nprogress/nprogress.js?ver=0.2.0:98

To Reproduce
Steps to reproduce the behavior:

  1. Go to Go to 'Edit trip summary' -> 'Map' after having uploaded a GPX track and fully reloaded the page afterwards.
  2. Open the browser console (Firefox);
  3. Click on 'Map'.
  4. Wait for the GPX track to be loaded
  5. See error in the console

Expected behavior
No error should be generated in the console.

Desktop (please complete the following information):

  • Browser Firefox
  • Version 74

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.