Skip to content

Fix/seo audit - #167

Merged
MaryWylde merged 2 commits into
devfrom
fix/seo-audit
Aug 5, 2026
Merged

Fix/seo audit#167
MaryWylde merged 2 commits into
devfrom
fix/seo-audit

Conversation

@MaryWylde

Copy link
Copy Markdown
Contributor

No description provided.

MaryWylde and others added 2 commits August 5, 2026 14:52
Ahrefs counts a decorative alt="" as a missing alt attribute, so the
cookie close button, the /uxcp country flags and the longevity
environment icons showed up across ~90 pages in the audit.

Alt text is derived from content already on the page — the country name
and the Strapi item name — so it stays correct and localized as the
content changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The locale-root canonical was built from asPath, and the `asPath === '/'`
guard only catches the bare root. Add any query string and the path fell
through as "/?x=1", which cleanURL trimmed back to "/" — yielding
https://keepsimple.io/ru/ and /hy/, both of which 308 to the slashless
form. Ahrefs surfaced it via a scanner's ?phpinfo=1 probe, but it hit
every UTM-tagged link to the RU and HY homepages too.

English is unaffected: it has no locale prefix, so the path is "/" and
the domain root never redirects.

Also flip the 404 page from "index, follow" to "noindex, follow" — it
was inviting Google to index the error page.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @MaryWylde's task in 1m 47s —— View job


Claude's Review

  • Gather context (diff against origin/dev, read changed files)
  • Understand the request (code review per custom instructions)
  • Review correctness & React best practices
  • Review TypeScript quality
  • Review project conventions (AGENTS.md)
  • Review accessibility & UX
  • Review security
  • Review styling
  • Post final summary

Summary

Small, well-scoped SEO fix PR (21/-8 across 9 files). Two independent fixes:

  1. Canonical URL trailing-slash bug (SeoGenerator.tsx x2, 404.tsx) — Previously, a homepage/index request with a query string or hash in a non-default locale (e.g. asPath = "/?utm_source=x") collapsed via cleanURL to "/", producing a canonical of .../ru/ which 308-redirects to .../ru. The new regex cleanURL(alternateLink).replace(/^\/(?=$|[?#])/, '') strips that lone leading slash so canonical points at the final URL, not a redirect. I traced through the home/en, home/ru, home-with-query, and normal-path cases — all correct, no regressions for multi-segment paths. Good catch, and the inline comment explaining why is exactly the kind of non-obvious context worth keeping.

    • 404 page also now emits noindex, follow instead of index, follow — correct practice, keeps the error page out of the index while still letting crawlers follow links off it.
  2. Missing/empty alt text (Box.tsx, EnvironmentSubSection.tsx, FlagImage.tsx + 3 call sites) — replaces empty alt="" with descriptive text ("Close cookie notice", the environment icon's name, "Flag of {countryName}"). Verified Country.name exists on the Country type (src/uxcore/data/countryBias/types.ts) so country.name / c.name / hoveredData.name passed into the new countryName prop are all valid, non-fabricated fields — this isn't UX Core bias data, just the country-map UI, so no schema-approval concern.

No violations of AGENTS.md conventions spotted (no App Router patterns, no new state libs, no global CSS leaks, import order untouched, barrels untouched). FlagImage still uses a plain <img> for the external flagcdn.com PNG, which is fine — the SVG-as-component rule doesn't apply to raster images from a remote CDN, and that pattern predates this PR.

No inline comments needed — didn't find bugs, only a couple of very minor optional nitpicks not worth blocking on:

  • The // A lone "/" here..." comment is duplicated verbatim in both SeoGenerator.tsx copies (src/components and src/uxcore/components) — expected given the two components are already separately maintained, not a new problem introduced here.

Verification note: I was unable to run tsc/eslint in this sandbox (bash commands required approval that wasn't available), so this review is based on manual reading of the diff and surrounding code, not a build/lint pass.

@MaryWylde
MaryWylde merged commit c633b8a into dev Aug 5, 2026
2 checks passed
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.

1 participant