DOING_AJAX php version issues

I am getting this notice with PHP 7.4.12 version : Use of undefined constant DOING_AJAX – assumed ‘DOING_AJAX’ (this will throw an Error in a future version of PHP) in

And with PHP 8 I am getting this error Fatal error: Uncaught Error: Undefined constant “DOING_AJAX” in

It is the second line in this function that is causing it. ( if (!is_admin() || (defined(DOING_AJAX) && DOING_AJAX)) { )

private function init() {
    if (!is_admin() || (defined(DOING_AJAX) && DOING_AJAX)) {
        $this->frontend = new Woo_Custom_CSV_Builder_Frontend();
    }
    if (isset($_GET['file'])) {
        //$this->handle_download();
    }
}

Could someone point to right direction with this issue?