classes/Tasks/BackgroundProcess.php
protected function is_process_running() {
	    $lockData = get_option($this->identifier . '_process_lock', null);

	    if (!empty($lockData) || isset($lockData['expires'])) {
            if (time() <= $lockData['expires']) {
                Logger::info('Lock still active.  Expires in: '.($lockData['expires'] - time()));

                return true;
            } else {
                Logger::info("Lock expired");
            }
        }

        if (!empty($lockData)) {
            delete_option($this->identifier . '_process_lock');
        } else {
            Logger::info('No lock data.');
        }

        return false;
	}
protected function is_process_running() {
	    $lockData = get_option($this->identifier . '_process_lock', null);

	    if (!empty($lockData) || isset($lockData['expires'])) {
            if (time() <= $lockData['expires']) {
                Logger::info('Lock still active.  Expires in: '.($lockData['expires'] - time()));

                return true;
            } else {
                Logger::info("Lock expired");
            }
        }

        if (!empty($lockData)) {
            delete_option($this->identifier . '_process_lock');
        } else {
            Logger::info('No lock data.');
        }

        return false;
	}
protected function is_process_running ( ) { $ lockData = get_option ( $ this -> identifier . '_process_lock' , null ) ; if ( ! empty ( $ lockData ) || isset ( $ lockData [ 'expires' ] ) ) { if ( time ( ) <= $ lockData [ 'expires' ] ) { Logger :: info ( 'Lock still active.  Expires in: ' . ( $ lockData [ 'expires' ] - time ( ) ) ) ; return true ; } else { Logger :: info ( "Lock expired" ) ; } } if ( ! empty ( $ lockData ) ) { delete_option ( $ this -> identifier . '_process_lock' ) ; } else { Logger :: info ( 'No lock data.' ) ; } return false ; }
Is process running

Check whether the current process is already running
in a background process.
Is process running