Skip to content

Commit 34ff3db

Browse files
committed
Release 1.4.12
Updated wp-redirect-log.php to include siteurl and home as well as backtrace.
1 parent 6a41a4e commit 34ff3db

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Changelog
2+
## Release 1.4.12
3+
4+
5+
## Release 1.4.11
6+
* Added updated-content.php snippet
7+
8+
29
## Release 1.4.10
310
* * Created blocks footer-navigation.php
411

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ The status field is used to indicate the current status of the snippet. This is
158158
| [Failover Status Monitor](./wp-failover/wp-failover.php) | 1.0.0 | mu-plugin | :white_check_mark: | Monitors failover status and provides notifications. |
159159

160160
# Changelog
161+
## Release 1.4.12
162+
163+
164+
## Release 1.4.11
165+
* Added updated-content.php snippet
166+
167+
161168
## Release 1.4.10
162169
* * Created blocks footer-navigation.php
163170

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.11
1+
1.4.12

debug/wp-redirect-log.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,25 @@ function wprl_log_redirect( $location, $status ) {
6565
$caller_info = wp_basename( $caller['file'] ) . ':' . ( $caller['line'] ?? 0 );
6666
}
6767

68+
// Grab siteurl and home from options
69+
$siteurl = get_option( 'siteurl' );
70+
$home = get_option( 'home' );
71+
6872
$msg = sprintf(
69-
"[WP-REDIRECT] %s → %s (status %d) called by %s",
73+
"[WP-REDIRECT] %s → %s (status %d) called by %s | siteurl=%s | home=%s",
7074
$_SERVER['REQUEST_URI'] ?? 'unknown',
7175
$location,
7276
$status,
73-
$caller_info
77+
$caller_info,
78+
$siteurl,
79+
$home
7480
);
7581
wprl_write_log( $msg );
7682

83+
// Also emit a short backtrace to the PHP error log for deeper debugging
84+
error_log( '[WP-REDIRECT TRACE] ' . ( $_SERVER['REQUEST_URI'] ?? 'unknown' ) . '' . $location );
85+
error_log( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 10 ), true ) );
86+
7787
return $location;
7888
}
7989

@@ -85,12 +95,22 @@ function wprl_log_redirect( $location, $status ) {
8595
*/
8696
function wprl_log_raw_header( $headers ) {
8797
if ( ! empty( $headers['Location'] ) ) {
98+
// Grab siteurl and home from options
99+
$siteurl = get_option( 'siteurl' );
100+
$home = get_option( 'home' );
101+
88102
$msg = sprintf(
89-
"[WP-HEADER] sending Location: %s (on %s)",
103+
"[WP-HEADER] sending Location: %s (on %s) | siteurl=%s | home=%s",
90104
$headers['Location'],
91-
$_SERVER['REQUEST_URI'] ?? 'unknown'
105+
$_SERVER['REQUEST_URI'] ?? 'unknown',
106+
$siteurl,
107+
$home
92108
);
93109
wprl_write_log( $msg );
110+
111+
// Also emit a short backtrace to the PHP error log for deeper debugging
112+
error_log( '[WP-HEADER TRACE] ' . ( $_SERVER['REQUEST_URI'] ?? 'unknown' ) . '' . $headers['Location'] );
113+
error_log( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 10 ), true ) );
94114
}
95115
return $headers;
96116
}

0 commit comments

Comments
 (0)