Digital Sovereignty for everyone

Changelog

  • 1.32.0: Map tile hosts are now declared to the network’s Content Security Policy. When LH CSP Directives is active, LH Places adds the hosts its maps load tiles from to the policy’s allowed sources: the OpenStreetMap tile servers (Street layer) and server.arcgisonline.com (Esri World Imagery, the Satellite layer). The Satellite layer was missing from the policy, so every satellite tile was reported as a violation (179 reports on Princes Park Touch since 8 October). The list is filterable with the new lh_places_return_map_tile_sources filter, and nothing changes when LH CSP Directives is not active.
  • 1.31.2: Stop the bundled WP-GeoMeta library re-testing database spatial functions on every request. When a site’s stored capability list was empty, the library treated it as not yet cached and re-ran its full set of probe queries on every meta query, including at shutdown, where a failing probe left the database connection unusable and later queries on the same request failed with “Commands out of sync” (seen on Princes Park Touch and site 92). An empty stored list is now accepted as a cached result. A probe answered with “Incorrect number of arguments for FUNCTION” now counts the stored function as present, since that reply means it exists. The custom-function lookup matches against the current database (DATABASE()) rather than the configured database name. The probe also returns its result directly instead of calling itself again, which could loop when nothing was found and caching was off. After updating, use the re-scan capabilities action on affected sites to rebuild their stored list.
  • 1.31.1: Static-analysis fixes, no behaviour change. When reading GPS coordinates from raw EXIF, the check that rejects a 0,0 position now compares as floats explicitly. PHPStan could not infer the type, so it reported the comparison as always false. The map’s data-zoom attribute now passes a string to esc_attr() instead of an int. PHPStan level 5 is clean after this release.
  • 1.31.0: Standards clean-up release (lh-tasks #149947), with no change to hooks, meta keys, REST routes or block names. The main file header now carries License: GPLv3 or later, License URI, Requires at least: 6.3 (the map block uses block.json apiVersion 3 and a render file) and Requires PHP: 7.4, so the compiled readmes no longer warn about missing fields. The hard-coded LH_PLACES_VERSION constant, stuck at 1.30, is gone. Script versions now come from a new plugin_version() that reads the Version header, so browser caches of the classic-editor script, the block-editor geo panel and the Leaflet map script now refresh on every release. The class follows the LH plugin structure: plugin_name() and plugin_version() identity methods, a private constructor, an initialised singleton property, and an lh_places_init_plugin filter in plugin_init() that lets a site disable the plugin without deactivating it. The class_exists() wrapper around the whole file is removed, because that pattern caused the lh-tasks early-binding outage. The wp-geometa-lib loader still runs at file level so its version arbitration happens before plugins_loaded. register_activation_hook() was being passed two stray arguments, which are now removed. This release also includes the 1.30.3 status filtering for the map block, documented in that release.
  • 1.30.3: Security: the map block and map_output() no longer show posts the viewer cannot see. The block’s Post status field (comma-separated, added in 1.23) was passed straight to WP_Query, so an editor could set it to draft or pending and publish those posts’ titles, links and locations on a public map. Statuses are now filtered for the current viewer by the new filter_viewable_statuses(). A status is kept when its registered status object is public for this request, which is how lh-membership, lh-restricted-post-status and the other LH status plugins already expose member-only statuses, so maps such as publish,member keep working for members. ‘private’ is kept only for users who can read_private_posts. Draft, pending, future, trash and unregistered statuses are dropped. If no requested status is viewable, the map renders nothing instead of falling back to published posts. The /lh-places/v1/geojson collection route no longer registers the post_status parameter. It was never read, because the callback always queried publish, so behaviour is unchanged and the route no longer advertises an option it does not support.
  • 1.30.2: Fix an undefined-variable warning in the bundled WP_GeoMeta library. deleted_meta() checked $delete_all, which it never defines (the check was copied from core’s delete_metadata(), where it is a parameter), so every geo meta deletion raised “Undefined variable $delete_all”. The checks now omit it, which leaves their behaviour unchanged. An empty list of meta IDs now returns early instead of running a DELETE with an empty IN () list.
  • 1.30.1: Fixes a PHP deprecation notice in the bundled wp-geometa-lib when GeoJSON stored as a string is merged into a FeatureCollection, which happens when a post with geo_json is saved or indexed. WP_GeoUtil::merge_geojson() passed an undefined $encoding variable to iconv(), so iconv() always received null as its source encoding and PHP 8.1+ logged a deprecation that the @ operator did not suppress. Invalid UTF-8 is now stripped with WordPress’s wp_check_invalid_utf8() before the string is decoded, which is what the iconv() call was meant to do. Valid GeoJSON is decoded exactly as before.
  • 1.30: Legacy release, recorded retrospectively. No release notes survive for this version: the on-disk readme changelog stops at 1.29. The date is when this version’s files were installed, the only record of when it was released.
  • 1.29: Fixes geo fields not saving from the block editor for post types registered late on init: the geo meta is now registered at init priority 9999 instead of 10, so those types already exist and declare geo support when it runs, and the fields appear in their REST responses.
  • 1.28: Import from media now falls back to reading EXIF directly when WordPress’s image metadata has no coordinates, which is common for iPhone photos on WordPress 7. It parses the raw GPS degree, minute and second values into decimal degrees, prefers the original upload over the rotated copy, and still checks WordPress’s metadata first.
  • 1.27: Adds an Import from media button to the block editor Geo Data panel. It looks through the post’s attachments for EXIF GPS data, applies southern and western hemisphere signs, and fills latitude, longitude and GeoJSON from the first usable pair, reporting which attachment it used or that none had GPS data. Backed by a new REST endpoint, lh-places/v1/attachment-exif-gps/{id}, which requires edit_post, validates coordinate ranges and treats 0,0 as missing.
  • 1.26: Adds a Show numbered list toggle to the map block’s display settings, on by default. Turning it off hides the list below the map. Single-place maps never show a list.
  • 1.25: Multi-place maps now use numbered markers (CSS teardrops with no image files, for any count) and render an ordered list below the map with each post’s linked title and address. The list is plain HTML and works without JavaScript. Single-place maps keep the standard pin and no list.
  • 1.24: Removes the lh_places_geomap and lh_places_geojson shortcodes, which the lh-places/map block replaces. map_output() now uses wp_parse_args() with post_type defaulting to any, and the static-map OG image now detects the map block rather than the shortcode.
  • 1.23: The map’s post status setting (shortcode attribute and block field) now accepts a comma-separated list such as publish,member,featured, including custom statuses. Each is sanitised and passed to WP_Query as an array. The default is still publish.
  • 1.22: Makes maps fully responsive: the map fills a wrapper that holds the configured height, so it always spans the container width, and a ResizeObserver tells Leaflet to redraw whenever the container resizes (sidebar toggles, window resizes, theme layout changes).
  • 1.21: Fixes the zoom calculation choosing the closer zoom instead of the further one. The map now fits all markers and only uses the zoom setting when the fitted view would be further out.
  • 1.20: Makes the zoom floor reliable by calculating synchronously the zoom fitBounds would choose, taking the closer of that and the zoom setting, and setting the view directly, with no dependence on animation events.
  • 1.19: Fixes the zoom floor having no effect on multi-place maps: fitBounds is asynchronous, so the zoom check now runs after the map has finished moving.
  • 1.18: Zoom on multi-place maps becomes a floor: the map fits all markers first, then zooms in to the zoom setting if it ended up further out than that.
  • 1.17: Reworks zoom for multi-place maps: zoom is now passed to fitBounds as its maximum, so markers are never over-zoomed but the map always zooms out far enough to show them all. Single-place zoom is unchanged. The block’s zoom control gains help text explaining both behaviours.
  • 1.16: Fixes the zoom setting having no effect on multi-place maps (the comparison was inverted), and relabels the block’s zoom control from “Default zoom (single-point maps)” to “Default zoom”.
  • 1.15: Fixes the map block rendering nothing when the post type was left blank and specific post IDs were given: it now queries all post types, and passes any to WP_Query as a plain string rather than an array. An empty map now shows a visible placeholder in the editor preview so misconfiguration is easy to spot, and stays silent on the public site.
  • 1.14: Adds the lh-places/map block, server-side rendered through the same map_output() logic as the map shortcode, with post type, post count, height, zoom, default layer, category, post parent and specific post IDs in the sidebar and a settings summary on the editor canvas. Registered from block.json with no build step. The geo panel still loads only on geo-enabled post types, while the map block loads on every block editor screen. The lh_places_geomap shortcode was kept for existing posts.
  • 1.13: Adds a satellite tile layer (Esri World Imagery, no API key) to every map through Leaflet’s layer control, and a layer attribute to start a map on street or satellite view.
  • 1.12: Fixes missing Leaflet marker icons: the marker images now sit where Leaflet’s CSS expects them (assets/css/images/), and the map passes the plugin’s absolute image URL to the script instead of relying on Leaflet’s relative-path guessing.
  • 1.11: Fixes a false “ST_AsGeoJSON not supported” notice on MariaDB 11 caused by a stale wp_geometa_capabilities option. The notice now says the cache may be stale and offers a Re-scan database capabilities link, which deletes the cached option and runs a live function test (nonce-checked, handled on admin_init with a safe redirect).
  • 1.10: Bundles wp-geometa-lib 0.4.0 for spatial indexing, so no separate plugin is needed. Adds a geo_json post meta field for full GeoJSON (polygons, lines, feature collections), REST endpoints lh-places/v1/geojson/{id} and lh-places/v1/geojson, and an lh_places_geojson shortcode. Replaces the Google Maps renderer with bundled Leaflet 1.9.4, so maps need no API key, and lh_places_geomap now renders points, polygons and lines natively. Adds a GeoJSON field to the block editor panel and classic meta box, keeps point GeoJSON and latitude/longitude in sync both ways, and shows an admin notice if the database lacks ST_AsGeoJSON. The OpenStreetMap attribution link replaces the Google Maps link, and the Google Maps API key is now optional (static OG images only). Fixes nonce handling to unslash before sanitising, and escapes all meta box output.
  • 1.03: Block editor geo panel using useEntityProp, and a classic editor meta box with geolocation lookup. Stores the WordPress geodata standard fields geo_latitude, geo_longitude and geo_address. Adds GeoRSS namespace and item output to feeds, ICBM and DC.title head meta tags, and Tribe Events and GatherPress integrations. The exact release date of this version is not recorded.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.