Activation & upgrades
What happens when you activate WP-PFManagement and how upgrades are handled between versions.
On activation
- Database tables are created for all PFM entities
- Six built-in roles are seeded:
admin,schema_manager,data_reader,data_writer,public(META),authenticated(META) - Seven built-in events are registered in
wp_pfm_event_registry - The "Administration" application is created with 11 navigation modules
- The
__wp_administratorssynthetic group is created and bound to theadminrole — all WP admins are auto-added - All PFM capabilities are granted to the WordPress
administratorrole
Upgrade path
On every plugin load, run_upgrade() checks the stored version against the current version and runs incremental upgrades:
- Schema changes — new tables or columns are added via the Reconciler
- Metadata re-seeding — new roles, events, or navigation modules are added
- Orphan cleanup — records for deleted entities are removed
- Capability re-grant — new capabilities are assigned to the admin role
Upgrades are idempotent — running them multiple times is safe.
On deactivation
The plugin does NOT remove your data on deactivation. Entities, records, roles, and settings are preserved. Deactivation only unregisters hooks and capabilities.
On uninstall
WordPress does not automatically call an uninstall routine for deactivated plugins. To fully remove PFM data, you must:
- Delete all entities (drops their tables)
- Delete the plugin from the Plugins screen
- Manually remove
pfm_*options fromwp_optionsif desired