Architecture

A singleton plugin class (LH_User_Profiles_Plugin) that bootstraps on plugins_loaded, behind the lh_user_profiles_init_plugin filter. It has no admin screens, database tables, cron jobs, settings or MCP abilities. On init it registers the avatar shortcode and the block (from blocks/profiles/block.json); on rest_api_init it registers the editor search route.

The block renders through one static method, render_profiles( $user_ids, $fields ), called directly with the block’s userIds and fields attributes. The block’s editor script uses plain wp.* globals with no build step, and previews through ServerSideRender.

Data it reads

The plugin stores no content of its own. It reads core user fields (display_name, description, avatar) plus two user meta keys written by other LocalHero plugins: lh_users_secondary_email and lh_profile-phone (E.164). A site leaving LocalHero keeps that data in its own user tables, but existing pages depend on this plugin to render it, which is why the plugin is public.

The only option it writes is lh_user_profiles_version (per site, not autoloaded). When upgrading from a version before 1.1.0, the plugin deletes the site’s cached rewrite_rules once so WordPress regenerates them.

History

Hooks

Roadmap

The avatar shortcode stays. The profile post type will be reintroduced as a separate piece of work (lh-tasks #147603).