My affiliate gap scanner reported that forty-nine pages mentioned a VPN brand and had zero affiliate links attached. Losing forty-nine monetised pages is the kind of thing you drop everything for.

Before I touched anything, I ran one command:

grep -rhoE 'href="https?://(www\.)?surfshark\.com[^"]*"' cyberpicks --include='*.html' | wc -l # 0 

Zero links to the vendor domain anywhere in the site. That is consistent with the report — and it is also consistent with something much more boring: the site never linked to the bare domain in the first place.

The actual cause

The scanner works by looking for a brand's URL in data/affiliate_links.json, then counting pages whose outbound links still point at the bare domain instead of the affiliate URL.

For this brand the entry was:

"surfshark.com": { "url": "", "site": "cyberpicks", "note": "确认是否已挂 CJ" } 

The url field was empty. So the scanner matched pages against an empty string, found every vendor link "not yet replaced," and reported forty-nine broken pages.

The links were there. The config was not. After filling in the URL and re-scanning, the same report read 49 mentions / 45 already attached — five to go, not forty-nine.

The general shape of this bug

A report that says "N things are missing" can mean two very different things:

  1. The things are missing.
  2. The check is looking at an empty field, so everything counts as missing.

These look identical from the outside. The tell is that version 2 usually reports a suspiciously round relationship to the total — nearly all of them, or exactly none of them.

Two habits that catch it:

  • Ask what field the check reads before believing the number. Especially for a count that jumped without an obvious cause.
  • Spot-check one item by hand. One page, opened and looked at, settles it faster than any amount of reasoning about the aggregate.

Why it mattered here

The scanner is the thing that decides where the next few hours go. A false 49-page emergency would have burned an evening rewriting pages that were already correct — and the actual five remaining pages would have gone untouched.

The cost of a wrong report is not the report. It is the work it sends you to do.

Built while running five comparison sites as a one-person operation. More notes at https://yongrui-services.pages.dev/