Preview checker: a long `og:title` or `og:description` gets no warning when the page also has a normal title and description
Maintainer thường phản hồi trong vòng 2 ngày
@Imhamza86 đang làm issue này rồi.
Từ ngày 4/12/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu tại src/lib/meta-analyzer.ts và đọc các bước kiểm tra độ dài tiêu đề và mô tả hiện có, sau đó xem lại các trường hợp liên quan trong tests/lib/meta-analyzer.test.ts. Bổ sung kiểm thử cho các giá trị Open Graph dài bên cạnh các giá trị bình thường, cũng như cho văn bản khớp nhau và khác nhau. Hoàn thành khi các cảnh báo và mức trừ điểm được chỉ định đã được kiểm thử, hành vi fallback hiện có được giữ nguyên và các bước kiểm tra được liệt kê đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
analyzeMeta only checks the length of one title and one description: tags.title || tags.ogTitle and tags.description || tags.ogDescription (src/lib/meta-analyzer.ts lines 21 and 35). So when a page has a <title> and a meta description, the og:title and og:description never get measured, and those are the ones the social previews show.
I ran parseMetaTags and analyzeMeta on the current dev with a page where everything else is set:
everything normal → score 100 (A), no issues
og:title is 116 chars → score 100 (A), no issues
og:description is 418 chars → score 100 (A), no issues
<title> is 116 chars → score 95 (A), "Title is 116 chars (recommended: under 70)"
#333 made the title check fall back to og:title when there's no <title>. This is the other half: a page that has both.
What to do
- After the current title check, also check
og:titlewhen it's set and isn't the same text as the title that was just checked. Over 70 characters gives a warning on theog:titletag, likeog:title is 116 chars (recommended: under 70), and takes 5 points like the title does. - Do the same for
og:descriptionover 160 characters, as a warning on theog:descriptiontag that takes 3 points like the description does. - When there's no
<title>or no meta description, keep what happens now: the Open Graph value is the one that gets checked, once. - The "too short" description warning stays as it is, this one is only about values that are too long.
- The test
prefers the HTML title when both title sources are presentintests/lib/meta-analyzer.test.tsexpects no warning for exactly this case, so it has to change.
Acceptance criteria
- A 116 character
og:titlenext to a normal<title>gets theog:titlewarning and scores 95 - A 418 character
og:descriptionnext to a normal description gets theog:descriptionwarning and scores 97 - A long
<title>and a longog:titlewith different text get one warning each - The same long text in
<title>andog:titlegets one warning, not two - Pages without a
<title>or meta description come out exactly as before - A test that fails on the current code
-
npm run check,npm run testandnpm run buildpass
How to test
Run the new tests, then npm run dev, open /preview and check a page with a short <title> and a long og:title. The report should list the og:title warning.
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #458 in the description.
- Ngôn ngữ chính
- TypeScript
- Star
- 8
- Fork
- 4
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 34
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codercops/ogcops
-
Preview checker: a page that only has `og:image:url` is reported as having no imageCó thể đã có người làm @MugdhoAI đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
codercops/ogcops#455 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] “Copy Recommended Meta Tags” generates an unusable placeholder image URLCó thể làm lại được @CreatorguyS đã nhận 34 ngày trước và không có pull request nào đang mở. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codercops/ogcops#378 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue templates
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue templates
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
codercops/ogcops#341 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của codercops/ogcops
Issue tương tự
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openclaw/openclaw#212827 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Use one constant for the 10,000-character input limitCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởgood first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aniru-dh21/snap-validate#51 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies effort: small good first issue priority: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-review tech-debt testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blamechris/chroxy#9520 ·
Maintainer thường phản hồi trong vòng 1 ngày