Skip to content

Stop adding the language code twice to upgrade links - #1243

Merged
selul merged 3 commits into
developmentfrom
fix/upgrade-link-locale-prefix
Nov 18, 2026
Merged

selul merged 3 commits into
developmentfrom
fix/upgrade-link-locale-prefix

Conversation

@selul

@selul selul commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Three upgrade links got the language code twice (/de/de/upgrade), which is a 404 on optimole.com. The upgrade link now gets the language code once, in Optml_Admin::get_upgrade_base_link().

Note

The doubled code was added in 063d888 on version 4.1.3 (2025-11-05).

What changed

  • Media Library upgrade notice, Black Friday sidebar offer, disabled-account notice: use the link from Optml_Admin::get_upgrade_base_link() as it is. For a German admin, each one links to https://optimole.com/de/upgrade?email=…. Before, each one localized the link a second time and linked to /de/de/upgrade.

Note

The affected languages are the ones that tsdk_translate_link() knows: de, es, fr, it, ja, nl and ro.

All other links do not change. The optimole.com links keep their language code, so they are ready when optimole.com gets translated pages.

Today optimole.com has no translated pages. It redirects most paths that have one language code to the page without the code. The home link is the exception: /ja/ is a 404, and /de/ opens an unrelated page. This PR does not change that.

This year the Black Friday sale week starts on 2026-11-23.

QA

Use a site that is connected to an Optimole account on the free plan.

  1. Go to WP Admin → Settings → General (/wp-admin/options-general.php). Set Site Language to Deutsch. Save the settings.

    Expect: the admin is in German.

  2. Create the file wp-content/mu-plugins/optml-bf.php with the content below. Then go to WP Admin → Optimole (/wp-admin/admin.php?page=optimole).

    <?php
    add_filter( 'themeisle_sdk_is_black_friday_sale', '__return_true', 99 );

    Expect: the upgrade box in the sidebar shows a black strip with the promo code BFCM2525.

  3. Click that black strip.

    Expect: the upgrade page opens. The link address starts with https://optimole.com/de/upgrade?email=. Before this change, it started with https://optimole.com/de/de/upgrade and the page was a 404.

  4. Delete the file wp-content/mu-plugins/optml-bf.php. Reload the Optimole page.

    Expect: the black strip is gone.

🤖 Generated with Claude Code

optimole.com has no translated pages, but the plugin passed its links
through tsdk_translate_link(), which puts the language code in the path
for de, es, fr, it, ja, nl and ro users. Three upgrade links were
translated twice and pointed to /de/de/upgrade, which is a 404.

The upgrade, contact, home, pricing, terms, privacy and badge links now
have no language code. Links to dashboard.optimole.com are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@pirate-bot

pirate-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Plugin build for 31711a2 is ready 🛎️!

selul and others added 2 commits November 18, 2026 11:35
Restores the localized optimole.com links that the previous commit
removed, so they are ready if translated pages are added.

The upgrade link is localized once, inside get_upgrade_base_link(). The
Media Library upgrade notice, the Black Friday sidebar offer and the
disabled-account notice no longer localize it a second time, which
produced /de/de/upgrade (a 404).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@selul selul changed the title Stop adding a language code to optimole.com links Stop adding the language code twice to upgrade links Nov 18, 2026
@selul
selul merged commit d1a7f81 into development Nov 18, 2026
11 checks passed
@selul
selul deleted the fix/upgrade-link-locale-prefix branch November 18, 2026 09:39
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.

2 participants