HEX
Server: LiteSpeed
System: Linux server358.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User: alfoxtfy (2915)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/alfoxtfy/www/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;
	}
	
}