Constants

AGENT

AGENT = 'ActionScheduler'

TYPE

TYPE = 'action_log'

Properties

$logger

$logger : null|self

Instance.

Type

normal

Methods

instance()

instance() : \ActionScheduler_Logger

Get instance.

Returns

\ActionScheduler_Logger

log()

log(string  $action_id, string  $message, \DateTime|null  $date = null) : string

Create log entry.

Parameters

string $action_id

Action ID.

string $message

Action log's message.

\DateTime|null $date

Action log's timestamp.

Returns

string —

The log entry ID

get_entry()

get_entry(string  $entry_id) : \ActionScheduler_LogEntry

Get single log entry for action.

Parameters

string $entry_id

Entry ID.

Returns

\ActionScheduler_LogEntry

get_logs()

get_logs(string  $action_id) : \ActionScheduler_LogEntry[]

Get action's logs.

Parameters

string $action_id

Action ID.

Returns

\ActionScheduler_LogEntry[]

init()

init() : mixed

Initialize.

Returns

mixed

hook_stored_action()

hook_stored_action() : mixed

Register callback for storing action.

Returns

mixed

unhook_stored_action()

unhook_stored_action() : mixed

Unhook callback for storing action.

Returns

mixed

log_stored_action()

log_stored_action(int  $action_id) : mixed

Log action stored.

Parameters

int $action_id

Action ID.

Returns

mixed

log_canceled_action()

log_canceled_action(int  $action_id) : mixed

Log action cancellation.

Parameters

int $action_id

Action ID.

Returns

mixed

log_started_action()

log_started_action(int  $action_id, string  $context = '') : mixed

Log action start.

Parameters

int $action_id

Action ID.

string $context

Action execution context.

Returns

mixed

log_completed_action()

log_completed_action(int  $action_id, null|\ActionScheduler_Action  $action = null, string  $context = '') : mixed

Log action completion.

Parameters

int $action_id

Action ID.

null|\ActionScheduler_Action $action

Action.

string $context

Action execution context.

Returns

mixed

log_failed_action()

log_failed_action(int  $action_id, \Exception  $exception, string  $context = '') : mixed

Log action failure.

Parameters

int $action_id

Action ID.

\Exception $exception

Exception.

string $context

Action execution context.

Returns

mixed

log_timed_out_action()

log_timed_out_action(int  $action_id, string  $timeout) : mixed

Log action timeout.

Parameters

int $action_id

Action ID.

string $timeout

Timeout.

Returns

mixed

log_unexpected_shutdown()

log_unexpected_shutdown(int  $action_id, array  $error) : mixed

Log unexpected shutdown.

Parameters

int $action_id

Action ID.

array $error

Error.

Returns

mixed

log_reset_action()

log_reset_action(int  $action_id) : mixed

Log action reset.

Parameters

int $action_id

Action ID.

Returns

mixed

log_ignored_action()

log_ignored_action(int  $action_id, string  $context = '') : mixed

Log ignored action.

Parameters

int $action_id

Action ID.

string $context

Action execution context.

Returns

mixed

log_failed_fetch_action()

log_failed_fetch_action(string  $action_id, null|\Exception  $exception = null) : mixed

Log the failure of fetching the action.

Parameters

string $action_id

Action ID.

null|\Exception $exception

The exception which occurred when fetching the action. NULL by default for backward compatibility.

Returns

mixed

log_failed_schedule_next_instance()

log_failed_schedule_next_instance(int  $action_id, \Exception  $exception) : mixed

Log the failure of scheduling the action's next instance.

Parameters

int $action_id

Action ID.

\Exception $exception

Exception object.

Returns

mixed

bulk_log_cancel_actions()

bulk_log_cancel_actions(array  $action_ids) : mixed

Bulk add cancel action log entries.

Implemented here for backward compatibility. Should be implemented in parent loggers for more performant bulk logging.

Parameters

array $action_ids

List of action ID.

Returns

mixed

filter_comment_queries()

filter_comment_queries(\WP_Comment_Query  $query) : mixed

Filter comment queries.

Parameters

\WP_Comment_Query $query

Comment query object.

Returns

mixed

filter_comment_query_clauses()

filter_comment_query_clauses(array  $clauses, \WP_Comment_Query  $query) : array

Filter comment queries.

Parameters

array $clauses

Query's clauses.

\WP_Comment_Query $query

Query object.

Returns

array

filter_comment_feed()

filter_comment_feed(string  $where, \WP_Query  $query) : string

Make sure Action Scheduler logs are excluded from comment feeds, which use WP_Query, not the WP_Comment_Query class handled by @see self::filter_comment_queries().

Parameters

string $where

Query's where clause.

\WP_Query $query

Query object.

Returns

string

filter_comment_count()

filter_comment_count(array  $stats, int  $post_id) : object

Remove action log entries from wp_count_comments()

Parameters

array $stats

Comment count.

int $post_id

Post ID.

Returns

object

delete_comment_count_cache()

delete_comment_count_cache() : mixed

Delete comment count cache whenever there is new comment or the status of a comment changes. Cache will be regenerated next time ActionScheduler_wpCommentLogger::filter_comment_count() is called.

Returns

mixed

disable_comment_counting()

disable_comment_counting() : mixed

Defer comment counting.

Returns

mixed

enable_comment_counting()

enable_comment_counting() : mixed

Enable comment counting.

Returns

mixed

create_wp_comment()

create_wp_comment(int  $action_id, string  $message, \DateTime  $date) : mixed

Create comment.

Parameters

int $action_id

Action ID.

string $message

Action log's message.

\DateTime $date

Action log entry's timestamp.

Returns

mixed

get_comment()

get_comment(int  $comment_id) : mixed

Get comment.

Parameters

int $comment_id

Comment ID.

Returns

mixed

get_where_clause()

get_where_clause() : string

Return a SQL clause to exclude Action Scheduler comments.

Returns

string

get_comment_count()

get_comment_count() : object

Retrieve the comment counts from our cache, or the database if the cached version isn't set.

Returns

object