Minifier
Minifier class.
Namespace: WebberZone\Snippetz\Snippets
Source: includes/snippets/class-minifier.php line 20
Methods
get_upload_dir() static
Get upload directory info for generated assets.
Since: 2.3.0
Line: 34
static public function get_upload_dir( ): array;
Returns: array — Upload directory information.
get_upload_path() static
Get upload directory path for generated assets.
Since: 2.3.0
Line: 61
static public function get_upload_path( $filename = ... ): string;
| Type | Name | Description |
|---|---|---|
string | $filename | Optional filename. |
Returns: string — Path to the upload directory or file.
get_upload_url() static
Get upload directory URL for generated assets.
Since: 2.3.0
Line: 75
static public function get_upload_url( $filename = ... ): string;
| Type | Name | Description |
|---|---|---|
string | $filename | Optional filename. |
Returns: string — URL to the upload directory or file.
get_snippet_filename() static
Get snippet filename for a given snippet and type.
Since: 2.3.0
Line: 90
static public function get_snippet_filename( $snippet_id, $type ): string;
| Type | Name | Description |
|---|---|---|
int | $snippet_id | Snippet ID. |
string | $type | Snippet type. |
Returns: string — Filename.
get_snippet_path() static
Get snippet file path.
Since: 2.3.0
Line: 103
static public function get_snippet_path( $snippet_id, $type ): string;
| Type | Name | Description |
|---|---|---|
int | $snippet_id | Snippet ID. |
string | $type | Snippet type. |
Returns: string — File path.
get_snippet_url() static
Get snippet file URL.
Since: 2.3.0
Line: 116
static public function get_snippet_url( $snippet_id, $type ): string;
| Type | Name | Description |
|---|---|---|
int | $snippet_id | Snippet ID. |
string | $type | Snippet type. |
Returns: string — File URL.
delete_snippet_file_by_url() static
Delete snippet file by URL.
Since: 2.3.0
Line: 128
static public function delete_snippet_file_by_url( $file_url ): void;
| Type | Name | Description |
|---|---|---|
string | $file_url | File URL. |
Returns: void
write_snippet_file() static
Write snippet file content using WP_Filesystem.
Since: 2.3.0
Line: 148
static public function write_snippet_file( $file_path, $content ): bool;
| Type | Name | Description |
|---|---|---|
string | $file_path | File path. |
string | $content | File content. |
Returns: bool — True on success.
delete_generated_files() static
Delete generated files.
Since: 2.3.0
Line: 166
static public function delete_generated_files( ): void;
Returns: void
clear_snippet_file_meta() static
Clear snippet file URL meta for all snippets.
Since: 2.3.0
Line: 192
static public function clear_snippet_file_meta( ): void;
Returns: void
minify_css() static
Minify CSS content.
Line: 217
static public function minify_css( $css ): string;
| Type | Name | Description |
|---|---|---|
string | $css | CSS content. |
Returns: string — Minified CSS.
minify_js() static
Minify JS content.
Line: 235
static public function minify_js( $js ): string;
| Type | Name | Description |
|---|---|---|
string | $js | JS content. |
Returns: string — Minified JS.
combine_css() static
Combine and minify all CSS snippets.
Line: 252
static public function combine_css( ): string;
Returns: string — Combined minified CSS.
combine_js() static
Combine and minify all JS snippets.
Line: 262
static public function combine_js( ): string;
Returns: string — Combined minified JS.
save_combined_css() static
Save combined CSS to file.
Line: 321
static public function save_combined_css( );
save_combined_js() static
Save combined JS to file.
Line: 333
static public function save_combined_js( );
get_file_stats() static
Get file stats.
Since: 2.3.0
Line: 350
static public function get_file_stats( $filename ): array|bool;
| Type | Name | Description |
|---|---|---|
string | $filename | Filename. |
Returns: array|bool — Array of file stats or false if file does not exist.