chore(catalog): add FluentSMTP (FLUENTMAIL_PLUGIN_VERSION) to the locked-catalog label map

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8t9GEyyLZbUQu26na1JQg
This commit is contained in:
2026-10-16 22:12:22 +00:00
parent f2b7a4edf3
commit f8894ebcd1
+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* Idempotent — adds FluentSMTP's guard constant (FLUENTMAIL_PLUGIN_VERSION) to the catalog
* label map so the locked FluentSMTP group reads "FluentSMTP" rather than a humanized fallback.
* Usage: php patch-fluentsmtp-label.php [ABS_PATH_TO/includes]
*/
$base = $argv[1] ?? '/var/www/html/wp-content/plugins/advanced-mcp-plugin/includes';
$admin = $base . '/Core/AdminMenu.php';
$src = file_get_contents($admin);
if ($src === false) { fwrite(STDERR, "cannot read $admin\n"); exit(1); }
if (strpos($src, 'FLUENTMAIL_PLUGIN_VERSION') !== false) { echo "fluentsmtp label already present\n"; exit(0); }
$anchor = "'MOYASAR_WC_VERSION' => ['Moyasar', 'moyasar'],";
if (strpos($src, $anchor) === false) { fwrite(STDERR, "anchor not found (run patch-moyasar-label.php first)\n"); exit(2); }
$add = $anchor . "\n 'FLUENTMAIL_PLUGIN_VERSION' => ['FluentSMTP', 'fluent-smtp'],";
$src = str_replace($anchor, $add, $src);
if (file_put_contents($admin, $src) === false) { fwrite(STDERR, "write failed\n"); exit(3); }
echo "fluentsmtp label added\n";