From a2d13200309221cb3321b62d561e572bba7f9c96 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Mon, 17 Aug 2026 16:06:40 +0000 Subject: [PATCH] v1.3.1 --- admin/views/page-catalog.php | 15 +++++++++++-- changelog.txt | 17 +++++++++++++++ includes/class-robotstxt-manager-updater.php | 23 +++++++++++++++++++- readme.txt | 10 +++++++-- robotstxt-manager.php | 4 ++-- 5 files changed, 62 insertions(+), 7 deletions(-) diff --git a/admin/views/page-catalog.php b/admin/views/page-catalog.php index 522a2a5..ce4c70f 100644 --- a/admin/views/page-catalog.php +++ b/admin/views/page-catalog.php @@ -167,6 +167,17 @@ $compat_warnings = 0; $website_url = '' !== $page_url ? $page_url : $homepage; $has_detail = ( '' !== $website_url || '' !== $desc ); + // Localised description: the admin user's locale first, + // falling back to the (English) default. + $raw_translations = $entry['description_translations'] ?? ''; + $translations = is_array( $raw_translations ) ? $raw_translations : array(); + $user_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); + $locale_text = $translations[ $user_locale ] ?? ''; + $display_desc = is_string( $locale_text ) && '' !== trim( $locale_text ) + ? trim( $locale_text ) + : $desc; + $has_detail = ( '' !== $website_url || '' !== $desc || '' !== $display_desc ); + // Subscription state: premium plugins are only usable // (install/update) with an active or in-grace subscription. $is_premium = ( $cost > 0.0 || 'premium' === $kind ); @@ -337,8 +348,8 @@ $compat_warnings = 0; - - + + diff --git a/changelog.txt b/changelog.txt index 0fcf438..61aeca7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,22 @@ == Changelog == += 1.3.1 = + +_Release date: 2026-08-17_ + +**Added** + +* Localized descriptions: catalog rows and the "View details" modal show the description in the logged-in admin's language (`get_user_locale()`, falling back to the site locale), using the new `description_translations` map from Core 1.8.0+; missing translations fall back to the English default. + +**Changed** + +* Plugin version 1.3.0 → 1.3.1. No database schema changes (no custom tables). + +**Compatibility** + +* WordPress: 4.4 - 7.1 (scan-verified: wp-compat clean from 4.4) +* PHP: 8.0 - 8.5 (scan-verified: PHPCompatibility + manual feature audit) + = 1.3.0 = _Release date: 2026-08-17_ diff --git a/includes/class-robotstxt-manager-updater.php b/includes/class-robotstxt-manager-updater.php index ca8a746..50cd2fe 100644 --- a/includes/class-robotstxt-manager-updater.php +++ b/includes/class-robotstxt-manager-updater.php @@ -210,7 +210,7 @@ class Robotstxt_Manager_Updater { 'requires_php' => $this->str( $row, 'requires_php', '' ), 'tested_up_to' => $this->str( $row, 'tested_up_to', '' ), 'page_url' => $this->str( $row, 'page_url', '' ), - 'description' => $this->str( $row, 'description', '' ), + 'description' => $this->localized_description( $row ), 'icon_url' => $this->str( $row, 'icon_url', '' ), 'banner_url' => $this->str( $row, 'banner_url', '' ), ); @@ -340,6 +340,27 @@ class Robotstxt_Manager_Updater { return $slug; } + /** + * Picks the description for the current admin user's locale, falling + * back to the default (English) description. + * + * @param array $row Catalog row. + * + * @return string The localized (or default) description. + */ + private function localized_description( array $row ): string { + $raw_translations = $row['description_translations'] ?? ''; + $translations = is_array( $raw_translations ) ? $raw_translations : array(); + $user_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); + $locale_text = $translations[ $user_locale ] ?? ''; + + if ( is_string( $locale_text ) && '' !== trim( $locale_text ) ) { + return trim( $locale_text ); + } + + return $this->str( $row, 'description', '' ); + } + /** * Extracts a string value from a mixed-value row. * diff --git a/readme.txt b/readme.txt index e19ed1b..a87fd6b 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: javiercasares, robotstxt Tags: dashboard, catalog, updates, subscriptions, management Requires at least: 4.4 Tested up to: 7.1 -Stable tag: 1.3.0 +Stable tag: 1.3.1 Requires PHP: 8.0 -Version: 1.3.0 +Version: 1.3.1 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.txt @@ -92,6 +92,12 @@ Encrypted at rest using AES-256-CBC with a key derived from your site's WordPres == Changelog == += 1.3.1 = + +_Release date: 2026-08-17_ + +* Descriptions render in the admin's language (Core 1.8.0+ `description_translations`), English fallback. + = 1.3.0 = _Release date: 2026-08-17_ diff --git a/robotstxt-manager.php b/robotstxt-manager.php index ea76084..d3e8a99 100644 --- a/robotstxt-manager.php +++ b/robotstxt-manager.php @@ -3,7 +3,7 @@ * Plugin Name: Manager (by ROBOTSTXT) * Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-manager * Description: Client-side dashboard for the ROBOTSTXT plugin ecosystem. Lists the catalog from a remote Plugins Core install, resolves local install/update state, and installs, activates, and updates plugins directly from the store. - * Version: 1.3.0 + * Version: 1.3.1 * Requires at least: 4.4 * Requires PHP: 8.0 * Author: ROBOTSTXT @@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) { } /** Plugin version. */ -define( 'ROBOTSTXT_MANAGER_VERSION', '1.3.0' ); +define( 'ROBOTSTXT_MANAGER_VERSION', '1.3.1' ); /** Absolute path to the plugin directory, with trailing slash. */ define( 'ROBOTSTXT_MANAGER_DIR', plugin_dir_path( __FILE__ ) );