PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.2.24
MxChat – AI Chatbot & Content Generation for WordPress v3.2.24
3.2.25 3.2.24 3.2.23 3.2.22 3.2.21 3.2.20 3.2.19 3.2.18 3.2.17 3.2.16 3.2.15 3.2.14 3.2.12 3.2.13 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 3.2.6 3.2.5 3.2.4 3.2.3 3.2.2 3.2.1 All 156 releases
← All changes | includes/admin-content-page.php +30 -50 3.2.19 → 3.2.24 View file →
@@ -513,59 +513,39 @@
513 513 <div class="mxch-field-control">
514 514 <select id="mxch-content-model" data-field="content_model" class="mxch-cg-select">
515 515 <?php
516 516 $content_model = $options['content_model'] ?? ($options['model'] ?? 'gpt-5.6-sol');
517 - // gpt-5.1-chat-latest removed 2026-08-02: OpenAI retires
518 - // it 2026-08-10 (plan e46b8f); saved values migrate via
519 - // mxchat_migrate_deprecated_models().
520 - $models = array(
521 - 'OpenAI' => array(
522 - 'gpt-5.6-sol' => 'GPT-5.6 Sol',
523 - 'gpt-5.6-terra' => 'GPT-5.6 Terra',
524 - 'gpt-5.6-luna' => 'GPT-5.6 Luna',
525 - 'gpt-5.5' => 'GPT-5.5',
526 - 'gpt-5.4' => 'GPT-5.4',
527 - 'gpt-5.2' => 'GPT-5.2',
528 - 'gpt-5' => 'GPT-5',
529 - ),
530 - 'Anthropic' => array(
531 - 'claude-fable-5' => 'Claude Fable 5',
532 - 'claude-opus-5' => 'Claude Opus 5',
533 - 'claude-opus-4-8' => 'Claude Opus 4.8',
534 - 'claude-opus-4-7' => 'Claude Opus 4.7',
535 - 'claude-opus-4-6' => 'Claude Opus 4.6',
536 - 'claude-sonnet-5' => 'Claude Sonnet 5',
537 - 'claude-sonnet-4-6' => 'Claude Sonnet 4.6',
538 - 'claude-haiku-4-5-20251001' => 'Claude Haiku 4.5',
539 - ),
540 - 'Google' => array(
541 - 'gemini-3.5-flash' => 'Gemini 3.5 Flash',
542 - 'gemini-3.1-pro-preview' => 'Gemini 3.1 Pro',
543 - 'gemini-3-flash-preview' => 'Gemini 3 Flash',
544 - 'gemini-3.1-flash-lite' => 'Gemini 3.1 Flash-Lite',
545 - 'gemini-3.1-flash-lite-preview' => 'Gemini 3.1 Flash-Lite (Preview)',
546 - 'gemini-2.5-pro' => 'Gemini 2.5 Pro',
547 - 'gemini-2.5-flash' => 'Gemini 2.5 Flash',
548 - 'gemini-2.5-flash-lite' => 'Gemini 2.5 Flash-Lite',
549 - ),
550 - // xAI lineup refreshed 2026-08-14 (plan e1aa4a) against a
551 - // live /v1/models pull: none of the three ids previously
552 - // here appear in xAI's listing any more. The old ids are
553 - // KEPT below the current generation because xAI still
554 - // serves them and deleting one would blank the selection
555 - // of an install saved on it.
556 - 'xAI' => array(
557 - 'grok-4.6' => 'Grok 4.6',
558 - 'grok-4.5' => 'Grok 4.5',
559 - 'grok-4.3' => 'Grok 4.3',
560 - 'grok-4.20-0309-reasoning' => 'Grok 4.20 (Reasoning)',
561 - 'grok-4.20-0309-non-reasoning' => 'Grok 4.20 (Non-Reasoning)',
562 - 'grok-4-0709' => 'Grok 4 (previous generation)',
563 - 'grok-4-1-fast-non-reasoning' => 'Grok 4.1 Fast (previous generation)',
564 - 'grok-code-fast-1' => 'Grok Code Fast',
565 - ),
517 + // Catalog-derived (plan ccb751): this select was the seventh
518 + // hand-maintained model map and had drifted (it still offered
519 + // a code model for content generation). It now renders from
520 + // MxChat_Model_Catalog, restricted to the providers the
521 + // generator can actually dispatch to — see
522 + // MxChat_Content_Generator::supported_content_providers().
523 + $model_groups = MxChat_Model_Catalog::settings_dropdown_groups(
524 + $content_model,
525 + MxChat_Content_Generator::supported_content_providers()
566 526 );
567 - foreach ($models as $group => $group_models) {
527 + // Round-trip guard: an install saved on an id the catalog no
528 + // longer lists (e.g. grok-code-fast-1) keeps its selection
529 + // rendered instead of silently snapping to the first option
530 + // on the next save.
531 + $mxch_cg_model_in_groups = false;
532 + foreach ($model_groups as $group_models) {
533 + if (array_key_exists($content_model, $group_models)) {
534 + $mxch_cg_model_in_groups = true;
535 + break;
536 + }
537 + }
538 + if (!$mxch_cg_model_in_groups && $content_model !== '') {
539 + $model_groups[__('Currently saved', 'mxchat')] = array(
540 + /* translators: %s: model id */
541 + $content_model => sprintf(__('%s — no longer offered, choose a replacement', 'mxchat'), $content_model),
542 + );
543 + }
544 + foreach ($model_groups as $group => $group_models) {
545 + if (empty($group_models)) {
546 + continue;
547 + }
568 548 echo '<optgroup label="' . esc_attr($group) . '">';
569 549 foreach ($group_models as $value => $label) {
570 550 $selected = selected($content_model, $value, false);
571 551 echo '<option value="' . esc_attr($value) . '" ' . $selected . '>' . esc_html($label) . '</option>';