Automattic / Automattic/jetpack

Publicize: Non-Latin characters in og:description causes error in FB

Open
#13,987 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Publicize [Feature] Sharing [Focus] i18n [Pri] Low Bug Customer Report [LEGACY]
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

When posting using non-Latin characters, the `og:description` when using WordPress's [auto-excerpt](https://wordpress.org/support/article/excerpt/) causes an error on Facebook's end and prevents the post from being publicized to that platform.

Discovered in 2476396-zen - blog ID 168708488

The error message we're seeing from FB is `Error 400 ((#100) name parameter cannot be longer than 255 bytes.)`

For this user, an example post (post ID 1212) that failed had an `og:description` of:

`चंडीगढ़, 7 नवंबर: पंजाब सरकार द्वारा राज्य में पराली की समस्या से निपटने के लिए गंभीरता के साथ कदम उठाए जा रहे हैं और इस दिशा में कई प्रयास विचाराधीन हैं। इस सम्बन्धी जानकारी देते हुए राजस्व मंत्री`

While it's technically 197 characters, it's 354 bytes, which exceeds FB's 255 limit.

We fixed a similar issue in #9898 that was implemented in r189761-wpcom - chatting with @jeherve, he said we'd just need to apply a similar fix to `og:description`.

Contributor guide

Open the contributing guide

Research direction

Compare the related fix in issue #9898 and revision r189761-wpcom, then locate where Jetpack generates the Facebook og:description for WordPress auto-excerpts. Reproduce the non-Latin example or inspect the existing regression coverage; done means the description complies with Facebook's 255-byte limit and the post can be publicized.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.