Digital Sovereignty for everyone

Changelog

  • 0.11.0: Addresses are no longer mirrored into LH Profile Page’s lh_profile-* meta: the tables are now the only store, and the meta keeps whatever it held until it is deleted. Saving some address parts now keeps the other parts from the member’s current address in the tables rather than from the meta. A stray direct write to one of the meta keys is still caught and recorded, and only the keys actually written are applied to the address. The full copy from the meta to the tables is retired, because it would roll addresses back: the resync-users ability is removed, and the backfill no longer changes anything.
  • 0.10.0: Adds LH_Addresses_Legacy_Sync::own_residential_subquery(): a derived table of user_id and meta_value for one LH Profile Page address key, so queries that join usermeta, such as Users Insights, can read the address tables instead.
  • 0.9.0: Adds LH_Addresses_Legacy_Sync::find_user_ids(), which finds members by an LH Profile Page address meta key in the address tables, so searches by country, state, town, postcode or street can move off the meta. A country matches by its English name as well as its code (Australia finds AU), and a state by its name (Victoria finds VIC).
  • 0.8.0: Adds LH_Addresses_Legacy_Sync::get_meta_value(), a drop-in reader for LH Profile Page’s address meta keys that answers from the member’s own residential address in the tables (country as its English name), cached per request and cleared on any address or use change. Readers can now move off the lh_profile-* meta.
  • 0.7.0: New write path for address fields: LH_Addresses_Legacy_Sync::set_user_parts() saves some or all of a user’s address parts to LH Addresses first, then mirrors them into LH Profile Page’s fields for the readers that still use them. Parts not given keep their current value, and clearing every part ends the member’s own address. LH Profile Page’s field saver moves to it next.
  • 0.6.0: Legacy sync: any write to LH Profile Page’s address fields is copied into the member’s own residential address once per request, so a profile save records one address, not several partial ones. A changed address replaces the old one, which is kept in the history, and clubs the member still belongs to move with it. Clearing every field ends the member’s own address; clubs keep what they were given. Writes to the fields are recorded with their caller. New resync-users ability copies chosen users now. The backfill now goes through the same sync and runs once more (pass 3) to catch edits made before the sync went live.
  • 0.5.0: Adds read-only MCP abilities: get-addresses lists a user’s addresses with the sites that hold them and their history; get-status reports address totals, validation and geocode status, and backfill progress.
  • 0.4.3: Backfill keeps users whose only address detail is a country: any data is kept. A second backfill pass starts from the first user, so users skipped by the first pass are copied; users already copied are passed over.
  • 0.4.2: Speed up the address backfill: its user query did not filter on the address meta, so it stepped through every network user (15,219) rather than the 6,280 with an address. It now reads the user meta table directly, keyset by user ID, as LH Phone Numbers’ backfill does, and also ignores values that are only whitespace. Progress carries on from where it is.
  • 0.4.1: Fix the address backfill, which stopped on its first run without copying anyone: its user query joined the user meta table once per address key, which overwhelmed the database (“MySQL server has gone away”), and the empty result was taken as the end. The query now uses a single meta clause across the five keys. A failed query no longer ends the backfill: the batch is retried five minutes later with progress unchanged. Progress moves to the network option lh_addresses_backfill_progress, so the backfill starts again; the stale lh_addresses_backfill_state is deleted by the next batch.
  • 0.4.0: Backfill from LH Profile Page: every user’s lh_profile-* address meta (street, town, postcode, state, country) is copied into the tables as their own residential address, by a single-event cron on the main site, 100 users per run in user ID order. States are mapped to codes (Victoria and VIC become VIC) and country names to ISO codes; anything that can’t be mapped is kept as typed and flagged by validation, never refused. Users who already have a residential address in their own book are skipped, so the backfill can safely run again. Progress is in the network option lh_addresses_backfill_state (last_user_id, seen, saved, skipped, failed, done, completed_at). Club uses are not added by the backfill; they follow separately once LH Membership answers who is a member.
  • 0.3.0: Address history is kept forever, and organisations keep the addresses they were given. Changing an address now ends its row and starts a new one instead of overwriting it: the member’s own address book and the sites they still belong to move to the new address, while a site they have left keeps the last address it was given (new filter lh_addresses_carry_use_on_move, for LH Membership to answer). A site’s use is ended, not deleted, when that site is given another address of the same type, and end_use() replaces remove_use(). Leaving a site and deleting a user no longer remove anything: remove_site_uses(), delete_user_addresses() and the personal data eraser are gone. Schema 0.2.0: addresses gain ended_at and ended_by, and uses get their own id plus created_by, ended_at and ended_by. get_user_addresses() returns current records by default and takes include_ended for history; the personal data export includes replaced addresses. New action lh_addresses_replaced; lh_addresses_use_removed is now lh_addresses_use_ended; lh_addresses_site_uses_removed and lh_addresses_user_addresses_deleted are removed.
  • 0.2.4: Requires PHP 8.1. doctrine/collections 3.x, which commerceguys/addressing 2.3 depends on, needs PHP 8.1, so the plugin header and composer.json now say so instead of 8.0. No code change.
  • 0.2.3: Simplifies the required-field check in address validation. commerceguys/addressing returns a country’s required fields as plain strings (AddressField constant values); the enum handling added in 0.2.2 was unnecessary and is replaced with a direct intersection against the fields LH Addresses stores. No change in behaviour.
  • 0.2.2: commerceguys/addressing 2.3 is now installed with Composer, so address validation (valid, incomplete or invalid for the country’s format and postcode pattern) and state-name mapping (Victoria or Vic to VIC) are active. Also adds handling for the library’s required fields arriving as enum cases; this proved unnecessary and was simplified in 0.2.3, with no change in behaviour.
  • 0.2.1: The user-deletion and geocoding cron hooks now go through small handler methods that return nothing, instead of hooking functions that return a count or a result array directly. No change in behaviour; found by static analysis.
  • 0.2.0: First working release of LH Addresses: structured, international postal addresses for users, stored network-wide and shared with the organisations (sites) they belong to. Three tables on the main site: lh_addresses (CLDR address fields as used by commerceguys/addressing, plus source, validation and geocoding status), lh_address_uses (which address fills which type for whom: blog 0 is the member’s own address book, any other blog ID means the address has been given to that site’s organisation) and lh_address_geo (one point per geocoded address, with a spatial index). Tables are created and upgraded from a schema version, not the plugin version. The LH_Addresses_Api class saves and normalises addresses (subdivision names such as Victoria or Vic become VIC; postcodes upper-cased; missing country taken from the site locale), records whether each address is valid, incomplete or invalid for its country without ever refusing a save, keeps at most one current address per user, site and type, and answers reads through access rules: users see their own addresses, install_plugins sees all, and anyone else sees only addresses given to a site when the lh_addresses_site_can_read filter allows it (answered by LH Membership). It also offers a near-point search over a site’s addresses using the spatial index. Geocoding is queued: saving or changing an address marks it pending, and a five-minute cron on the main site sends due addresses through the lh_places_geocode filter (answered by LH Places) at no more than one request per second, retrying failures with backoff and skipping an address after five attempts; without a geocoder addresses simply stay pending. Removing a user from a site removes that site’s uses of their addresses, and deleting a user from the network deletes all of their addresses, uses and points. WordPress personal data export and erasure include addresses: on the main site they cover everything, on other sites only what was given to that site. Adds a write_log() helper, Requires at least 6.7 and Requires PHP 8.0 headers, and a Composer manifest for commerceguys/addressing (validation and subdivision mapping are skipped until it is installed).
  • 0.1.0: Initial scaffold.

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.