Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

Activation & upgrades

What happens when you activate WP-PFManagement and how upgrades are handled between versions.

On activation

  1. Database tables are created for all PFM entities
  2. Six built-in roles are seeded: admin, schema_manager, data_reader, data_writer, public (META), authenticated (META)
  3. Seven built-in events are registered in wp_pfm_event_registry
  4. The "Administration" application is created with 11 navigation modules
  5. The __wp_administrators synthetic group is created and bound to the admin role — all WP admins are auto-added
  6. All PFM capabilities are granted to the WordPress administrator role

Upgrade path

On every plugin load, run_upgrade() checks the stored version against the current version and runs incremental upgrades:

  1. Schema changes — new tables or columns are added via the Reconciler
  2. Metadata re-seeding — new roles, events, or navigation modules are added
  3. Orphan cleanup — records for deleted entities are removed
  4. 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:

  1. Delete all entities (drops their tables)
  2. Delete the plugin from the Plugins screen
  3. Manually remove pfm_* options from wp_options if desired