isset($_GET['aiflt_saved']), 'ideas' => isset($_GET['aiflt_ab_generated']), 'rollback' => isset($_GET['aiflt_rollback']) ? sanitize_key(wp_unslash($_GET['aiflt_rollback'])) : '', 'email' => isset($_GET['aiflt_email_test']) ? sanitize_key(wp_unslash($_GET['aiflt_email_test'])) : '', ]; // phpcs:enable WordPress.Security.NonceVerification.Recommended $aiflt_notice = static function ($text, $good = true) { echo '
' . AIFLT_UI::icon($good ? 'check' : 'alert') . esc_html($text) . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Fixed SVG. }; if ($aiflt_flags['saved']) { $aiflt_notice(__('Saved.', 'ai-flash-tune')); } if ($aiflt_flags['ideas']) { $aiflt_notice(__('New test ideas are below.', 'ai-flash-tune')); } if ($aiflt_flags['rollback'] !== '') { $aiflt_flags['rollback'] === '1' ? $aiflt_notice(__('Undone. The earlier version is back.', 'ai-flash-tune')) : $aiflt_notice(__('That change could not be undone. It may already be undone, or you may not be allowed to edit it.', 'ai-flash-tune'), false); } if ($aiflt_flags['email'] !== '') { $aiflt_flags['email'] === 'sent' ? $aiflt_notice(__('Test email sent. Check the inbox it went to.', 'ai-flash-tune')) : $aiflt_notice(__('The test email could not be sent. Check that this site can send email (an SMTP plugin usually fixes it).', 'ai-flash-tune'), false); } // Short description of a logged change, for the history list. $aiflt_change_target = static function ($change) { if (($change['object_type'] ?? '') === 'product' && !empty($change['object_id'])) { $id = absint($change['object_id']); $title = get_the_title($id); return $title !== '' ? '' . esc_html($title) . '' : esc_html__('A deleted product', 'ai-flash-tune'); } if (($change['object_type'] ?? '') === 'option') { $before = json_decode((string) ($change['before_data'] ?? ''), true); if (is_array($before) && ($before['option_name'] ?? '') === 'aiftco_settings') { return '' . esc_html__('Checkout quick fixes', 'ai-flash-tune') . ''; } return esc_html__('Plugin settings', 'ai-flash-tune'); } return '—'; }; ?>