• v0.2.1 5912599769

    v0.2.1 Stable

    hanyixuanten released this 2026-07-27 20:08:09 +08:00 | 39 commits to master since this release

    Full Changelog: https://github.com/hanyixuanten/wp-translate/compare/v0.2.0...v0.2.1

    English

    Highlights

    • Added localized sitemap support for both subdirectory and domain-binding routing:
      • Subdirectory: /{language}/sitemap.xml
      • Bound domain: /sitemap.xml
    • Rewrites source-site URLs in sitemap XML text nodes, attributes, and stylesheet processing instructions to the active language URL.
    • Added support for enabling subdirectory and domain-binding modes at the same time.
    • Generated links now preserve the routing mode used by the current request.
    • Both routing modes can be disabled when localized routing is not required.
    • The domain-binding settings field is hidden when domain mode is disabled.

    Fixes

    • Fixed subdirectory rewrite handling so language-prefixed requests correctly reuse WordPress rewrite rules.
    • Fixed fallback routing behavior when one or both routing modes are disabled.
    • Fixed conflicts that previously prevented subdirectory and domain modes from working together.
    • Improved localized sitemap URL matching and rewriting across several edge cases.
    • Sitemap retrieval failures are non-fatal and fall back to normal WordPress request handling.
    • External URLs and unrelated sitemap files are no longer rewritten.

    Maintenance

    • Standardized the plugin entry file and internal identifiers under the btranslate prefix.
    • Renamed settings, Cron hooks, translation tables, PHP symbols, and related package references from wpt_* to btranslate_*.
    • Updated the packaging workflow to build releases from btranslate.php.
    • Added complete uninstall cleanup for:
      • Plugin settings and Baidu credentials
      • Retranslation batch state
      • Pending Btranslate Cron events
      • Persisted translation tables on single-site and multisite installations
    • Updated the English and Chinese documentation.

    Upgrade Notice

    This release changes persistent identifiers from wpt_* to btranslate_*, including the settings option and translation table name. No automatic migration from the old identifiers is included.

    Before upgrading an existing v0.2.0 installation, back up the WordPress database. Existing settings, credentials, and translations stored under the old identifiers may need to be reconfigured or regenerated.


    中文

    主要更新

    • 新增本地化站点地图支持,同时适用于子目录和域名绑定路由:
      • 子目录模式:/{语言}/sitemap.xml
      • 绑定域名模式:/sitemap.xml
    • 支持将站点地图 XML 文本节点、属性及样式表处理指令中的源站 URL 改写为当前语言 URL。
    • 子目录和域名绑定模式现在可以同时启用。
    • 页面生成的链接会保持当前请求所使用的路由模式。
    • 不需要多语言路由时,可以同时关闭两种路由模式。
    • 关闭域名模式后,管理界面会隐藏域名绑定设置。

    问题修复

    • 修复子目录重写逻辑,使带语言前缀的请求能够正确复用 WordPress 重写规则。
    • 修复关闭一种或全部路由模式时的回退行为。
    • 修复此前导致子目录模式和域名模式无法同时工作的冲突。
    • 修复本地化站点地图请求匹配和 URL 改写中的多个边界问题。
    • 获取源站站点地图失败时不再造成致命错误,而是交回 WordPress 按普通请求处理。
    • 不再改写外部 URL 和无关的站点地图文件。

    维护改进

    • 将插件入口文件和内部标识统一为 btranslate 前缀。
    • 将设置项、Cron 钩子、翻译数据表、PHP 符号及打包配置从 wpt_* 统一更名为 btranslate_*
    • 更新发布工作流,改为从 btranslate.php 构建插件包。
    • 新增完整的卸载清理逻辑,包括:
      • 插件设置和百度翻译凭据
      • 重新翻译批处理状态
      • 待执行的 Btranslate Cron 事件
      • 单站点和多站点环境中持久化的翻译数据表
    • 更新中英文文档。

    升级注意事项

    本版本将持久化标识从 wpt_* 更改为 btranslate_*,其中包括设置选项和翻译数据表名称。目前没有包含旧标识到新标识的自动迁移逻辑。

    从现有 v0.2.0 安装升级前,请先备份 WordPress 数据库。保存在旧标识下的设置、凭据和翻译数据可能需要重新配置或重新生成。


    Changes: v0.2.0...v0.2.1
    Commits: 15 non-merge commits / 15 个非合并提交

    Downloads