Database
Manages the per-site conversion queue table.
Namespace: WebberZone\Image_Optimizer
Since: 1.0.0
Source: includes/class-database.php line 19
Methods
get_table() static
Get the queue table name for the current site.
Since: 1.0.0
Line: 45
static public function get_table( ): string;
Returns: string — Table name.
get_schema() static
The CREATE TABLE statement for the queue table.
Since: 1.0.0
Line: 58
static public function get_schema( ): string;
Returns: string — SQL.
install() static
Create or update the queue table on the current site.
Since: 1.0.0
Line: 87
static public function install( ): void;
Returns: void
install_all() static
Create the table on every site of the network, or just the current site.
register_activation_hook fires once for a network activation, so without
this loop every site except the one activating would be left without a
table.
Since: 1.0.0
Line: 107
static public function install_all( bool $network_wide = ... ): void;
| Type | Name | Description |
|---|---|---|
bool |
$network_wide |
Whether the plugin was network activated. |
Returns: void
get_site_ids() static
Get every site ID in the network.
Since: 1.0.0
Line: 127
static public function get_site_ids( ): array;
Returns: array — int> Site IDs.
on_new_site() static
Create the table when a new site is added to the network.
Since: 1.0.0
Line: 151
static public function on_new_site( $site ): void;
| Type | Name | Description |
|---|---|---|
\WP_Site |
$site |
New site object. |
Returns: void
maybe_upgrade() static
Create the table if the stored schema version is missing or stale.
Since: 1.0.0
Line: 168
static public function maybe_upgrade( ): void;
Returns: void
is_installed() static
Whether the queue table exists on the current site.
Since: 1.0.0
Line: 183
static public function is_installed( ): bool;
Returns: bool — True when installed.
drop_table() static
Drop the queue table on the current site.
Since: 1.0.0
Line: 209
static public function drop_table( ): void;
Returns: void