1, 'username'=>'admin', 'roles'=>['administrator']] * plugin_activated → ['plugin_file'=>'foo/foo.php', 'plugin_name'=>'Foo', 'version'=>'1.2'] * * @var array */ public array $metadata; /** @var float Unix timestamp with microseconds (from microtime(true)). */ public float $timestamp; /** * @param string $type Event type identifier. * @param string $severity info|notable|important|critical. * @param string $category authentication|user|content|plugin|theme|file|security|system. * @param array $metadata Structured per-event payload. * @param float $timestamp Optional; defaults to now. */ public function __construct( string $type, string $severity, string $category, array $metadata = array(), float $timestamp = 0.0 ) { $this->type = $type; $this->severity = $severity; $this->category = $category; $this->metadata = $metadata; $this->timestamp = $timestamp > 0 ? $timestamp : microtime( true ); } /** * Wire format for batch POST to the WPPilot backend. * * @return array */ public function to_payload(): array { return array( 'type' => $this->type, 'severity' => $this->severity, 'category' => $this->category, 'metadata' => $this->metadata, 'timestamp' => gmdate( 'c', (int) $this->timestamp ), ); } }