OS Routes Plugin

Description

This plugin generates a website to manage routes (defined by GPX files) and to overlay them on to OS maps. The routes can be uploaded by a user, who can annotate them with a description and subsequent comments.

Shortcode

The short code is ‘osroutes’ . This has one attribute: ‘function’.

  • all_starts: displays the map with starting markers on the ROUTE STARTS page.
  • route: displays a single route on the ROUTE page.
  • database: provides the introduction for the DATABASE page.
  • new_route: provides the introduction for the NEW ROUTE page.
  • settings: shows the SETTINGS page.

Loading

The plugin can be loaded as a set of files into the website’s plugins directory. It then needs to be activated as usual. Two other plugins are necessary to do the vast bulk of the work:

  • OS Datahub Maps (OSD) -provides the OS maps and the marker and route overlays.
  • WP Data Access – provides a table of all routes derived from the database. Can also be used in the back end – look for OS Routes in the back-end menu.

The following plugins are not necessary for the functioning of the OS Routes plugin, but are included in the site build to provide other functionality:

  • Colorlib Login Customizer – tailors login page
  • Duplicator – enables site dupliaction – used to update online site.
  • Go Live Update Urls – updates all the Urls in the database to point to a new URL when making your site live or changing domains.
  • Login WP – sends editors to the main page – not the dashboard.
  • Remember Me Controls – has “Remember Me” checked by default on the login page and ensures that a login is remembered for a long time.
  • Remove Dashboard Access – grants dashboard access only to administrator;
  • Restricted Site Access – enforces login for access to the site
  • WP Activity Log – identify WordPress security issues

Releases

  • 1.0: 25 February 2021: Initial release.
  • 1.1: 16 March 2021: A considerable number of additions, many of these derived from comments from Liz, Steve and John.
  • 1.1.1: 19 March 2021: Minor changes to URLs (removing initial ‘/’) for compatibility with localhost.
  • 1.1.2: 22 March 2021: Minor changes to take account of comments from John. Further explanation of difference between Tracks and Routes; rename column heading for the hyperlink in the database; reduced OSMaps track width to 3.
  • 1.2: 31 March 2021: Move data entry for new route to following page. Rationalise the acceptance of new route by contributor.
  • 1.2.1: 4 April 2021: Add logging facility – table in database.
  • 1.2.2: 8 April 2021: Added a number of plugins to control access: see above for Colorlib Login Customizer, Remove Dashboard Access, Restricted Site Access; also WP Activity Log.
  • 1.3.0: 4 November 2021: Use new zoom and centering facilities for All Starts. Introduce SETTINGS page. Note that map printing on full screen now works.
  • 1.3.1: 25 November 2021: Bug fix -‘route_type’ not being picked up correctly from cookies – new function ‘osr_parse_cookies’ introduced.
  • 1.3.2: 2 May 2022: Now use ../wp-content/temp to temporarily store the uploaded gpx files. This deals with a change to the WordPress File Upload plugin which now blocks access to the directory which was used in the past: plugins/os-routes/routes.
  • 1.3.3: 31 December 2022: Replace get_home_path() with ABSPATH in new_route as the former now seems to fail.
  • 1.3.4: 4 June 2023: In route_introduction($route, $route_type) set href for the Walk/Cycle Starts button to ../markers [markers didn’t work]; similarly in osroutes.js function osrNewRoute(route_id) ../route_map; and in database table osroutes, Settings, Dynamic Hyperlinks, HTML = ../route_map.
  • 1.3.5: 13 November 2023: Remove need to login unless making changes. Resolved issue regarding relative addressing when clicking on a marker for a single route. Also for footers: Privacy and Plugin.
  • 1.3.6: 22 February 2024: Move access to Plugin page to main menu for Admin

Issues

  • None known.

To do

Essential:

  • None known.

Desirable:

  • Page titles: Find a way of dynamically setting page titles, avoiding wasted space at top of page. Also look at page title in the web browser tab.
  • Set colours: Front end colour selector still isn’t same as back end.
  • Maintenance for administrator on back end – allow the regeneration of route files.
  • Geo-location: Get County/City for log.
  • Log analysis: Make this available on back-end.
  • Print description: Can we print off the description?
  • Grid reference: For the start of route in the database?
  • Photos: Upload photos and display down side of route.

Settings

Default settings for this website are:

OS Routes

  • Global Settings/Colour for Walks: red
  • Global Settings/Colour for Cycle rides: black
  • Global Settings/Colour for Multiple Routes: green

OS Datahub Map

  • API keys/Maps API Key: ???
  • Map Defaults/Map Zoom: 1:25,000 Leisure, zoom
  • Map Defaults/Map Height (pixels): 800
  • Map Defaults/Profile Height (pixels): 200
  • Map Defaults/GPX Track Width (pixels): 4
  • Global Settings/OpenData Style: Outdoor
  • Global Settings/Print Maps: Everyone
  • Global Settings/Info Pane: Ticked
  • Global Settings/Use Imperial Units: Unticked
  • Global Settings/Show Scale: Ticked
  • Global SettingsAdd Link to GPX/KML Files: Ticked

Testing

All tests should be carried out on a computer, tablet (and phone?), and for ordinary users, contributors and editors.

ROUTE STARTS

  • Correct menu items.
  • Instructions correct (walk/cycle, colours).
  • Markers are displayed correctly in correct colours.
  • Multiple markers where appropriate.
  • Links to individual routes work correctly.
  • Login and logout work.
  • NEW ROUTE link present on relevant pages when logged in.
  • EDITOR:
  • Login and out work.

INDIVIDUAL ROUTE

  • Route title displayed correctly.
  • Appropriate instructions.
  • ROUTE STARTS button.
  • Start markers both single and multiple.
  • Route displayed in correct colour and elevation plot present (for tracks)
  • Download file for GPS.
  • Error response with incorrect route’ in URL – go to ROUTE STARTS; error logged correctly.
  • Correct description with description size tailored to text.
  • Can add a comment and submit but can’t alter description. Name and comment must have values if submit is pressed. Correct response to Submit (route reloaded with refreshed description).
  • EDITORS:
  • Name filled in.
  • Can alter description as well as adding comments and submit both.
  • Delete button only displayed to Editors and functions correctly including confirm pop-up. ‘Yes’ should go to ROUTE STARTS – confirm deletion from markers and list ‘Cancel’ should restore the status quo.

ALL ROUTES: MAP

  • Similar to ROUTE STARTS
  • Markers and routes displayed correctly.
  • Individual hyperlinks work.

ALL ROUTES: DATABASE

  • Routes displayed correctly.
  • Ordering by column headers
  • Individual hyperlinks work.
  • Click on route to View details.

NEW ROUTE

  • ‘Select File’ allows selection.
  • Unsuccessful upload gives alert box and status quo.
  • Successful upload generates individual review page for new route.

INDIVIDUAL ROUTE/REVIEW

  • Entry of contributor’s name and route name and description – correct handling with ACCEPT button.
  • Not possible to enter a comment.
  • Delete functions correctly (see above).
  • EDITORS:
  • As for ROUTE.

SETTINGS

  • Correct display of page from link.
  • Alter settings and ensure that the changes are acted upon.

HELP, OS Routes Plugin, Privacy Policy

  • Correct display of page from link.