Skip to content

Commit

Permalink
fix: Don't set a user if a user is not authenticated (#2424)
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM authored Dec 15, 2023
1 parent a8e7c52 commit b58702a
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function (HookData $hook) use ($integration, $theme) {
// Runs after wp-settings.php is loaded - i.e., after the entire core of WordPress functions is
// loaded and the current user is populated
$user = wp_get_current_user();
if ($user) {
if ($user && $user->ID !== 0) {
$meta = [];
if ($user->user_login) {
$meta['username'] = $user->user_login;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "ca4d22f2-9347-458f-be03-e9defbc1af52",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "2ee1d558-5813-4a2b-a74e-1404119c4473",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "6732cc6a-78ad-4ca4-b1ea-5eb516ff75f0",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "a4fe8a3c-397d-4da6-afb8-53617be50dbe",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "06e879d2-e97d-4420-81ec-30074239cf68",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "06e879d2-e97d-4420-81ec-30074239cf68",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "bb23676d-44d0-4bd7-8c2a-fc5a5c89985a",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "404",
"http.url": "http://localhost:9999/does_not_exist?key=value&<redacted>",
"runtime-id": "bb23676d-44d0-4bd7-8c2a-fc5a5c89985a",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "7b42d084-3a90-4688-9319-30e9724039bb",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "7b42d084-3a90-4688-9319-30e9724039bb",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "9244a46d-d13c-4bce-b787-87c52dd20f33",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "404",
"http.url": "http://localhost:9999/does_not_exist?key=value&<redacted>",
"runtime-id": "b5e7ee20-5ea1-486f-a770-c17a3b60636e",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "7a9eb703-4857-4061-adce-a45e58093b65",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "b5e7ee20-5ea1-486f-a770-c17a3b60636e",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "95e244b4-fc3a-4566-8940-d2badc3e99b5",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "404",
"http.url": "http://localhost:9999/does_not_exist?key=value&<redacted>",
"runtime-id": "95e244b4-fc3a-4566-8940-d2badc3e99b5",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "eae4f3b0-bd58-46e8-ac81-96149959e17a",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "95e244b4-fc3a-4566-8940-d2badc3e99b5",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "500b19ab-e36c-4cbc-a9dd-f15015a52ccf",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "404",
"http.url": "http://localhost:9999/does_not_exist?key=value&<redacted>",
"runtime-id": "c1971c1f-c171-4612-ba42-df98413a59df",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "500b19ab-e36c-4cbc-a9dd-f15015a52ccf",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "c1971c1f-c171-4612-ba42-df98413a59df",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "912637ae-7f7b-4e70-aaf9-c93af17d9c55",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "c89d84b2-1990-414b-82d3-bd32b893f06f",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "912637ae-7f7b-4e70-aaf9-c93af17d9c55",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple?key=value&<redacted>",
"runtime-id": "837e05f7-6878-41e5-b501-744109c8953b",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/error?key=value&<redacted>",
"runtime-id": "7232ea59-8385-4459-abb2-dfebc631eff9",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"http.status_code": "200",
"http.url": "http://localhost:9999/simple_view?key=value&<redacted>",
"runtime-id": "837e05f7-6878-41e5-b501-744109c8953b",
"span.kind": "server",
"usr.id": "0"
"span.kind": "server"
},
"metrics": {
"_sampling_priority_v1": 1.0
Expand Down

0 comments on commit b58702a

Please sign in to comment.