HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/karjerosdiena.lt/wp-content/plugins/wp-all-import/models/history/record.php
<?php

class PMXI_History_Record extends PMXI_Model_Record {	
	
	/**
	 * Initialize model instance
	 * @param array[optional] $data Array of record data to initialize object with
	 */
	public function __construct($data = array()) {
		parent::__construct($data);
		$this->setTable(PMXI_Plugin::getInstance()->getTablePrefix() . 'history');
	}

	public function delete( $db = true ) {
		if ($this->id) { // delete history file first

			$uploads = wp_upload_dir();

			$history_file_path = wp_all_import_secure_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::LOGS_DIRECTORY, $this->id, false, false ) . DIRECTORY_SEPARATOR . $this->id . '.html';
			if ( @file_exists($history_file_path) ){
				wp_all_import_remove_source($history_file_path);
			}
		}
		return ($db) ? parent::delete() : true;
	}
	
}