Skip to content

Claude/track broken affiliate links e cb uy - #181

Merged
RivianTrackr merged 2 commits into
mainfrom
claude/track-broken-affiliate-links-ECbUY
Mar 2, 2026
Merged

Claude/track broken affiliate links e cb uy#181
RivianTrackr merged 2 commits into
mainfrom
claude/track-broken-affiliate-links-ECbUY

Conversation

@RivianTrackr

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits March 2, 2026 00:49
Two issues caused the AJAX request to fail silently:

1. No time limit extension — checking up to 50 links sequentially with
   15s HTTP timeouts easily exceeds PHP's default 30s max_execution_time.
   Added set_time_limit(300) in the AJAX handler.

2. Redundant second HTTP request per link — get_effective_url() always
   fell through to a probe request because wp_remote_head() follows
   redirects transparently (no Location header in final response).
   Now reads the effective URL directly from the WP_HTTP_Requests_Response
   transport object, eliminating ~50 unnecessary outbound requests.

https://claude.ai/code/session_01Gh8fJc8PBbaxd55cC7TR2N
Affiliate networks like CJ (jdoqocy.com) only redirect GET requests,
not HEAD. wp_remote_head returned 200 from the tracking domain itself,
so the redirect-to-homepage detection never triggered. Switched to
wp_remote_get with limit_response_size of 4KB to follow the real
redirect chain without downloading full pages.

https://claude.ai/code/session_01Gh8fJc8PBbaxd55cC7TR2N
@RivianTrackr
RivianTrackr merged commit 4f42593 into main Mar 2, 2026
6 of 7 checks passed
@RivianTrackr
RivianTrackr deleted the claude/track-broken-affiliate-links-ECbUY branch March 2, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants