WS_OK_7.4.33 HEX
HEX
Server: nginx/1.21.4
System: Linux v12674 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: endtheignorance (1014)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v12674/lcanorthernco/public_html/wp-content/plugins/simple-history/inc/class-constants.php
<?php

namespace Simple_History;

/**
 * Constants class for Simple History.
 *
 * @package SimpleHistory
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Constants
 *
 * Centralized constants for Simple History plugin.
 */
class Constants {

	/**
	 * Time period constants in days.
	 */
	const DAYS_PER_WEEK = 7;
	const DAYS_PER_MONTH = 30;
	const DAYS_PER_FORTNIGHT = 14;
	const DAYS_PER_QUARTER = 90;

	/**
	 * Get the number of days for a specific time period.
	 *
	 * @param string $period The time period (week, month, fortnight, quarter).
	 * @return int Number of days for the period.
	 */
	public static function get_days_for_period( $period ) {
		switch ( $period ) {
			case 'week':
				return self::DAYS_PER_WEEK;
			case 'month':
				return self::DAYS_PER_MONTH;
			case 'fortnight':
				return self::DAYS_PER_FORTNIGHT;
			case 'quarter':
				return self::DAYS_PER_QUARTER;
			default:
				return self::DAYS_PER_MONTH; // Default to month
		}
	}

	/**
	 * Get all available time periods.
	 *
	 * @return array Array of available time periods.
	 */
	public static function get_available_periods() {
		return array(
			'week'      => self::DAYS_PER_WEEK,
			'fortnight' => self::DAYS_PER_FORTNIGHT,
			'month'     => self::DAYS_PER_MONTH,
			'quarter'   => self::DAYS_PER_QUARTER,
		);
	}
}