# cartflows/3.3.0/admin-core/inc/log-status.php

CartFlows – Funnel Builder &amp; Checkout Plugin for WooCommerce, version 3.3.0. 83 lines.

- Page: https://pluginprobe.com/plugins/cartflows/3.3.0/code/admin-core/inc/log-status.php
- Raw: https://pluginprobe.com/plugins/cartflows/3.3.0/raw/admin-core/inc/log-status.php
- Modified: 2026-10-05T04:31:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/cartflows/3.3.0/code/admin-core/inc/log-status.php#L10-L20`.

```php
<?php
/**
 * CartFlows Log status.
 *
 * @package CartFlows
 */

namespace CartflowsAdmin\AdminCore\Inc;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class LogStatus.
 *
 * Reads the log directory for the debug UI. The download/delete handlers live in
 * ajax/debugger.php, which resolves the filename through get_log_files() and adds a
 * realpath containment check; the unreferenced copies that used to sit here took
 * $_REQUEST['handle'] straight onto the log path and were removed.
 */
class LogStatus {

	/**
	 * Instance
	 *
	 * @access private
	 * @var object Class object.
	 * @since 1.0.0
	 */
	private static $instance;

	/**
	 * Initiator
	 *
	 * @since 1.0.0
	 * @return object initialized object of class.
	 */
	public static function get_instance() {
		if ( ! isset( self::$instance ) ) {
			self::$instance = new self();
		}
		return self::$instance;
	}

	/**
	 * Constructor
	 *
	 * @since 1.0.0
	 */
	public function __construct() {
	}

	/**
	 * Get all log files in the log directory.
	 *
	 * @return array
	 */
	public function get_log_files() {
		// Condition for multisite instances:
		// Return empty array if log directory doesn't exist yet or is not readable.
		if ( ! is_dir( CARTFLOWS_LOG_DIR ) || ! is_readable( CARTFLOWS_LOG_DIR ) ) {
			return array();
		}

		$files  = scandir( CARTFLOWS_LOG_DIR );
		$result = array();

		if ( ! empty( $files ) ) {
			foreach ( $files as $key => $file ) {
				if ( ! is_dir( $file ) && strstr( $file, '.log' ) ) {
					$result[ pathinfo( $file, PATHINFO_FILENAME ) ] = $file;
				}
			}
		}

		return $result;
	}
}

LogStatus::get_instance();

```
