Making WordPress.org

Opened 5 years ago

Closed 23 months ago

Last modified 23 months ago

#4367 closed defect (bug) (fixed)

Plugin Directory: Duplicate hreflang tags

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

Background: #4357

On https://wordpress.org/plugins/akismet/, some hreflang link tags are duplicated:

<link rel="alternate" href="https://de.wordpress.org/plugins/akismet/" hreflang="de-de" />
<link rel="alternate" href="https://de.wordpress.org/plugins/akismet/" hreflang="de-de" />
...
<link rel="alternate" href="https://nl.wordpress.org/plugins/akismet/" hreflang="nl-nl" />
<link rel="alternate" href="https://nl.wordpress.org/plugins/akismet/" hreflang="nl-nl" />

Probably caused by formal/informal locale variants, as in #4357.

Change History (5)

#1 @SergeyBiryukov
5 years ago

The code for outputting hreflang tags currently exists in plugin-directory/class-template.php, as well as the wporg theme. It might be a good idea to abstract some of it, but for now applying [8569] and [8571] to the Plugin Directory would probably be enough.

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


5 years ago

#3 @dd32
4 years ago

This seems to be caused by GlotPress, as it's returning the incorrect wp_locale field for de_DE_formal:

https://translate.wordpress.org/api/projects/wp-plugins/akismet/stable/

....
{
      "id": "26810",
      "name": "German",
      "slug": "default",
      "project_id": "433",
      "locale": "de",
      "current_count": 208,
      "untranslated_count": 0,
      "waiting_count": 0,
      "fuzzy_count": 0,
      "percent_translated": 100,
      "wp_locale": "de_DE",
      "last_modified": "2020-03-29 20:09:22"
    },
....

      "id": "333713",
      "name": "German (Formal)",
      "slug": "formal",
      "project_id": "433",
      "locale": "de",
      "current_count": 202,
      "untranslated_count": 5,
      "waiting_count": 0,
      "fuzzy_count": 1,
      "percent_translated": 97,
      "wp_locale": "de_DE",
      "last_modified": "2019-11-21 17:20:04"
    },
...

#4 follow-up: @dd32
23 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 12176:

Translate: Ensure that /api/projects/wp-plugins/{$plugin}/dev/ returns translation sets with appropriate wp_locale fields.

Currently GlotPress doesn't support locale variants, resulting in API endpoints returning multiple sets with the same wp_locale value. This fixes that.

This will result in the plugin directory correctly listing hreflang tags, as it'll no longer list variants as their base locale.

Fixes #4367.

#5 in reply to: ↑ 4 @dd32
23 months ago

Replying to dd32:

This will result in the plugin directory correctly listing hreflang tags, as it'll no longer list variants as their base locale.

Fixes #4367.

...once the cache expires, which is currently 72hours for the caches in question.

Last edited 23 months ago by dd32 (previous) (diff)
Note: See TracTickets for help on using tickets.