time(), 'action' => $action, 'target' => $target, 'actor' => $actor, 'ip' => RateLimiter::client_ip(), ); update_post_meta( $id, self::META, array_slice( $log, -200 ) ); } /** * @param int $id Application ID. * @return array */ public static function entries( $id ) { $log = get_post_meta( $id, self::META, true ); return is_array( $log ) ? $log : array(); } }