From 4f8ab239b04d90d8c4d131f6b0e9f73fcce4bb36 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Tue, 18 Aug 2026 10:49:06 +0000 Subject: [PATCH] v1.6.1 --- admin/class-robotstxt-manager-settings.php | 8 ++++---- changelog.txt | 8 ++++++++ languages/robotstxt-manager.pot | 2 +- readme.txt | 23 ++++++++-------------- robotstxt-manager.php | 4 ++-- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/admin/class-robotstxt-manager-settings.php b/admin/class-robotstxt-manager-settings.php index d1fcf12..955b7c1 100644 --- a/admin/class-robotstxt-manager-settings.php +++ b/admin/class-robotstxt-manager-settings.php @@ -44,6 +44,7 @@ class Robotstxt_Manager_Settings { $menu_hook = is_multisite() ? 'network_admin_menu' : 'admin_menu'; $loader->add_action( $menu_hook, $this, 'add_settings_page' ); $loader->add_action( 'admin_init', $this, 'register_settings' ); + $loader->add_action( 'admin_init', $this, 'handle_form_submission' ); $loader->add_action( 'admin_enqueue_scripts', $this, 'enqueue_scripts' ); $loader->add_action( 'wp_ajax_robotstxt_manager_test_connection', $this, 'handle_test_connection' ); $loader->add_action( 'wp_ajax_robotstxt_manager_delete_key', $this, 'handle_delete_key' ); @@ -209,8 +210,6 @@ class Robotstxt_Manager_Settings { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'robotstxt-manager' ) ); } - $this->handle_form_submission(); - require_once ROBOTSTXT_MANAGER_DIR . 'admin/views/page-settings.php'; } @@ -218,11 +217,12 @@ class Robotstxt_Manager_Settings { * Handles manual form submission for network settings. * * The WordPress Settings API (options.php) does not handle network - * options, so the network settings page must process its own form. + * options, so the settings page must process its own form. Hooked to + * admin_init so the redirect runs before any output is sent. * * @return void */ - private function handle_form_submission(): void { + public function handle_form_submission(): void { if ( ! isset( $_POST['robotstxt_manager_settings_group_nonce'] ) ) { return; } diff --git a/changelog.txt b/changelog.txt index f8c45c5..788573a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,13 @@ == Changelog == += 1.6.1 = + +_Release date: 2026-08-18_ + +**Fixed** + +* "Cannot modify header information — headers already sent" warning after saving the settings: the form handler ran inside the page renderer (after output started). It now runs on `admin_init`, before any output, so the redirect succeeds. + = 1.6.0 = _Release date: 2026-08-18_ diff --git a/languages/robotstxt-manager.pot b/languages/robotstxt-manager.pot index 1d92587..dcc62df 100644 --- a/languages/robotstxt-manager.pot +++ b/languages/robotstxt-manager.pot @@ -2,7 +2,7 @@ # This file is distributed under the GPL-3.0-or-later. msgid "" msgstr "" -"Project-Id-Version: Manager (by ROBOTSTXT) 1.6.0\n" +"Project-Id-Version: Manager (by ROBOTSTXT) 1.6.1\n" "Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-manager/\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/readme.txt b/readme.txt index 0a6dd0f..fec94ec 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: robotstxt, javiercasares Tags: dashboard, catalog, updates, subscriptions, management Requires at least: 4.4 Tested up to: 7.1 -Stable tag: 1.6.0 +Stable tag: 1.6.1 Requires PHP: 8.0 -Version: 1.6.0 +Version: 1.6.1 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.txt @@ -94,6 +94,12 @@ Encrypted at rest using AES-256-CBC with a key derived from your site's WordPres Only the 3 last versions. The full changelog will be at changelog.txt += 1.6.1 = + +_Release date: 2026-08-18_ + +* Fixed: "headers already sent" warning after saving the settings — the form handler now runs on `admin_init`, before any output. + = 1.6.0 = _Release date: 2026-08-18_ @@ -111,19 +117,6 @@ _Release date: 2026-08-18_ * Fixed: API key saving, test connection, settings error display, registration link. -= 1.4.1 = - -_Release date: 2026-08-17_ - -* Housekeeping release: plugin identity now points at the ROBOTSTXT software site — Plugin URI and Update URI are `https://www.robotstxt.software/plugins/robotstxt-manager/`, Author URI is `https://www.robotstxt.software/`, and this readme's full-changelog link points to the same page. -* Tooling aligned with the declared real floors: PHPCS `testVersion` and the preflight scan range now cover PHP 8.0-8.5 (was 7.4/8.4). - -= 1.4.0 = - -_Release date: 2026-08-17_ - -* Premium update URLs carry a short-lived download token (Core 1.9.0+) instead of the API key; automatic fallback on older Core. - = Previous versions = If you want to see the full changelog, visit the [plugin page](https://www.robotstxt.software/plugins/robotstxt-manager/). diff --git a/robotstxt-manager.php b/robotstxt-manager.php index 60131ec..072a92d 100644 --- a/robotstxt-manager.php +++ b/robotstxt-manager.php @@ -3,7 +3,7 @@ * Plugin Name: Manager (by ROBOTSTXT) * Plugin URI: https://www.robotstxt.software/plugins/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.6.0 + * Version: 1.6.1 * Requires at least: 4.4 * Requires PHP: 8.0 * Update URI: https://www.robotstxt.software/plugins/robotstxt-manager/ @@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) { } /** Plugin version. */ -define( 'ROBOTSTXT_MANAGER_VERSION', '1.6.0' ); +define( 'ROBOTSTXT_MANAGER_VERSION', '1.6.1' ); /** Absolute path to the plugin directory, with trailing slash. */ define( 'ROBOTSTXT_MANAGER_DIR', plugin_dir_path( __FILE__ ) );