Repository navigation
Stop adding the language code twice to upgrade links - #1243
Merged
Merged
Conversation
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>
Collaborator
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, inOptml_Admin::get_upgrade_base_link().Note
The doubled code was added in 063d888 on version 4.1.3 (2025-11-05).
What changed
Optml_Admin::get_upgrade_base_link()as it is. For a German admin, each one links tohttps://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.
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.
Create the file
wp-content/mu-plugins/optml-bf.phpwith the content below. Then go toWP Admin → Optimole(/wp-admin/admin.php?page=optimole).Expect: the upgrade box in the sidebar shows a black strip with the promo code
BFCM2525.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 withhttps://optimole.com/de/de/upgradeand the page was a 404.Delete the file
wp-content/mu-plugins/optml-bf.php. Reload the Optimole page.Expect: the black strip is gone.
🤖 Generated with Claude Code