/** * */ public static function tml_machine_name_handler() { check_ajax_referer('MachineNameCheck223.'); try { include_once UTILS_CLASS . "CodeGenerator.php"; if ($_POST['firstWordOnly'] === "on") { $firstWordOnly = true; } else { $firstWordOnly = false; } $codeGenerator = new CodeGenerator($_POST['title'], 0, 8, 4, $firstWordOnly); $code = $codeGenerator->generateCode(); echo $code; //$machineF = new MachineFactory(); } catch (LogicException $le) { echo $le->getMessage(); } finally { wp_die(); } }