From 7f89e98bbc3193bf64972fe38bc964de7178560c Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Mon, 17 Aug 2026 18:51:45 +0000 Subject: [PATCH 1/2] v1.8.3 --- changelog.txt | 44 + includes/Admin/ManagerNotice.php | 209 ++++ includes/Admin/Settings.php | 2 + includes/Core/Plugin.php | 2 + includes/Network/Settings.php | 2 + includes/Network/ToolsPage.php | 11 +- languages/robotstxt-mediaaudit-ca.mo | Bin 24866 -> 32382 bytes languages/robotstxt-mediaaudit-ca.po | 1184 ++++++++++++----------- languages/robotstxt-mediaaudit-es_ES.mo | Bin 24674 -> 32065 bytes languages/robotstxt-mediaaudit-es_ES.po | 1183 +++++++++++----------- languages/robotstxt-mediaaudit.pot | 1019 ++++++++++++------- readme.txt | 23 +- robotstxt-mediaaudit.php | 11 +- robotstxt-updater.php | 383 -------- uninstall.php | 3 + update.json | 8 +- vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_static.php | 1 + 18 files changed, 2230 insertions(+), 1856 deletions(-) create mode 100644 includes/Admin/ManagerNotice.php delete mode 100644 robotstxt-updater.php diff --git a/changelog.txt b/changelog.txt index d07cf8e..8e62ad3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,49 @@ == Changelog == += 1.8.3 = + +_Release date: 2026-08-17_ + +**Highlights** + +* Plugin updates are now delivered through [Manager (by ROBOTSTXT)](https://www.robotstxt.software/plugins/robotstxt-manager/) instead of a bundled self-updater. + +**Added** + +* Dismissible admin notice on the site and Network Admin Plugins pages when Manager (by ROBOTSTXT) is not installed and active, linking to `https://www.robotstxt.software/plugins/robotstxt-manager/` (dismissible per user; re-appears if the Manager is later removed). +* Permanent (non-dismissible) notice on the site and network Settings pages while Manager is not available. +* `Update URI` plugin header pointing to `https://www.robotstxt.software/plugins/robotstxt-mediaaudit/`. +* Header tests now also cover `Plugin URI`, `Update URI`, `Author`, `Author URI`, `Contributors`, contributor ordering, and absence of self-updater artifacts. + +**Fixed** + +* The dismissible Manager notice now also renders on the Network Admin plugins page (screen base `plugins-network`), not only on site-level Plugins. +* `uninstall.php` now always removes the per-user notice-dismissal user meta (UI state, not user data). + +**Changed** + +* Plugin URI and Author URI now point to `www.robotstxt.software`; `robotstxt` is listed first in the Contributors headers. +* `bin/preflight.sh` allowlist updated: `update.json` and `robotstxt-updater.php` are forbidden in the release ZIP. +* Dev tooling updated via `composer update` (PHPCS 3.13.6, WPCS 3.4.1, PHPStan 2.2.8, PHPUnit 9.6.36); PHPStan fix for transient cache typing in the Network Tools status reader. +* Translations completed for Spanish (es_ES) and Catalan (ca): all fuzzy and untranslated strings through 1.8.2 are now translated (326/326 in both locales). + +**Removed** + +* Bundled self-updater files `robotstxt-updater.php` and `update.json`. + +**Compatibility** + +* WordPress: 5.3 - 7.1 +* PHP: 8.0 - 8.5 +* WP-CLI: 2.x + +**Tests** + +* PHPCS (WordPress-Core, WordPress-Docs, WordPress-Extra): PASS +* PHPStan level 9: PASS +* PHPCompatibility 8.0-8.5: PASS +* PHPUnit: 11 tests, 54 assertions + = 1.8.2 = _Release date: 2026-08-08_ diff --git a/includes/Admin/ManagerNotice.php b/includes/Admin/ManagerNotice.php new file mode 100644 index 0000000..2be289d --- /dev/null +++ b/includes/Admin/ManagerNotice.php @@ -0,0 +1,209 @@ +base, array( 'plugins', 'plugins-network' ), true ) ) { + return; + } + + if ( self::is_manager_active() ) { + return; + } + + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + if ( '1' === get_user_meta( get_current_user_id(), self::DISMISS_KEY, true ) ) { + return; + } + + $dismiss_url = wp_nonce_url( + add_query_arg( self::DISMISS_ARG, 1 ), + self::DISMISS_ACTION + ); + + echo '

' + . wp_kses( self::message(), array( 'a' => array( 'href' => true ) ) ) + . ' ' . esc_html__( 'Dismiss', 'robotstxt-mediaaudit' ) . '' + . '

'; + } + + /** + * Renders the permanent inline notice for the Settings pages (not dismissible). + * + * Used on both the site Settings page and the Network Settings page. + * + * @return void + */ + public static function render_settings_notice(): void { + if ( self::is_manager_active() ) { + return; + } + + echo '
' + . '

' . wp_kses( self::message(), array( 'a' => array( 'href' => true ) ) ) . '

' + . '
'; + } + + /** + * Handles the dismiss link: verifies the nonce, stores the dismissal (PRG). + * + * Also clears a stored dismissal once Manager is active again, so the + * notice returns if Manager is ever removed. + * + * @return void + */ + public static function handle_dismiss(): void { + $user_id = get_current_user_id(); + $dismissed = $user_id && get_user_meta( $user_id, self::DISMISS_KEY, true ); + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- presence check only; state changes require the nonce below. + if ( ! isset( $_GET[ self::DISMISS_ARG ] ) && ! $dismissed ) { + return; + } + + if ( self::is_manager_active() ) { + if ( $dismissed ) { + delete_user_meta( $user_id, self::DISMISS_KEY ); + } + return; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no state change without the nonce check below. + if ( ! isset( $_GET[ self::DISMISS_ARG ] ) ) { + return; + } + + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + check_admin_referer( self::DISMISS_ACTION ); + + update_user_meta( $user_id, self::DISMISS_KEY, '1' ); + + wp_safe_redirect( remove_query_arg( array( self::DISMISS_ARG, '_wpnonce' ) ) ); + exit; + } + + /** + * Builds the shared notice message (translation with a link placeholder). + * + * The result must be passed through wp_kses() at output time. + * + * @return string Unescaped message HTML. + */ + private static function message(): string { + return sprintf( + /* translators: %s: Manager plugin page URL. */ + __( 'To receive plugin updates, the plugin Manager (by ROBOTSTXT) must be installed and active.', 'robotstxt-mediaaudit' ), + esc_url( self::MANAGER_URL ) + ); + } +} diff --git a/includes/Admin/Settings.php b/includes/Admin/Settings.php index a395b77..230d9f0 100644 --- a/includes/Admin/Settings.php +++ b/includes/Admin/Settings.php @@ -963,6 +963,8 @@ class Settings {

+ +