<ul><li>CRITICAL: mailinglist_modals.php lines 964-969 — $_SESSION["YPTemplateID"], $_SESSION["YPSiteLinkID"], $_SESSION["YPCompanyAcctID"], $_SESSION["YPCompanyID"] used directly in SQL without null guards. When any key missing, empty string injected into integer SQL column causing Fatal mysqli_sql_exception (MySQL integer syntax error). Fixed: added intval() + ?? 0 guards for all four session keys.</li><li>CRITICAL: mailinglist_modals.php line 952 — $_SESSION["activeacctid"] accessed without null guard in else branch. Fixed: ?? 0 fallback added.</li><li>HIGH: ajax.php lines 212, 235 — $_SESSION["YPSiteLinkID"] used without ?? guard in update_email_settings and add_email_settings actions. Empty string injected into sitelinkid_fk integer column causing Fatal mysqli_sql_exception. Fixed: ?? 0 fallback on both lines.</li><li>HIGH: mailinglist_settings.php — all variables populated via extract($contdata) have no fallback defaults when DB record does not exist (new site). 16 Undefined variable Warnings on MailingListTitle, SendService, FromEmailAddress, TestEmailAddress, smtpUsername, smtpPassword, smtpServer, smtpLocalhost, smtpPort, and message fields. Fixed: added ?? guard defaults for all 16 variables after extract().</li><li>HIGH: mailinglist_settings.php line 17 — $_REQUEST["siteid"] accessed without null guard (undefined array key Warning when accessed via include context). Fixed: ?? $siteid ?? 0.</li><li>MEDIUM: mailinglist_modals.php lines 220, 559 — $_SERVER["REMOTE_ADDR"] used without null guard in modal hidden inputs (Warning in CLI/include context). Fixed: ?? "" on both.</li><li>MEDIUM: mailinglist_modals.php line 910 — $_SESSION["activesiteacctid"] echoed without null guard. Fixed: ?? "" fallback.</li><li>SPEED: domain_tbl_mailinglistactivity — no index on MailingListID_fk. Full table scan across 834 rows on every email list load. Added: idx_mailinglistid_fk. EXPLAIN type changed from ALL to ref, rows reduced from 834 to 1.</li><li>SPEED: wwbn_company_join — no index on siteid_fk/sitelinkid_fk. Full table scan across 2504 rows on Send Email modal load. Added: idx_site_sitelinkid compound index. EXPLAIN type changed from ALL to ref, rows reduced from 2504 to 74.</li></ul>