Scanner
Finds convertible attachments via direct queries to avoid loading post objects.
Namespace: WebberZone\Image_Optimizer
Since: 1.0.0
Source: includes/class-scanner.php line 21
Methods
count_candidates() static
Count the attachments the plugin could convert.
Since: 1.0.0
Line: 38
static public function count_candidates( ): int;
Returns: int — Attachment count.
count_optimized() static
Count the attachments that already carry a conversion record.
Since: 1.0.0
Line: 61
static public function count_optimized( ): int;
Returns: int — Attachment count.
get_candidate_ids() static
Get a page of attachment IDs that could be converted.
Since: 1.0.0
Line: 83
static public function get_candidate_ids( int $limit = ..., int $after_id = ..., bool $only_unhandled = ... ): array;
| Type | Name | Description |
|---|---|---|
int |
$limit |
Maximum IDs to return. |
int |
$after_id |
Only return IDs greater than this. |
bool |
$only_unhandled |
Whether to skip attachments that already have a record. |
Returns: array — int> Attachment IDs, ascending.
enqueue_all() static
Fill the queue with every attachment that still needs work.
Since: 1.0.0
Line: 129
static public function enqueue_all( bool $force = ... ): int;
| Type | Name | Description |
|---|---|---|
bool |
$force |
Whether to include attachments that already have a record. |
Returns: int — Number of attachments queued.