This commit is contained in:
Javier Casares 2026-08-17 19:16:01 +00:00
commit 1f308e8917

View file

@ -1093,6 +1093,7 @@ class Settings_Page {
?>
<div class="wrap">
<h1><?php echo esc_html__( 'SMTP (by ROBOTSTXT)', 'robotstxt-smtp' ); ?></h1>
<?php $this->render_manager_plugin_notice(); ?>
<form action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>" method="post">
<?php
settings_fields( self::SITE_SETTINGS_GROUP );
@ -1134,11 +1135,43 @@ class Settings_Page {
<?php
}
/**
* Renders the settings page shown in the network admin area.
*
* @return void
*/
/**
* Renders a non-dismissible inline notice when the Manager plugin is missing.
*
* Updates for this plugin are delivered through the Manager (by ROBOTSTXT)
* plugin, so settings pages warn the administrator while it is not active.
*
* @since 2.2.4
*
* @return void
*/
private function render_manager_plugin_notice(): void {
if ( Plugin::is_manager_plugin_active() ) {
return;
}
?>
<div class="notice notice-warning inline">
<p>
<strong><?php esc_html_e( 'SMTP (by ROBOTSTXT)', 'robotstxt-smtp' ); ?></strong>
</p>
<p>
<?php
printf(
/* translators: %s: Manager plugin page link. */
esc_html__( 'To receive updates for this plugin, the %s plugin must be installed and active.', 'robotstxt-smtp' ),
'<a href="' . esc_url( Plugin::MANAGER_PLUGIN_URL ) . '">' . esc_html__( 'Manager (by ROBOTSTXT)', 'robotstxt-smtp' ) . '</a>'
);
?>
</p>
</div>
<?php
}
/**
* Renders the settings page shown in the network admin area.
*
* @return void
*/
public function render_network_settings_page(): void {
$this->ensure_capability( self::SCOPE_NETWORK );
$this->set_scope( self::SCOPE_NETWORK );
@ -1148,6 +1181,7 @@ class Settings_Page {
?>
<div class="wrap">
<h1><?php echo esc_html__( 'SMTP (by ROBOTSTXT)', 'robotstxt-smtp' ); ?></h1>
<?php $this->render_manager_plugin_notice(); ?>
<?php
$saved_notice_raw = filter_input( INPUT_GET, 'robotstxt_smtp_saved', FILTER_UNSAFE_RAW );