<div class="std-form-wrap <?php echo (!empty($form_details['form']['custom_fields'])) ? 'std-form-with-custom-fields' : 'std-form-without-custom-fields'; ?> std-<?php echo esc_attr($form_template); ?> std-<?php echo esc_attr($form_row->form_alias); ?>">
    <form method="post" action="" class="std-subscription-form" data-form-alias="<?php echo esc_attr($form_row->form_alias); ?>">

        <?php
        /**
         * Triggers just before displaying the subscription form
         *
         * @param object $form_row
         *
         * @since 1.0.0
         */
        do_action('std_before_form', $form_row);

        $base_dir = realpath(STD_PATH . 'inc/views/frontend/form-templates') . DIRECTORY_SEPARATOR;
        $sanitized_template = basename($form_template) . '.php';
        $file_path = realpath($base_dir . $sanitized_template);

        if ($file_path && strpos($file_path, $base_dir) === 0 && file_exists($file_path)) {
            include($file_path);
        }

        /**
         * Triggers just after displaying the subscription form
         *
         * @param object $form_row
         *
         * @since 1.0.0
         */
        do_action('std_after_form', $form_row);
        ?>
    </form>
</div>