class-log.php

Log Class

Source includes/Support/class-log.php2 min readPart of Performance Optimisation

includes/Support/class-log.php

Log Class

Namespace: PerformanceOptimise\\Inc · Lines: 248

Class Log

Log Class

Source: includes/Support/class-log.php, line 27

class Log

Tags: @since 1.0.0

Constants

ConstantVisibilityValueLine
SALT_KEYprivate\'wppo_activity_log_salt\'35

Properties

PropertyVisibilityTypeDefaultLine
$version_memoprivate staticarrayarray()47

publicstatic reset_version_memo()

public static function reset_version_memo(): void

Reset the version memo (tests only).

Return: void.

Tags: @since 2.2.0

Source: includes/Support/class-log.php, line 55

privatestatic get_cache_version()

private static function get_cache_version(): int

Get the activity cache version, memoized per request per site.

Return: int.

Tags: @since 2.2.0

Source: includes/Support/class-log.php, line 65

private __construct()

private function __construct()

Private constructor to prevent direct instantiation.

Tags: @since 2.0.0

Source: includes/Support/class-log.php, line 78

privatestatic salted_cache_active()

private static function salted_cache_active(): bool

Whether the salted object-cache layer is usable for persistence.

Return: bool.

Tags: @since 2.0.0

Source: includes/Support/class-log.php, line 91

publicstatic add()

public static function add($activity): void

Add a new activity log entry.

ParameterTypeDefaultDescription
$activitymixed—The activity description to log; non-strings are ignored.

Return: void.

Tags: @since 2.0.0

Source: includes/Support/class-log.php, line 106

publicstatic get_recent_activities()

public static function get_recent_activities(array $params): array

Get recent activities with pagination and caching.

ParameterTypeDefaultDescription
$paramsarray—Pagination parameters including \’page\’ and \’per_page\’.

Return: array — Cached or freshly queried results with pagination details.

Tags: @since 1.0.0

Source: includes/Support/class-log.php, line 176